Tebex Headless API allows integration of your store directly into your own frontend or in-game.
The Headless API works with your existing packages, coupons, sales & creator codes.
If you haven't already done so, we recommend having a read of our quick start guide before beginning integration.
You can query the Headless API to retrieve your packages/categories, build a basket for a user, and direct them to checkout - all from within your own frontend implementation (be that a website or in-game).
The Headless API can be used with Tebex.js for a fully embedded checkout experience without the user ever leaving your own website.
Below is the expected flow your application should follow when utilizing the Headless API. For a list of all endpoints, please see the Endpoints page.
You can retrieve your store's listings in JSON format and display them however you wish:
In order to purchase items, a basket must be created for the customer. Create a basket and allow the customer to login with their username or other OAuth login mechanism (e.g Steam or FiveM).
You can add or remove packages programmatically to the created basket via the API as needed when the user interacts with your application.
Once all packages and quantities are selected, apply any relevant coupons, gift cards, or creator codes with these endpoints.
When the user is ready to checkout, fetch the basket and direct the user to the links.checkout
URL.
To get started with your own integration of the Headless API you're able to use our example integration built upon Nuxt.js, Vue & Typescript. Take a look at the tebexio/Headless-Template GitHub repo to begin.
The following websites are built using the Headless API - hosted via our customers own infrastructure, using frontend frameworks such as Vue or React.
Applies a creator code to a basket.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Creator code removed successfully.
Removes a coupon code from a basket
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Successful response.
Gets all categories from a webstore including packages.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
Successful response returns a list of category information.
2678660
User-friendly name of the category
"Test"
Short identifier slug for the category
Parent category, if applicable
HTML description of the category
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
The numeric order in which to display the category.
1
How the category should be displayed
Gets information about a category and returns the packages in that category.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The ID of the category to fetch.
127244343
Successful response returns the category without package information.
2678660
User-friendly name of the category
"Test"
Short identifier slug for the category
Parent category, if applicable
HTML description of the category
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
The numeric order in which to display the category.
1
How the category should be displayed
Gets information about a category and returns the packages in that category.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The ID of the category to fetch.
127244343
Successful response returns the category with package information.
2678660
User-friendly name of the category
"Test"
Short identifier slug for the category
Parent category, if applicable
HTML description of the category
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
The numeric order in which to display the category.
1
How the category should be displayed
Gets all packages from a webstore.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
Successful response returns a list of package information.
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
Removes a gift card from the basket.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Provide the card_number
to remove from the basket.
"0127 0244 7210 1111"
Gift card removed successfully.
Fetches a basket's auth URL.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
The URL you would like to redirect the user to after successful basket authentication.
"https://example.tebex.io/"
Successful response returns the basket auth information.
"FiveM"
"https://ident.tebex.io/"
Applies a creator code to a basket.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Provide a creator_code
to apply to the basket.
"Academy10"
Successful response returns the basket.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Applies a creator code to a basket.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Provide a card_number
to apply to the basket.
"0127 0244 7210 1111"
Successful response returns the basket.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Applies a creator code to a basket.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Provide a coupon_code
to apply to the basket.
"Academy10"
Successful response returns the basket.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Creates a new basket for use during checkout.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
A URL the user can return to when checkout is completed.
"https://example.tebex.io/thank-you"
A URL the user can return to when cancelling checkout.
"https://tebex.io/"
Custom data you wish to associate with the basket. This data will be included with webhook responses and GET requests associated with the Basket.
True if the user should automatically be redirected to the relevant complete/cancel URL
true
Successful response returns the basket information.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Gets a package from a webstore by ID.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The package's ID.
1272441812
Successful response returns the package information.
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
Remove the given package ID from the basket.
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
6276316
Successful response returns the basket.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Gets a basket associated with the provided identifier.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
Successful response returns the basket information.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
Gets all categories from a webstore. This does not include package information. To include package information, add ?includePackages=1
to the URL.
The webstore identifier.
"t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb"
Successful response returns a list of category information.
2678660
User-friendly name of the category
"Test"
Short identifier slug for the category
Parent category, if applicable
HTML description of the category
6276316
"test package 101"
"<p>this is just a test. only a test. nothing more.</p>"
"single"
2678660
"Packages"
5
0
5
"USD"
0
false
false
"2024-05-21T18:09:17+00:00"
"2024-05-21T18:09:17+00:00"
The numeric order in which to display the category.
1
How the category should be displayed
Add a package with the given ID to the basket.
The basket identifier.
"c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c"
6276316
1
Successful response.
244127617
"1a-55fff4107740a1f40d844ff89607557f45bfafb3"
false
"support@tebex.io"
"Academy10"
"0127 0244 7210 1111"
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
"https://tebex.io"
false
A two-character country code
"US"
"127.0.0.1"
127244
1.27
0.11
1.38
A 3 character currency code
"USD"
The quantity of package
in this basket. This is not the total quantity of overall items in the basket.
2
The type of payment, either single
for one-time payments or subscription
.
"single"
An array of payment destination objects describing how the purchase should be split between multiple wallets. Only available with pre-agreement from Tebex.
"some_wallet_reference"
A float (decimal) value representing the amount of this payment in your account currency that is credited to the wallet_ref
0.5
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.
50
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.
"https://checkout.tebex.io/api/payments/tbx-12345"
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
"https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"