XM
Powered By GitBook
Add Billing
Path:
1
POST https://{baseurl}/api-cart/bill-to/cart/{cartID}
Copied!
This endpoint enables your customers to add the billing details such as preferred payment method, billing address, contact details, etc. to the cart . The billToId received in the response is required to retrieve or update the billing details in the future.

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).
Required: true
Type: requestBody
Name: The billing adddress along with the contact information and the payment details.
Required: true

Sample Request

Path:
1
https://{baseurl}/api-cart/bill-to/cart/5f8f0da2d4cc8e00084b9e8e
Copied!
Body:
1
{
2
"paymentMethod": "VISA",
3
"cardIdentifier": "4242",
4
"amount": 24,
5
"address": {
6
"street1": "10400 NE 4th St",
7
"city": "Bellevue",
8
"state": "WA",
9
"country": "United States",
10
"zipCode": "98004",
11
"kind": "shipping",
12
"name": {
13
"first": "John",
14
"middle": "M",
15
"last": "demo"
16
},
17
"email": "[email protected]",
18
"phone": {
19
"number": "123-992-9404",
20
"kind": "Mobile"
21
},
22
"attention": "Leave at the back door"
23
}
24
}
Copied!

Response

Response Code: 200
Message: OK
Description: You will see this message when the billing details are successfully added to the cart.
Sample
1
{
2
"_id": "60803ab6880a2e0009bc5250",
3
"address": {
4
"street1": "10400 NE 4th St",
5
"city": "Bellevue",
6
"state": "WA",
7
"country": "United States",
8
"zipCode": "98004",
9
"kind": "shipping",
10
"name": {
11
"first": "John",
12
"middle": "M",
13
"last": "Demo"
14
},
15
"email": "[email protected]",
16
"phone": {
17
"number": "123-992-9404",
18
"kind": "Mobile"
19
},
20
"attention": "Leave at the back door"
21
},
22
"paymentMethod": "VISA",
23
"cardIdentifier": "4242",
24
"amount": 24,
25
"billToId": 35,
26
"cart": "5f8f0da2d4cc8e00084b9e8e",
27
"createdAt": "2021-07-14T03:27:29.198Z",
28
"updatedAt": "2021-07-14T03:29:29.198Z"
29
}
Copied!
Response Code: 404
Message: Not found
Description: You will see this error when the specified 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: Bad Request
Description: You will see this error when the specified 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 2mo ago
Copy link
Contents
Change Log