> For the complete documentation index, see [llms.txt](https://docs.tebex.io/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/developers/headless-api/endpoints.md).

# Endpoints

All endpoints for Headless API: for specific implementation guides see Guides

## Get the webstore's information

> Gets the webstore associated with the provided token

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/":{"get":{"description":"Gets the webstore associated with the provided token","operationId":"getWebstore","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebstoreResponse"}}},"description":"Successful response returns the webstore's information."}},"summary":"Get the webstore's information","tags":["Headless"]}}},"components":{"schemas":{"WebstoreResponse":{"description":"Wrapped webstore information in a \"data\" object.","properties":{"data":{"$ref":"#/components/schemas/Webstore"}}},"Webstore":{"properties":{"id":{"type":"integer"},"description":{"description":"Store description in HTML format","type":"string"},"name":{"description":"Name of the store","type":"string"},"webstore_url":{"description":"URL of the webstore","format":"uri","type":"string"},"currency":{"description":"Currency used in the store","type":"string"},"lang":{"description":"Language of the store","type":"string"},"logo":{"description":"URL of the store's logo","format":"uri","type":"string","nullable":true},"platform_type":{"description":"Platform type for the store","type":"string"},"platform_type_id":{"type":"string"},"disabled":{"description":"True if the store is disabled.","type":"boolean"},"created_at":{"description":"The date and time when the store was created","format":"date-time","type":"string"},"supports_usernames":{"description":"True if the store's platform identifies customers by username.","type":"boolean"},"supports_gifting":{"description":"True if packages can be gifted to another user.","type":"boolean"}}}}}}
```

## Get custom pages defined for the webstore.

> Gets a list of custom pages associated with the webstore. These contain a \`content\` variable with the HTML content of the page.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/pages":{"get":{"description":"Gets a list of custom pages associated with the webstore. These contain a `content` variable with the HTML content of the page.","operationId":"getCustomPages","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CMSPagesResponse"}}},"description":"Successful response returns the webstore's pages."}},"summary":"Get custom pages defined for the webstore.","tags":["Headless"]}}},"components":{"schemas":{"CMSPagesResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CMSPage"},"type":"array"}}},"CMSPage":{"properties":{"id":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"account_id":{"type":"integer"},"title":{"type":"string"},"slug":{"type":"string"},"private":{"type":"boolean"},"hidden":{"type":"boolean"},"disabled":{"type":"boolean"},"sequence":{"type":"boolean"},"content":{"type":"string"}}}}}}
```

## Get a basket

> Gets a basket associated with the provided identifier.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}":{"get":{"description":"Gets a basket associated with the provided identifier.","operationId":"getBasket","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}},"description":"Successful response returns the basket information."}},"summary":"Get a basket","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"BasketResponse":{"properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"creator_code":{"description":"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","type":"string"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"description":"A two-character country code","type":"string"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"description":"A 3 character currency code","type":"string"},"packages":{"items":{"$ref":"#/components/schemas/BasketPackage"},"type":"array"},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"properties":{"code":{"type":"string"}}},"GiftCard":{"properties":{"card_number":{"type":"string"}}},"BasketPackage":{"description":"A package within an existing basket.","properties":{"id":{"description":"The package ID","type":"integer"},"description":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"in_basket":{"$ref":"#/components/schemas/BasketPackage_in_basket"},"type":{"description":"The type of payment, either `single` for one-time payments or `subscription`.","enum":["single","subscription"],"type":"string"},"revenue_share":{"description":"An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**","items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"is_recurring":{"description":"Whether this package is a recurring (subscription) purchase.","type":"boolean"}}},"BasketPackage_in_basket":{"properties":{"quantity":{"description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.","type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"description":"The username id of the user this package is gifted to","type":"string"},"gift_username":{"description":"The username of the user this package is gifted to.","type":"string"}}},"RevenueShare":{"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","type":"number"},"gateway_fee_percent":{"description":"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.","type":"number"}}},"BasketLinks":{"properties":{"payment":{"description":"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.","type":"string"},"checkout":{"description":"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","type":"string"}}}}}}
```

## Create a new basket

> Creates a new basket for use during checkout.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets":{"post":{"description":"Creates a new basket for use during checkout.","operationId":"createBasket","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createBasket_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}},"description":"Successful response returns the basket information."},"422":{"description":"The provided webstore ID is invalid."}},"summary":"Create a new basket","tags":["Headless"]}}},"components":{"schemas":{"createBasket_request":{"properties":{"complete_url":{"description":"A URL the user can return to when checkout is completed.","type":"string"},"cancel_url":{"description":"A URL the user can return to when cancelling checkout.","type":"string"},"custom":{"description":"Custom data you wish to associate with the basket. This data will be included with webhook responses and GET requests associated with the Basket.","type":"object"},"complete_auto_redirect":{"description":"True if the user should automatically be redirected to the relevant complete/cancel URL","type":"boolean"}}},"BasketResponse":{"properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"creator_code":{"description":"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","type":"string"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"description":"A two-character country code","type":"string"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"description":"A 3 character currency code","type":"string"},"packages":{"items":{"$ref":"#/components/schemas/BasketPackage"},"type":"array"},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"properties":{"code":{"type":"string"}}},"GiftCard":{"properties":{"card_number":{"type":"string"}}},"BasketPackage":{"description":"A package within an existing basket.","properties":{"id":{"description":"The package ID","type":"integer"},"description":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"in_basket":{"$ref":"#/components/schemas/BasketPackage_in_basket"},"type":{"description":"The type of payment, either `single` for one-time payments or `subscription`.","enum":["single","subscription"],"type":"string"},"revenue_share":{"description":"An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**","items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"is_recurring":{"description":"Whether this package is a recurring (subscription) purchase.","type":"boolean"}}},"BasketPackage_in_basket":{"properties":{"quantity":{"description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.","type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"description":"The username id of the user this package is gifted to","type":"string"},"gift_username":{"description":"The username of the user this package is gifted to.","type":"string"}}},"RevenueShare":{"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","type":"number"},"gateway_fee_percent":{"description":"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.","type":"number"}}},"BasketLinks":{"properties":{"payment":{"description":"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.","type":"string"},"checkout":{"description":"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","type":"string"}}}}}}
```

