XM

Update Shipping

Path:

PATCH https://{baseurl}/cart/{cartId}/ship-to/{shipToId}

Through this endpoint, your customers can easily update the shipping details, based on the specified cartId and shipToId.

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) and ship-to ID (from the Add Shipping API)

Required: true

Sample Request

Path:

https://{baseurl}/api-cart/cart/5f8f0da2d4cc8e00084b9e8e/ship-to/6080320cdd745b0008b98784

Body:

{
"address": {
"street1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "shipping",
"name": {
"first": "John",
"last": "Doe"
},
"email": "[email protected]",
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
}
},
"shipToType": "SHIP_TO_ADDRESS",
"shipMethod": {
"shipMethodId": 10002,
"shipmentCarrier": "Fedex",
"shipmentMethod": "Next Day",
"cost": {
"currency": "USD",
"amount": 10
}
},
"storeId": "store123456789",
"pickupPerson": {
"name": {
"first": "John",
"last": "Doe"
},
"email": "[email protected]",
"phone": {
"number": "8087769338",
"kind": "Mobile"
}
},
"altPickupPerson": {
"name": {
"first": "Jane",
"last": "Doe"
},
"email": "[email protected]",
"phone": {
"number": "8087769338",
"kind": "Mobile"
}
}
}

Response Code: 200

Message: OK

Description: You will see this message when the shipping details are successfully updated.

Sample

{
"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"
}

Error Code: 404

Message: Not found

Description: You will see this error when the specified ship-to ID doesn't exist in the system.

{
"code": "SHIPTO_NOT_FOUND",
"message": "Ship-to not found."
}

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