---
title: "Add a package to the basket"
method: POST
path: "/baskets/{ident}/packages"
tags: ["Baskets"]
---

# Add a package to the basket

`POST /baskets/{ident}/packages`

This adds a package (an object describing the product) to the basket `{ident}`. For subscriptions, **only one subscription item may be in a basket at a time**, and it cannot be included with one-time payment items. **This endpoint requires prior approval. Please contact your account manager.**

## Path parameters

- `ident` string, required

## Request body

- object
  - `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)
  - `qty` integer — The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.
  - `type` 'single' | 'subscription' — The type of payment, either `single` for one-time payments or `subscription`.
  - `revenue_share` RevenueShare[] — An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**
    - `wallet_ref` string
    - `amount` number, float — A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`
    - `gateway_fee_percent` number, float — A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.

## Response `200`

Package is successfully added to the basket, and basket is returned.

- 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` — Improperly formatted package. See ErrorResponse.
- `404` — Basket not found.

---

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