Overview
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.
Headless API Flow
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.
Packages & Listings
You can retrieve your store's listings in JSON format and display them however you wish:
Creating Baskets
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).
Adding and Removing Packages
You can add or remove packages programmatically to the created basket via the API as needed when the user interacts with your application.
Coupons, Gift Cards, and Creator Codes
Once all packages and quantities are selected, apply any relevant coupons, gift cards, or creator codes with these endpoints.
Checkout
When the user is ready to checkout, fetch the basket and direct the user to the links.checkout
URL.
Starter Template
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.
Examples
The following websites are built using the Headless API - hosted via our customers own infrastructure, using frontend frameworks such as Vue or React.
Last updated