# Endpoints

## Fetch a webstore by its identifier

> Gets the webstore associated with the provided identifier.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}":{"get":{"tags":["Headless"],"operationId":"getWebstoreById","summary":"Fetch a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"description":"The webstore identifier.","required":true}],"description":"Gets the webstore associated with the provided identifier.","responses":{"200":{"description":"Successful response returns the webstore's information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebstoreResponse"}}}}}}}},"components":{"schemas":{"WebstoreResponse":{"type":"object","properties":{"data":{"type":"object","$ref":"#/components/schemas/Webstore"}},"description":"Wrapped webstore information in a \"data\" object."},"Webstore":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string","description":"Store description in HTML format"},"name":{"type":"string","description":"Name of the store"},"webstore_url":{"type":"string","format":"uri","description":"URL of the webstore"},"currency":{"type":"string","description":"Currency used in the store"},"lang":{"type":"string","description":"Language of the store"},"logo":{"type":"string","format":"uri","description":"URL of the store's logo","nullable":true},"platform_type":{"type":"string","description":"Platform type for the store"},"platform_type_id":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the store was created"}}}}}}
```

## Fetch the custom pages associated with the store.

> 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/pages":{"get":{"tags":["Headless"],"operationId":"getCMSPages","summary":"Fetch the custom pages associated with the store.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."}],"description":"Gets a list of custom pages associated with the webstore. These contain a `content` variable with the HTML content of the page.","responses":{"200":{"description":"Successful response returns the webstore's pages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CMSPagesResponse"}}}}}}}},"components":{"schemas":{"CMSPagesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CMSPage"}}}},"CMSPage":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"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"}}}}}}
```

### Baskets

## Fetch a basket from a webstore by its identifier

> Gets a basket associated with the provided identifier.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}":{"get":{"tags":["Headless"],"operationId":"getBasketById","summary":"Fetch a basket from a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Gets a basket associated with the provided identifier.","responses":{"200":{"description":"Successful response returns the basket information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}}}}}}},"components":{"schemas":{"BasketResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Create a new basket

> Creates a new basket for use during checkout.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets":{"post":{"tags":["Headless"],"operationId":"createBasket","summary":"Create a new basket","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."}],"description":"Creates a new basket for use during checkout.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"complete_url":{"type":"string","description":"A URL the user can return to when checkout is completed."},"cancel_url":{"type":"string","description":"A URL the user can return to when cancelling checkout."},"custom":{"type":"object","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."},"complete_auto_redirect":{"type":"boolean","description":"True if the user should automatically be redirected to the relevant complete/cancel URL"}}}}}},"responses":{"200":{"description":"Successful response returns the basket information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}}},"422":{"description":"The provided webstore ID is invalid."}}}}},"components":{"schemas":{"BasketResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Get authentication links for a basket.

> Fetches a basket's auth URL.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/auth?returnUrl={returnUrl}":{"get":{"tags":["Headless"],"operationId":"getBasketAuthUrl","summary":"Get authentication links for a basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."},{"in":"path","name":"returnUrl","description":"The URL you would like to redirect the user to after successful basket authentication.","schema":{"type":"string"},"required":true}],"description":"Fetches a basket's auth URL.","responses":{"200":{"description":"Successful response returns the basket auth information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketAuthResponse"}}}},"422":{"description":"The provided webstore ID or basket ID is invalid."}}}}},"components":{"schemas":{"BasketAuthResponse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}}}}}}
```

### Category and Package Retrieval

## Gets all categories available in the webstore.

> 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/categories":{"get":{"tags":["Headless"],"operationId":"getAllCategories","summary":"Gets all categories available in the webstore.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."}],"description":"Gets all categories from a webstore. This does not include package information. To include package information, add `?includePackages=1` to the URL.","responses":{"200":{"description":"Successful response returns a list of category information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}}}}}},"components":{"schemas":{"CategoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"User-friendly name of the category"},"slug":{"type":"string","description":"Short identifier slug for the category","nullable":true},"parent":{"type":"object","description":"Parent category, if applicable","format":"Category","nullable":true},"tiered":{"type":"boolean","description":"True if this is a tiered category"},"active_tier":{"description":"If this is a tiered category and the usernameId is provided, this will be the active tier information for this category.","nullable":true,"$ref":"#/components/schemas/Tier"},"description":{"type":"string","description":"HTML description of the category"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/Package"},"nullable":true},"order":{"type":"integer","description":"The numeric order in which to display the category."},"display_type":{"type":"string","enum":["list","grid"],"description":"How the category should be displayed"}}},"Tier":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the tier became active"},"username_id":{"type":"string","description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID"},"package":{"$ref":"#/components/schemas/Package"},"active":{"type":"boolean","description":"True if the tier is currently active."},"recurring_payment_reference":{"type":"string","description":"The ID of the recurring payment this tier is attached to."},"next_payment_date":{"type":"string","format":"date-time","description":"The date and time of the next payment for this tier."},"status":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"pending_downgrade_package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"description":"The package this tier is downgrading to if a downgrade is pending.","nullable":true}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Gets a store's categories including all package information with them.

> Gets all categories from a webstore including packages.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/categories?includePackages=1":{"get":{"tags":["Headless"],"operationId":"getAllCategoriesIncludingPackages","summary":"Gets a store's categories including all package information with them.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."}],"description":"Gets all categories from a webstore including packages.","responses":{"200":{"description":"Successful response returns a list of category information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}}}}}},"components":{"schemas":{"CategoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"User-friendly name of the category"},"slug":{"type":"string","description":"Short identifier slug for the category","nullable":true},"parent":{"type":"object","description":"Parent category, if applicable","format":"Category","nullable":true},"tiered":{"type":"boolean","description":"True if this is a tiered category"},"active_tier":{"description":"If this is a tiered category and the usernameId is provided, this will be the active tier information for this category.","nullable":true,"$ref":"#/components/schemas/Tier"},"description":{"type":"string","description":"HTML description of the category"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/Package"},"nullable":true},"order":{"type":"integer","description":"The numeric order in which to display the category."},"display_type":{"type":"string","enum":["list","grid"],"description":"How the category should be displayed"}}},"Tier":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the tier became active"},"username_id":{"type":"string","description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID"},"package":{"$ref":"#/components/schemas/Package"},"active":{"type":"boolean","description":"True if the tier is currently active."},"recurring_payment_reference":{"type":"string","description":"The ID of the recurring payment this tier is attached to."},"next_payment_date":{"type":"string","format":"date-time","description":"The date and time of the next payment for this tier."},"status":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"pending_downgrade_package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"description":"The package this tier is downgrading to if a downgrade is pending.","nullable":true}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Gets a store's categories including all package information with them.

> 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"schemas":{"CategoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"User-friendly name of the category"},"slug":{"type":"string","description":"Short identifier slug for the category","nullable":true},"parent":{"type":"object","description":"Parent category, if applicable","format":"Category","nullable":true},"tiered":{"type":"boolean","description":"True if this is a tiered category"},"active_tier":{"description":"If this is a tiered category and the usernameId is provided, this will be the active tier information for this category.","nullable":true,"$ref":"#/components/schemas/Tier"},"description":{"type":"string","description":"HTML description of the category"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/Package"},"nullable":true},"order":{"type":"integer","description":"The numeric order in which to display the category."},"display_type":{"type":"string","enum":["list","grid"],"description":"How the category should be displayed"}}},"Tier":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the tier became active"},"username_id":{"type":"string","description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID"},"package":{"$ref":"#/components/schemas/Package"},"active":{"type":"boolean","description":"True if the tier is currently active."},"recurring_payment_reference":{"type":"string","description":"The ID of the recurring payment this tier is attached to."},"next_payment_date":{"type":"string","format":"date-time","description":"The date and time of the next payment for this tier."},"status":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"pending_downgrade_package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"description":"The package this tier is downgrading to if a downgrade is pending.","nullable":true}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}},"paths":{"/accounts/{token}/categories?usernameId={usernameId}&includePackages=1":{"get":{"tags":["Headless"],"operationId":"getTieredCategoriesForUser","summary":"Gets a store's categories including all package information with them.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"usernameId","schema":{"type":"integer"},"required":true}],"description":"Gets all categories from the webstore, returning active tier information for the given player.","responses":{"200":{"description":"Successful response returns a list of category information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}}}}}}}
```

