---
title: "Create a checkout request"
method: POST
path: "/checkout"
tags: ["Checkout"]
---

# Create a checkout request

`POST /checkout`

This API call allows the complete checkout flow (create basket, add items, add sale) to be made in a single API call, for when the Seller is managing the basket locally. **This endpoint requires prior approval - please contact your account manager.**

## Request body

- object
  - `basket` object, required — An object containing the customer's information, relevant links, and any custom tracking data.
    - `first_name` string
    - `last_name` string
    - `email` string
    - `return_url` string
    - `complete_url` string
    - `custom` object
  - `items` CheckoutItem[], required — An array of `Packages` in the basket.
    - `package` Package
      - `name` string — The name of the item being purchased. This should be user-friendly as it is shown to the customer on checkout and receipts.
      - `price` number, float — A float (decimal describing the price of the package in your account currency)
      - `type` 'single' | 'subscription'
      - `qty` integer
      - `expiry_period` 'day' | 'month' | 'year' — The renewal period of this item
      - `expiry_length` integer — An integer representing the number of `expiry_periods` that make up the renewal period.
      - `custom` object — A map of data that is passed back to you via the webhook (for example, a tracking ID)
  - `sale` Sale
    - `name` string — The name of the sale (displayed to the customer)
    - `discount_type` 'percentage' | 'amount' — The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.
    - `amount` number — The amount or percentage to deduct

## Response `200`

Successfully created basket. The basket will be returned with `links` containing the URLs you should direct the customer to in order to complete payment.

- Basket
  - `ident` string
  - `expire` string
  - `price` number, float
  - `priceDetails` PriceDetails
    - `fullPrice` number, float
    - `subTotal` number, float
    - `discounts` object[]
    - `total` number, float
    - `tax` number, float
    - `balance` number, float
    - `sales` Sale[]
      - `name` string — The name of the sale (displayed to the customer)
      - `discount_type` 'percentage' | 'amount' — The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.
      - `amount` number — The amount or percentage to deduct
    - `giftcards` GiftCard[]
    - `recurring` boolean — Contains recurring amount. Limited to 1 subscription package in the basket at a time.
    - `username` string
    - `roundUp` number, nullable
  - `isPaymentMethodUpdate` boolean
  - `returnUrl` string, nullable
  - `complete` boolean
  - `tax` number
  - `username` string, nullable
  - `discounts` Discount[]
  - `coupons` Coupon[]
  - `giftcards` GiftCard[]
  - `address` Address
    - `name` string
    - `first_name` string
    - `last_name` string
    - `address` string
    - `email` string
    - `state_id` string, nullable
    - `country` string
    - `postal_code` string
  - `rows` BasketRow[]
    - `id` integer
    - `basket` integer — Numeric basket ID
    - `package` integer, nullable — Package ID associated with this item
    - `override` integer — Package ID associated with this item
    - `quantity` integer
    - `server` integer, nullable
    - `price` number, float
    - `gift_username_id` integer, nullable
    - `options` object, nullable
    - `recurring` boolean
    - `recurring_period` string, nullable
    - `recurring_next_payment_date` string, date-time, nullable
    - `meta` object
      - `name` string
      - `rowprice` number, float
      - `initialprice` number, float
      - `isCumulative` boolean
      - `requiredPackages` integer[]
      - `requiresAny` boolean
      - `category` boolean
      - `producesGiftCard` boolean
      - `allowsGiftCards` boolean
      - `servers` integer[]
      - `limits` object
        - `user` object
          - `enabled` boolean
          - `timestamp` integer
          - `limit` boolean
        - `global` object
          - `enabled` boolean
          - `timestamp` integer
          - `limit` boolean
        - `packageExpiryTime` integer
      - `hasDeliverables` boolean
      - `deliverableTypes` string[]
      - `downloadLink` string
      - `hasSellerProtection` boolean
      - `itemType` string, nullable
      - `revenue_share` number[]
      - `image` string, nullable
      - `realprice` number, float
    - `custom` object, nullable
    - `image_url` string, nullable
    - `recurring_price` number, float, nullable
  - `fingerprint` string, nullable — Browser fingerprint to identify the user
  - `creator_code` string — The creator code is used to share a percentage of the payment with another party. See more about creator codes at https://docs.tebex.io/creators/tebex-control-panel/engagement/creator-codes
  - `roundup` boolean, nullable
  - `cancel_url` string
  - `complete_url` string, nullable
  - `complete_auto_redirect` boolean
  - `custom` object, nullable
  - `links` BasketLinks
    - `payment` string — The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.
    - `checkout` string — The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment

## Other responses

- `400` — Bad Request. See ErrorResponse.

---

[API](https://skmtc.net/tebex/apis/tebex-checkout-api.md) · [All operations](https://skmtc.net/tebex/apis/tebex-checkout-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tebex/tebex-checkout-api/revisions/a52c87b9a2b9/schema)