## Get auth links for basket

> Fetches a basket's auth URL. The player should be directed here in order for them to authorize their account.\
> When complete, they will be returned to the provided \`returnUrl\` and the basket will be authorized from that moment onwards.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/auth?returnUrl={returnUrl}":{"get":{"description":"Fetches a basket's auth URL. The player should be directed here in order for them to authorize their account.\nWhen complete, they will be returned to the provided `returnUrl` and the basket will be authorized from that moment onwards.","operationId":"getBasketAuthUrl","parameters":[{"$ref":"#/components/parameters/basketIdent"},{"description":"The URL you would like to redirect the user to after successful basket authentication.","explode":false,"in":"path","name":"returnUrl","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketAuthResponse"}}},"description":"Successful response returns the auth provider options and URLs of the sign-in link."},"422":{"description":"The provided webstore ID or basket ID is invalid."}},"summary":"Get auth links for basket","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"BasketAuthResponse":{"items":{"$ref":"#/components/schemas/BasketAuthResponse_inner"},"type":"array"},"BasketAuthResponse_inner":{"properties":{"name":{"type":"string"},"url":{"type":"string"}}}}}}
```

## Add packages to a dynamic category for a basket.

> Populates a dynamic category with custom packages for the given basket. Dynamic categories are created in the creator panel with the type \`dynamic\`, and are typically populated in response to a \`basket.authenticated\` webhook.\
> \
> Requires basic auth: the username is the webstore identifier and the password is the account's checkout API key.\
> \
> Once created, the packages can be fetched using the category endpoints with both \`includePackages=1\` and \`basketIdent\` provided.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"scheme":"basic","type":"http"}},"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"DynamicPackagesRequest":{"properties":{"basket_id":{"description":"The basket's ident. Use the same value as the `basketIdent` path parameter.","type":"string"},"username":{"description":"The username of the authenticated customer the packages are being created for.","type":"string"},"category_id":{"description":"The ID of the dynamic category to populate. Must be a category of type `dynamic`.","type":"integer"},"packages":{"items":{"$ref":"#/components/schemas/DynamicPackageInput"},"type":"array"}},"required":["basket_id","category_id","packages","username"]},"DynamicPackageInput":{"description":"A custom package to add to a dynamic category.","properties":{"name":{"type":"string"},"price":{"format":"float","type":"number"},"slug":{"type":"string"},"description":{"type":"string"},"image_url":{"type":"string"},"custom":{"additionalProperties":{"type":"string"},"description":"Arbitrary custom key/value data to associate with the package."}},"required":["name","price","slug"]},"DynamicPackagesResponse":{"properties":{"message":{"type":"string"}}},"ErrorResponse":{"properties":{"type":{},"title":{"description":"A short, human-readable summary of the problem type.  It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization","type":"string"},"status":{"description":"The HTTP status code gen by the origin server for the occurrence of the problem.","type":"integer"},"detail":{"description":"A human-readable explanation specific to this occurrence of the problem.","type":"string"},"instance":{"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced","type":"string"}}}}},"paths":{"/baskets/{basketIdent}/dynamic-packages":{"put":{"description":"Populates a dynamic category with custom packages for the given basket. Dynamic categories are created in the creator panel with the type `dynamic`, and are typically populated in response to a `basket.authenticated` webhook.\n\nRequires basic auth: the username is the webstore identifier and the password is the account's checkout API key.\n\nOnce created, the packages can be fetched using the category endpoints with both `includePackages=1` and `basketIdent` provided.","operationId":"createDynamicPackage","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicPackagesRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicPackagesResponse"}}},"description":"Successful response confirms the dynamic packages were created."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The request is invalid. The error response will include detail as to which parameter failed validation. This is also returned when basic auth credentials are missing (\"Basic auth credentials are required\") or when `category_id` is not a dynamic category (\"The specified category is not a dynamic category.\")."}},"summary":"Add packages to a dynamic category for a basket.","tags":["Headless"]}}}}
```

