XM

Update Shipping and Pickup

Path:

PATCH https://{baseurl}/api-cart/v1/cart/{cartID}/ship-to/{shipTo-ID}

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) and ship-to ID.

Required: true

Type: requestBody

Name: The pickup and/or shipping details to be updated along with the contact information.

Required: true

Sample Request

Path

PATCH https://{baseurl}/api-cart/v1/cart/5f8f0da2d4cc8e00084b9e8e/ship-to/60803976439dc70009b2b8d2

Body:

{
"shipToType": "BOPIS",
"shipMethod":10129,
"taxCode": "FR1000",
"warehouseId":"5edfb1404ecac5000708764f",
"isPickup":true,
"pickupPerson": {
"name": {
"first": "John",
"last": "Smith"
},
"email": "[email protected]",
"phone": {
"number": "8087769338",
"kind": "Mobile"
}
},
"altPickupPerson": {
"name": {
"first": "Jane",
"last": "Smith"
},
"email": "[email protected]",
"phone": {
"number": "8087769338",
"kind": "Mobile"
}
}
}

Response

Response Code: 200

Message: OK

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

{
"_id": "60803976439dc70009b2b8d2",
"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"
}
},
"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": [
"5f5020443e62350007fe285f"
],
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"warehouseId": "123456789012345678903234",
"isPickup": false,
"cartId": "5f8f0da2d4cc8e00084b9e8e",
"shipToId": 749,
"createdAt": "2021-04-21T14:40:54.644Z",
"updatedAt": "2021-04-21T14:43:30.146Z",
"__v": 0,
"shipMethod": {
"shipMethodId": "10105",
"cost": {
"amount": 12,
"currency": "USD"
},
"shipmentCarrier": "muhammad Umer waheed"
},
"storeId": "store123456789"
}

Response Code: 404

Message: Not found

Description: You will see this error when the cart ID or ship-to 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 or ship-to ID is lesser or greater than 24 characters.

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

Response Code: 400

Message: Bad Request - Warehouse doesn't allow pickup

Description: You will see this error when the selected pickup location (warehouse) doesn't support pickup.

{
"code": "PICKUP_NOT_ALLOWED",
"message": "Warehouse doesn't allow pickup."
}

Response Code: 400

Message: Bad Request - Primary pickup missing

Description: You will see this error when the details of the primary pickup person is missing.

{
"code": "SHIP_TO_NOT_CREATED_OR_UPDATED",
"message": "Pick Up Person is required"
}

Response Code: 404

Message: Not Found - Location Not Found

Description: You will see this error when the pickup location is not found or doesn't exist.

{
"code": "LOCATION_NOT_FOUND",
"message": "Location not found"
}

Error Code: 403

Message: Forbidden

Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

{
"message": "Forbidden"
}

Change Log

  • June - 2021

  • July - 2020 First updated