Book order

POST/api/v2/orders/{order_id}/book

Books all shipments in an order that are in status draft or booking_failed.

Authorization

Add HTTP header Authorization with the received API key as the bearer token:

Authorization
API Key

Parameters

URL parameters

PropertyTypeDescription
order_id
string

Order ID

Unique identifier for order.

uuid

Request body

Content-Type
application/json
Body
PropertyTypeDescription
book_order
Object to book an order.
any of
preferred_service_level
string
Preferred service level of shipment. Indicates what carrier, service and/or tags may be used for the booking process.
required
^[a-zA-Z_]+\:[a-zA-Z0-9_-]+$
length 3...80
any of
rate_selections
object
required
one of
rate_id
string
Unique identifier for rate.
required
uuid
shipment_id
string
Unique identifier for shipment.
required
uuid
one of
rate
object
Custom rate object. Contains information regarding the rate for a shipment that is used to book the shipment. See custom rate in Shipping flow - Book documentation
required
carrier_code
string
Uppercased code of the carrier in Wuunder
required
carrier_name
string
Human readable carrier name
carrier_product_code
string
Uppercased product/service code for the carrier in Wuunder
required
delivery_after
string
Start of delivery window
delivery_before
string
End of delivery window
delivery_date
string
Date of expected delivery
required
is_parcelshop_drop_off
boolean
Drop off instead of pick up
is_return
boolean
Marks return shipment
pickup_after
string
Start of pickup window
pickup_before
string
End of pickup window
pickup_date
string
Date of expected pickup
required
price
integer
The price of a rate in cents.
value 1...
product
string
Product linked to product/service
purchase_price
integer
The price of a rate in cents.
value 1...
source
string
Internal field, cannot be set. Defaults to 'user'
tracking
boolean
shipment_id
string
Unique identifier for shipment.
required
uuid

Request example

JSON
{
  "book_order": {
    "preferred_service_level": "any:cheapest",
    "rate_selections": [
      {
        "rate_id": "806e39bb-0a28-4c6c-9881-38c096f531e4",
        "shipment_id": "57168dba-c987-4755-9c3b-6c5d86825e75"
      }
    ]
  }
}

Response

Response body

Content-Type
application/json
Body
PropertyTypeDescription
book_order
object
required
booking_status
string
Indicates the booking process in the system. Note: this does not reflect the state of the order.
required
one of:
scheduled
complete
in_progress
order
A collection of shipments. Contains data for orders that are persisted.
required
rate_selections
object
List of the rates that were selected per shipment for the booking process
required

Response body example

