XM
Members
Add Shipping (Legacy)
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
POST https://{baseurl}/api-cart/ship-to/cart/{cartID}
Copied!
Once the digital shopping cart is finalized, the next step is to add the shipping details. Users can go ahead to select the shipping carrier and add the associated shipping details, through this endpoint.

Headers

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

Parameters

Type : path
Name : The 24 character system-generated cart ID (from the Add Items to Cart or Retrieve Cart by userAuthToken API).
Required: true
Type: requestBody
Name: The shipping adddress along with contact information and the details of the selected shipping method.
Required: true

Sample Request

Path
1
https://{baseurl}/api-cart/ship-to/cart/609d623f9bbc8a00092ebc10
Copied!
Body:
1
{
2
"address": {
3
"street1": "10400 NE 4th St ",
4
"city": "Bellevue",
5
"state": "WA",
6
"country": "United States",
7
"zipCode": "98004",
8
"kind": "shipping",
9
"name": {
10
"first": "John",
11
"last": "Smith"
12
},
13
"email": "[email protected]",
14
"phone": {
15
"number": "123-992-9404",
16
"kind": "Mobile"
17
}
18
},
19
"shipToType": "SHIP_TO_ADDRESS",
20
"shipMethod": {
21
"shipMethodId": 100000,
22
"shipmentCarrier": "Fedex",
23
"shipmentMethod": "Next Day",
24
"cost": {
25
"currency": "USD",
26
"amount": 5
27
}
28
},
29
"taxCode": "FR1000"
30
}
Copied!

Response

Response Code: 200
Message: OK
Description: You will see this message when the shipping details are successfully added to the cart.
1
{
2
"shipMethod": {
3
"cost": {
4
"currency": "USD",
5
"amount": 10,
6
"realPrice": 10
7
},
8
"shipMethodId": "10002",
9
"shipmentCarrier": "Fedex",
10
"shipmentMethod": "Next Day"
11
},
12
"address": {
13
"phone": {
14
"number": "123-992-9404",
15
"kind": "Mobile"
16
},
17
"name": {
18
"first": "John",
19
"last": "Smith"
20
},
21
"street1": "10400 NE 4th St ",
22
"city": "Bellevue",
23
"state": "WA",
24
"country": "United States",
25
"zipCode": "98004",
26
"kind": "shipping",
27
"email": "[email protected]"
28
},
29
"billTo": [
30
"5f5020443e62350007fe285f"
31
],
32
"_id": "609d627aa52a0400081ddbbb",
33
"shipToType": "SHIP_TO_ADDRESS",
34
"taxCode": "FR1000",
35
"cartId": "609d623f9bbc8a00092ebc10",
36
"shipToId": 1630,
37
"createdAt": "2021-05-13T17:31:38.952Z",
38
"updatedAt": "2021-05-13T17:31:38.952Z"
39
}
Copied!
Response Code: 404
Message: Not found
Description: You will see this error when the cart ID doesn't exist in the system.
1
{
2
"code": "CART_NOT_FOUND",
3
"message": "Cart not found."
4
}
Copied!
Response Code: 400
Message: Request validation
Description: You will see this error when the cart ID is lesser or greater than 24 characters.
1
{
2
"code": "REQUEST_VALIDATION",
3
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
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