---
title: "Create a basket that can be used to pay for items"
method: POST
path: "/baskets"
tags: ["Baskets"]
---

# Create a basket that can be used to pay for items

`POST /baskets`

This will create and return a `Basket` that can be paid for by redirecting the user to `links.checkout`

## Request body

- object
  - `return_url` string — The URL a customer can return to without completing checkout
  - `complete_url` string — URL the customer can return to after completing payment
  - `custom` object — Any custom data to be passed through the request. This will be returned in a post-completion webhook.
  - `first_name` string — The first name of the customer
  - `last_name` string — The last name of the customer
  - `email` string — The email address of the customer
  - `expires_at` string — An ISO8601 formatted date. After this date the basket cannot be used to checkout.
  - `complete_auto_redirect` boolean — Automatically redirect to the complete_url provided
  - `country` string — An ISO 3166-1 alpha-2 character code representing the customer's country.
  - `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
  - `ip` string — The IP address of the customer using this basket. Provide the IP if creating a basket on your server backend.

## Response `200`

Basket created successfully

- 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

---

[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)