JSON
{
  "book_order": {
    "booking_status": "scheduled",
    "order": {
      "reference": "89977-3249",
      "id": "4a2a1a78-6b9a-43af-887e-2adc7d415e7a",
      "inserted_at": "2019-08-24T14:15:22Z",
      "order_code": "stringstrings",
      "receiver": {
        "city": "Rotterdam",
        "country_code": "NL",
        "email_address": "order-receiver@example.com",
        "eori_number": "NL123456789000",
        "family_name": "Koebergen",
        "given_name": "Peter",
        "house_number": "1",
        "phone_number": "+311012345678",
        "state_code": "ZH",
        "street_name": "Stationsplein",
        "type": "business",
        "zip_code": "3013AK"
      },
      "sender": {
        "business_name": "Acme Inc",
        "city": "Amsterdam",
        "country_code": "NL",
        "email_address": "order-sender@example.com",
        "eori_number": "NL123456789000",
        "family_name": "Gehlen",
        "given_name": "Jeroen",
        "house_number": "1",
        "phone_number": "+311012345678",
        "state_code": "NH",
        "street_name": "Dam",
        "type": "business",
        "vat": "NL000099998B0",
        "zip_code": "1122AA"
      },
      "shipments": [
        {
          "currency": "EUR",
          "delivery_instructions": "Leave at the back door if no one answers.",
          "description": "Box of toothbrushes",
          "external_id": "EXT123",
          "height": 2,
          "incoterms": "DDP",
          "length": 20,
          "meta": {
            "customer_id": "AB-001",
            "locations": [
              "Warehouse X",
              "Warehouse Y"
            ]
          },
          "ordered_at": "2019-08-24T14:15:22Z",
          "parcelshop_drop_off": true,
          "parcelshop_id": "POST_NL:1234",
          "reference": "89977-3249",
          "return": true,
          "type": "document",
          "value": 1444,
          "webhook_url": "https://www.example.com/test.jpeg",
          "weight": 200,
          "width": 10,
          "booked_rate": {
            "carrier_code": "POST_NL",
            "carrier_name": "PostNL",
            "carrier_product_code": "POSTNL_BRIEVENBUSPAKKET",
            "carrier_product_description": "Pakket tot 20 gram in brievenbus",
            "price": 255,
            "receiver_type": "consumer",
            "sender_type": "business",
            "tags": [
              "preferred",
              "fastest",
              "cheapest"
            ]
          },
          "booking_failure_reason": "string",
          "delivery_info": {
            "date": "2024-07-04",
            "time_window": "10:00-17:00",
            "type": "address"
          },
          "documents": {
            "commercial_invoice_url": "https://api.wearewuunder.com/public/123/A-111-111/commercial_invoice",
            "label_pdf_url": "https://api.wearewuunder.com/public/123/A-111-111/get_label",
            "label_zpl_url": "https://api.wearewuunder.com/public/123/A-111-111/zpl_label",
            "packinglist_url": "https://api.wearewuunder.com/public/123/A-111-111/packing_list"
          },
          "id": "57168dba-c987-4755-9c3b-6c5d86825e75",
          "inserted_at": "2019-08-24T14:15:22Z",
          "order_lines": [
            {
              "description": "Toothbrush",
              "ean": "0799439112766",
              "hs_code": "620520",
              "meta": {
                "customer_id": "AB-001",
                "locations": [
                  "Warehouse X",
                  "Warehouse Y"
                ]
              },
              "origin_country_code": "NL",
              "quantity": 2,
              "sku": "ABC-123",
              "value": 1444,
              "weight": 200
            }
          ],
          "parcelshop": {
            "business_name": "Doelen Pakketservice",
            "carrier_code": "POST_NL",
            "city": "Rotterdam",
            "country_code": "NL",
            "email_address": "parcelshop@example.com",
            "eori_number": "NL123456789000",
            "family_name": null,
            "given_name": null,
            "house_number": "50",
            "id": "302",
            "latitude": 51.9216717,
            "longitude": 4.470482,
            "opening_hours": [
              {
                "hours": [
                  "09:00-17:30",
                  "20:00-21:00"
                ],
                "weekday": "monday"
              },
              {
                "hours": [
                  "09:00-17:30",
                  "20:00-21:00"
                ],
                "weekday": "tuesday"
              },
              {
                "hours": [],
                "weekday": "wednesday"
              },
              {
                "hours": [
                  "09:00-17:30",
                  "20:00-21:00"
                ],
                "weekday": "thursday"
              },
              {
                "hours": [
                  "09:00-17:30",
                  "20:00-21:00"
                ],
                "weekday": "friday"
              },
              {
                "hours": [
                  "09:00-17:30"
                ],
                "weekday": "saturday"
              },
              {
                "hours": [
                  "09:00-12:30",
                  "13:00-14:00"
                ],
                "weekday": "sunday"
              }
            ],
            "phone_number": "+311012345678",
            "state_code": "ZH",
            "street_name": "Schouwburgplein",
            "type": "business",
            "website_url": "www.example.com",
            "wuunder_reference": "POST_NL:302",
            "zip_code": "3012CL"
          },
          "pickup_info": {
            "date": "2024-07-04",
            "time_window": "10:00-17:00",
            "type": "regular_pickup"
          },
          "receiver_address": {
            "address2": "Apt 202",
            "business_name": "Wuunder",
            "city": "Amsterdam",
            "country_code": "NL",
            "email_address": "info@wearewuunder.com",
            "eori_number": "GB123456789000",
            "family_name": "Henk",
            "given_name": "Henk",
            "house_number": "22-A",
            "id": "d1dcceb0-0796-43bb-bcc1-67aedbf0b436",
            "phone_number": "+31612345678",
            "state_code": "NY",
            "street_name": "Berglaan",
            "vat": "NL000099998B57",
            "zip_code": "2211AA",
            "type": "consumer"
          },
          "sender_address": {
            "address2": "Apt 202",
            "business_name": "Wuunder",
            "city": "Amsterdam",
            "country_code": "NL",
            "email_address": "info@wearewuunder.com",
            "eori_number": "GB123456789000",
            "family_name": "Henk",
            "given_name": "Henk",
            "house_number": "22-A",
            "id": "d1dcceb0-0796-43bb-bcc1-67aedbf0b436",
            "phone_number": "+31612345678",
            "state_code": "NY",
            "street_name": "Berglaan",
            "vat": "NL000099998B57",
            "zip_code": "2211AA",
            "type": "consumer"
          },
          "status": "booked",
          "status_history": [
            {
              "state": "draft",
              "timestamp": "2023-06-01T10:00:00Z"
            },
            {
              "state": "pending_printing",
              "timestamp": "2023-06-01T12:00:00Z"
            },
            {
              "state": "ready_for_pickup",
              "timestamp": "2023-06-02T09:15:00Z"
            },
            {
              "state": "in_transit",
              "timestamp": "2023-06-03T14:30:00Z"
            },
            {
              "state": "out_for_delivery",
              "timestamp": "2023-06-04T08:45:00Z"
            },
            {
              "state": "delivered",
              "timestamp": "2023-06-04T15:20:00Z"
            }
          ],
          "track_and_trace_code": "0009398723",
          "track_and_trace_url": "https://api.wearewuunder.com/track-and-trace",
          "updated_at": "2019-08-24T14:15:22Z",
          "wuunder_id": "strings"
        }
      ],
      "status": "string",
      "status_history": [
        {
          "state": "draft",
          "timestamp": "2023-06-01T10:00:00Z"
        },
        {
          "state": "pending_printing",
          "timestamp": "2023-06-01T12:00:00Z"
        },
        {
          "state": "ready_for_pickup",
          "timestamp": "2023-06-02T09:15:00Z"
        },
        {
          "state": "in_transit",
          "timestamp": "2023-06-03T14:30:00Z"
        },
        {
          "state": "out_for_delivery",
          "timestamp": "2023-06-04T08:45:00Z"
        },
        {
          "state": "delivered",
          "timestamp": "2023-06-04T15:20:00Z"
        }
      ],
      "updated_at": "2019-08-24T14:15:22Z"
    },
    "rate_selections": [
      {
        "selected_rate": {
          "carrier_code": "POST_NL",
          "carrier_name": "PostNL",
          "carrier_product_code": "POSTNL_BRIEVENBUSPAKKET",
          "carrier_product_description": "Pakket tot 20 gram in brievenbus",
          "price": 255,
          "receiver_type": "consumer",
          "sender_type": "business",
          "tags": [
            "preferred",
            "fastest",
            "cheapest"
          ]
        },
        "shipment_id": "57168dba-c987-4755-9c3b-6c5d86825e75"
      }
    ]
  }
}