XM
Members
Add Shipment
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
POST https://{baseurl}/api-order/orders/shipments
Copied!
This API enables you to add shipments to the different line items in the order. This API is secured by x-api-key. To add shipment, the following APIs must be run sequentially:
To add shipments to multiple orders in bulk, the Add Bulk Shipment API is used.

Headers

Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }
x-api-key : d41d8cd98f00b204e9800998ecf8****

Parameters

Type : requestBody
Name : The order ID and shipment details.
Required: true

Sample Request

Path:
1
POST https://{baseurl}/api-order/orders/shipments
Copied!
Request Body:
1
{
2
"orderId": "2698-6683-19607",
3
"shipments": [
4
{
5
"shipmentRef": "ref-100",
6
"shipmentCarrier": "Fedex",
7
"shipmentCarrierUrl": "https://fedex.com",
8
"trackingNumber": "2345367890876549",
9
"lineItems": [
10
{
11
"lineItemId": 2,
12
"quantity": 1
13
}
14
],
15
"shipmentStatus": "awaiting",
16
"estimatedDeliveryDate": "2019-03-01",
17
"shippedDate": "2020-04-05"
18
}
19
]
20
}
21
Copied!

Response

Response Code: 200
Message: OK
Description: You will see this message when the shipments are successfully added to the cart.
1
{
2
"orderId": "2698-6683-19607",
3
"status": "Successfully added shipment"
4
}
Copied!
Error Code: 400
Message: Not Found
Description: You will see this error when the Order ID is not found.
1
{
2
"code": "ORDER_NOT_FOUND",
3
"message": "Order Id Not Found"
4
}
Copied!
Error Code: 400
Message: Bad Request
Description: You will see this error when the Order ID is lesser or greater than 15 characters.
1
{
2
"code": "REQUEST_VALIDATION",
3
"message": "Invalid data in body: /orderId should NOT be shorter than 15 characters"
4
}
Copied!
Error Code: 400
Message: Bad Request
Description: You will see this error when the order quantity is greater than the pending shipment quantity.
1
{
2
"code": "ORDER_INVALID_QUANTITY",
3
"message": "Invalid Item Quantity"
4
}
Copied!
Error Code: 404
Message: Not Found
Description: You will see this error when the line item ID is not found.
1
{
2
"code": "ORDER_LINE_ITEM_NOT_FOUND",
3
"message": "Unable to Find lineItemId: 2"
4
}
Copied!
Error Code: 500
Message: Internal Server Error
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

  • June - 2021
  • July - 2020 First updated
Last modified 1mo ago
Copy link
Contents
Change Log