13. Orders
It is possible to use orders as a starting point instead of shipments.
13.A Add Order
13.A.1 Overview
Use this endpoint to create orders. Upon success an HTTP 200 OK
with an order response is returned.
13.A.2 Reference
URI | https://api.myparcel.nl/fulfilment/orders |
Methods | POST |
Required request headers | Authorization: bearer BASE64(API_KEY) |
Content-Type: application/json;charset=utf-8 | |
URI parameters | None. |
Query parameters | None. |
Request body | array of Order objects. |
Response | HTTP 200 OK |
Response body | array of Order objects with UUIDs |
Error response | HTTP 4xx |
Error response body | Error |
13.A.3 Examples
13.B Get Order
13.B.1 Overview
Use this endpoint to retrieve orders. Upon success an HTTP 200 OK
with an order response is returned.
13.B.2 Reference
URI | https://api.myparcel.nl/fulfilment/orders |
Methods | GET |
Required request headers | Authorization: bearer BASE64(API_KEY) |
URI parameters | uuid |
Query parameters | q = string |
status = order_status | |
from = timestamp | |
to = timestamp | |
page = integer | |
per_page = integer | |
barcode = string | |
Request body | None. |
Response | HTTP 200 OK |
Response body | array of Order objects |
Error response | HTTP 4xx |
Error response body | Error |
13.B.3 Parameters
id
Data type: uuid
This is the order id. You can specify multiple order ids by semicolon separating them on the URI.
q
Data type: string
Use this parameter to search through all the fields of an order object including the embedded objects
status
Data type: order_status
Use this parameter to specify the order status to filter on. You can specify multiple status by semicolon separating them on the URI.
from
Data type: date
Use this parameter to filter on the order creation date. This filter will set the lower bound of the date search range.
to
Data type: date
Use this parameter to filter on the order creation date. This filter will set the upper bound of the date search range.
page
Data type: integer
Page number. Defaults to 1.
per_page
Data type: integer
Items per page. Defaults to 10.
barcode Data type: string Use this parameter to filter on the barcode of the order-shipment.
13.B.4 Examples
Search order
13.C Edit Order
13.C.1 Overview
Use this endpoint to edit orders. Upon success an HTTP 200 OK
with an order response is returned.
13.C.2 Reference
URI | https://api.myparcel.nl/fulfilment/orders |
Methods | PUT |
Required request headers | Authorization: bearer BASE64(API_KEY) |
Content-Type: application/json;charset=utf-8 | |
URI parameters | None. |
Query parameters | None. |
Request body | array of Order objects. |
Response | HTTP 200 OK |
Response body | array of Order objects with uuid's |
Error response | HTTP 4xx |
Error response body | Error |
13.C.3.Example
13.D Delete Order
Deleting orders can only be done for orders with (order-status open (Open)
).
13.D.1 Overview
Use this link to remove orders. You can specify multiple order ids by semicolon separating them on the URL. Only orders with order-status open (Open)
can be deleted. This method returns HTTP 204 No Content
if successful. If the order doesn't exist a HTTP 422 Unprocessable Entity
is returned.
13.D.2 Reference
URI | https://api.myparcel.nl/fulfilment/orders/id[;id] |
Methods | DELETE |
Required request headers | Authorization: bearer BASE64(API_KEY) |
Content-Type: application/json;charset=utf-8 | |
URI parameters | id = Order.id |
Query parameters | None. |
Request body | None. |
Response | HTTP 204 No Content |
Response body | None. |
Error response | HTTP 4xx |
Error response body | Error |
13.D.3 Parameters
id
Data type: uuid
The id of the order to delete. You can specify multiple orders by semicolon separating them.
13.D.4 Examples
Remove an order with id 3f86a6d1-6607-45a8-a815-13048fc18d7b.
13.E Packing slips
Use this endpoint to create packing slips of one or multiple orders. This can be done synchronously and asynchronously by choosing the correct accept header. When chosen for synchronous, a maximum of 5 packing slips can be created. For asynchronous no limit is set.
Upon error HTTP 4xx
with a response body containing an Error is returned.
If you want to retrieve more than 5 packing slips in one response, you can use Accept: application/json;charset=utf8
. You will receive a URL to the packing slips, but the label is not immediately available and will return an HTTP 404 Not Found
until it is ready.
13.E.2 Reference
URI | https://api.myparcel.nl/fulfilment/orders/id[;id]/packing_slip |
Methods | GET |
Required request headers | Authorization: bearer BASE64(API_KEY) |
Accept: application/pdf;charset=utf-8 (For the PDF binary. This is the default.) For processing max 5 packing slips. | |
Accept: application/json;charset=utf-8 (For the download link.) For processing more than 5 packing slips. | |
URI parameters | id = Order.id |
Query parameters | None. |
Request body | None. |
Response | HTTP 200 OK Content-Disposition: attachment; filename="PDF_FILE" Content-Type: application/pdf |
or | |
HTTP 200 OK Content-Type: application/json | |
Response body | Shipment label PDF. |
or | |
Download link. | |
Error response | HTTP 4xx |
Error response body | Error |
13.E.3 Parameters
id
Data type: uuid
The id of the order for which the packing slip is created. You can specify multiple orders by semicolon separating them.