XM
Members
Checkout 4.0 (New)
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
POST https://{baseurl}/api-order/checkout-v4
Copied!
This API supports checkout using multiple payment methods through popular payment gateways such as Stripe or Authorize.net. In addition, you may allow your customers the option to use split payments between the different payment methods such as Gift Cart, Loyalty Points, Credit/Debit Cards, Apple Pay, Google Pay, and PayPal (based on the selected payment gateway).
To checkout using Stripe, the following APIs must be run sequentially.
  1. 1.
    Add Items to Cart
  2. 2.
    Create Shipping
  3. 3.
    Add Shipping to Line Items
  4. 4.
    Create Payment Method
  5. 5.
    Create Payment Intent
  6. 6.
    Confirm Payment intent
  7. 7.
    Checkout
Although, the paymentDetails are optional in the requestBody, the 'Add Payment to Cart' API determines whether the amount matches with the cart amount

Headers

Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type: body
Name: The cart ID, customer contact, estimated taxes, and optionally the payment details.
Required: true

Sample Request

Path:
1
POST https://{baseurl}/api-order/checkout-v4
Copied!
1
{
2
"cartId": "{{cartId}}",
3
"customerEmail": "[email protected]",
4
"paymentDetails": [{
5
"transactionDetails": {
6
"paymentType": "CARD",
7
"cardNumber": "4111111111111111",
8
"expDate": "1122",
9
"cvv": "999",
10
"cardHolderFullName": "tawseefahmade bhat",
11
"metadata": {}
12
},
13
"paymentIdentifier": {
14
"cardIdentifier": "1111"
15
},
16
"paymentMethod": "Visa",
17
"paymentKind": "Fabric User",
18
"amount": "100",
19
"currency": "USD",
20
"conversion": 1,
21
"billToAddress": {
22
"name": {
23
"first": "tawseef",
24
"last": "ahmade bhat"
25
},
26
"email": "[email protected]",
27
"phone": {
28
"number": "07780811973",
29
"kind": "Mobile"
30
},
31
"street1": "600 CONGRESS AVE",
32
"street2": "",
33
"city": "AUSTIN",
34
"state": "TX",
35
"country": "US",
36
"zipCode": "1003"
37
}
38
}],
39
"estimatedTax": {
40
"itemsTaxes": [
41
{
42
"lineItemId": 1,
43
"amount": 1
44
}
45
],
46
"shipToTaxes": [
47
{
48
"shipToId": "{{shipToId}}",
49
"amount": 0
50
}
51
]
52
}
53
}
Copied!

Response

Response Code: 200
Message: OK
Description: You will see this message when the checkout is successful.
1
{
2
"checkoutComplete": true,
3
"orderId": "4679-1016-66250"
4
}
Copied!
When the payment initiated doesn't match with the amout payable for the cart, the success response will show checkoutComplete as false, along with the payment discrepancy.
1
{
2
"checkoutComplete": false,
3
"pointOfFailure": "payment",
4
"paymentResp": {
5
"totalAmountCapturable": "0.00",
6
"orderTotal": "1001.00"
7
}
8
}
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