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

# Add a sale to the basket

`POST /baskets/{ident}/sales`

Adds a `Sale` to the basket with `{ident}`. **Sales cannot be applied to baskets with `revenue_share` set.**

## Path parameters

- `ident` string, required

## Request body

- 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 adds sale to basket.

- 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. Improperly formatted Sale or this basket cannot accept sales. 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)
