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.

You can query Tebex for your store information, build a basket for a user, and direct them to checkout all using the endpoints available in Headless API.

Headless API can be used with Tebex.js for a fully embedded checkout experience without the user ever leaving your 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