Creating quote order¶
You can create a quote order by sending the order information in JSON as a POST
request to /api/orders
.
The following can be used as an example to create a quote order:
{
"orderLines": [
{
"quoteLineItemId": "6ca49923-79ba-4513-b0f3-f84517bfa6a4",
"files": [
{
"url": "https://s3-eu-west-1.amazonaws.com/printdealcdn/content_service/informatiesheet_cold-foil.pdf"
}
]
},
{
"quoteLineItemId": "4ca49923-79ba-4513-b0f3-f84517bfa6a4",
"files": [
{
"url": "https://s3-eu-west-1.amazonaws.com/printdealcdn/content_service/informatiesheet_cold-foil.pdf"
}
]
}
],
"quoteId": "1ca49923-79ba-4513-b0f3-f84517bfa6a4",
"invoiceAddress": {
"company":"Bedrijfsnaam",
"firstName":"Voornaam",
"lastName":"Achternaam",
"email":"Voornaam@gmail.com",
"street": "Dorpsstraat",
"housenumber": "123",
"zipcode": "1234AB",
"city": "Dorp",
"country": "nl"
},
"deliveryAddress": {
"company":"Bedrijfsnaam",
"firstName":"Voornaam",
"lastName":"Achternaam",
"street": "Dorpsstraat",
"housenumber": "123",
"housenumberAddition": "A",
"zipcode": "1234AB",
"city": "Dorp",
"country": "nl"
},
"deliveryMethod": 1,
"reference": "reference-1234",
"poNumber": "poNumber"
}
The response will be a JSON object with the order UUID that can be used to retrieve information from the order:
{
"uuid": "fea079fc-2f77-4223-9d5f-10254bb48717"
}
Payment¶
The payment method for this order is on account. You will receive the invoice by email.
Required fields¶
Field |
Type |
Description |
---|---|---|
|
|
Array with orderlines |
|
|
The id of the quote lineItem |
|
|
Array with one file, due too technical limitations its currently not possible to supply multiple files per orderline |
|
|
URL of a PDF file. |
|
|
UUID of quote |
|
|
Object of the invoice address. See Addresses for more information. |
|
|
Object of the delivery address. See Addresses for more information. |
|
|
ID of the delivery method. See Delivery methods for more information. |
Optional fields¶
Field |
Type |
Description |
---|---|---|
|
|
Your reference. Max length: 35 chars. |
|
|
Your purchase-order number. Max length: 120 chars. |
|
|
The external ID you want to pass |
|
|
To place a test order |
Example request create quote order¶
The following PHP code can be used to create a quote order. Make sure you replace the values YOUR_USER_ID_HERE
and YOUR_SECRET_HERE
with the User-ID and secret you received on the API-credentials page.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.printdeal.com/api/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{
"orderLines": [
{
"quoteLineItemId": "6ca49923-79ba-4513-b0f3-f84517bfa6a4",
"files": [
{
"url": "https://s3-eu-west-1.amazonaws.com/printdealcdn/content_service/informatiesheet_cold-foil.pdf"
}
]
},
{
"quoteLineItemId": "4ca49923-79ba-4513-b0f3-f84517bfa6a4",
"files": [
{
"url": "https://s3-eu-west-1.amazonaws.com/printdealcdn/content_service/informatiesheet_cold-foil.pdf"
}
]
}
],
"quoteId": "1ca49923-79ba-4513-b0f3-f84517bfa6a4",
"invoiceAddress": {
"company":"Bedrijfsnaam",
"firstName":"Voornaam",
"lastName":"Achternaam",
"email":"Voornaam@gmail.com",
"street": "Dorpsstraat",
"housenumber": "123",
"zipcode": "1234AB",
"city": "Dorp",
"country": "nl"
},
"deliveryAddress": {
"company":"Bedrijfsnaam",
"firstName":"Voornaam",
"lastName":"Achternaam",
"street": "Dorpsstraat",
"housenumber": "123",
"housenumberAddition": "A",
"zipcode": "1234AB",
"city": "Dorp",
"country": "nl"
},
"deliveryMethod": 1,
"reference": "reference-1234",
"poNumber": "poNumber"
}',
CURLOPT_HTTPHEADER => array(
"User-ID: YOUR_USER_ID_HERE",
"API-Secret: YOUR_SECRET_HERE"
)
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}