XM
Members
Update Billing
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
PATCH https://{baseurl}/api-cart/cart/{cartID}/bill-to/{bill-toID}
Copied!
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:
1
PATCH https://{baseurl}/api-cart/cart/{cartID}/bill-to/{bill-toID}
Copied!
Body:
1
{
2
"paymentMethod":"Mastercard",
3
"cardIdentifier":"4242",
4
"amount":50,
5
"address": {
6
"phone": {
7
"number": "123-992-9404",
8
"kind": "Mobile"
9
},
10
"street1":"10400 NE 4th St ",
11
"city":"Bellevue",
12
"state":"WA",
13
"country": "United States",
14
"zipCode":"98004",
15
"kind":"shipping",
16
"name":{
17
"first":"John",
18
"last":"demo"
19
},
20
"email": "[email protected]"
21
}
22
}
Copied!
Response Code: 200
Message: OK
Description: You will see this message when the billing details are successfully updated.
1
{
2
"_id": "60ad33dcc378e90008c3cbf1",
3
"address": {
4
"phone": {
5
"number": "123-992-9404",
6
"kind": "Mobile"
7
},
8
"street1": "10400 NE 4th St ",
9
"city": "Bellevue",
10
"state": "WA",
11
"country": "United States",
12
"zipCode": "98004",
13
"kind": "shipping",
14
"name": {
15
"first": "John",
16
"last": "Demo"
17
},
18
"email": "[email protected]"
19
},
20
"paymentMethod": "Mastercard",
21
"cardIdentifier": "4242",
22
"amount": 50,
23
"billToId": 1067,
24
"cart": "60ad33d48ac3fe0008b65f66",
25
"createdAt": "2021-05-25T17:29:00.041Z",
26
"updatedAt": "2021-05-25T18:10:39.007Z",
27
"__v": 0
28
}
Copied!
Response Code: 404
Message: Not found
Description: You will see this error when the cart ID doesn't exist in the system.
1
{
2
"code": "CART_NOT_FOUND",
3
"message": "Cart not found."
4
}
Copied!
Response Code: 400
Message: Request validation
Description: You will see this error when the cart ID is lesser or greater than 24 characters.
1
{
2
"code": "REQUEST_VALIDATION",
3
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
4
}
Copied!
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
Last modified 1mo ago
Copy link
Contents
Change Log