latestOpenAPI 3.0.3MIT2026-08-10121945.1 KB

a52c87b9a2b9

Baskets

Add a package to the basket

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.

post/baskets/{ident}/packages

Path parameters

identstring required
Example:1a-55fff4107740a1f40d844ff89607557f45bfafb3

The basket identifier.

Request body

qtyinteger

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.

Example request

{
  "package": {
    "name": "1000 Gold",
    "price": 1.27,
    "type": "subscription",
    "qty": 1,
    "expiry_period": "month",
    "expiry_length": 3,
    "custom": {
      "foo": "bar"
    }
  },
  "qty": 2,
  "type": "single",
  "revenue_share": [
    {
      "wallet_ref": "centralised_404244_127",
      "amount": 0.5,
      "gateway_fee_percent": 50
    }
  ]
}

Response

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

identstring
expirestring
pricenumber float
isPaymentMethodUpdateboolean
returnUrlstring nullable
completeboolean
taxnumber
usernamestring nullable
discountsDiscount[]
couponsCoupon[]
giftcardsGiftCard[]
fingerprintstring nullable

Browser fingerprint to identify the user

creator_codestring

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

roundupboolean nullable
cancel_urlstring
complete_urlstring nullable
complete_auto_redirectboolean
customobject nullable

Example response

{
  "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
  "expire": "2022-10-25 15:15:40",
  "price": 1.27,
  "priceDetails": {
    "fullPrice": 1.4,
    "subTotal": 1.27,
    "discounts": [],
    "total": 1.4,
    "surcharges": [],
    "tax": 0.13,
    "balance": 0,
    "sales": [],
    "giftcards": [],
    "roundUp": null
  },
  "address": {
    "name": "Ted Tebex",
    "first_name": "Ted",
    "last_name": "Tebex",
    "address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
    "email": "example@tebex.io",
    "state_id": null,
    "country": "UK",
    "postal_code": "NW6 3QT"
  },
  "rows": [
    {
      "id": 173125385,
      "basket": 725572301,
      "quantity": 2,
      "price": 1.27,
      "meta": {
        "name": "1000 Gold",
        "rowprice": 2.54,
        "initialprice": 1.27,
        "requiredPackages": [],
        "allowsGiftCards": true,
        "servers": [],
        "deliverableTypes": [],
        "hasSellerProtection": true,
        "revenue_share": [],
        "realprice": 1.27
      }
    }
  ],
  "cancel_url": "https://tebex.io",
  "custom": {
    "foo": "bar",
    "ref": 1234
  },
  "links": {
    "payment": "https://checkout.tebex.io/api/payments/tbx-12345",
    "checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
  }
}