## Get all categories

> Gets all categories from a webstore. This does not include package information. To include package information, add \`?includePackages=1\` to the URL.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories":{"get":{"description":"Gets all categories from a webstore. This does not include package information. To include package information, add `?includePackages=1` to the URL.","operationId":"getCategories","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}},"description":"Successful response returns a list of category information."}},"summary":"Get all categories","tags":["Headless"]}}},"components":{"schemas":{"CategoryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Gets all categories and packages

> Gets all categories from a webstore including packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories?includePackages=1":{"get":{"description":"Gets all categories from a webstore including packages.","operationId":"getCategoriesIncludePackages","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}},"description":"Successful response returns a list of category information."}},"summary":"Gets all categories and packages","tags":["Headless"]}}},"components":{"schemas":{"CategoryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Get user's tiered categories

> Gets all categories from the webstore, returning active tier information for the given player.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"scheme":"basic","type":"http"}},"schemas":{"CategoryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}},"paths":{"/categories?usernameId={usernameId}&includePackages=1":{"get":{"description":"Gets all categories from the webstore, returning active tier information for the given player.","operationId":"getUserTieredCategories","parameters":[{"explode":false,"in":"path","name":"usernameId","required":true,"schema":{"type":"integer"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}},"description":"Successful response returns a list of category information."}},"summary":"Get user's tiered categories","tags":["Headless"]}}}}
```

## Get Dynamic Categories

> Gets all categories from a webstore including packages. When \`basketIdent\` is provided, dynamic categories are populated with the packages associated with that basket.\
> \
> If a basket identifier is not provided, dynamic categories will be empty as the basket is required to relate packages to the category.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories?includePackages=1&basketIdent={basketIdent}":{"get":{"description":"Gets all categories from a webstore including packages. When `basketIdent` is provided, dynamic categories are populated with the packages associated with that basket.\n\nIf a basket identifier is not provided, dynamic categories will be empty as the basket is required to relate packages to the category.","operationId":"getDynamicCategories","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}},"description":"Successful response returns a list of category information."}},"summary":"Get Dynamic Categories","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"CategoryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Get specific category

> Gets information about a category and returns the packages in that category.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories/{categoryId}":{"get":{"description":"Gets information about a category and returns the packages in that category.","operationId":"getCategory","parameters":[{"description":"The ID or slug of the category to fetch.","explode":false,"in":"path","name":"categoryId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleCategoryResponse"}}},"description":"Successful response returns the category without package information."}},"summary":"Get specific category","tags":["Headless"]}}},"components":{"schemas":{"SingleCategoryResponse":{"properties":{"data":{"$ref":"#/components/schemas/Category"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Get a category with all packages

> Gets information about a category and returns the packages in that category.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories/{categoryId}?includePackages=1":{"get":{"description":"Gets information about a category and returns the packages in that category.","operationId":"getCategoryIncludePackages","parameters":[{"description":"The ID or slug of the category to fetch.","explode":false,"in":"path","name":"categoryId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleCategoryResponse"}}},"description":"Successful response returns the category with package information."}},"summary":"Get a category with all packages","tags":["Headless"]}}},"components":{"schemas":{"SingleCategoryResponse":{"properties":{"data":{"$ref":"#/components/schemas/Category"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Gets a specific category including packages, populating a dynamic category for the given basket.

> Gets information about a category and returns the packages in that category. When the category is dynamic and \`basketIdent\` is provided, the category is populated with the packages associated with that basket.\
> \
> If a basket identifier is not provided, a dynamic category will be empty as the basket is required to relate packages to the category.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/categories/{categoryId}?includePackages=1&basketIdent={basketIdent}":{"get":{"description":"Gets information about a category and returns the packages in that category. When the category is dynamic and `basketIdent` is provided, the category is populated with the packages associated with that basket.\n\nIf a basket identifier is not provided, a dynamic category will be empty as the basket is required to relate packages to the category.","operationId":"getCategoryIncludeDynamicPackages","parameters":[{"description":"The ID or slug of the category to fetch.","explode":false,"in":"path","name":"categoryId","required":true,"schema":{"type":"string"},"style":"simple"},{"$ref":"#/components/parameters/basketIdent"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleCategoryResponse"}}},"description":"Successful response returns the category with package information."}},"summary":"Gets a specific category including packages, populating a dynamic category for the given basket.","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"SingleCategoryResponse":{"properties":{"data":{"$ref":"#/components/schemas/Category"}}},"Category":{"properties":{"id":{"type":"integer"},"name":{"description":"User-friendly name of the category","type":"string"},"slug":{"description":"Short identifier slug for the category","type":"string","nullable":true},"parent":{"description":"Parent category, if applicable","format":"Category","type":"object","nullable":true},"tiered":{"description":"True if this is a tiered category","type":"boolean"},"active_tier":{"$ref":"#/components/schemas/Tier"},"description":{"description":"HTML description of the category","type":"string"},"packages":{"description":"Packages within the category. For dynamic categories, packages use the `DynamicPackage` shape and are only populated when a `basketIdent` is provided.","items":{"$ref":"#/components/schemas/Package"},"type":"array","nullable":true},"order":{"description":"The numeric order in which to display the category.","type":"integer"},"display_type":{"description":"How the category should be displayed","enum":["list","grid"],"type":"string"},"image_url":{"description":"URL of the category image, if set.","format":"uri","type":"string","nullable":true},"dynamic":{"description":"True if this is a dynamic category. Dynamic categories are populated with custom packages per-basket using the Add Dynamic Packages endpoint, and their packages can only be fetched by providing a `basketIdent`.","type":"boolean"}}},"Tier":{"properties":{"id":{"type":"integer"},"created_at":{"description":"The date and time when the tier became active","format":"date-time","type":"string"},"username_id":{"description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID","type":"string"},"package":{"$ref":"#/components/schemas/Package"},"active":{"description":"True if the tier is currently active.","type":"boolean"},"recurring_payment_reference":{"description":"The ID of the recurring payment this tier is attached to.","type":"string"},"next_payment_date":{"description":"The date and time of the next payment for this tier.","format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/Tier_status"},"pending_downgrade_package":{"$ref":"#/components/schemas/Tier_pending_downgrade_package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"Tier_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"Tier_pending_downgrade_package":{"description":"The package this tier is downgrading to if a downgrade is pending.","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"nullable":true}}}}
```

