XM

Update Billing

Path:

PATCH https://{baseurl}/api-cart/cart/{cartID}/bill-to/{bill-toID}

Through this endpoint, your customer can easily update their billing details, by passing the cartId and billToId as path parameters.

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 bill-to ID.

Required: true

Type: requestBody

Name: The billing details to be updated.

Required: true

Sample Request

Path:

PATCH https://{baseurl}/api-cart/cart/{cartID}/bill-to/{bill-toID}

Body:

{
"paymentMethod":"Mastercard",
"cardIdentifier":"4242",
"amount":50,
"address": {
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"street1":"10400 NE 4th St ",
"city":"Bellevue",
"state":"WA",
"country": "United States",
"zipCode":"98004",
"kind":"shipping",
"name":{
"first":"John",
"last":"demo"
},
"email": "[email protected]"
}
}

Response Code: 200

Message: OK

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

{
"_id": "60ad33dcc378e90008c3cbf1",
"address": {
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"street1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "shipping",
"name": {
"first": "John",
"last": "Demo"
},
"email": "[email protected]"
},
"paymentMethod": "Mastercard",
"cardIdentifier": "4242",
"amount": 50,
"billToId": 1067,
"cart": "60ad33d48ac3fe0008b65f66",
"createdAt": "2021-05-25T17:29:00.041Z",
"updatedAt": "2021-05-25T18:10:39.007Z",
"__v": 0
}

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