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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  "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:

1
2
3
 {
     "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
orderLines Array Array with orderlines
orderLines > quoteLineItemId String The id of the quote lineItem
orderLines > files Array Array with one file, due too technical limitations its currently not possible to supply multiple files per orderline
orderLines > files > url String URL of a PDF file.
quoteId String UUID of quote
invoiceAddress Object Object of the invoice address. See Addresses for more information.
deliveryAddress Object Object of the delivery address. See Addresses for more information.
deliveryMethod Integer ID of the delivery method. See Delivery methods for more information.

Optional fields

Field Type Description
reference String Your reference. Max length: 35 chars.
poNumber > productCode String Your purchase-order number. Max length: 120 chars.
orderLines > externalId String The external ID you want to pass
testOrder Boolean To place a test order true / false

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?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",
        "Accept: application/vnd.printdeal-api.v2"
    )
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}