## Gets information about a 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/categories/{categoryId}":{"get":{"tags":["Headless"],"operationId":"getCategoryById","summary":"Gets information about a specific category","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"categoryId","required":true,"schema":{"type":"string"},"description":"The ID of the category to fetch."}],"description":"Gets information about a category and returns the packages in that category.","responses":{"200":{"description":"Successful response returns the category without package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}}}}}},"components":{"schemas":{"CategoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"User-friendly name of the category"},"slug":{"type":"string","description":"Short identifier slug for the category","nullable":true},"parent":{"type":"object","description":"Parent category, if applicable","format":"Category","nullable":true},"tiered":{"type":"boolean","description":"True if this is a tiered category"},"active_tier":{"description":"If this is a tiered category and the usernameId is provided, this will be the active tier information for this category.","nullable":true,"$ref":"#/components/schemas/Tier"},"description":{"type":"string","description":"HTML description of the category"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/Package"},"nullable":true},"order":{"type":"integer","description":"The numeric order in which to display the category."},"display_type":{"type":"string","enum":["list","grid"],"description":"How the category should be displayed"}}},"Tier":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the tier became active"},"username_id":{"type":"string","description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID"},"package":{"$ref":"#/components/schemas/Package"},"active":{"type":"boolean","description":"True if the tier is currently active."},"recurring_payment_reference":{"type":"string","description":"The ID of the recurring payment this tier is attached to."},"next_payment_date":{"type":"string","format":"date-time","description":"The date and time of the next payment for this tier."},"status":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"pending_downgrade_package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"description":"The package this tier is downgrading to if a downgrade is pending.","nullable":true}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Gets information about a specific category, including all the packages in the category

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

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/categories/{categoryId}?includePackages=1":{"get":{"tags":["Headless"],"operationId":"getCategoryIncludingPackages","summary":"Gets information about a specific category, including all the packages in the category","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"categoryId","required":true,"schema":{"type":"string"},"description":"The ID of the category to fetch."}],"description":"Gets information about a category and returns the packages in that category.","responses":{"200":{"description":"Successful response returns the category with package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}}}}}},"components":{"schemas":{"CategoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"User-friendly name of the category"},"slug":{"type":"string","description":"Short identifier slug for the category","nullable":true},"parent":{"type":"object","description":"Parent category, if applicable","format":"Category","nullable":true},"tiered":{"type":"boolean","description":"True if this is a tiered category"},"active_tier":{"description":"If this is a tiered category and the usernameId is provided, this will be the active tier information for this category.","nullable":true,"$ref":"#/components/schemas/Tier"},"description":{"type":"string","description":"HTML description of the category"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/Package"},"nullable":true},"order":{"type":"integer","description":"The numeric order in which to display the category."},"display_type":{"type":"string","enum":["list","grid"],"description":"How the category should be displayed"}}},"Tier":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time","description":"The date and time when the tier became active"},"username_id":{"type":"string","description":"The user's username ID. For Steam, this is a numeric representation of their Steam64ID"},"package":{"$ref":"#/components/schemas/Package"},"active":{"type":"boolean","description":"True if the tier is currently active."},"recurring_payment_reference":{"type":"string","description":"The ID of the recurring payment this tier is attached to."},"next_payment_date":{"type":"string","format":"date-time","description":"The date and time of the next payment for this tier."},"status":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"}}},"pending_downgrade_package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"description":"The package this tier is downgrading to if a downgrade is pending.","nullable":true}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Fetch a package from a webstore by its identifier

