Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Get started integrating Tebex into your website or game
Welcome to your journey of launching your first project with Tebex! This guide will walk you through the essential steps to create, set up, and launch your store, ensuring a seamless experience for your customers. From building your first project in the creator panel to implementing automatic product delivery, we'll cover everything you need to know to get started.
Head over to the creator panel and kick things off by creating your first project.
Check out the docs for the integration method you’re going with. If needed, build the APIs into your website or game.
If your integration method requires it, create the packages your customers can buy.
Make sure your customers get their packages right away after they’ve made a purchase. For game studios, webhooks or license keys (like Steam keys) are the way to go. If you’re monetizing a game server, don’t forget to check out our official plugins for that.
Learn how to integrate Tebex and leave the complexities of monetization to us.
Welcome to the Tebex developer documentation. If you're new, start with our or explore one of our products below. If you need assistance during the integration process, don’t hesitate to - we’re here to help.
Package slugs allow you to customize your package's URL slug for better readability.
If you are using a custom template, you may need to update it to ensure the package slugs feature functions correctly on your webstore.
In your Twig templates, any instance of package.id should be updated to package.identifier. This property will use the package’s slug if available and default to the numeric ID if not.
The best way to understand the functionality of the Tebex templating engine is to create a copy of our default template, named Exo.
You can do this by navigating to Webstore -> Appearance in your control panel and creating a custom template based on Exo.
For a live demonstration of Exo in action, visit .
Let us support you develop custom templates for Tebex creators.
If you're a template developer, you're entitled to receive free Tebex Plus to enable you to freely develop templates for your clients. Stores that receive our developer plan won't be able to transact real payments on their store.
You're also eligible to gain access to the certified Tebex designers club. You'll get insider help guides, access to a private community of other elite designers, feedback sessions with the Tebex product team, and also BETA features that are not yet available to others.
If you'd like to apply to become a Tebex Certified Designer, .
You can allow players to gift packages to other players. Include target_username_id , or target_username when adding the package to the basket and the package will be delivered to that player rather than the buyer.
The target_username_id should be a unique identifier for the player instead of their name (such as a Minecraft UUID or Steam ID):
Bedrock and Geyser stores must provide target_username instead of the UUID due to differences in player IDs between Minecraft: Java Edition and Minecraft: Bedrock Edition.
If offered by your store, you can apply coupons, gift cards, and creator codes via Headless API once a basket has been created and the user's desired packages have been added.
Depending on the store's configuration, multiple gift cards or coupons may be applied. To remove a gift card or coupon, use the relevant /remove endpoint.
{
"package_id": "6276316",
"target_username_id": "069a79f444e94726a5befca90e38aaf5"
}{
"package_id": "6276316",
"target_username": "TebexDev"
}How to use Tebex with Overwolf Apps
The Overwolf Subscriptions API enables developers to seamlessly integrate subscription-based monetization into their Overwolf apps using a Tebex Store. This integration provides a complete subscription management system - removing the need to handle payment processing, track subscription statuses, or build complex server-side infrastructure.
Before implementing subscriptions, review Overwolf’s documentation to understand the available monetization options and how to incorporate them into your app.
Learn more: Overwolf App Monetization Guide
This guide covers:
Supported monetization models in Overwolf
How Tebex integrates into the Overwolf ecosystem
Steps for setting up and linking your Tebex Store
The Overwolf Subscriptions API provides all the endpoints and methods you’ll need to manage your users’ subscriptions through Tebex. It includes details on authentication, subscription lifecycle management, and user entitlement verification.
View the full API documentation: Overwolf Subscriptions API Reference
Use this reference to:
Fetch active subscriptions for users
Verify subscription status within your app
Manage user access based on entitlement data
To see a working implementation, Overwolf provides an example application demonstrating how to use the Tebex Subscriptions API in a sample application.
Explore the sample app on GitHub: Tebex Subscriptions Example App
This repository includes:
End-to-end integration examples
Code samples for handling subscription data
Reference architecture for production deployments
Discover the power of the Twig templating engine used by Tebex.
Templates on the Tebex platform are written in the Twig Templating Engine. Twig allows you to customise your store with control structures, similar to any other language, while maintaining a sandboxed and safe environment for the Tebex infrastructure.
You're able to learn more information about the syntax of Twig by viewing the official documentation.
A common Twig file may look like the following:
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
<h1>My Webpage</h1>
{{ a_variable }}
</body>
</html>Accessing global variables to help populate your template with live data.
Global variables are variables which are available across all pages of your store.
If you'd like access to a variable that is not currently available, please let us know.
The global store object contains all information associated with the project itself, such as store name.
name
string
The name of the project.
currency
string
The base currency of the project.
css
string
The custom theme currently active on the project.
logo
string
The full url of the custom logo of the project.
favicon
string
The full url of the custom favicon of the project.
noLogin
Boolean
If the project requires no login (e.g. if no username system is being used).
categories
array[category]
An array of package categories of the project.
If you'd like access to a variable that is not currently available, please let us know.
The global page object contains variables associated with the current http request.
title
string
The title of the current page.
message.type
string
The type of toast notification to display to the customer.
message.text
string
The contents of a toast notificaton to display to the customer
message.display
boolean
If a toast notification needs to be shown to the customer (eg. a validation error has occured).
If you'd like access to a variable that is not currently available, please let us know.
The index.html page is the homepage of your store.
description
string
The homepage content of the store.
If you'd like access to a variable that is not currently available, please let us know.
There isn't any specific variables for layout.html. This page is usually extended by all other pages, providing your stores base layout structure.
An example of using layout.html can be seen below:
<!DOCTYPE html>
<html>
<body>
{% block content %}{% endblock %} {# The content of checkout.html will be shown #}
</body>
</html>{% extends "layout.html" %}
{% block content %}
Hello, world!
{% endblock %}The gift card balance module lets your customers enter a gift card and determine the amount of value that remains on the specified gift card.
module.header
string
The header of the module.
search
boolean
If the customer has attempted to search for a giftcard.
giftcard
object
If a giftcard was found from their search, it will be populated in this object.
giftcard.card_number
string
The gift card number the customer has searched for.
giftcard.void
boolean
If the giftcard that has been searched for has been voided by the store owner.
giftcard.remaining_balance
string
The remaining balance of the giftcard which has been searched for.
If you'd like access to a variable that is not currently available, please let us know.
The server status module allows creators who operate Game Servers to display the status of their game server (e.g. player count or online status) on their store.
module.header
string
The header of the module.
module.online
boolean
If the game server is online.
module.ip
string
The IP address of the game server.
module.port
string
The port of the game server.
module.players.online
string
The total players on the game server.
module.players.max
string
The maximum players that can be online at one point on the game server.
If you'd like access to a variable that is not currently available, please let us know.
The top donator module allows you to display the highest spending customer on your store.
module.header
string
The header of the module.
module.donor
boolean
If there is actually a top customer to show yet.
module.skin
string
The URL of the customers profile image to display.
module.ign
string
The username of the customer.
module.displayAmount
boolean
If to display the amount the customer has spent on your store.
module.total
string
The total amount the customer has spent on your store.
module.period
string
The period which calculates the above total. Can be either hourly, daily, weekly, monthly or yearly.
If you'd like access to a variable that is not currently available, please let us know.
Upload custom CSS, Javascript, Images or Twig files to your store for public access.
Assets allow you to upload your own CSS, Javascript, Images or Twig files to your template, which you can later reference in your files.
To create an asset, first upload it from within the template editor. Once you have uploaded the asset, you can retrieve the public URL of the asset by using theasset() function. This function will return the full URL of the asset hosted on our global CDN.
For example, you could upload scripts.js as an asset, and then include it in your template:
<script defer src="{{ asset('scripts.js') }}"></script>You're also able to create TWIG files that you can later reference in your template. For example, you could create an asset called navigation.twig, and then include it using the Twig include tag:
{% include "navigation.twig" %}This allows you to create code that is easily reusable across multiple locations in your template.
Guides to help keep your custom template up-to-date.
In order to support certain features of Tebex, your custom template must be kept up-to-date. Please see the following guides:
Package SlugsIf you’re using a custom or legacy store template, you may not see all package images (when multiple images are uploaded) or the package video.
If you are using the Exo template, this guide does not apply.
Older templates relied on the package.image property to display a package’s image URL. To support package media properly, you now need to use the new package.media array instead. See the example code snippet below demonstrating how to use the new media array.
{% for media in package.media %}
<div class="slide">
{% if media.type == 'image' %}
<img
class="slide-image"
src="{{ media.url }}"
alt="{{ package.name }}"
/>
{% elseif media.type == 'video' %}
<iframe
class="slide-frame"
src="https://www.youtube.com/embed/{{ media.url }}?color=white&rel=0"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
{% endif %}
</div>
{% endfor %}If you're developing a game for UE5, Tebex makes monetization simple.
We've built an open-source SDK for Unreal Engine 5 that provides everything needed to quickly start integrating with Tebex:
C++ mappings for Headless API
C++ mappings for the Plugin API
An example in-game Plugin
GitHub Repository: tebexio/Tebex-UE5
When you're ready to start processing payments for your Unreal game, we’d love to connect. Reach out to us to get started.
Dynamic modules to display useful information on your store.
Modules allow you to add dynamic modules on your store, which you can configure from within your creator panel on the sidebar section.
Each modules HTML is configurable in their associated module.*.html page (documented onwards).
You can display the modules on your store by printing the modules variable, as seen below:
{{ modules|raw }}How to authenticate when accessing the Game Server API.
To access the Plugin API, all requests need to be authenticated via a Game Server secret key which is found in the game servers section of your creator panel.
Supply the secret key by setting the X-Tebex-Secret header in all requests to the API.
If you don't wish to use a popup, you can choose to render the checkout to an element within your page. To do this, use Tebex.checkout.render() instead of Tebex.checkout.launch():
Tebex.checkout.init({
ident: "your checkout request ident goes here",
});
Tebex.checkout.render(
// The element to render to
document.getElementById("some-element");
// The width of the checkout iframe, in pixels
500,
// The height of the checkout iframe, in pixels
600
// Boolean indicating whether you want to open a new tab on mobile
// (defaults to true if unspecified)
false
);Your server can receive Webhooks from Tebex after events occur on our platform (successful payment, refunds, etc.)
Please see our Webhooks Overview for a guide on working with Webhooks.
Any webhooks sent to the server will contain the details of the actual items purchased (the basket at the point of payment).
If your app manages its own basket, it is important to verify that webhook contents always match the items and amount you are expecting.
Understand how errors are handled within the Game Server API.
Errors are JSON format and are based around the standard HTTP status codes.
For example when an invalid secret key is provided the HTTP status code 403 Forbidden will be returned along with a JSON body containing further information.
The error_message object will always be user friendly and should be shown directly to the client.
The available control structures within Twig.
Tags are control structures within Twig. They allow you to change the flow of code within your template.
If you'd like access to a TWIG tag that is not available below, please let us know.
if
for
block
extends
include
set
The global basket object contains all information relevant to the customers basket, such as price & packages.
id
string
Internal ID of the basket.
ident
string
The identifier that can be passed to
ign
string
The username of the customer.
uuid
string
The UUID of the customer.
currency
string
The 3 digit currency code of the basket.
price
string
The current price of the basket.
packages
array[package]
An array of packages in the customers basket.
coupons
array[coupon]
An array of coupons in the customers basket.
If you'd like access to a variable that is not currently available, please let us know.
The entry point for each page on your store.
Pages represent different landing points of your customers on your Tebex store. For example, when customers visit a category on your store, the category.html page will be rendered. For this reason, pages must be implemented in your templates and cannot be deleted (unlike Assets).
If you'd like access to a variable that is not currently available, please let us know.
The only pages that are not accessible to the public are the following:
layout.html
This is the global layout of your store that all pages extend from. You are able to create multiple layouts if you wish via creating an .
module.*
These pages are used to build the Sidebar modules of your store, and you can view more information within the section.
The featured package module allows you to feature a package, bringing more attention to it on your store.
module.header
string
The header of the module.
module.package
The package to feature.
If you'd like access to a variable that is not currently available, please let us know.
When the user is ready to checkout, you can fetch the current basket and direct the user to its links.checkout URL. Here, the user will enter their payment information and complete checkout.
If you'd like the user to stay on your site during checkout, use Tebex.js alongside the Headless API.
For most stores, authorizing the user against the basket is required before checkout. You can do this by directing the user to the appropriate link provided by the /baskets/auth endpoint. Read more here.
Tebex offers many different ways to integrate with your existing infrastructure.
The SDKs below include support for Headless API, Checkout API, and Webhooks, complete with examples, making implementation of these APIs into your project as easy as possible.
Tebex APIs are documented using OpenAPI. These are used to generate our Endpoints documentation. Our schemas are available at the GitHub repositories below. The OpenAPI Generator can be used to generate an SDK in the language of your choice if we do not have your language available.
Below are additional resources and projects that can help you implement Tebex into your project. If you've developed an SDK, please reach out to us at [email protected].
Tebex provides an example integration script for Unity games with a feature-complete implementation of Headless and Plugin API.
We provide our complete C# SDK used to develop our official plugins.
This repository serves as our full Tebex SDK for projects using C#. It is designed to be forked and modified for your particular requirements.
C# mappings for Headless API
C# mappings for Plugin API
An example in-game TebexCorePlugin which implements processing command deliverables on game servers.
GitHub Repositories:
C# SDK:
Unity Plugin:
When you're ready to start processing payments for your Unity game, we’d love to connect. to get started.
There is no specific variables for checkout.html. All checkout functionality is handled via opening a new session. To start a new Checkout session, you should do the following:
GET /checkout/ident
This endpoint will return an ident for the current basket, which is required by when launching a checkout modal.
Response
To learn how to add Tebex.js to your store, please view the or view the demo over at .
When adding packages, there may be certain Variables associated with them. These can be filled by providing a variable_data object.
Packages that deliver a gift card to the user should include giftcard_to mapped to the e-mail address that will receive the gift card:
Packages that deliver Discord actions should include the user's discord_id:
Packages that deliver game server commands should include the username_id of the user, dependent on your store type.
You can get the username_id after creating the basket if you provide the player's username at the time of creation. See Creating a Basket for specific details on Game Servers.
You can also provide custom data when adding packages which can be referenced by the seller as part of the transaction.
If a package with a Game Server Command has the configuration option:
Allow customers to select the game server they want to receive this package on.
You can specify the target game server in the request by including server_id in your package's variable_data:
A list of your server_ids can be found in your by clicking Edit beside your relevant game server. The server ID is the number at the end of the URL when editing the game server.
All errors returned by the Tebex Checkout APIs follow the RFC 7807 standard ().
We also use standardised HTTP response codes to describe each error:
400 Bad Request - User data validation error
401 / 403 - Authentication / Authorization (depending on if it's pre- or post- authentication
404 - Requested resource doesn't exist
5xx - Server side transitory errors.
Integrate the one-click affiliate API into your business to generate new revenue streams and support your customers with their monetization needs via Tebex.
The affiliate API enables you to integrate a one-click setup process for Tebex within your server management panel. A one-click setup process has the following benefits:
Removes the complexity of your customers installing the Tebex Plugin
Increases conversions which will result in more commission paid into your affiliate account.
You will receive a percentage of any revenue the server earns from their players.
Your customers click Install Tebex within your server management panel.
You send an API request to Tebex alerting us of the customers request.
We send an email to the customer with a link that allows them to create a webstore.
Once the customer has created a webstore we will send you a webhook that contains a download url of the plugin, along with a pre-made plugin config file that includes the customers authentication details (their secret key).
You install the provided plugin along with its config file and restart your customers game server.
A typical integration of this API will take a few hours depending on the experience of your development team.
Please note that the one-click setup process is only available to approved partners of the Tebex Checkout For Server Hosts program. Please us for any additional questions or application information.
Once your application has been approved, your API key can be found towards the bottom of the .
To ensure you receive JSON responses, please provide an Accept: application/json header with all API requests.
Beautiful checkout experiences directly within your own site.
Tebex.js is our solution to enable developers to integrate the checkout experience directly within your own website. Customers do not have to be redirected to an external website, improving conversions and providing a seamless checkout experience.
You can experience a live demo of Tebex.js by heading over to or taking a look at the gallery below.
When you are ready to redirect the customer to checkout, there are two ways of beginning the checkout experience:
If you'd like the customer to remain on your website to complete their purchase, you're able to integrate Tebex.js, which is our embeddable checkout experience.
Head over to the to get started.
You may also redirect the customer to an external checkout window using the following URL:
https://pay.tebex.io/{ident}
This is the same as the links.checkout value in a Basket API response. Where {ident} is the ident value returned when creating the basket.
When a customer starts their payment (is redirected to PayPal, provides their card details etc), a copy of the basket at that point in time is converted to a pending payment.
Any changes made to the basket after this point will not be reflected unless the checkout process is re-started.
Configure dynamic store-driven UI blocks to render on your frontend.
PHP
Composer / Packagist
NodeJS
NPM
C#
N/A
Headless API
Checkout API
Nuxt.js
Official
Typescript
Third Party
PHP
Third Party
id
string
The ID of the page.
category
string
The category of the page.
title
string
The title of the page.
metaData.content
string
The actual content of the page.
module.header
string
The header of the module.
module.communitygoal.image
string
The URL of the image of the community goal hosted on our public CDN.
module.communitygoal.repeatable
boolean
If the community goal is repeatable.
module.communitygoal.times_achieved
string
The number of times the community goal has been reached.
module.communitygoal.description
string
The description of the community goal.
module.bar.style
string
The style of the goal, either striped or animated.
module.displayAmount
boolean
If the amount of the community goal should be displayed on your store.
module.total
string
The total the community goal has currently earned.
module.target
string
The target amount of the community goal.
module.percentage
string
The percentage equivalent of the current total against the target.
module.header
string
The header of the module.
module.bar.style
string
The style of the module.
module.bar.animated
string
If the goal bar should be animated.
module.displayAmount
boolean
If to display the amount instead of just a percentage.
module.total
string
The total amount earned so far towards the goal.
module.target
string
The target of the goal.
module.percentage
string
The percentage towards completion of the goal.
"variable_data": {
"variable_identifier": "value"
}{
"package_id": "6276316",
"quantity": 1,
"variable_data": {
"giftcard_to": "[email protected]"
}
}{
"package_id": "6276316",
"quantity": 1,
"variable_data": {
"discord_id": "000000000000000000"
}
}{
"package_id": "6276316",
"quantity": 1,
"variable_data": {
"username_id": "9e65a968ee4743d19a2a4c9969154491"
}
}{
"package_id": "6276316",
"quantity": 1,
"variable_data": {
"username_id": "9e65a968ee4743d19a2a4c9969154491"
},
"custom": {
"key": "value"
}
}{
"package_id": "6276316",
"quantity": 1,
"variable_data": {
"server_id": "127444"
}
}{
"type": "Not Found",
"title": "Resource not found",
"status": 404,
"detail": "The requested resource does not exist.",
"instance": "/account/12345"
}

{
"ident":"null if customer is not logged in"
}Login verification allows you to integrate your own authentication layer into your webstore. Once you have set up player verification the webstore will ping an endpoint hosted on your own website with information about the player attempting to log in. Depending on your response you can deny/allow the customer from logging in.
The login verification system opens up a whole new world of opportunities for integrating with your own backend systems.
Go to Webhooks.
Enter the full URL of your endpoint in the login webhooks config box, for example, http://example.com/tebex/verification.php. You can use any programming language to create your endpoint as long as it returns the response as listed below.
When a customer attempts to log in to your webstore we will send a GET request to the URL you have previously set as outlined above. An example request URL would look like the following:
http://example.com/tebex/verification.php?ign=Notch&ip=127.0.0.1&country=USRequest Query Parameters
ign - The username of the customer attempting to log in.
ip - The IP address of the customer attempting to log in.
country - The country code of the customer (Based on GEO locating their IP address).
To allow the customer to log in based on the provided query parameters you need to return a JSON response such as the following example:
{
"verified":true,
"message":"An optional message to send to the customer upon login. This field is optional."
}
If you don't want to allow the customer to login you can return a JSON response such as:
{
"verified":false,
"error":"You are not allowed to access our webstore."
}
Upon creating your store you may notice the footer at the bottom of your store stating that it is powered by Tebex and that we are the reseller & merchant of record.
Hiding the footer on your webstore will void our terms and conditions and will result in us having to disable your store from the public.
As a merchant of record platform we are under strict requirements by the card networks, such as Visa & Mastercard, to ensure customers understand which company they are purchasing from. You are authorising Tebex to operate a webstore on your behalf and sell content that we license from you, thus we need to let customers know about this as clearly as possible.
We don't place the footer for our own marketing/branding benefit - we simply have to do it to be able to provide you with all the benefits you receive as us being the Merchant Of Record, such as:
100 payment method integrations
Sales tax collection and remittance worldwide
Fraud protection & our chargeback guarantee
Easy to integrate product delivery for your game studio & server
The colour scheme of the footer by default matches your Tebex Checkout theme. You're able to select between Dark or Light mode by viewing your Checkout settings within the creator panel.
The footer also listens to the following CSS variables which you can define in your template/theme, providing you with further customisation ability:
--tebex-legal-footer-background-color
--tebex-legal-footer-text-color
--tebex-legal-footer-border-color
--tebex-legal-footer-max-width
--tebex-legal-footer-logo-color
An example of setting the CSS variables can be seen below, which you could place in your templates CSS file:
:root {
--tebex-legal-footer-background-color: #fcba03;
--tebex-legal-footer-text-color: #4c00ff;
}Events are fired by Tebex.js upon specific actions to alert your frontend and enable you to take action when required. These events should not be used to confirm actual receipt of payment - you should use Webhooks instead.
To add an event callback, use Tebex.checkout.on() . The first argument to this function should be the name of the event to listen to, and the second argument should be a function to call when that function is fired:
Tebex.checkout.on("payment:complete", (event) => {
console.log("Payment completed!", event);
});Available events are as follows:
"open"
The checkout popup opening.
"close"
The checkout popup closing.
"payment:complete"
The customer has successfully completed their payment.
"payment:error"
The customer experienced an error, such as incorrect card details or insufficient funds, when making a payment.
All events that can be listened to with Tebex.checkout.on() are exposed on the element as custom DOM events, which means you can use addEventListener to subscribe to them:
<html>
<body>
<tebex-checkout id="checkout"></tebex-checkout>
</body>
<script>
const checkout = document.getElementById("checkout);
checkout.addEventListener("open", () => {
console.log("checkout opened");
});
checkout.addEventListener("close", () => {
console.log("checkout closed");
});
checkout.addEventListener("payment:complete", (event) => {
console.log("payment completed", event);
});
checkout.addEventListener("payment:error", (event) => {
console.log("payment errored", event);
});
</script>
</html>You will receive a webhook notification when the customer has created their webstore and their game server is ready to have the Tebex plugin automatically installed. Upon receipt of the webhook you should do the following:
Download the Tebex plugin and install it onto the game server using the provided url.
Download the premade config file and install it onto the game server (or manually create the config file depending on the game type, using the secret parameter in the webhook).
Restart the game server to allow the Tebex Plugin to notify us that the plugin has been installed and authenticated against the webstore.
You can specify the url of your webhook handler (such as serverhost.com/tebex.php) within the settings section of your affiliate control panel.
To verify that the webhook has been sent from Tebex, we send a X-Tebex-Signature header that contains a HMAC using SHA256 created by the POST body (JSON) using your Webhook Signature Secret as the key.
You can find your Webhook Signature Secret within the setting section of your affiliate panel and example of calculating the signature in PHP is below:
$body = file_get_contents("php://stdin");
$secret = "myagreedsecret";
$signature = hash_hmac("sha256", $body, $secret);
if ($signature != $_SERVER['HTTP_X_TEBEX_SIGNATURE']) {
return "Invalid signature";
}{
"reference": "123456",
"secret": "9a6747fc6259aa374ab4e1bb03074b6ec672cf99",
"game_type": {
"id": 1,
"plugins": {
"bukkit": {
"platform": "bukkit",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/bukkit/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/bukkit"
},
"sponge": {
"platform": "sponge",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/sponge/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/sponge"
},
"bungeecord": {
"platform": "bungeecord",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/bungeecord/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/bungeecord"
},
"forge": {
"platform": "forge",
"version": "12.0.1",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/minecraft-java/12.0.1/forge/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/forge"
}
}
},
"setup_at": "2020-11-17T09:41:57+00:00"
}Integrate product delivery into your game server.
The Game Server API is for implementing command execution on game servers - an example of this would be the official Tebex Minecraft Plugin.
If you haven't already done so, we recommend having a read of our quick start guide before beginning integration.
You can download compiled versions of the official plugins that implement this API from the Game Servers section of the creator panel.
The source code for these plugins can also be found in the following GitHub repositories:
If we don't have a plugin available for your game you're also able to make use of the RCON Adapter.
top_customer
Shows the top customer of the store.
textbox
Renders custom HTML on the sidebar
recent_payments
Shows information of most recent payor
featured_package
Showcases a particular package
giftcard_balance
Shows the user's giftcard balance
server_status
Online status of a store's server
payment_goal
Progress to completing a payment goal
community_goal
Progress to completing a community goal
Customise your store to match your games brand using our Webstore Builder.
The Webstore Builder enables you to fully customise the design of your store using templates & themes, providing your customers with a seamless transition from your existing website when they're making a purchase.
If you haven't already done so, we recommend having a read of our quick start guide before continuing.
With the webstore builder, you can:
Use templates to change the HTML structure of each page and implement conditional logic via the TWIG templating engine.
Upload custom CSS, Javascript and images via Assets.
If you're a template designer, you can offer your customers the ability to customise their templates via Config Schema, and you're also eligible for free Plus via our Developer Plan.
Browse examples of other Tebex stores for some inspiration.
If you're a designer who creates templates for others, either for free or to sell, let us know! We'll add you to the certified Tebex designers club. You'll gain access to insider help guides, a private community of other designers, feedback sessions with the Tebex product team, and also BETA features that are not yet available to others.
If there are any functions, tags, filters or variables that you need to use in your template, but they're not available or documented, please let us know.
To create your first template, head over to the Appearance section within your creator panel.
As a creator using Checkout API, you must authenticate directly with the API as opposed to individual customers authenticating.
We use HTTP BASIC for authorization, and all requests are made over HTTPS so that your credentials are protected.
Username (Project ID)
Your Project ID (you can get this from )
Password (Private Key)
Your Private Key (you can get this from )
Your store's Private Key should never be shared publicly. If your key is ever compromised, it can be reset in your Webstore panel.
All requests use application/json as the Content-Type. Ensure this is set with all requests to our Checkout API.
const url = "https://checkout.tebex.io/api/checkout";
const headers = new Headers();
headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
headers.append('Content-Type', 'application/json');
const options = {
method: 'POST', // Use 'GET', 'POST', 'PUT', etc. as needed
headers: headers
};
const response = await fetch(url, options);
// etcTiers are for upgrading between different levels of subscription packages and automatically applying their deliverables.
This guide will detail the expected flows and endpoints for implementing tiers using Headless API.
See our Creator docs for Tiered Packages to learn how to set up tiers.
If you are using an older or custom store template, you may need to modify your template to support tiers. A tiered category view is different from a non-tiered category.
See Supporting Tiers on Custom Store Templates to learn how to set up the necessary pages.
Tiers require an authenticated user. After you create the basket, you must log the user in using the relevant basket auth links.
See Creating A Basket for further information.
The expected flow for checking out with a Tier is identical to any other package:
Create the basket
Authenticate the user via the basket's auth links
Add the tiered package to the basket
Direct the user to checkout
On successful checkout, the user will now have an active_tier when retrieving their tiered categories against their usernameId.
If the active_tier property is not present, the user does not have an active package in that tier.
Tiered categories use our existing /categories endpoint.
Unlike other Headless API endpoints, you must use HTTP Basic authentication with the Username set to your project ID and Password as your secret key.
Provide a usernameId as a query parameter to check for an active_tier
All tiered categories will have the property tiered: true
Your project must be approved to use this endpoint, please contact your Creator Success Manager to seek approval.
The payments module allows you to display a selection of recent payments received from customers on your store.
module.header
string
The header of the module.
module.payments
array[]
An array of payments.
module.displayPackage
boolean
If to display the package names against each payment.
module.displayPrice
boolean
If to display the price of each payment.
ign
string
The username of the customer.
name
string
The name of the package the customer has purchased.
time
string
The time the purchase was received on the store.
price
string
The amount of the purchase.
currency
string
The currency of the purchase.
If you'd like access to a variable that is not currently available, please let us know.
The category.html page lists the packages that are available to purchase in the current category being viewed on your store.
id
string
The ID of the category.
name
string
The name of the category.
displayType
string
The display type (either grid or list)
description
string
The description of the category.
packages
array
An array of .
slug
string
The url slug of the category.
If you'd like access to a variable that is not currently available, please let us know.
The username.html page is responsible for allowing your customers login to your store.
external
Boolean
If the login provider of the store requires the user to be sent to an external url which is available in the url variable. See for what to do in the event external is false.
provider
String
The name of the login provider, such as FiveM, Discord or Steam.
url
String
The URL that the customer should be directed to so they can perform their login with the external provider.
If the external variable is true, let the user click a link to proceed to login via the external login provider:
<p>Please login with your {{ provider }} account to continue.</p>
<a href="{{ url }}">Login</a>If the external variable is false, provide a form submitting to the current url, including an ign form parameter. The ign parameter should be a text field allowing the customer to enter their username freehand.
An example can be seen below:
<form method="post">
<input type="text" name="ign" placeholder="Enter your in-game username" />
<button type="submit">Login</button>
</form>An example of a flow supporting both external and non-external login providers is shown below:
{% if external %}
<a href="{{ url }}">Login via {{ provider }}</a>
{% else %}
<form method="post">
<input
type="text"
name="ign"
placeholder="Enter your in-game username"
/>
<button type="submit">Login</button>
</form>
{% endif %}If you'd like access to a variable that is not currently available, please let us know.
Modify variable values with Twig filters.
View the available functions within your Twig template.
Functions generate content for you to use within your templates.
If you'd like access to a TWIG function that is not available below,
__Returns the equivalent translation from within your translations settings.
_pReturns the plural translation from within your translation settings.
configReturns a config value from your .
assetReturns the full url path of an asset from within your template.
pathReturns the full url path of the current page.
queryReturns a GET parameter from the current url.
The options.html page is shown to the customer when adding a package that requires customisation, such as when you are using .
If you'd like access to a variable that is not currently available,
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 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 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 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 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.
Depending on the type of Tebex store you are integrating, additional parameters may be necessary before the basket can be successfully created.
For most stores, the user must authorize their account before checkout is completed. This is done via the /auth endpoint where we will return the authentication options available for your store.
Provide a returnUrl , and after successful authentication the user will be directed back to your site.
You must provide the username parameter as part of the basket creation request so that the basket is attributed to the correct user:
If you are creating a basket on your backend server, you will need to provide us the ip_address of the customer.
Currently we are unable to support IPv6 addresses being provided in the ip_address property. While we work on enabling IPv6 support, please provide an IPv4 address for the customer.
If you are creating a basket from the user's browser, we will automatically determine the IP from the requesting device.
The Basket which is returned will include the username_id which may be required for certain endpoints.
You should save the username_id as part of the user's session for use later.
No username is required, but depending on your package Deliverables you may need to provide variable_data so that the package is attributed to the correct user. See .
If you are creating a basket on your backend server, you will need to provide us the IP address of the customer through the If you are creating a basket from the user's browser, we will automatically determine the IP from the requesting device.
Currently we are unable to support IPv6 addresses being provided in the ip_address property. While we work on enabling IPv6 support, please provide an IPv4 address for the customer.
If you’re being asked for authentication; you'll need to use HTTP BASIC with the following details:
Your store's Private Key should never be shared publicly. If your key is ever compromised, it can be reset on the API Keys page linked in the table above.
All requests use application/json as the Content-Type. Ensure this is set with all requests to our Headless API.
escape
length
raw
money
slice
number_format
date
nl2br
replace
split
upper
lower
{% set value = 1 %}
{{ value|money }} // returns 1.00__
_p
config
asset
path
query
range
{{ __('Redeem coupons / gift cards') }}
// prints "Redeems coupons / gift cards" (Or the equivalent translation if another language is selected){{ _p(":count items for :amount :currency", basket.packages|length, {'count' : basket.packages|length, 'amount' : basket.price|money, 'currency' : basket.currency}) }}
// prints "5 items for $5.00 USD"{{ config("header-colour") }}
// prints the associated config value with the key header-colour{{ asset("style.css") }}
// Prints the URL of style.css, such as https://your-store.tebex.io/template-assets/style.css"{{ path() }}
// Prints the full URL of the current page the customer is browsing on your store{{ query("test" }}
// Returns the GET param of "test" if it is provided in the URL.options.package
An object containing information about the current package.
options.variables
array[Variable]
An array containing the variables the customer needs to select.
name
string
The name of the package.
chooseServer
boolean
If the package requires the customer to select a game server.
customPrice
boolean
If the package requires the customer to enter how much they want to pay for the package.
category
string
The category ID of the package.
price
string
The price of the package.
description
string
A summary of the description of the variable.
type
string
Either dropdown, discord_id, or show an input field for freehand input by the customer.
id
string
The ID of the variable.
options
array[Variable Option]
If the type is dropdown, we include an array of options the customer should select from.
value
string
The current value of the variable.
discord_tag
string
If the variable is type is discord_id and the value is not empty, this will include their discord tag once they have logged in.
default
boolean
If this variable option should be selected by default.
name
string
The name of the dropdown option.
price
string
The additional price the customer would pay by selecting this variable option.
Username (Public Token)
Your Public Token (you can get this from https://creator.tebex.io/developers/api-keys)
Password (Private Key)
Your Private Key (you can get this from https://creator.tebex.io/developers/api-keys)
const url = "https://headless.tebex.io/api/accounts/{token}/baskets";
const headers = new Headers();
headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
headers.append('Content-Type', 'application/json');
const body = {
"complete_url": "https://example.tebex.io/thank-you",
"cancel_url": "https://tebex.io/",
"custom": {
"foo": "bar"
},
"complete_auto_redirect": true,
"username": "TebexDev"
};
const options = {
method: 'POST',
headers: headers,
body: JSON.stringify(body)
};
const response = await fetch(url, options);Example Store
Hypixel


The package.html page displays details about a specific package on your store.
id
string
The ID of the package.
identifier
string
The slug of the package. Defaults to the numeric ID if no slug is defined.
name
string
The name of the package.
description
string
The description of the package.
customPrice
boolean
If the package can have a custom price.
price
string
The price of the package.
purchasable
boolean
If the currently logged in customer is allowed to purchase this package on your store.
quantity
integer
The quantity of this package in the customers basket.
image.url
string
The public url of the packages image hosted on the Tebex CDN.
image.uploaded
boolean
If this package has an image uploaded.
category
string
The ID of the category which this package belongs to.
has_options
boolean
If this package requires options to be entered/selected before adding to the basket.
discount.applied
boolean
If the package has a discount applied.
discount.original
string
The original price of the package before the discount was applied.
discount.percentage
string
The percentage equivalent of the discount applied to the package.
If you'd like access to a variable that is not currently available, please let us know.
GET https://affiliate.tebex.io/api/game-types
Retrieve a list of all games that the Tebex Platform supports.
Authorization
string
Bearer <Your API Key>
{
"data": [
{
"id": 1,
"name": "Minecraft: Java Edition"
},
{
"id": 2,
"name": "Minecraft (Bedrock)"
},
{
"id": 3,
"name": "Minecraft Offline"
},
{
"id": 4,
"name": "Unturned"
},
{
"id": 5,
"name": "Rust"
},
{
"id": 6,
"name": "7 Days to Die"
},
{
"id": 7,
"name": "Garry's Mod"
},
{
"id": 8,
"name": "Counter-Strike: Global Offensive"
},
{
"id": 9,
"name": "Team Fortress 2"
},
{
"id": 10,
"name": "Hurtworld"
},
{
"id": 11,
"name": "ARK: Survival Evolved"
},
{
"id": 12,
"name": "Space Engineers"
},
{
"id": 13,
"name": "ATLAS"
},
{
"id": 14,
"name": "GTA V"
},
{
"id": 15,
"name": "FiveM"
}
]
}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-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of category information.
Successful response returns a list of category information.
Gets all categories from a webstore including packages.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of category information.
Successful response returns a list of category information.
Gets information about a category and returns the packages in that category.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe ID of the category to fetch.
127244343Successful response returns the category without package information.
Successful response returns the category without package information.
Gets information about a category and returns the packages in that category.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe ID of the category to fetch.
127244343Successful response returns the category with package information.
Successful response returns the category with package information.
Gets a package from a webstore by ID.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe package's ID.
1272441812Successful response returns the package information.
Successful response returns the package information.
Gets all packages from a webstore.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of package information.
Successful response returns a list of package information.
Creates a new basket for use during checkout.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbA URL the user can return to when checkout is completed.
https://example.tebex.io/thank-youA 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.
{"foo":"bar"}True if the user should automatically be redirected to the relevant complete/cancel URL
trueSuccessful response returns the basket information.
The provided webstore ID is invalid.
Fetches a basket's auth URL.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cThe URL you would like to redirect the user to after successful basket authentication.
https://example.tebex.io/Successful response returns the basket auth information.
The provided webstore ID or basket ID is invalid.
Add a package with the given ID to the basket.
The basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c62763161Successful response.
The provided request is invalid. The error response will include detail as to which parameter failed validation.
Remove the given package ID from the basket.
The basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c6276316Successful response returns the basket.
The provided request is invalid. The error response will include detail as to which parameter failed validation.
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cAcademy10Successful response returns the basket.
The provided request is invalid. The error response will include detail as to which parameter failed validation.
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cCreator code removed successfully.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c0127 0244 7210 1111Successful response returns the basket.
Successful response returns the basket.
Removes a gift card from the basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c0127 0244 7210 1111Gift card removed successfully.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cAcademy10Successful response returns the basket.
Successful response returns the basket.
Removes a coupon code from a basket
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cSuccessful response.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Gets a basket associated with the provided identifier.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cSuccessful response returns the basket information.
Successful response returns the basket information.
Fetches a basket's auth URL.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cThe URL you would like to redirect the user to after successful basket authentication.
https://example.tebex.io/Successful response returns the basket auth information.
The provided webstore ID or basket ID is invalid.
{
"complete_url": "https://example.tebex.io/thank-you",
"cancel_url": "https://tebex.io/",
"custom": {
"foo": "bar"
},
"complete_auto_redirect": true,
"username": "TebexDev",
}Creates a new basket for use during checkout.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbA URL the user can return to when checkout is completed.
https://example.tebex.io/thank-youA 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.
{"foo":"bar"}True if the user should automatically be redirected to the relevant complete/cancel URL
trueSuccessful response returns the basket information.
The provided webstore ID is invalid.
Learn which integration method is best for you
Tebex offers multiple integration options tailored to meet different business needs, each equipped with unique features for specific use cases.
There are three integration methods available, as highlighted below. Each method varies in complexity, with the Webstore Builder being the easiest to get started with.
Checkout: Maximize revenue by utilizing Tebex’s global Merchant of Record platform. With over 100 payment methods, Tebex handles the entire checkout process, offering chargeback protection, fraud monitoring, 14-day payouts, and international sales tax coverage.
Package Management: Effortlessly set up and manage packages for sale on your project through the creator panel. You can organize packages into categories and easily define details such as names, descriptions, pricing, and images. You're also able to invite other team members to manage these too.
Hosted Webstore: Tebex provides a customizable webstore that allows you to start selling in minutes. This enables you to focus on your business, while we handle the hosting infrastructure & technical requirements for you.
Take a look at the example scenarios below to get a better understanding of which integration method is best for you. Whatever you choose, all of our integration methods come with access to over 100 payment methods, international sales tax coverage, fraud protection, webhooks, and seamless inline checkout through Tebex.js.
Now that you've chosen your integration method, you can begin by exploring the relevant documentation:
Learn how to design your own store using the Webstore Builder.
Sell packages directly from your website or in-game with the Headless API.
For more complex integrations, get started with the Checkout API.
Develop advanced custom checkout experiences.
The Checkout API is designed to allow creators to use Tebex's Merchant of Record platform without the need to use a Tebex-powered webstore.
If you haven't already done so, we recommend having a read of our quick start guide before beginning integration.
This means creators can create baskets with custom products (as opposed to pre-created products on our webstore platform), and send customers directly to the checkout flow to proceed with payment.
The Checkout API can be used with Tebex.js for a fully embedded checkout experience without the user ever leaving your own website.
Using the Checkout API requires prior approval from our compliance teams. Please note that the Checkout API is not available to some UGC creators, such as those on FiveM or RedM.
Basket
To start a transaction, a basket must be created. The basket, similar to a standard eCommerce basket will contain the items that the customer is purchasing
Ident
A string identifier representing the basket
Below is the expected flow your application should follow when implementing the Checkout API. This should be considered a general guideline. For a full list of endpoints available, see the Endpoints page.
You have two options for implementing Checkout API. We include a Checkout request where all data about the customer and their desired packages can be provided in one request.
If your app has existing basket functionality, we recommend using a Checkout request. You can send the details of your customer, basket, and sale information all in one request:
If you do not have existing basket functionality in your app, you can use the Checkout API to fully manage the customer's basket on Tebex:
Create a basket for the customer.
Your app should save the ident value for reference later, as this is the identifier for this customer's basket.
Add or remove packages from the customer's basket as desired.
Add any desired sales / discounts to the basket
Direct the user to the basket's links.checkout URL in order to complete payment.
After payment is complete, you may verify payment if you wish by checking the links.payment URL associated with the customer's basket.
Tebex Checkout supports recurring payments in addition to single, one-time payments. Below are the endpoints you can use for managing a customer's recurring payments.
Tebex Checkout is documented with OpenAPI. To view the schema and available SDKs, see our releases on GitHub.
An importable Postman collection can always be downloaded from Tebex Checkout's repository on GitHub.
The following websites are integrated using the Checkout API.
As an alternative to using the Tebex.checkout JavaScript API, Tebex.js also provides a tebex-checkout .
With this, you can embed a Tebex Checkout into your page by placing the <tebex-checkout></tebex-checkout> HTML tag anywhere in your page's <body>, so long as Tebex.js is also loaded into the page:
Two modes are available for tebex-checkout:
This is the default mode. The component will display nothing initially, but will launch the checkout as a popup when activated, akin to .
The simplest way to achieve this is by placing a button inside the <tebex-checkout> and </tebex-checkout> tags. Tebex.js will automatically attach handlers so that clicking the button will launch the checkout:
Alternatively, if you would prefer to open the checkout from your code (i.e. instead of having a user click something), you can leave the tebex-checkout empty and add the open attribute to it whenever you are ready for it to launch:
By adding the inline attribute to the checkout element, the element will instead be rendered inline within the rest of the page, in a similar way to .
It will automatically take up 100% of the width of its container and set its height to a sane default for displaying the iframe checkout content, but you can use the height attribute to manually set the height, in CSS pixels:
HTML attributes take the place of 's config options, along with a couple of extra options:
For example:
Web Components such as tebex-checkout integrate seamlessly with most modern frontend frameworks without needing any special setup. However, if you are using Vue, please note that you may need to adjust your config to for tebex-checkout.
In Vue, this is how you could include an inline tebex-checkout component and call a function when the payment complete event fires:
Tebex.js enables you to integrate a seamless checkout experience for customers without them leaving your website or game.
Tebex.js is available as an NPM package, which you can install using your preferred JS package manager:
The Tebex object can then be imported into your code like so:
Alternatively, we also provide Tebex.js via our own CDN, which you can add as a script within the <head> tag of your website:
When installing Tebex.js this way, the Tebex object will become available globally on the window object.
We recommend using defer on the script to prevent it from blocking your website's initial page render, but when doing do, it's important to wait for the page load event before you begin configuring the checkout:
Before your checkout can be launched, it must first be configured by calling the Tebex.checkout.init() method. This method takes an object containing config options:
Brand colors can be specified as an array of objects with name and color keys. name must be either "primary" or "secondary", while color must be a valid CSS color:
When you are ready to show the Tebex.js checkout to your user, you can call the Tebex.checkout.launch() method. On desktop devices this will open the checkout as a popup, while on mobile devices it will open as a new tab.
If you are only calling the Tebex.checkout.launch() inside a click event, you might prefer to also call Tebex.checkout.init()inside your click handler.
This way, you don't need to wait for the page load event to fire to configure your checkout:
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cAcademy10Successful response returns the basket.
The provided request is invalid. The error response will include detail as to which parameter failed validation.
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cCreator code removed successfully.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c0127 0244 7210 1111Successful response returns the basket.
Successful response returns the basket.
Removes a gift card from the basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c0127 0244 7210 1111Gift card removed successfully.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Applies a creator code to a basket.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cAcademy10Successful response returns the basket.
Successful response returns the basket.
Removes a coupon code from a basket
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cSuccessful response.
No content
The provided request is invalid. The error response will include detail as to which parameter failed validation.
No content
Gets a basket associated with the provided identifier.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cSuccessful response returns the basket information.
Successful response returns the basket information.
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-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of category information.
Successful response returns a list of category information.
Gets all categories from a webstore including packages.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of category information.
Successful response returns a list of category information.
Gets information about a category and returns the packages in that category.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe ID of the category to fetch.
127244343Successful response returns the category without package information.
Successful response returns the category without package information.
Gets information about a category and returns the packages in that category.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe ID of the category to fetch.
127244343Successful response returns the category with package information.
Successful response returns the category with package information.
Gets a package from a webstore by ID.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe package's ID.
1272441812Successful response returns the package information.
Successful response returns the package information.
Gets all packages from a webstore.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbSuccessful response returns a list of package information.
Successful response returns a list of package information.
Gets all packages from a webstore.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbAn IP address can be provided with authenticated requests.
127.0.0.1Successful response returns a list of package information.
The provided request is invalid.
Gets all packages from a webstore.
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbThe basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cAn IP address can be provided with authenticated requests.
127.0.0.1Successful response returns a list of package information.
The provided request is invalid.
Webstore Builder Easiest
Headless API Complex
Checkout API Advanced
POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"creator_code": "Academy10"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*
POST /api/accounts/{token}/baskets/{basketIdent}/giftcards HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"card_number": "0127 0244 7210 1111"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/giftcards/remove HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"card_number": "0127 0244 7210 1111"
}POST /api/accounts/{token}/baskets/{basketIdent}/coupons HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 27
{
"coupon_code": "Academy10"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/coupons/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*
GET /api/accounts/{token}/baskets/{basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories?includePackages=1 HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories/{categoryId}?includePackages=1 HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}GET /api/accounts/{token}/packages HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}GET /api/accounts/{token}/packages?ipAddress={ipAddress} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}GET /api/accounts/{token}/packages?ipAddress={ipAddress}&basketIdent={basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}GET /api/accounts/{token}/baskets/{basketIdent}/auth?returnUrl={returnUrl} HTTP/1.1
Host: headless.tebex.io
Accept: */*
[
{
"name": "FiveM",
"url": "https://ident.tebex.io/"
}
]POST /api/accounts/{token}/baskets HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 139
{
"complete_url": "https://example.tebex.io/thank-you",
"cancel_url": "https://tebex.io/",
"custom": {
"foo": "bar"
},
"complete_auto_redirect": true
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories?includePackages=1 HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/categories/{categoryId}?includePackages=1 HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 2678660,
"name": "Test",
"slug": "text",
"parent": {},
"description": "text",
"packages": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
],
"order": 1,
"display_type": "list"
}
]
}GET /api/accounts/{token}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}GET /api/accounts/{token}/packages HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": [
{
"id": 6276316,
"name": "test package 101",
"description": "<p>this is just a test. only a test. nothing more.</p>",
"image": null,
"type": "single",
"category": {
"id": 2678660,
"name": "Packages"
},
"base_price": 5,
"sales_tax": 0,
"total_price": 5,
"currency": "USD",
"discount": 0,
"disable_quantity": false,
"disable_gifting": false,
"expiration_date": null,
"created_at": "2024-05-21T18:09:17+00:00",
"updated_at": "2024-05-21T18:09:17+00:00"
}
]
}POST /api/accounts/{token}/baskets HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 139
{
"complete_url": "https://example.tebex.io/thank-you",
"cancel_url": "https://tebex.io/",
"custom": {
"foo": "bar"
},
"complete_auto_redirect": true
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}GET /api/accounts/{token}/baskets/{basketIdent}/auth?returnUrl={returnUrl} HTTP/1.1
Host: headless.tebex.io
Accept: */*
[
{
"name": "FiveM",
"url": "https://ident.tebex.io/"
}
]POST /api/baskets/{basketIdent}/packages HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"package_id": 6276316,
"quantity": 1
}{
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}POST /api/baskets/{basketIdent}/packages/remove HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 22
{
"package_id": 6276316
}{
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"creator_code": "Academy10"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*
POST /api/accounts/{token}/baskets/{basketIdent}/giftcards HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"card_number": "0127 0244 7210 1111"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/giftcards/remove HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"card_number": "0127 0244 7210 1111"
}POST /api/accounts/{token}/baskets/{basketIdent}/coupons HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 27
{
"coupon_code": "Academy10"
}{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}POST /api/accounts/{token}/baskets/{basketIdent}/coupons/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*
GET /api/accounts/{token}/baskets/{basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
{
"data": {
"id": 244127617,
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"complete": false,
"email": "[email protected]",
"username": null,
"coupons": [
{
"coupon_code": "Academy10"
}
],
"giftcards": [
{
"card_number": "0127 0244 7210 1111"
}
],
"creator_code": "text",
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"country": "US",
"ip": "127.0.0.1",
"username_id": 127244,
"base_price": 1.27,
"sales_tax": 0.11,
"total_price": 1.38,
"currency": "USD",
"packages": [
{
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "some_wallet_reference",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}
],
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}
}<html>
<head>
<script defer src="https://js.tebex.io/v/1.js"></script>
</head>
<body>
<tebex-checkout></tebex-checkout>
</body>
</html><tebex-checkout ident="...">
<button>Open Checkout</button>
</tebex-checkout><script>
function openCheckout() {
const checkout = document.getElementById("checkout");
checkout.setAttribute("open", "true");
}
// call openCheckout() when you want the checkout to launch...
</script>
<tebex-checkout id="checkout" ident="..."></tebex-checkout><tebex-checkout inline ident="..." height="800"></tebex-checkout>ident
Required. This should be the checkout request ident received via the Headless API or Checkout API.
locale
Default language for checkout text. Specified as an ISO locale code, e.g. "en_US" for American English, "de_DE" for German, etc. Users can change the language from within the checkout panel UI.
theme
Checkout color theme. Must be one of the following options:
"light"
"dark"
"auto" - applies the theme based on the user's light/dark mode system preference.
"default" - applies the theme option you have selected in your store's settings.
color-primary
Checkout primary brand color.
color-secondary
Checkout secondary brand color.
popup-on-mobile
If set, when in popup mode, the checkout will always launch in the current browser window rather than opening a new page, even on mobile devices.
redirect-on-complete
If set to a URL, the user will be redirected to this page once the payment has completed.
<tebex-checkout theme="dark" color-primary="#ff0000"></tebex-checkout><script setup>
import "@tebexio/tebex.js";
const ident = ref("");
// something to fetch the ident here
function onPaymentComplete() {
console.log("payment completed");
}
</script>
<template>
<tebex-checkout inline :ident="ident" @payment:complete="onPaymentComplete"></tebex-checkout>
</template>npm install @tebexio/tebex.jsimport Tebex from "@tebexio/tebex.js";<script defer src="https://js.tebex.io/v/1.js"></script><script>
addEventListener("load", function() {
// Configure Tebex.js here
});
</script>Tebex.checkout.init({
ident: "checkout request ident"
});ident
Required. This should be the checkout request ident received via the Webstore Builder, Headless API or Checkout API.
locale
Default language for checkout text. Specified as an ISO locale code, e.g. "en_US" for American English, "de_DE" for German, etc. Users can change the language from within the checkout panel UI.
English
theme
Checkout color theme. Must be one of the following options:
"light"
"dark"
"auto" - applies the theme based on the user's light/dark mode system preference.
"default" - applies the theme option you have selected in your store's settings.
"default"
colors
Checkout brand colors.
[]
defaultPaymentMethod
The default payment method ID to be selected when the user loads the checkout. You can get the list of available methods from the creator panel. To get the ID of the method, hover over the name in the table.
Tebex.checkout.init({
//..
colors: [
{
name: "primary",
color: "#910f0f",
},
{
name: "secondary",
color: "#25c235"
}
]
});<!-- Include the Tebex.js script here -->
<script>
function checkout() {
Tebex.checkout.init({
ident: "your checkout request ident goes here"
};
Tebex.checkout.launch();
}
</script>
<!-- ... -->
<button onclick="checkout()">Checkout</button>No-code customisation for your template directly from within the creator panel.
A template schema allows other team members or consumers of your template to change its appearance, for example providing colour pickers to change the colours of your template without the need to edit the CSS or HTML manually. This is especially useful if you are a template designer and you're selling access to your custom template for many different stores to use.
To edit the schema of a template, first open the template editor and select the Change Schema page from the navigation on the left. Any config options you add within the schema will appear within the Appearance section of the creator panel when you click edit on the template.
A great example of Schema in action would be to look at the configuration options available with our default template, Exo, which you can view in the creator panel.
{
"author": "Tebex",
"support_email": "[email protected]",
"config": [
{
"header": "Customize Template",
"options": [
{
"id": "nav-style",
"name": "Navigation Style",
"description": "Set the location for your navigation.",
"type": "select",
"default": "Vertical Nav in Sidebar",
"values": [
"Horizontal Nav in Header",
"Vertical Nav in Sidebar"
]
},
{
"id": "server-ip",
"name": "Server IP",
"default": "",
"description": "Enter your server IP - it will be used in the copy server IP section.",
"type": "textarea"
},
{
"id": "discord",
"name": "Discord",
"default": "",
"description": "Enter your Discord invite url - it will be used in the header Discord section.",
"type": "textarea"
}
]
}
]
}You're able to implement several different types of config options within your template schema, from colour pickers to text boxes.
To dynamically access the config option from within your template you can use the config() Twig function. This will output the entered option value, allowing you to use it however you wish within your template, such as outputting a text area into a specific location or altering CSS via a colour picker.
Lunarclient

This API call allows the complete checkout flow (create basket, add items, add sale) to be made in a single API call, for when the Seller is managing the basket locally. This endpoint requires prior approval - please contact your account manager.
Successfully created basket. The basket will be returned with links containing the URLs you should direct the customer to in order to complete payment.
Bad Request. See ErrorResponse.
POST /api/checkout HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 330
{
"basket": {
"first_name": "Neil",
"last_name": "McNeil",
"email": "[email protected]",
"return_url": "https://tebex.io",
"complete_url": "https://tebex.io",
"custom": {
"foo": "bar",
"trackingId": 127,
"list": [
"1",
"2",
"3"
]
}
},
"items": [
{
"package": {
"price": 1.27,
"name": "1000 Gold"
}
}
],
"sale": {
"name": "Test Sale",
"discount_type": "amount",
"amount": 4.99
}
}{
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"expire": "2022-10-25 15:15:40",
"price": 1.27,
"priceDetails": {
"fullPrice": 1.4,
"subTotal": 1.27,
"discounts": [],
"total": 1.4,
"surcharges": [],
"tax": 0.13,
"balance": 0,
"sales": [],
"giftcards": [],
"roundUp": null
},
"isPaymentMethodUpdate": false,
"returnUrl": null,
"complete": false,
"tax": 1,
"username": null,
"discounts": [
{}
],
"coupons": [
{}
],
"giftcards": [
{}
],
"address": {
"name": "Ted Tebex",
"first_name": "Ted",
"last_name": "Tebex",
"address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
"email": "[email protected]",
"state_id": null,
"country": "UK",
"postal_code": "NW6 3QT"
},
"rows": [
{
"id": 173125385,
"basket": 725572301,
"package": null,
"override": 0,
"quantity": 2,
"server": null,
"price": 1.27,
"gift_username_id": null,
"options": null,
"recurring": false,
"recurring_period": null,
"recurring_next_payment_date": null,
"meta": {
"name": "1000 Gold",
"rowprice": 2.54,
"initialprice": 1.27,
"isCumulative": false,
"requiredPackages": [],
"requiresAny": false,
"category": false,
"producesGiftCard": false,
"allowsGiftCards": true,
"servers": [],
"limits": {
"user": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"global": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"packageExpiryTime": 0
},
"hasDeliverables": false,
"deliverableTypes": [],
"downloadLink": "",
"hasSellerProtection": true,
"itemType": null,
"revenue_share": [],
"image": null,
"realprice": 1.27
},
"custom": null,
"image_url": null,
"recurring_price": null
}
],
"fingerprint": "",
"creator_code": "text",
"roundup": false,
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}This will create and return a Basket that can be paid for by redirecting the user to links.checkout
The URL a customer can return to without completing checkout
https://example.tebex.io/URL the customer can return to after completing payment
https://example.tebex.io/completeAny custom data to be passed through the request. This will be returned in a post-completion webhook.
{"foo":"bar"}The first name of the customer
NeilThe last name of the customer
McNeilAn ISO8601 formatted date. After this date the basket cannot be used to checkout.
2025-01-27T18:09:51ZAutomatically redirect to the complete_url provided
trueAn ISO 3166-1 alpha-2 character code representing the customer's country.
USThe 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
The IP address of the customer using this basket. Provide the IP if creating a basket on your server backend.
1.2.3.4Basket created successfully
POST /api/baskets HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 300
{
"return_url": "https://example.tebex.io/",
"complete_url": "https://example.tebex.io/complete",
"custom": {
"foo": "bar"
},
"first_name": "Neil",
"last_name": "McNeil",
"email": "[email protected]",
"expires_at": "2025-01-27T18:09:51Z",
"complete_auto_redirect": true,
"country": "US",
"creator_code": null,
"ip": "1.2.3.4"
}Basket created successfully
{
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"expire": "2022-10-25 15:15:40",
"price": 1.27,
"priceDetails": {
"fullPrice": 1.4,
"subTotal": 1.27,
"discounts": [],
"total": 1.4,
"surcharges": [],
"tax": 0.13,
"balance": 0,
"sales": [],
"giftcards": [],
"roundUp": null
},
"isPaymentMethodUpdate": false,
"returnUrl": null,
"complete": false,
"tax": 1,
"username": null,
"discounts": [
{}
],
"coupons": [
{}
],
"giftcards": [
{}
],
"address": {
"name": "Ted Tebex",
"first_name": "Ted",
"last_name": "Tebex",
"address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
"email": "[email protected]",
"state_id": null,
"country": "UK",
"postal_code": "NW6 3QT"
},
"rows": [
{
"id": 173125385,
"basket": 725572301,
"package": null,
"override": 0,
"quantity": 2,
"server": null,
"price": 1.27,
"gift_username_id": null,
"options": null,
"recurring": false,
"recurring_period": null,
"recurring_next_payment_date": null,
"meta": {
"name": "1000 Gold",
"rowprice": 2.54,
"initialprice": 1.27,
"isCumulative": false,
"requiredPackages": [],
"requiresAny": false,
"category": false,
"producesGiftCard": false,
"allowsGiftCards": true,
"servers": [],
"limits": {
"user": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"global": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"packageExpiryTime": 0
},
"hasDeliverables": false,
"deliverableTypes": [],
"downloadLink": "",
"hasSellerProtection": true,
"itemType": null,
"revenue_share": [],
"image": null,
"realprice": 1.27
},
"custom": null,
"image_url": null,
"recurring_price": null
}
],
"fingerprint": "",
"creator_code": "text",
"roundup": false,
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}This adds a package (an object describing the product) to the basket {ident}. For subscriptions, only one subscription item may be in a basket at a time, and it cannot be included with one-time payment items. This endpoint requires prior approval. Please contact your account manager.
The basket identifier.
1a-55fff4107740a1f40d844ff89607557f45bfafb3The quantity of package in this basket. This is not the total quantity of overall items in the basket.
2The type of payment, either single for one-time payments or subscription.
singlePossible values: Package is successfully added to the basket, and basket is returned.
Improperly formatted package. See ErrorResponse.
Basket not found.
POST /api/baskets/{ident}/packages HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 260
{
"package": {
"name": "1000 Gold",
"price": 1.27,
"type": "subscription",
"qty": 1,
"expiry_period": "month",
"expiry_length": 3,
"custom": {
"foo": "bar"
}
},
"qty": 2,
"type": "single",
"revenue_share": [
{
"wallet_ref": "centralised_404244_127",
"amount": 0.5,
"gateway_fee_percent": 50
}
]
}{
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"expire": "2022-10-25 15:15:40",
"price": 1.27,
"priceDetails": {
"fullPrice": 1.4,
"subTotal": 1.27,
"discounts": [],
"total": 1.4,
"surcharges": [],
"tax": 0.13,
"balance": 0,
"sales": [],
"giftcards": [],
"roundUp": null
},
"isPaymentMethodUpdate": false,
"returnUrl": null,
"complete": false,
"tax": 1,
"username": null,
"discounts": [
{}
],
"coupons": [
{}
],
"giftcards": [
{}
],
"address": {
"name": "Ted Tebex",
"first_name": "Ted",
"last_name": "Tebex",
"address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
"email": "[email protected]",
"state_id": null,
"country": "UK",
"postal_code": "NW6 3QT"
},
"rows": [
{
"id": 173125385,
"basket": 725572301,
"package": null,
"override": 0,
"quantity": 2,
"server": null,
"price": 1.27,
"gift_username_id": null,
"options": null,
"recurring": false,
"recurring_period": null,
"recurring_next_payment_date": null,
"meta": {
"name": "1000 Gold",
"rowprice": 2.54,
"initialprice": 1.27,
"isCumulative": false,
"requiredPackages": [],
"requiresAny": false,
"category": false,
"producesGiftCard": false,
"allowsGiftCards": true,
"servers": [],
"limits": {
"user": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"global": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"packageExpiryTime": 0
},
"hasDeliverables": false,
"deliverableTypes": [],
"downloadLink": "",
"hasSellerProtection": true,
"itemType": null,
"revenue_share": [],
"image": null,
"realprice": 1.27
},
"custom": null,
"image_url": null,
"recurring_price": null
}
],
"fingerprint": "",
"creator_code": "text",
"roundup": false,
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}This will remove the given {rows.id} from the basket {ident}. The basket must be re-fetched after running to receive updated totals.
The basket identifier.
1a-55fff4107740a1f40d844ff89607557f45bfafb3The id of the basket.rows row to remove.
1Successfully deleted a row from the basket.
Row or basket not found.
DELETE /api/baskets/{ident}/packages/{rows.id} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
No content
Adds a Sale to the basket with {ident}. Sales cannot be applied to baskets with revenue_share set.
The basket identifier.
1a-55fff4107740a1f40d844ff89607557f45bfafb3The name of the sale (displayed to the customer)
Test SaleThe type of discount, either percentage for deducting a percentage of each item, or amount to deduct a fixed amount from each item.
amountPossible values: The amount or percentage to deduct
4.99Successfully adds sale to basket.
Bad request. Improperly formatted Sale or this basket cannot accept sales. See ErrorResponse.
Basket not found.
POST /api/baskets/{ident}/sales HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 59
{
"name": "Test Sale",
"discount_type": "amount",
"amount": 4.99
}{
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"expire": "2022-10-25 15:15:40",
"price": 1.27,
"priceDetails": {
"fullPrice": 1.4,
"subTotal": 1.27,
"discounts": [],
"total": 1.4,
"surcharges": [],
"tax": 0.13,
"balance": 0,
"sales": [],
"giftcards": [],
"roundUp": null
},
"isPaymentMethodUpdate": false,
"returnUrl": null,
"complete": false,
"tax": 1,
"username": null,
"discounts": [
{}
],
"coupons": [
{}
],
"giftcards": [
{}
],
"address": {
"name": "Ted Tebex",
"first_name": "Ted",
"last_name": "Tebex",
"address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
"email": "[email protected]",
"state_id": null,
"country": "UK",
"postal_code": "NW6 3QT"
},
"rows": [
{
"id": 173125385,
"basket": 725572301,
"package": null,
"override": 0,
"quantity": 2,
"server": null,
"price": 1.27,
"gift_username_id": null,
"options": null,
"recurring": false,
"recurring_period": null,
"recurring_next_payment_date": null,
"meta": {
"name": "1000 Gold",
"rowprice": 2.54,
"initialprice": 1.27,
"isCumulative": false,
"requiredPackages": [],
"requiresAny": false,
"category": false,
"producesGiftCard": false,
"allowsGiftCards": true,
"servers": [],
"limits": {
"user": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"global": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"packageExpiryTime": 0
},
"hasDeliverables": false,
"deliverableTypes": [],
"downloadLink": "",
"hasSellerProtection": true,
"itemType": null,
"revenue_share": [],
"image": null,
"realprice": 1.27
},
"custom": null,
"image_url": null,
"recurring_price": null
}
],
"fingerprint": "",
"creator_code": "text",
"roundup": false,
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}Gets the basket associated with the provided identifier.
The basket identifier.
1a-55fff4107740a1f40d844ff89607557f45bfafb3Successful response returns the basket.
The links.payment property is only returned if the basket has been paid for, and a payment exist with the complete/refund/chargeback status.
The links.checkout property is only returned if the basket has not been paid, and is the URL to send the customer to in order to complete payment.
Basket not found.
GET /api/baskets/{ident} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
"ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
"expire": "2022-10-25 15:15:40",
"price": 1.27,
"priceDetails": {
"fullPrice": 1.4,
"subTotal": 1.27,
"discounts": [],
"total": 1.4,
"surcharges": [],
"tax": 0.13,
"balance": 0,
"sales": [],
"giftcards": [],
"roundUp": null
},
"isPaymentMethodUpdate": false,
"returnUrl": null,
"complete": false,
"tax": 1,
"username": null,
"discounts": [
{}
],
"coupons": [
{}
],
"giftcards": [
{}
],
"address": {
"name": "Ted Tebex",
"first_name": "Ted",
"last_name": "Tebex",
"address": "37 Broadhurst Gardens, London, United Kingdom, NW6 3QT",
"email": "[email protected]",
"state_id": null,
"country": "UK",
"postal_code": "NW6 3QT"
},
"rows": [
{
"id": 173125385,
"basket": 725572301,
"package": null,
"override": 0,
"quantity": 2,
"server": null,
"price": 1.27,
"gift_username_id": null,
"options": null,
"recurring": false,
"recurring_period": null,
"recurring_next_payment_date": null,
"meta": {
"name": "1000 Gold",
"rowprice": 2.54,
"initialprice": 1.27,
"isCumulative": false,
"requiredPackages": [],
"requiresAny": false,
"category": false,
"producesGiftCard": false,
"allowsGiftCards": true,
"servers": [],
"limits": {
"user": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"global": {
"enabled": false,
"timestamp": 0,
"limit": false
},
"packageExpiryTime": 0
},
"hasDeliverables": false,
"deliverableTypes": [],
"downloadLink": "",
"hasSellerProtection": true,
"itemType": null,
"revenue_share": [],
"image": null,
"realprice": 1.27
},
"custom": null,
"image_url": null,
"recurring_price": null
}
],
"fingerprint": "",
"creator_code": "text",
"roundup": false,
"cancel_url": "https://tebex.io",
"complete_url": null,
"complete_auto_redirect": false,
"custom": {
"foo": "bar",
"ref": 1234
},
"links": {
"payment": "https://checkout.tebex.io/api/payments/tbx-12345",
"checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
}
}The recurring payment reference to fetch.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Successfully fetched recurring payment.
Recurring payment not found.
GET /api/recurring-payments/{reference} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}If the new subscription amount is higher than the existing amount, a pro-rata charge will be made to cover the cost of the new price up until the next billing date.
This endpoint requires prior approval - please contact your account manager.
The recurring payment reference to fetch.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Successfully updated subscription. The updated RecurringPayment is returned.
Bad Request.
Recurring payment not found.
PUT /api/recurring-payments/{reference} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 201
{
"items": [
{
"type": "subscription",
"qty": 1,
"revenue_share": [],
"package": {
"name": "1000 Gold",
"price": 1.27,
"type": "subscription",
"qty": 1,
"expiry_period": "month",
"expiry_length": 3,
"custom": {
"foo": "bar"
}
}
}
]
}{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}This cancels the recurring payment for the reference provided. Recurring payment references start with tbx-r-
The recurring payment reference to cancel.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Recurring payment cancelled successfully.
Recurring payment not found.
DELETE /api/recurring-payments/{reference} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}The recurring payment reference to update.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Your desired state of the recurring payment. Provide Paused with paused_until to pause a recurring payment. Otherwise, provide Active to resume a recurring payment.
PausedPossible values: To pause a payment, provide a ISO8601 formatted date on which the payment should be reactivated.
2025-01-27T16:43:53.000000ZSuccessfully paused or reactivated a payment. The RecurringPayment is returned.
Recurring payment not found.
Unprocessible Entity. An invalid status was provided or the recurring payment cannot be processed. See ErrorResponse.
PUT /api/recurring-payments/{reference}/status HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 64
{
"status": "Paused",
"paused_until": "2025-01-27T16:43:53.000000Z"
}{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}If the new subscription amount is higher than the existing amount, a pro-rata charge will be made to cover the cost of the new price up until the next billing date.
This endpoint requires prior approval - please contact your account manager.
The recurring payment reference to fetch.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Successfully updated subscription. The updated RecurringPayment is returned.
Bad Request.
Recurring payment not found.
PUT /api/recurring-payments/{reference} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 201
{
"items": [
{
"type": "subscription",
"qty": 1,
"revenue_share": [],
"package": {
"name": "1000 Gold",
"price": 1.27,
"type": "subscription",
"qty": 1,
"expiry_period": "month",
"expiry_length": 3,
"custom": {
"foo": "bar"
}
}
}
]
}{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}This cancels the recurring payment for the reference provided. Recurring payment references start with tbx-r-
The recurring payment reference to cancel.
tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3Recurring payment cancelled successfully.
Recurring payment not found.
DELETE /api/recurring-payments/{reference} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
"id": 5000,
"created_at": "2022-12-16T16:43:06.000000Z",
"updated_at": "2022-12-16T16:43:06.000000Z",
"paused_at": "2025-12-07T15:14:30.540Z",
"paused_until": "2025-12-07T15:14:30.540Z",
"next_payment_date": "2022-12-30T16:43:06",
"reference": "88",
"account_id": 1,
"interval": "P2W",
"cancelled_at": "2025-12-07T15:14:30.540Z",
"cancellation_requested_at": "2024-07-25 14:01:03",
"status": {
"id": 2,
"class": "success",
"description": "Active",
"active": 1
},
"amount": {
"amount": 7,
"tax": 1.4,
"period": "P2W"
},
"cancel_reason": "text",
"links": {
"initial_payment": "https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id",
"payment_history": [
"https://checkout.tebex.io/api/payments/tbx-123123aabccd123-bf71ad?type=txn_id"
]
}
}If you are using a custom or legacy store template, Tiered packages may not display properly once enabled on your store.
If you are using Exo or a Premium template, this guide does not apply.
For tiers to display on your store, create the following Assets:
category/tiered.html - HTML structure for a tiered category
quote.html - HTML confirmation page when updating a tier
Use the following examples to add Tiers support to your store:
{% extends "layout.html" %}
{% block content %}
<div class="site-content site-content-widgets" style="max-width: 1140px; margin: 0 auto; padding: 1rem;">
<main class="store-category-tiered">
<header class="store-category-tiered-header text-content">
<h2>{{ category.name }}</h2>
{% if category.description != "" %}
<p>{{ category.description|raw }}</p>
{% endif %}
</header>
{% if category.packages|length > 0 %}
<div class="store-products-tiered" style="display: flex; flex-wrap: wrap;">
{% for package in category.packages %}
<article
class="store-product store-product-tiered {{ (tier and tier.package_id == package.id) ? 'subscribed' : '' }}" style="display: flex; flex-direction: column; padding: 1rem;"
>
<img
class="image"
src="{{ package.image.url }}"
alt="{{ package.name }}"
/>
<h3 class="product-title">
{{ package.name }}
{% if package.countdownEnds %}
<span
class="countdown"
data-countdown="{{ package.countdownEnds }}"
>
{{__("Ending Soon!") }}
</span>
{% endif %}
</h3>
<div class="descr">
{{ package.description|raw }}
</div>
{% set packageIdentifier = package.identifier ? package.identifier : package.id %}
<div
class="actions product-actions"
style="margin-top: auto;"
data-package="{{ package.id }}"
data-package-type="{{ package.type }}"
{% if package.purchasable == false %}
title="{{ package.reason }}"
{% endif %}
>
<p class="price">
{% if package.customPrice %}
{{ __("You decide how much to pay.") }}
{% elseif package.price == 0.00 %}
<strong>{{ __("This item is free.") }}</strong>
{% else %}
{% if package.discount.applied %}
<del class="text-danger small font-weight-bold">{{ package.discount.original|money }}</del>
{% endif %}
<strong>{{ package.price|money }}</strong> {{ basket.currency }}
{% endif %}
</p>
{% if tier and tier.package_id == package.id %}
<button class="btn btn-tertiary wide" disabled>
{{ __("Subscribed") }}
</button>
{% elseif tier and tier.downgrade_package_id == package.id %}
<button class="btn btn-tertiary wide" disabled>
{{ __("Pending Downgrade") }}
</button>
{% elseif tier %}
<a
href="/tier/quote?category={{ category.id }}&package={{ package.id }}"
class="btn btn-primary wide"
{% if package.purchasable == false %}disabled{% endif %}
{% if package.basket %}hidden style="display: none;"{% endif %}
>
{{ __("Subscribe") }}
</a>
{% else %}
<a
href="/checkout/packages/add/{{ packageIdentifier }}/subscribe"
class="btn btn-primary subscribe wide"
{% if package.purchasable == false %}disabled{% endif %}
{% if package.basket %}hidden style="display: none;"{% endif %}
>
{{ __("Subscribe") }}
</a>
{% endif %}
<button
class="btn btn-secondary wide open-basket open-basket-cta"
{% if package.basket == false %}hidden style="display: none;"{% endif %}
>
{{ __("Added to Basket") }}
</button>
</div>
</article>
{% endfor %}
</div>
{% else %}
<p>{{ __("No packages to display in this category.") }}</p>
{% endif %}
</main>
</div>
{% endblock %}{% extends "layout.html" %}
{% block content %}
<main class="store-quote store-form" data-popup style="max-width: 1140px; margin: 0 auto; padding: 1rem; text-align: center;">
<div class="text-content">
<h2>Update Tier</h2>
{{ description|raw }}
</div>
<form method="post" action="/tier/update">
<input type="hidden" name="category_id" value="{{ category }}">
<input type="hidden" name="package_id" value="{{ package }}">
{% for k, v in options %}
<input type="hidden" name="options[{{ k }}]" value="{{ v }}">
{% endfor %}
<div class="actions quote-actions">
<a href="/category/{{category}}" class="btn btn-tertiary wide">
{{ __("Back") }}
</a>
<button type="submit" class="btn btn-primary wide confirm">
{{ __("Confirm") }}
</button>
</div>
</form>
</main>
{% endblock %}POST https://affiliate.tebex.io/api/referrals
This endpoint should be called when your customer requests that they want to install Tebex on their game server. It will send an email to the customer containing a link which allows them to setup their webstore and ensure your affiliate account is associated with the customer.
Authorization
string
Bearer <Your API Key>
link
string
The UUID of your referral link within your affiliate panel. You can find this on https://affiliate.tebex.io/links, under your Link name.
reference
string
A unique ID that references the customer's game server within your management panel. You will use this to identify the game server when we send the installation webhook.
game_type_id
number
The ID of the game type found within the game types endpoint.
server_name
string
The name of your customer's game server.
string
The email address of the customer.
last_name
string
The last name of the customer.
first_name
string
The first name of the customer.
{
"data": {
"reference": "123456",
"secret": null,
"game_type": {
"id": 1
},
"setup_at": null
}
}GET https://affiliate.tebex.io/api/referrals/:reference
Retrieve an existing referral. This method is useful for checking if a customer has created their webstore and can also be used to retrieve the plugin urls and locations of the premade config files.
reference
string
The reference provided when you created the referral.
Authorization
string
Bearer <Your API Key>
{
"data": {
"reference": "123456",
"secret": "9a6747fc6259aa374ab4e1bb03074b6ec672cf99",
"game_type": {
"id": 1,
"plugins": {
"bukkit": {
"platform": "bukkit",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/bukkit/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/bukkit"
},
"sponge": {
"platform": "sponge",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/sponge/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/sponge"
},
"bungeecord": {
"platform": "bungeecord",
"version": "10.2",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/10.2/bungeecord/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/bungeecord"
},
"forge": {
"platform": "forge",
"version": "12.0.1",
"url": "https://d2vpaemuugs53a.cloudfront.net/latest/minecraft-java/12.0.1/forge/BuycraftX.jar",
"config": "http://affiliate.tebex.io/api/referrals/123456/config/forge"
}
}
},
"setup_at": "2020-11-17T09:41:57+00:00"
}
}GET https://affiliate.tebex.io/api/referrals/:reference/config/:platform
Retrieve the premade config file for a specific platform (such as Minecraft Spigot or Forge). The config file will include the customer's secret key, removing any need of manual setup of the Tebex plugin on the server's behalf.
platform
string
The plugin platform such as bukkit or forge.
reference
string
The reference provided when you created the referral.
Authorization
string
Bearer <Your API Key>
#BuycraftX configuration file
push-commands=true
server-key=a8ba0940f9deb37b79d66fa19f8b36ba5df14fa2
verbose=false
disable-buy-command=false
check-for-updates=true
buy-command-name=buy
is-bungeecord=false
language=en-GBThe textbox module allows a store owner to define a module with arbitrary text.
module.header
string
The header of the module.
module.text
string
The content of the textbox module.
If you'd like access to a variable that is not currently available, please let us know.
Receive real time notifications of payments, subscriptions, and much more.
Webhooks enable you to receive notifications upon certain webstore events, for example when a new payment is made. We will send a HTTP request containing a JSON object to any configured endpoints that are subscribing to the respective event. Webhooks are a great way to integrate Tebex with your own website, forum or internal database.
Go to Developers > Webhooks > Endpoints.
Click Add Endpoint.
Enter the URL of your webhook endpoint.
Select the types of webhooks that you'd like to subscribe to.
Click Add.
After adding your endpoint, you will receive a warning to inform you that we haven't been able to validate endpoint. Please see the section below for further information about handling validation webhooks.
Webhooks will not be sent to an endpoint unless it has been validated first. This is to ensure we are not sending HTTP requests to URLs that are not expecting our webhooks.
The validation webhook that we send will look similar to the example below. To identify a validation webhook you can check the type property in the JSON body.
{
"id": "2c116b11-1110-91e0-b266-b792c8da5f11",
"type": "validation.webhook",
"date": "2021-08-24T12:21:47+00:00",
"subject": {}
}Upon receiving a validation webhook you must respond with a 200 OK response containing a JSON object that has an id property representing the validation webhook's ID, please see the example response below.
{
"id": "2c116b11-1110-91e0-b266-b792c8da5f11"
}Once your endpoint is setup to successfully handle validation webhooks, please visit Developers > Webhooks > Endpoints and click the Validate button next to the endpoint to re-send the validation webhook.
Webhooks from Tebex will only ever be sent from the two IP addresses listed below.
18.209.80.3 54.87.231.232
When building your webhook endpoint, we suggest that you check the IP address of the sender and throw a 404 Not Found error if the IP address isn't in the above list.
In addition to checking the IP address, we strongly advise that you verify the X-Signature header that we send with all requests.
The signature is generated by SHA256 hashing the JSON body and then building a SHA256 HMAC with the body hash as the data/content and your webhook secret as the key.
Your webhook secret is displayed on the Developers > Webhooks > Endpoints page. Please see our example code snippets below of how to generate the signature.
$json = file_get_contents('php://input');
$secret = "0d45982a10e3a072d0c1261c55dd9918";
$signature = hash_hmac('sha256', hash('sha256', $json), $secret);var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json({
verify: (req, res, buf) => {
req.rawBody = buf
}
}));
router.post('/webhook', function(req, res, next) {
const secret = 'xxxxxxxxxxx';
const bodyHash = crypto
.createHash('sha256')
.update(req.rawBody.toString(), 'utf-8')
.digest('hex');
const finalHash = crypto.createHmac('sha256', secret)
.update(bodyHash)
.digest('hex');
console.log('finalHash', finalHash)
// Compare hash...
});