## Get package

> Gets a package from a webstore by its \`ident\` or numeric ID.\
> \
> \- Using \`ident\` is recommended, since it works for every package type. Send it back exactly as returned; don't build or parse it.\
> \- \`id\` stays numeric for standard packages. For external packages \`id\` is synthetic, so always use \`ident\`.\
> \
> Note: this endpoint does not support packages belonging to dynamic categories. Use the category endpoints with \`includePackages=1\` and \`basketIdent\` to fetch dynamic packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/packages/{packageId}":{"get":{"description":"Gets a package from a webstore by its `ident` or numeric ID.\n\n- Using `ident` is recommended, since it works for every package type. Send it back exactly as returned; don't build or parse it.\n- `id` stays numeric for standard packages. For external packages `id` is synthetic, so always use `ident`.\n\nNote: this endpoint does not support packages belonging to dynamic categories. Use the category endpoints with `includePackages=1` and `basketIdent` to fetch dynamic packages.","operationId":"getPackage","parameters":[{"description":"The package's `ident` (recommended, e.g. `pkg_12_456`) or numeric ID.","explode":false,"in":"path","name":"packageId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SinglePackageResponse"}}},"description":"Successful response returns the package information."}},"summary":"Get package","tags":["Headless"]}}},"components":{"schemas":{"SinglePackageResponse":{"properties":{"data":{"$ref":"#/components/schemas/Package"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}}}}}
```

## Get all packages

> Gets all packages from a webstore.\
> \
> Note: this endpoint does not support packages belonging to dynamic categories. Use the category endpoints with \`includePackages=1\` and \`basketIdent\` to fetch dynamic packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/packages":{"get":{"description":"Gets all packages from a webstore.\n\nNote: this endpoint does not support packages belonging to dynamic categories. Use the category endpoints with `includePackages=1` and `basketIdent` to fetch dynamic packages.","operationId":"getAllPackages","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}},"description":"Successful response returns a list of package information."}},"summary":"Get all packages","tags":["Headless"]}}},"components":{"schemas":{"PackageResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Package"},"type":"array"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}}}}}
```