> Gets a package from a webstore by ID.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/packages/{packageId}":{"get":{"tags":["Headless"],"operationId":"getPackageById","summary":"Fetch a package from a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"packageId","schema":{"type":"integer"},"required":true,"description":"The package's ID."}],"description":"Gets a package from a webstore by ID.","responses":{"200":{"description":"Successful response returns the package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}}}}}}},"components":{"schemas":{"PackageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Fetch all packages from a webstore

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/packages":{"get":{"tags":["Headless"],"operationId":"getAllPackages","summary":"Fetch all packages from a webstore","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."}],"description":"Gets all packages from a webstore.","responses":{"200":{"description":"Successful response returns a list of package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}}}}}}},"components":{"schemas":{"PackageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Fetch a package from a webstore by its identifier

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/packages?ipAddress={ipAddress}":{"get":{"tags":["Headless"],"operationId":"getAllPackagesWithAuthedIP","summary":"Fetch a package from a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"ipAddress","required":true,"schema":{"type":"string"},"description":"An IP address can be provided with authenticated requests."}],"description":"Gets all packages from a webstore.","responses":{"200":{"description":"Successful response returns a list of package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}}},"422":{"description":"The provided request is invalid."}}}}},"components":{"schemas":{"PackageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Fetch a package from a webstore by its identifier

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/packages?basketIdent={basketIdent}":{"get":{"tags":["Headless"],"operationId":"getAllPackagesWithBasket","summary":"Fetch a package from a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"description":"The basket identifier."}],"description":"Gets all packages from a webstore.","responses":{"200":{"description":"Successful response returns a list of package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}}},"422":{"description":"The provided request is invalid."}}}}},"components":{"schemas":{"PackageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

## Fetch a package from a webstore by its identifier

> Gets all packages from a webstore.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/packages?ipAddress={ipAddress}&basketIdent={basketIdent}":{"get":{"tags":["Headless"],"operationId":"getAllPackagesWithAuthedIPAndBasket","summary":"Fetch a package from a webstore by its identifier","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","required":true,"schema":{"type":"string"},"description":"The basket identifier."},{"in":"path","name":"ipAddress","required":true,"schema":{"type":"string"},"description":"An IP address can be provided with authenticated requests."}],"description":"Gets all packages from a webstore.","responses":{"200":{"description":"Successful response returns a list of package information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageResponse"}}}},"422":{"description":"The provided request is invalid."}}}}},"components":{"schemas":{"PackageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}}}}}
```

### Promotions and Discounts

## Apply a creator code to a basket.

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/creator-codes":{"post":{"tags":["Headless"],"operationId":"applyCreatorCode","summary":"Apply a creator code to a basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Applies a creator code to a basket.","requestBody":{"description":"Provide a `creator_code` to apply to the basket.","content":{"application/json":{"schema":{"type":"object","properties":{"creator_code":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response returns the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}}},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}},"components":{"schemas":{"BasketResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Remove a creator code from the basket.

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/creator-codes/remove":{"post":{"tags":["Headless"],"operationId":"removeCreatorCode","summary":"Remove a creator code from the basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Applies a creator code to a basket.","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."}}}}}}
```

