Order API - Create Shipment
Create shipment
Endpoint: POST *base*/shipments
Authentication: API Key
This will create a shipment and per default try to capture from the payment provider, shipment will not be created if the capture fails.
You have the ability to turn off capture to make it possible to edit the shipment after it has been created. However, if you explicitly turn off capture using "capture": false
, we will not capture the money for the order automatically, and the Complete shipment call MUST be made and verified that it was successful until you can ship any products.
Parameters
Order ID to create shipment on.
Key is lineID
from the Get orders response and value is the quantity
.
Example: {"products":{"1441":2}}
will create a shipment of 2 products from item 1441
.
lineID
from the Get orders response referring to a specific product item in the order.
Quantity of the item that should be shipped.
Default: false
. Mark the shipment as good to go.
Default: true
. If Centra should capture the shipment amount from the payment provider.
Should not be turned off unless you are capturing the money somewhere else.
Mark the shipment as sent. Default: false
.
Carrier used for shipping. Only used if shipped
is true
.
Service level used for shipping. Only used if shipped
is true
.
Number of packages in shipment. Only used if shipped
is true
.
Tracking number for shipment. Only used if shipped
is true
.
Return slip tracking number for shipment. Only used if shipped
is true
.
Decide if Shipping Confirmation e-mail should be sent. If not defined, Store setting "Send Shipping Confirmation" will be used instead. Only used if shipped
is true
.
Used together with the capture
param, necessary when your order is split into multiple shipments. If the first shipment you created and captured contained the shipping cost, you can use this param to skip it in the subsequent shipments. This is necessary, since the payment providers will not allow you to capture more than was authorised, so you can only charge the shipping cost once.
Response in xml format instead of json.
Request example
POST <base>/shipments HTTP/1.1
Content-type: application/json
{
"order": 83651,
"products": {
"43243": 1,
"43244": 2
}
}
Response
200
Content-type: application/json
ok
if success, else no
.
Order ID that the shipment was created on.
The shipment ID for the create shipment.
URL to a PDF delivery note for the shipment.
URL to a PDF proforma for the shipment.
URL to a PDF invoice for the shipment. Will only be set if an invoice exists.
If status
returns no
, this value should send back a message why it failed.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"order": 83651,
"shipment": "83651-1",
"deliveryNote": "http://.../delivery-note.pdf",
"proforma": "http://.../proforma.pdf",
"invoice": "http://.../invoice.pdf"
}
Error examples
{
"status": "no",
"msg": "order does not exist",
"order": "1337"
}
{
"msg": "can not capture order",
"status": "no",
"order": "5"
}