XM

Update Shipping

Path:

PATCH /cart/{cartId}/ship-to/{shipToId}

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

Headers

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

x-api-key : d41d8cd98f00b204e9800998ecf8427e

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: path

Name: cartId and shipToId

Required: true

Type: body

Name: Shipping details

Required: true

Sample Request

Path:

https://{baseurl}/api-cart/cart/5e99d75cfcef0314e06b64b8/ship-to/5e99dd58fcef0314e06b64fe

Body:

{
"billTo": ["5e99dba9fcef0314e06b64fd"],
"address": {
"address1":"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,
"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

{
"_id": "5e99dd58fcef0314e06b64fe",
"shipMethod": {
"shipMethodId": "10002",
"cost": {
"currency": "USD",
"amount": 10
}
},
"address": {
"address1": "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"
}
},
"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"
}
},
"billTo": [
"5e99dba9fcef0314e06b64fd"
],
"shipToType": "SHIP_TO_ADDRESS",
"storeId": "store123456789",
"cartId": "5e99d75cfcef0314e06b64b8",
"shipToId": 16,
"createdAt": "2020-04-17T16:46:16.352Z",
"updatedAt": "2020-04-17T17:04:23.198Z",
"__v": 0
}

Changelog

  • Last updated - July 2020