## Get packages

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"scheme":"basic","type":"http"}},"schemas":{"PackageResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Package"},"type":"array"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}}}},"paths":{"/packages?ipAddress={ipAddress}":{"get":{"description":"Gets all packages from a webstore.","operationId":"getAllPackagesWithAuthedIP","parameters":[{"description":"An IP address can be provided with authenticated requests","explode":false,"in":"path","name":"ipAddress","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}},"description":"Successful response returns a list of package information."},"422":{"description":"The provided request is invalid."}},"summary":"Get packages","tags":["Headless"]}}}}
```

## Get packages available for basket

> Gets all packages available to the provided basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/packages?basketIdent={basketIdent}":{"get":{"description":"Gets all packages available to the provided basket.","operationId":"getPackagesForBasket","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}},"description":"Successful response returns a list of package information."},"422":{"description":"The provided request is invalid."}},"summary":"Get packages available for basket","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"PackageResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Package"},"type":"array"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}}}}}
```

## Get packages available for IP and basket

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"scheme":"basic","type":"http"}},"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"PackageResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Package"},"type":"array"}}},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}}}},"paths":{"/packages?ipAddress={ipAddress}&basketIdent={basketIdent}":{"get":{"description":"Gets all packages from a webstore.","operationId":"getAllPackagesWithAuthedIPAndBasket","parameters":[{"$ref":"#/components/parameters/basketIdent"},{"description":"An IP address can be provided with authenticated requests.","explode":false,"in":"path","name":"ipAddress","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}},"description":"Successful response returns a list of package information."},"422":{"description":"The provided request is invalid."}},"summary":"Get packages available for IP and basket","tags":["Headless"]}}}}
```

## Apply a creator code

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/creator-codes":{"post":{"description":"Applies a creator code to a basket.","operationId":"applyCreatorCode","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/applyCreatorCode_request"}}},"description":"Provide a `creator_code` to apply to the basket."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/applyCreatorCode_200_response"}}},"description":"Successful response returns a success object"},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Apply a creator code","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"applyCreatorCode_request":{"properties":{"creator_code":{"type":"string"}}},"applyCreatorCode_200_response":{"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}
```

## Removes the creator code from the basket.

> Removes the creator code from the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/creator-codes/remove":{"post":{"description":"Removes the creator code from the basket.","operationId":"removeCreatorCode","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"responses":{"200":{"description":"Creator code removed successfully."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Removes the creator code from the basket.","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}}}}
```

## Apply a gift card

> Applies a gift card to the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/giftcards":{"post":{"description":"Applies a gift card to the basket.","operationId":"applyGiftCard","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}},"description":"Provide a `card_number` to apply to the basket."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/applyGiftCard_200_response"}}},"description":"Successful response returns a success message."}},"summary":"Apply a gift card","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"GiftCard":{"properties":{"card_number":{"type":"string"}}},"applyGiftCard_200_response":{"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}
```

## Remove a gift card from the basket.

> Removes a gift card from the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/giftcards/remove":{"post":{"description":"Removes a gift card from the basket.","operationId":"removeGiftCard","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/removeGiftCard_request"}}},"description":"Provide the `card_number` to remove from the basket."},"responses":{"200":{"description":"Gift card removed successfully."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Remove a gift card from the basket.","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"removeGiftCard_request":{"properties":{"card_number":{"type":"string"}}}}}}
```

## Apply a coupon

> Applies a coupon to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/coupons":{"post":{"description":"Applies a coupon to a basket.","operationId":"applyCoupon","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyCouponRequest"}}},"description":"Provide a `coupon_code` to apply to the basket."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/applyCoupon_200_response"}}},"description":"Successful response returns a success message."}},"summary":"Apply a coupon","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"ApplyCouponRequest":{"properties":{"coupon_code":{"type":"string"}}},"applyCoupon_200_response":{"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}
```

## Remove a coupon from the basket.

> Removes a coupon code from a basket

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/coupons/remove":{"post":{"description":"Removes a coupon code from a basket","operationId":"removeCoupon","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyCouponRequest"}}},"description":"Provide a `coupon_code` to remove from the basket."},"responses":{"200":{"description":"Successful response."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Remove a coupon from the basket.","tags":["Headless"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"ApplyCouponRequest":{"properties":{"coupon_code":{"type":"string"}}}}}}
```

## Add package to basket

> Add a package to the basket by its \`ident\` or numeric ID.\
> \
> \- Using \`ident\` is recommended, since it works for every package type. It is required for external packages.\
> \- Numeric IDs still work for standard packages.\
> \
> To add a package belonging to a dynamic category, set \`dynamic\` to \`true\`. Without this property the API will treat the request as a normal package ID.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Endpoints requiring only a basket ident with no token","name":"Baskets"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/{basketIdent}/packages":{"post":{"description":"Add a package to the basket by its `ident` or numeric ID.\n\n- Using `ident` is recommended, since it works for every package type. It is required for external packages.\n- Numeric IDs still work for standard packages.\n\nTo add a package belonging to a dynamic category, set `dynamic` to `true`. Without this property the API will treat the request as a normal package ID.","operationId":"addBasketPackage","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/addBasketPackage_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}},"description":"Successful response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The ident is unknown or does not match a package in this store (\"The selected id is invalid.\")."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation. A malformed `package_id` fails with \"package_id must be a package ID or ident.\""}},"summary":"Add package to basket","tags":["Baskets"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"addBasketPackage_request":{"properties":{"package_id":{"description":"The package's `ident` (recommended) or numeric ID. `ident` is required for external packages. Send the `ident` exactly as returned by the package endpoints.","type":"string"},"quantity":{"type":"integer"},"dynamic":{"description":"Set to `true` when adding a package that belongs to a dynamic category. When omitted, the API acts as if a normal package ID was provided.","type":"boolean"}},"required":["package_id","quantity"]},"BasketResponse":{"properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"creator_code":{"description":"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","type":"string"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"description":"A two-character country code","type":"string"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"description":"A 3 character currency code","type":"string"},"packages":{"items":{"$ref":"#/components/schemas/BasketPackage"},"type":"array"},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"properties":{"code":{"type":"string"}}},"GiftCard":{"properties":{"card_number":{"type":"string"}}},"BasketPackage":{"description":"A package within an existing basket.","properties":{"id":{"description":"The package ID","type":"integer"},"description":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"in_basket":{"$ref":"#/components/schemas/BasketPackage_in_basket"},"type":{"description":"The type of payment, either `single` for one-time payments or `subscription`.","enum":["single","subscription"],"type":"string"},"revenue_share":{"description":"An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**","items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"is_recurring":{"description":"Whether this package is a recurring (subscription) purchase.","type":"boolean"}}},"BasketPackage_in_basket":{"properties":{"quantity":{"description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.","type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"description":"The username id of the user this package is gifted to","type":"string"},"gift_username":{"description":"The username of the user this package is gifted to.","type":"string"}}},"RevenueShare":{"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","type":"number"},"gateway_fee_percent":{"description":"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.","type":"number"}}},"BasketLinks":{"properties":{"payment":{"description":"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.","type":"string"},"checkout":{"description":"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","type":"string"}}},"ErrorResponse":{"properties":{"type":{},"title":{"description":"A short, human-readable summary of the problem type.  It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization","type":"string"},"status":{"description":"The HTTP status code gen by the origin server for the occurrence of the problem.","type":"integer"},"detail":{"description":"A human-readable explanation specific to this occurrence of the problem.","type":"string"},"instance":{"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced","type":"string"}}}}}}
```