## Apply a gift card to a basket.

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/giftcards":{"post":{"tags":["Headless"],"operationId":"applyGiftCard","summary":"Apply a gift card to a basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Applies a creator code to a basket.","requestBody":{"description":"Provide a `card_number` to apply to the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"responses":{"200":{"description":"Successful response returns the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}}}}}}},"components":{"schemas":{"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/giftcards/remove":{"post":{"tags":["Headless"],"operationId":"removeGiftCard","summary":"Remove a gift card from the basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Removes a gift card from the basket.","requestBody":{"description":"Provide the `card_number` to remove from the basket.","content":{"application/json":{"schema":{"type":"object","properties":{"card_number":{"type":"string"}}}}}},"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."}}}}}}
```

## Apply a coupon to a basket.

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/coupons":{"post":{"tags":["Headless"],"operationId":"applyCoupon","summary":"Apply a coupon to a basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Applies a creator code to a basket.","requestBody":{"description":"Provide a `coupon_code` to apply to the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"responses":{"200":{"description":"Successful response returns the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasketResponse"}}}}}}}},"components":{"schemas":{"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"BasketResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Basket"}}},"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Remove a coupon from the basket.

> Removes a coupon code from a basket

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/baskets/{basketIdent}/coupons/remove":{"post":{"tags":["Headless"],"operationId":"removeCoupon","summary":"Remove a coupon from the basket.","parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true,"description":"The webstore identifier."},{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Removes a coupon code from a 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."}}}}}}
```

### Adding and Removing Packages

## Add a package to a basket

> Add a package with the given ID to the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/baskets/{basketIdent}/packages":{"post":{"tags":["Headless"],"operationId":"addBasketPackage","summary":"Add a package to a basket","parameters":[{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Add a package with the given ID to the basket.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"package_id":{"type":"string"},"quantity":{"type":"integer"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}}},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}},"components":{"schemas":{"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Remove a package from a basket

> Remove the given package ID from the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/baskets/{basketIdent}/packages/remove":{"post":{"tags":["Headless"],"operationId":"removeBasketPackage","summary":"Remove a package from a basket","parameters":[{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."}],"description":"Remove the given package ID from the basket.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"package_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response returns the basket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}}},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}},"components":{"schemas":{"Basket":{"type":"object","properties":{"id":{"type":"string"},"ident":{"type":"string"},"complete":{"type":"boolean"},"email":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"giftcards":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"creator_code":{"type":"string","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"},"cancel_url":{"type":"string"},"complete_url":{"type":"string","nullable":true},"complete_auto_redirect":{"type":"boolean"},"country":{"type":"string","description":"A two-character country code"},"ip":{"type":"string"},"username_id":{"type":"integer"},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string","description":"A 3 character currency code"},"packages":{"type":"array","items":{"$ref":"#/components/schemas/BasketPackage"}},"custom":{"type":"object","nullable":true},"links":{"$ref":"#/components/schemas/BasketLinks"}}},"Coupon":{"type":"object","properties":{"coupon_code":{"type":"string"}}},"GiftCard":{"type":"object","properties":{"card_number":{"type":"string"}}},"BasketPackage":{"type":"object","description":"A package within an existing basket.","properties":{"qty":{"type":"integer","description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket."},"type":{"type":"string","enum":["single","subscription"],"description":"The type of payment, either `single` for one-time payments or `subscription`."},"revenue_share":{"type":"array","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"}}}},"RevenueShare":{"type":"object","properties":{"wallet_ref":{"type":"string"},"amount":{"type":"number","description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`"},"gateway_fee_percent":{"type":"number","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."}}},"BasketLinks":{"type":"object","properties":{"payment":{"type":"string","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."},"checkout":{"type":"string","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"}}}}}}
```

## Updates the quantity of the given package in the basket. The user must be logged in before the quantity can be changed.

> Sets the quantity of the given item in the basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/baskets/{basketIdent}/packages/{packageId}":{"put":{"tags":["Headless"],"operationId":"updatePackageQuantity","summary":"Updates the quantity of the given package in the basket. The user must be logged in before the quantity can be changed.","parameters":[{"in":"path","name":"basketIdent","schema":{"type":"string"},"required":true,"description":"The basket identifier."},{"in":"path","name":"packageId","schema":{"type":"integer"},"required":true,"description":"The package identifier."}],"description":"Sets the quantity of the given item in the basket.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}},"responses":{"200":{"description":"Successful response."},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}}}
```

## Updates the given tier to the provided 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"schemas":{"UpdateTierResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}},"paths":{"/accounts/{token}/tiers/{tierId}":{"patch":{"tags":["Headless"],"operationId":"updateTier","summary":"Updates the given tier to the provided package.","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"The webstore identifier."},{"in":"path","name":"tierId","required":true,"schema":{"type":"integer"},"description":"The tier identifier"}],"description":"Updates a tier to a new package. A recurring payment updated webhook is sent when an update is successful.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"package_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTierResponse"}}}}}}}}}
```

### Sidebar

## 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":"1.2.0"},"tags":[{"name":"Headless","description":"Endpoints which interact with a basket requiring the basket ID"}],"servers":[{"url":"https://headless.tebex.io/api"}],"paths":{"/accounts/{token}/sidebar":{"get":{"tags":["Headless"],"operationId":"getSidebar","summary":"Retrieves the available sidebar modules.","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"The webstore identifier."}],"description":"Retrieves the available sidebar modules configured for the store.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesResponse"}}}}}}}},"components":{"schemas":{"ModulesResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Module"}}}},"Module":{"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"}],"discriminator":{"propertyName":"type","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"}}},"TopCustomerModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"top_customer"},"data":{"$ref":"#/components/schemas/TopCustomerData"}},"required":["data"]}]},"ModuleBase":{"type":"object","required":["id","type","start_time","data"],"properties":{"id":{"type":"integer","format":"int64"},"type":{"type":"string","description":"Discriminator for module kind."},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":["null","string"],"format":"date-time","description":"Nullable; when null the module is ongoing."},"data":{"type":"object","description":"Type-specific payload."}}},"TopCustomerData":{"type":"object","required":["header","username","username_id"],"properties":{"header":{"type":"string"},"username":{"type":"string"},"username_id":{"type":"string","description":"User identifier."},"total":{"type":"number","description":"Optional, present depending on module configuration."}}},"TextboxModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"textbox"},"data":{"$ref":"#/components/schemas/TextboxData"}},"required":["data"]}]},"TextboxData":{"type":"object","required":["header","text"],"properties":{"header":{"type":"string"},"text":{"type":"string","description":"HTML supported."}}},"RecentPaymentsModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"recent_payments"},"data":{"$ref":"#/components/schemas/RecentPaymentsData"}},"required":["data"]}]},"RecentPaymentsData":{"type":"object","required":["header","payments"],"properties":{"header":{"type":"string"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/RecentPayment"}}}},"RecentPayment":{"type":"object","required":["username","username_id","package"],"properties":{"username":{"type":"string"},"username_id":{"type":"string"},"package":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"created_at":{"type":["null","string"],"format":"date-time","description":"Optional, present depending on module configuration."},"price":{"type":["null","number"],"description":"Optional, present depending on module configuration."},"currency":{"type":["null","string"],"description":"Optional, present depending on module configuration."}}},"FeaturedPackageModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"featured_package"},"data":{"$ref":"#/components/schemas/FeaturedPackageData"}},"required":["data"]}]},"FeaturedPackageData":{"type":"object","required":["header","package"],"properties":{"header":{"type":"string"},"package":{"$ref":"#/components/schemas/Package"}}},"Package":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string","nullable":true},"type":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"base_price":{"type":"number","format":"float"},"sales_tax":{"type":"number","format":"float"},"total_price":{"type":"number","format":"float"},"currency":{"type":"string"},"prorate_price":{"type":"number","format":"float","description":"If this package is part of a tiered category, this is the difference on upgrade pricing from the current active tier.","nullable":true},"discount":{"type":"number","format":"float"},"disable_quantity":{"type":"boolean"},"disable_gifting":{"type":"boolean"},"expiration_date":{"type":"string","nullable":true,"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/PackageMedia"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PackageMedia":{"properties":{"type":{"type":"string","enum":["video","image"]},"name":{"type":"string","description":"A file name for the media, if applicable.","nullable":true},"url":{"type":"string","description":"The URL of the package media."},"featured":{"type":"boolean","description":"True if this media should be featured more prominently than others."}}},"GiftcardBalanceModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"giftcard_balance"},"data":{"$ref":"#/components/schemas/GiftcardBalanceData"}},"required":["data"]}]},"GiftcardBalanceData":{"type":"object","required":["header"],"properties":{"header":{"type":"string"}}},"ServerStatusModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"server_status"},"data":{"$ref":"#/components/schemas/ServerStatusData"}},"required":["data"]}]},"ServerStatusData":{"type":"object","required":["header","hostname","port","online","players"],"properties":{"header":{"type":"string"},"hostname":{"type":"string"},"port":{"type":"integer"},"online":{"type":"boolean"},"players":{"description":"Nullable object; null when server is offline.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Players"}]}}},"Players":{"type":"object","required":["online","max"],"properties":{"online":{"type":"integer"},"max":{"type":"integer"}}},"PaymentGoalModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"payment_goal"},"data":{"$ref":"#/components/schemas/PaymentGoalData"}},"required":["data"]}]},"PaymentGoalData":{"type":"object","required":["header","percentage","bar_style","bar_animated"],"properties":{"header":{"type":"string"},"percentage":{"type":"number","minimum":0,"maximum":100},"bar_style":{"type":"string","enum":["normal","striped"]},"bar_animated":{"type":"boolean"},"total":{"type":["null","number"],"description":"Optional, present depending on module configuration."},"target":{"type":["null","number"],"description":"Optional, present depending on module configuration."}}},"CommunityGoalModule":{"allOf":[{"$ref":"#/components/schemas/ModuleBase"},{"type":"object","properties":{"type":{"const":"community_goal"},"data":{"$ref":"#/components/schemas/CommunityGoalData"}},"required":["data"]}]},"CommunityGoalData":{"type":"object","required":["header","bar_style","bar_animated","percentage"],"properties":{"header":{"type":"string"},"bar_style":{"type":"string","enum":["normal","striped"]},"bar_animated":{"type":"boolean"},"percentage":{"type":"number","minimum":0,"maximum":100},"total_payments":{"type":["null","number"],"description":"Optional, present depending on module configuration."},"target":{"type":["null","number"],"description":"Optional, present depending on module configuration."},"times_achieved":{"type":["null","integer"],"description":"Optional, present depending on module configuration."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/headless-api/endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
