POST
/
checkout
/
sessions
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

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
string

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.

x-fabric-request-id
string

Unique request ID

Body

application/json

Checkout request body

cartId
string
required

Unique cart ID

Example:

"d7e78a21-bee3-4448-bf1c-d5b5461dbda2"

payments
object[]
required

Payment detail list

Payment request details.Empty if there is no payment configuration.

tax
object
required

Estimated taxes for items, shipping and fees

customer
object

Customer making payment

orderMetadata
object

Additional order information

Response

200
application/json
OK

Checkout response details

state
enum<string>

Checkout session state.<br />COMPLETED: Checkout is complete<br />PENDING: Checkout is incomplete

Available options:
COMPLETED,
PENDING
Example:

"COMPLETED"

orderId
string | null

Order ID

Example:

"111-123-4421"

Was this page helpful?