XM

Add Pickup and Shipping to Line Items

Path:

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

Users may have the requirement to pickup items from a physical store, in addition to getting items shipping to their location. This API facilitates adding pickup details for the required line item in the cart.

Note: Pickup or shipping is not applicable for digital items.

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 cartId

Required: true

Type: requestBody

Name: The shipping details.

Required: true

Sample Request

Path:

https://{baseurl}/api-cart/cart/60806e0b2b71680009000e0d/ship-to/v1

Request Body:

[
{
"itemId": 1000000051,
"lineItemId": 1,
"shipToId": "60803976439dc70009b2b8d2"
}

Response

Success Code: 200

Message: OK

Description: You'll see this message when the promo is successfully applied.

{
"_id": "60806e0b2b71680009000e0d",
"deleted": false,
"registeredUser": false,
"cartId": 1491,
"items": [
{
"price": {
"discount": {
"discountAmount": 0,
"price": 0,
"promosApplied": []
},
"sale": 0,
"base": 900,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 0,
"group": [
"5ecef789df21ae00077e7a2f"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T18:25:15.428Z",
"updatedAt": "2021-04-21T18:25:22.936Z",
"_id": "60806e0b2b71680009000e0e",
"itemId": 1000000051,
"sku": "1538910",
"taxCode": "PH060771",
"title": "Luminous Cushion Lagoon",
"weight": 1,
"quantity": 1,
"priceListId": 100269,
"lineItemId": 1,
"attributeTotalPrice": 0,
"totalPrice": {
"currency": "USD",
"amount": 900
},
"attributes": [],
"shipTo": "60803976439dc70009b2b8d2",
"id": "60806e0b2b71680009000e0e"
}
],
"allPromosApplied": [],
"attributes": [],
"createdAt": "2021-04-21T18:25:15.947Z",
"updatedAt": "2021-04-21T18:59:43.541Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 900
},
"quantity": 1
}

Error 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."
}

Error 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