## Remove a package from a basket

> Remove a package from the basket by its \`ident\` or numeric ID.\
> \
> \- Using \`ident\` is recommended, since it works for every package type. Send it back exactly as returned; don't build or parse it.\
> \- Numeric IDs still work for standard packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Endpoints requiring only a basket ident with no token","name":"Baskets"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/{basketIdent}/packages/remove":{"post":{"description":"Remove a package from the basket by its `ident` or numeric ID.\n\n- Using `ident` is recommended, since it works for every package type. Send it back exactly as returned; don't build or parse it.\n- Numeric IDs still work for standard packages.","operationId":"removeBasketPackage","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/removeBasketPackage_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}},"description":"Successful response returns the basket."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Remove a package from a basket","tags":["Baskets"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"removeBasketPackage_request":{"properties":{"package_id":{"description":"The package's `ident` (recommended) or numeric ID.","type":"string"}}},"BasketResponse":{"properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"creator_code":{"description":"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","type":"string"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"description":"A two-character country code","type":"string"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"description":"A 3 character currency code","type":"string"},"packages":{"items":{"$ref":"#/components/schemas/BasketPackage"},"type":"array"},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"properties":{"code":{"type":"string"}}},"GiftCard":{"properties":{"card_number":{"type":"string"}}},"BasketPackage":{"description":"A package within an existing basket.","properties":{"id":{"description":"The package ID","type":"integer"},"description":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"in_basket":{"$ref":"#/components/schemas/BasketPackage_in_basket"},"type":{"description":"The type of payment, either `single` for one-time payments or `subscription`.","enum":["single","subscription"],"type":"string"},"revenue_share":{"description":"An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**","items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"is_recurring":{"description":"Whether this package is a recurring (subscription) purchase.","type":"boolean"}}},"BasketPackage_in_basket":{"properties":{"quantity":{"description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.","type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"description":"The username id of the user this package is gifted to","type":"string"},"gift_username":{"description":"The username of the user this package is gifted to.","type":"string"}}},"RevenueShare":{"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","type":"number"},"gateway_fee_percent":{"description":"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.","type":"number"}}},"BasketLinks":{"properties":{"payment":{"description":"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.","type":"string"},"checkout":{"description":"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","type":"string"}}}}}}
```

