Shipments
Summary of shipment endpoints
- GET /admin/api/ecommerce/v1/orders/1/shipment - list attributes of a shipment.
- POST /admin/api/ecommerce/v1/orders/1/shipment - create a new shipment.
- GET /admin/api/ecommerce/v1/orders/1/shipment/package_label - get the package label for a shipment.
List attributes of a shipment
GET /admin/api/ecommerce/v1/orders/1/shipment
Example request:
GET http://helloworld.voog.com/admin/api/ecommerce/v1/orders/1/shipment
Example response:
Status: 200 OK
{
"id": 1,
"external_shipment_attrs": null,
"label_message": "#80",
"sender": {
"name": "Jay B. Goode",
"address1": "R. Tobiase 8",
"address2": "Floor 3",
"zip_code": "10147",
"city": "Tallinn",
"country_code": "EE",
"phone": "+37255666777",
"email": "jay@goode.ee"
},
"physical_props": {
"weight": 2.42
},
"delivery": {
"kind": "pup",
"pup_id": "EE90001"
},
"external_shipment_id": "50c6309d-9316-4c04-9be4-8aea5cbfa8d7",
"delivery_provider_code": "dpd",
"created_at": "2021-09-21 12:03:48",
"updated_at": "2021-09-21 12:03:48",
"external_order_id": "12345",
"recipient": {
"name": "Tom C. Clarke",
"address1": "Käo põik 77",
"zip_code": "50404",
"city": "Tartu",
"country_code": "EE",
"phone": "+37255666888",
"email": "tom.c@example.com"
}
}
Create a new shipment
POST /admin/api/ecommerce/v1/orders/1/shipment
This request should have an empty payload. All shipment details are inferred from the order and its addresses.
Example response:
Status: 201 Created
{
"id": 1,
"external_shipment_attrs": null,
"label_message": "#80",
"sender": {
"name": "Jay B. Goode",
"address1": "R. Tobiase 8",
"address2": "Floor 3",
"zip_code": "10147",
"city": "Tallinn",
"country_code": "EE",
"phone": "+37255666777",
"email": "jay@goode.ee"
},
"recipient": {
"name": "Tom C. Clarke",
"address1": "Käo põik 77",
"zip_code": "50404",
"city": "Tartu",
"country_code": "EE",
"phone": "+37255666888",
"email": "tom.c@example.com"
},
"physical_props": {
"weight": 2.42
},
"delivery": {
"kind": "pup",
"pup_id": "EE90001"
},
"external_shipment_id": "50c6309d-9316-4c04-9be4-8aea5cbfa8d7",
"delivery_provider_code": "dpd",
"created_at": "2021-09-21 12:03:48",
"updated_at": "2021-09-21 12:03:48",
"external_order_id": "12345"
}
Parameters
regenerate
- if present, force shipment creation even if the order already has an associated shipment.
Get package label for a shipment
GET /admin/api/ecommerce/v1/orders/1/shipment/package_label
On success, returns the PDF package label for a shipment. On error, returns a JSON payload explaining the error condition.
Example request:
GET http://helloworld.voog.com/admin/api/ecommerce/v1/orders/1/shipment/package_label
Example response:
Status: 200 OK
Content-Type: application/pdf