Examples

Delivery

The delivery object is used in several API endpoints, please check out the reference to find out which. The delivery object is divided into several subparts. The address contains the delivery information. The other properties handle the shipping method and the delivery date. This can be achieved by giving the exact values or using the presets. Presets allow you to quickly place an order without the need of handling all the exact values.

Address breakdown.

To get the correct delivery prices and shipping methods in the price or configure endpoint or if you want to place an order the address object is always needed. Below is a breakdown of the object

Parameter
company_name Company name of recipient
first_name First name of recipient required
last_name Last name of recipient required
street Street name required
house_number Building / Housenumber required
addition Addition to number for example A.
postal_code Postal code required
city City required
country Country required
phone phone
email email, will be used by carrier to push notifications

Usage


{
  "deliveries": [
    {
      "address": {
        "company_name": "",
        "first_name": "Friso",
        "last_name": "Speulman",
        "street": "Fortuinweg",
        "house_number": 17,
        "addition": "",
        "postal_code": "9113 PR",
        "city": "Dokkum",
        "country": "EN",
        "phone": "",
        "email": "friso@probo.nl"
      }
    }
  ]
}

Sender breakdown.

Some carriers allow you to add your own name as the sending party. This can be done by adding a sender object to the deliveries object. This feature is optional and not required. The carrier will determine if and which data to use. ONB is the most complete

Parameter
company_name Company name of sender
first_name First name of sender
last_name Last name of sender
street Street name
house_number Building / Housenumber
addition Addition to number for example A.
postal_code Postal code
city City
country Country
phone phone
email emai

Usage


{
  "deliveries": [
    {
      "address":{...},
      "delivery_date": "2023-03-28",
      "shipping_methode_code": "onb-express",
      "sender_address": {
        "company_name": "",
        "first_name": "Friso",
        "last_name": "Speulman",
        "street": "Fortuinweg",
        "house_number": 17,
        "addition": "",
        "postal_code": "9101 PE",
        "city": "Dokkum",
        "country": "EN",
        "phone": "",
        "email": "friso@probo.nl"
      }
    }
  ]
}

Delivery date and shipping information

The order endpoint requires delivery and shipment information. This can be supplied with fixed data or you can use one of our presets.

Caveats:

  • It is not possible to use both the delivery_date and the delivery_date_preset. This results in an error.
  • It is not possible to use both the shiment_method_code and the shipping_method_preset. This results in an error.

Delivery

Parameter
delivery_date Date as (YYYY-MM-DD) required if the preset is not used
delivery_date_preset ENUM example: 'cheapest' . See presets. required if no date is used

Shipping

Parameter
shipment_method_code ENUM example: 'onb-express' . See list required if the preset is not used
shipping_method_preset ENUM example: 'cheapest' . See presets. required if no method is used

Example delivery date with shipment method code

{
  "deliveries": [
    {
      "address":{...},
      "delivery_date": "2023-03-28",
      "shipping_method_code": "onb-express"
    }
  ]
}

Example delivery date with shipment method preset

{
  "deliveries": [
    {
      "address":{...},
      "delivery_date": "2023-03-28",
      "shipping_method_preset": "cheapest"
    }
  ]
}

Example delivery date preset with shipment method code

{
  "deliveries": [
    {
      "address":{...},
      "delivery_date_preset": "cheapest",
      "shipping_methode_code": "onb-express"
    }
  ]
}

Example delivery date preset with shipment method preset

{
  "deliveries": [
    {
      "address":{...},
      "delivery_date_preset": "cheapest",
      "shipping_method_preset": "cheapest"
    }
  ]
}

Full Delivery example with delivery date and shipping method preset

{
  "deliveries": [
    {
      "address": {
        "company_name": "",
        "first_name": "Friso",
        "last_name": "Speulman",
        "street": "Fortuinweg",
        "house_number": 17,
        "addition": "",
        "postal_code": "9113 PR",
        "city": "Dokkum",
        "country": "EN",
        "phone": "",
        "email": "friso@probo.nl"
      },
      "delivery_date": "2023-03-28",
      "shipping_method_preset": "cheapest"
    }
  ]
}

Full Delivery example with sender_address, delivery date and shipping method preset

{
  "deliveries": [
    {
      "address": {
        "company_name": "",
        "first_name": "Friso",
        "last_name": "Speulman",
        "street": "Fortuinweg",
        "house_number": 17,
        "addition": "",
        "postal_code": "9113 PR",
        "city": "Dokkum",
        "country": "EN",
        "phone": "",
        "email": "friso@probo.nl"
      },
  "sender_address": {
        "company_name": "MyAwesomePrintAPIConnection",
        "street": "Printterweg",
        "house_number": 17,
        "addition": "",
        "postal_code": "9113 PR",
        "city": "GKVeen",
        "country": "NL",
        "phone": "",
        "email": "friso@probo.nl"
      },
      "delivery_date": "2023-03-28",
      "shipping_method_preset": "cheapest"
    }
  ]
}