XM

Add Shipping (Legacy)

Path:

POST https://{baseurl}/api-cart/ship-to/cart/{cartID}

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

https://{baseurl}/api-cart/ship-to/cart/609d623f9bbc8a00092ebc10

Body:

{
"address": {
"street1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "shipping",
"name": {
"first": "John",
"last": "Smith"
},
"email": "[email protected]",
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
}
},
"shipToType": "SHIP_TO_ADDRESS",
"shipMethod": {
"shipMethodId": 100000,
"shipmentCarrier": "Fedex",
"shipmentMethod": "Next Day",
"cost": {
"currency": "USD",
"amount": 5
}
},
"taxCode": "FR1000"
}

Response

Response Code: 200

Message: OK

Description: You will see this message when the shipping details are successfully added to the cart.

{
"shipMethod": {
"cost": {
"currency": "USD",
"amount": 10,
"realPrice": 10
},
"shipMethodId": "10002",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Next Day"
},
"address": {
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"name": {
"first": "John",
"last": "Smith"
},
"street1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "shipping",
"email": "[email protected]"
},
"billTo": [
"5f5020443e62350007fe285f"
],
"_id": "609d627aa52a0400081ddbbb",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"cartId": "609d623f9bbc8a00092ebc10",
"shipToId": 1630,
"createdAt": "2021-05-13T17:31:38.952Z",
"updatedAt": "2021-05-13T17:31:38.952Z"
}

Response Code: 404

Message: Not found

Description: You will see this error when the cart ID doesn't exist in the system.

{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}

Response Code: 400

Message: Request validation

Description: You will see this error when the cart ID is lesser or greater than 24 characters.

{
"code": "REQUEST_VALIDATION",
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
}

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