Release Notes
- January 2025
- October 2024
- July 2024
- November 2023
- Feedback and Contact
Create and complete a checkout session
Create and complete checkout session on all the items in a specific cart, identified by a cartId
. Along with cartId
, the checkout operation includes merchant account ID, amount to be paid, tax to be imposed on cart items, shipping address, and other details.
curl --request POST \
--url https://api.fabric.inc/v3/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '{
"cartId": "d7e78a21-bee3-4448-bf1c-d5b5461dbda2",
"customer": {
"name": {
"firstName": "Pat",
"middleName": "E",
"lastName": "Kake"
},
"email": "test@example.com",
"phone": {
"number": "5555555555",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94",
"accountId": "62272e917b12209e68751d94",
"employeeId": "62272e917b12209e68751d94",
"company": "fabric"
},
"payments": [
{
"paymentProvider": "authorize.net",
"paymentMethod": "card",
"paymentToken": {
"token": "pi_34tr6787rt",
"paymentType": "VISA"
},
"amount": 150.25,
"currency": "USD",
"billingAddress": {
"addressLine1": "123 Main St.",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"city": "Seattle",
"region": "WA",
"postalCode": "98121",
"country": "US",
"name": {
"firstName": "Pat",
"middleName": "E",
"lastName": "Kake"
},
"phone": {
"number": "123-456-7890",
"type": "office"
},
"email": "user@example.com",
"customerId": "62cffd65e8d7eb868c6a29d6",
"type": "residence",
"latitude": 47.6205,
"longitude": -122.3493
},
"attributes": {
"paymentId": "620d8896058edb0009385311"
}
}
],
"tax": {
"itemTaxes": [
{
"lineItemId": "d7e78a21-bee3-4448-bf1c-d5b5461dbda2",
"position": 1,
"amount": 150.25,
"currency": "USD",
"name": "state tax",
"rateType": "PERCENTAGE",
"rate": 10
}
],
"shippingTaxes": [
{
"shippingDetailsId": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"amount": 150.25,
"currency": "USD",
"name": "state tax"
}
],
"feeTaxes": [
{
"feeId": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"name": "State tax",
"amount": 150.25,
"currency": "USD"
}
]
},
"orderMetadata": {
"orderType": "MOBILE_APP",
"orderSubtype": "Android",
"notes": [
{
"notedAt": "2022-09-06T14:07:17.000Z",
"user": "261AF48",
"notes": "Additional notes..."
}
]
}
}'
{
"state": "COMPLETED",
"orderId": "111-121-1234"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
Unique request ID
Body
Checkout request body
Unique cart ID
"d7e78a21-bee3-4448-bf1c-d5b5461dbda2"
Payment detail list
Payment request details.Empty if there is no payment configuration.
Payment gateway service provider
"authorize.net"
Payment method
"card"
Payment amount
150.25
Three-letter currency code as defined by ISO-4217
"USD"
Billing address
Address line 1
"123 Main St."
Address line 2
"Suite 100"
Address line 3
"Seventh floor"
Address line 4
"Attention: Pat E. Kake"
City
"Seattle"
Region or state
"WA"
Postal or zip code
"98121"
Country (can be full name, or ISO 3166-1 alpha-2 or alpha-3 code)
"US"
Receiver email ID
"user@example.com"
Customer profile ID, created by the payment gateway, for payment instruction. This ID is specific to payment flow.
"62cffd65e8d7eb868c6a29d6"
Address type
"residence"
Address latitude
47.6205
Address longitude
-122.3493
Additional data passed by the caller
{ "paymentId": "620d8896058edb0009385311" }
Estimated taxes for items, shipping and fees
Item taxes
Cart line item tax
Line item ID
"d7e78a21-bee3-4448-bf1c-d5b5461dbda2"
Item sequence number
1
Currency amount
150.25
Three-letter currency code as defined by ISO-4217
"USD"
Tax name
"state tax"
Rate type
"PERCENTAGE"
Rate
10
Shipping taxes
Shipping taxes
Unique shipping ID
"fef78121-bee3-4448-bf1c-d5b5461dbda2"
Currency amount
150.25
Three-letter currency code as defined by ISO-4217
"USD"
Tax name
"state tax"
Taxes related to fees
Fee taxes
Unique fee tax ID
"fef78121-bee3-4448-bf1c-d5b5461dbda2"
Fee tax type
"State tax"
Fee tax amount
150.25
Three-letter currency code as defined by ISO-4217
"USD"
Customer making payment
Contact person's email
"test@example.com"
User ID
"62272e917b12209e68751d94"
Account ID such as loyalty account ID
"62272e917b12209e68751d94"
Employee ID used when the customer is the employee
"62272e917b12209e68751d94"
Company
"fabric"
Additional order information
Order type (WEB, CSC, MOBILE_APP, POS, etc.)
"MOBILE_APP"
Order subtype (Android, IOS, International, etc.)
"Android"
Customer service representative's notes
Notes section for use by customer service representative only
Was this page helpful?
curl --request POST \
--url https://api.fabric.inc/v3/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '{
"cartId": "d7e78a21-bee3-4448-bf1c-d5b5461dbda2",
"customer": {
"name": {
"firstName": "Pat",
"middleName": "E",
"lastName": "Kake"
},
"email": "test@example.com",
"phone": {
"number": "5555555555",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94",
"accountId": "62272e917b12209e68751d94",
"employeeId": "62272e917b12209e68751d94",
"company": "fabric"
},
"payments": [
{
"paymentProvider": "authorize.net",
"paymentMethod": "card",
"paymentToken": {
"token": "pi_34tr6787rt",
"paymentType": "VISA"
},
"amount": 150.25,
"currency": "USD",
"billingAddress": {
"addressLine1": "123 Main St.",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"city": "Seattle",
"region": "WA",
"postalCode": "98121",
"country": "US",
"name": {
"firstName": "Pat",
"middleName": "E",
"lastName": "Kake"
},
"phone": {
"number": "123-456-7890",
"type": "office"
},
"email": "user@example.com",
"customerId": "62cffd65e8d7eb868c6a29d6",
"type": "residence",
"latitude": 47.6205,
"longitude": -122.3493
},
"attributes": {
"paymentId": "620d8896058edb0009385311"
}
}
],
"tax": {
"itemTaxes": [
{
"lineItemId": "d7e78a21-bee3-4448-bf1c-d5b5461dbda2",
"position": 1,
"amount": 150.25,
"currency": "USD",
"name": "state tax",
"rateType": "PERCENTAGE",
"rate": 10
}
],
"shippingTaxes": [
{
"shippingDetailsId": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"amount": 150.25,
"currency": "USD",
"name": "state tax"
}
],
"feeTaxes": [
{
"feeId": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"name": "State tax",
"amount": 150.25,
"currency": "USD"
}
]
},
"orderMetadata": {
"orderType": "MOBILE_APP",
"orderSubtype": "Android",
"notes": [
{
"notedAt": "2022-09-06T14:07:17.000Z",
"user": "261AF48",
"notes": "Additional notes..."
}
]
}
}'
{
"state": "COMPLETED",
"orderId": "111-121-1234"
}