XM
Powered By GitBook
Add Bulk Shipments
Path:
1
POST https://{baseurl}/api-order/orders/shipments-bulk
Copied!
This API offers you the flexibility to add shipments to multiple orders. This is secured by x-api-key. The successMessages in the response lists all the order IDs for which shipments are added successfully and the errorMessages in the response separately list all the order IDs for which shipments could not be added due to incorrect order ID, missing lineItemId, or invalid item quantity.

Headers

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

Parameters

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

Sample Request

Path:
1
POST https://{baseurl}/api-order/orders/shipments-bulk
Copied!
1
[
2
{
3
"orderId": "6562-1726-73447",
4
"shipments": [
5
{
6
"shipmentRef": "ref-100",
7
"shipmentCarrier": "Fedex",
8
"shipmentCarrierUrl": "https://fedex.com",
9
"trackingNumber": "2345367890876549",
10
"lineItems": [
11
{
12
"lineItemId": 1,
13
"quantity": 1
14
}
15
],
16
"shipmentStatus": "shipping",
17
"estimatedDeliveryDate": "2021-06-01",
18
"shippedDate": "2021-05-28"
19
}
20
]
21
},
22
{
23
"orderId": "2224-7457-16398",
24
"shipments": [
25
{
26
"shipmentRef": "ref-100",
27
"shipmentCarrier": "Fedex",
28
"shipmentCarrierUrl": "https://fedex.com",
29
"trackingNumber": "2345367890876549",
30
"lineItems": [
31
{
32
"lineItemId": 2,
33
"quantity": 1
34
}
35
],
36
"shipmentStatus": "awaiting",
37
"estimatedDeliveryDate": "2019-03-01",
38
"shippedDate": "2020-04-05"
39
}
40
]
41
}
42
]
43
44
Copied!

Response

Response Code: 200
Message: OK
Description: The successMessages field lists the order IDs for which shipments are added. When all of the order IDs encounter errors while adding shipment in bulk, this field returns a blank array. The errorMessages field lists the order IDs for which shipments couldn't be added. The error reason could be Invalid item quantity, Unable to find the specified lineItemID, or Order ID not found. When shipments are successfully added to all of the order IDs in the requestBody, this field returns a blank array.
Sample
1
{
2
"successMessages": [
3
"Order: 6562-1726-73447 was sucessfully imported"
4
],
5
"errorMessages": [
6
"Order: 2224-7457-16398 - Error: Unable to Find lineItemId: 2 in items of order 2224-7457-16398"
7
]
8
}
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 2mo ago
Copy link
Contents
Change Log