Create shipment

Order API v1
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.

Warning

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

int
required
Order ID to create shipment on.

products

object
required

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.

key in object

string
required
lineID from the Get orders response referring to a specific product item in the order.

value in object

int
required
Quantity of the item that should be shipped.

gtg

boolean
optional
Default: false. Mark the shipment as good to go.

capture

boolean
optional

Default: true. If Centra should capture the shipment amount from the payment provider.

Warning

Should not be turned off unless you are capturing the money somewhere else.

shipped

boolean
optional
Mark the shipment as sent. Default: false.

carrier

string
optional
Carrier used for shipping. Only used if shipped is true.

service

string
optional
Service level used for shipping. Only used if shipped is true.

packages

int
optional
Number of packages in shipment. Only used if shipped is true.

tracking

string
optional
Tracking number for shipment. Only used if shipped is true.

returnSlipTracking

string
optional
Return slip tracking number for shipment. Only used if shipped is true.

xml

boolean
optional
Response in xml format instead of json.

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
POST <base>/shipments HTTP/1.1
Content-type: application/json

{
  "order": 83651,
  "products": {
    "43243": 1,
    "43244": 2
  }
}

Response

200 Content-type: application/json

status

string
required
ok if success, else no.

order

int
Order ID that the shipment was created on.

shipment

string
The shipment ID for the create shipment.

deliveryNote

string
optional
URL to a PDF delivery note for the shipment.

proforma

string
optional
URL to a PDF proforma for the shipment.

invoice

string
optional
URL to a PDF invoice for the shipment. Will only be set if an invoice exists.

msg

string
optional
If status returns no, this value should send back a message why it failed.

Response example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

1
2
3
4
5
{
  "status": "no",
  "msg": "order does not exist",
  "order": "1337"
}
1
2
3
4
5
{
  "msg": "can not capture order",
  "status": "no",
  "order": "5"
}