## Update package quantity

> Sets the quantity of the given item in the basket. The user must be logged in before the quantity can be changed.\
> \
> \- \`{packageId}\` accepts the package's \`ident\` or numeric ID. Using \`ident\` is recommended, since it works for every package type.\
> \- Numeric IDs still work for standard packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Endpoints requiring only a basket ident with no token","name":"Baskets"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/{basketIdent}/packages/{packageId}":{"put":{"description":"Sets the quantity of the given item in the basket. The user must be logged in before the quantity can be changed.\n\n- `{packageId}` accepts the package's `ident` or numeric ID. Using `ident` is recommended, since it works for every package type.\n- Numeric IDs still work for standard packages.","operationId":"updatePackageQuantity","parameters":[{"$ref":"#/components/parameters/basketIdent"},{"description":"The package's `ident` (recommended) or numeric ID.","explode":false,"in":"path","name":"packageId","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updatePackageQuantity_request"}}}},"responses":{"200":{"description":"Successful response."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}},"summary":"Update package quantity","tags":["Baskets"]}}},"components":{"parameters":{"basketIdent":{"description":"The basket identifier.","explode":false,"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"style":"simple"}},"schemas":{"updatePackageQuantity_request":{"properties":{"quantity":{"type":"integer"}}}}}}
```

## Update user's tier to a new package

> Updates a tier to a new package. A recurring payment updated webhook is sent when an update is successful.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"scheme":"basic","type":"http"}},"schemas":{"updateTier_request":{"properties":{"package_id":{"type":"integer"}}},"UpdateTierResponse":{"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}},"paths":{"/tiers/{tierId}":{"patch":{"description":"Updates a tier to a new package. A recurring payment updated webhook is sent when an update is successful.","operationId":"updateTier","parameters":[{"description":"The tier identifier","explode":false,"in":"path","name":"tierId","required":true,"schema":{"type":"integer"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateTier_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTierResponse"}}},"description":"Successful response."}},"summary":"Update user's tier to a new package","tags":["Headless"]}}}}
```

## Retrieves the available sidebar modules.

> Retrieves the available sidebar modules configured for the store.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.1.0"},"tags":[{"description":"Main API scoped to public token","name":"Headless"}],"servers":[{"description":"Main API scoped to public token","url":"https://headless.tebex.io/api/accounts/{token}","variables":{"token":{"default":"YOUR_PUBLIC_TOKEN","description":"The store's public token"}}}],"paths":{"/sidebar":{"get":{"description":"Retrieves the available sidebar modules configured for the store.","operationId":"getSidebar","parameters":[{"description":"The webstore identifier.","explode":false,"in":"path","name":"token","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesResponse"}}},"description":"Successful response."}},"summary":"Retrieves the available sidebar modules.","tags":["Headless"]}}},"components":{"schemas":{"ModulesResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Module"},"type":"array"}},"required":["data"]},"Module":{"discriminator":{"mapping":{"top_customer":"#/components/schemas/TopCustomerModule","textbox":"#/components/schemas/TextboxModule","recent_payments":"#/components/schemas/RecentPaymentsModule","featured_package":"#/components/schemas/FeaturedPackageModule","giftcard_balance":"#/components/schemas/GiftcardBalanceModule","server_status":"#/components/schemas/ServerStatusModule","payment_goal":"#/components/schemas/PaymentGoalModule","community_goal":"#/components/schemas/CommunityGoalModule"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/TopCustomerModule"},{"$ref":"#/components/schemas/TextboxModule"},{"$ref":"#/components/schemas/RecentPaymentsModule"},{"$ref":"#/components/schemas/FeaturedPackageModule"},{"$ref":"#/components/schemas/GiftcardBalanceModule"},{"$ref":"#/components/schemas/ServerStatusModule"},{"$ref":"#/components/schemas/PaymentGoalModule"},{"$ref":"#/components/schemas/CommunityGoalModule"}]},"TopCustomerModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/TopCustomerData"}},"required":["data"]}]},"ModuleBase":{"properties":{"id":{"format":"int64","type":"integer"},"type":{"description":"Discriminator for module kind.","type":"string"},"start_time":{"format":"date-time","type":"string"},"end_time":{"description":"Nullable; when null the module is ongoing.","format":"date-time","nullable":true,"type":"string"},"data":{"description":"Type-specific payload.","type":"object"}},"required":["data","id","start_time","type"]},"TopCustomerData":{"properties":{"header":{"type":"string"},"username":{"type":"string"},"username_id":{"description":"User identifier.","type":"string"},"total":{"description":"Optional, present depending on module configuration.","type":"number"}},"required":["header","username","username_id"]},"TextboxModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/TextboxData"}},"required":["data"]}]},"TextboxData":{"properties":{"header":{"type":"string"},"text":{"description":"HTML supported.","type":"string"}},"required":["header","text"]},"RecentPaymentsModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/RecentPaymentsData"}},"required":["data"]}]},"RecentPaymentsData":{"properties":{"header":{"type":"string"},"payments":{"items":{"$ref":"#/components/schemas/RecentPayment"},"type":"array"}},"required":["header","payments"]},"RecentPayment":{"properties":{"username":{"type":"string"},"username_id":{"type":"string"},"package":{"$ref":"#/components/schemas/RecentPayment_package"},"created_at":{"description":"Optional, present depending on module configuration.","format":"date-time","nullable":true,"type":"string"},"price":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"number"},"currency":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"string"}},"required":["package","username","username_id"]},"RecentPayment_package":{"properties":{"name":{"type":"string"}},"required":["name"]},"FeaturedPackageModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/FeaturedPackageData"}},"required":["data"]}]},"FeaturedPackageData":{"properties":{"header":{"type":"string"},"package":{"$ref":"#/components/schemas/Package"}},"required":["header","package"]},"Package":{"properties":{"id":{"description":"The package's numeric ID. For external packages this is synthetic; use `ident` instead.","type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"$ref":"#/components/schemas/Package_category"},"base_price":{"format":"float","type":"number"},"sales_tax":{"format":"float","type":"number"},"total_price":{"format":"float","type":"number"},"currency":{"type":"string"},"prorate_price":{"description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","format":"float","type":"number","nullable":true},"discount":{"format":"float","type":"number"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"format":"date-time","type":"string","nullable":true},"media":{"items":{"$ref":"#/components/schemas/PackageMedia"},"type":"array"},"order":{"type":"integer"},"slug":{"type":"string"},"user_limit":{"type":"integer"},"creator_meta_data":{"type":"object"},"options":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"variables":{"items":{"description":"TODO default missing array inner type to string","type":"string"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"ident":{"description":"The package's string identifier, returned on every package (standard, dynamic and external). Treat it as an opaque string: store it and send it back as-is to `getPackage` and `addBasketPackage`; don't build or parse it.\n\nIt has the form `{prefix}_{categoryId}_{id}`, where `prefix` is `pkg` (standard), `dyn` (dynamic, numeric id) or `ext` (external, e.g. `ext_10_{asset-uuid}` for INTRACT, with the provider's identifier URL-encoded).","type":"string"},"vip_status":{"description":"The package's VIP status. Only `null` has been observed so far, so the non-null type is unconfirmed.","type":"string","nullable":true}}},"Package_category":{"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"PackageMedia":{"properties":{"type":{"enum":["video","image"],"type":"string"},"name":{"description":"A file name for the media, if applicable.","type":"string","nullable":true},"url":{"description":"The URL of the package media.","type":"string"},"featured":{"description":"True if this media should be featured more prominently than others.","type":"boolean"},"primary":{"description":"True if this is the primary media for the package.","type":"boolean"}}},"GiftcardBalanceModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/GiftcardBalanceData"}},"required":["data"]}]},"GiftcardBalanceData":{"properties":{"header":{"type":"string"}},"required":["header"]},"ServerStatusModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/ServerStatusData"}},"required":["data"]}]},"ServerStatusData":{"properties":{"header":{"type":"string"},"hostname":{"type":"string"},"port":{"type":"integer"},"online":{"type":"boolean"},"players":{"$ref":"#/components/schemas/Players"}},"required":["header","hostname","online","players","port"]},"Players":{"properties":{"online":{"type":"integer"},"max":{"type":"integer"}},"required":["max","online"]},"PaymentGoalModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/PaymentGoalData"}},"required":["data"]}]},"PaymentGoalData":{"properties":{"header":{"type":"string"},"percentage":{"maximum":100,"minimum":0,"type":"number"},"bar_style":{"enum":["normal","striped"],"type":"string"},"bar_animated":{"type":"boolean"},"total":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"number"},"target":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"number"}},"required":["bar_animated","bar_style","header","percentage"]},"CommunityGoalModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"properties":{"type":{},"data":{"$ref":"#/components/schemas/CommunityGoalData"}},"required":["data"]}]},"CommunityGoalData":{"properties":{"header":{"type":"string"},"bar_style":{"enum":["normal","striped"],"type":"string"},"bar_animated":{"type":"boolean"},"percentage":{"maximum":100,"minimum":0,"type":"number"},"total_payments":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"number"},"target":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"number"},"times_achieved":{"description":"Optional, present depending on module configuration.","nullable":true,"type":"integer"}},"required":["bar_animated","bar_style","header","percentage"]}}}}
```
