Only this pageAll pages
Powered by GitBook
1 of 75

Developers

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Webstore Builder

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...

Headless API

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Checkout API

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Tebex.js

Loading...

Loading...

Loading...

Loading...

Loading...

Webhooks

Loading...

Loading...

Game Server API

Loading...

Loading...

Loading...

Affiliate API

Loading...

Loading...

Loading...

Loading...

Tebex for Unreal Engine 5

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 Plugin API

  • An example in-game Plugin

GitHub Repository:

When you're ready to start processing payments for your Unreal game, weโ€™d love to connect. to get started.

tebexio/Tebex-UE5
Reach out to us

Tebex for Unity Engine

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.

https://github.com/tebexio/Tebex-CSharp
https://github.com/tebexio/Tebex-Unity
Reach out to us

Welcome

Learn how to integrate Tebex and leave the complexities of monetization to us.

SDKs

Tebex offers many different ways to integrate with your existing infrastructure.

Official SDKs

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.

OpenAPI Schema

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.

Other SDKs / Integration Options

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 tebex-integrations@overwolf.com.

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.

Language
Package Manager
Link
API
Repository Link
Language
GitHub Repository
Support
quick start guide
reach out

Integration Methods

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.

Which integration method is best for me?

I want to sell packages that are dynamic in nature
I want to sell hundreds or thousands of packages through my own backend system
I want to sell physical goods or launch a marketplace

Tebex cannot support projects that aim to sell physical goods or provide marketplace services. If you are looking to pursue either of these options, we regret to inform you that we cannot collaborate in this capacity, and you will need to seek a payment partner elsewhere.

Let's begin!

Now that you've chosen your integration method, you can begin by exploring the relevant documentation:

Overview

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.

With the webstore builder, you can:

Examples

Browse examples of other Tebex stores for some inspiration.

Certified Tebex Designers

Feedback

Getting Started

PHP

Composer / Packagist

NodeJS

NPM

C#

N/A

Headless API

Checkout API

Nuxt.js

Official

Typescript

Third Party

PHP

Third Party

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, , and seamless inline checkout through .

I want to sell packages via a pre-built webstore that's hosted for me

If you're looking for a pre-built, hosted webstore, we recommend using the Tebex . This tool offers comprehensive package management through the Tebex creator panel, a fully customizable webstore displaying all your available packages, and a built-in add-to-cart feature. Webstores are seamlessly integrated with , our inline checkout solution. To see an example of a webstore created with the Webstore Builder, visit .

I want to sell packages from my own website or in-game

If you want to sell packages directly through your own website or in-game, while managing package creation, updates, and configuration via Tebex, the is the ideal solution. By integrating the Headless API with , you can offer a seamless checkout experience, allowing customers to make purchases without leaving your site.

If your packages require a high level of customization for each customer and cannot be created within the Tebex creator panel, the Checkout API is the ideal solution. For example, this could apply to packages with varying names, descriptions, pricing, or images tailored to individual customers. By integrating the Checkout API with , you can provide a smooth purchasing experience, allowing customers to complete transactions without leaving your website.

If you manage a large volume of packages that would be impractical to create manually in the Tebex creator panel, or if your package offerings update based on your internal inventory system, the is the optimal solution. By integrating the Checkout API with , you can offer a seamless purchasing experience, allowing customers to complete transactions without leaving your website.

Learn how to design your own store using the .

Sell packages directly from your website or in-game with the .

For more complex integrations, get started with the .

If you haven't already done so, we recommend having a read of our before continuing.

Use templates to change the HTML structure of each page and implement conditional logic via the .

Upload custom CSS, Javascript and images via .

If you're a template designer, you can offer your customers the ability to customise their templates via , and you're also eligible for free Plus via our .

If you're a designer who creates templates for others, either for free or to sell, ! 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, .

To create your first template, head over to the Appearance section within your .

https://packagist.org/packages/tebex/tebex-sdk-php
https://www.npmjs.com/package/@tebexio/tebex-sdk-nodejs
https://github.com/tebexio/Tebex-CSharp
https://github.com/tebexio/TebexHeadless-OpenAPI
https://github.com/tebexio/TebexCheckout-OpenAPI
tebexio/Headless-Template
Tynopia/tebex_headless
Nabla-Corporation/tebex_headless_php
webhooks
Tebex.js
Webstore Builder
Tebex.js
example.tebex.io
Headless API
Tebex.js
Tebex.js
Checkout API
Tebex.js
Webstore Builder
Headless API
Checkout API
quick start guide
TWIG templating engine
Assets
Config Schema
Developer Plan
let us know
please let us know
creator panel

Webstore Builder Easiest

โœ… Checkout

โœ… Package Management

Headless API Complex

โœ… Checkout

โœ… Package Management

Checkout API Advanced

โœ… Checkout

* Package Management

Getting Started

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.

1

Create a project

2

Setup your store or integrate our APIs

3

Create your packages

4

Implement product delivery

5

Make a test payment

Before going live, give everything a test run by going through the checkout process using the test payment method. Donโ€™t worry, no real money needed here!

6

Submit for review

Ready to roll? Submit your project for review by our Content & Safety team. Weโ€™ll give it a quick check, and if everything looks good, youโ€™ll be ready to launch within a day.

7

Go live

Getting Started

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.

Twig

Discover the power of the Twig templating engine used by Tebex.

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>

Filters

Modify variable values with Twig filters.

Filters enable you to modify the content of variables within your template.

Available Filters

Filter
Documentation

escape

length

raw

money

slice

number_format

date

nl2br

replace

split

upper

lower

Filter Documentation

money

The money filter transforms a variable into a monetary format.

{% set value = 1 %}

{{ value|money }} // returns 1.00

Functions

View the available functions within your Twig template.

Functions generate content for you to use within your templates.

Available Functions

Function
Documentation

__

_p

config

asset

path

query

range

Function Documentation

__

Returns the equivalent translation from within your translations settings.

{{ __('Redeem coupons / gift cards') }}

// prints "Redeems coupons / gift cards" (Or the equivalent translation if another language is selected)

_p

Returns the plural translation from within your translation settings.

{{ _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

{{ config("header-colour") }}

// prints the associated config value with the key header-colour

asset

Returns the full url path of an asset from within your template.

{{ asset("style.css") }}

// Prints the URL of style.css, such as https://your-store.tebex.io/template-assets/style.css"

path

Returns the full url path of the current page.

{{ path() }}

// Prints the full URL of the current page the customer is browsing on your store

query

Returns a GET parameter from the current url.

{{ query("test" }}

// Returns the GET param of "test" if it is provided in the URL.

Global Variables

Accessing global variables to help populate your template with live data.

Global variables are variables which are available across all pages of your store.

โœ… Hosted Webstore

* Hosted Webstore

* Hosted Webstore

Head over to the and kick things off by creating your first project.

Check out the docs for the youโ€™re going with. If needed, build the APIs into your website or game.

If your integration method requires it, your customers can buy.

Make sure your customers get their packages right away after theyโ€™ve made a purchase. For game studios, 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 for that.

Once youโ€™re approved, youโ€™re all set to go live and start making money from your game! Plus, with us as your Merchant of Record, youโ€™ll get access to worldwide payment methods, tax handling, and fraud protection. Nice!

For a live demonstration of Exo in action, visit .

Templates on the Tebex platform are written in the . 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 .

If you're interested in becoming a pro at the Twig syntax, you can complete the official .

If you'd like access to a TWIG filter that is not available below,

If you'd like access to a TWIG function that is not available below,

Returns a config value from your .

If you'd like access to a variable that is not currently available,

๐Ÿ˜Ž
๐ŸŽ‰
creator panel
integration method
create the packages
webhooks
official plugins
example.tebex.io
Twig Templating Engine
official documentation
Twig certification programme
please let us know.
please let us know.
template config schema
Webstore Builder Docs
Headless API Doc
s
Checkout API Docs
View
View
View
View
View
View
View
View
View
View
View
View
please let us know.
View
View
View
View
View
View
View

page

The global page object contains variables associated with the current http request.

Variables
Type
Description

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).

Request Variable

index.html

The index.html page is the homepage of your store.

Root Object

Variables
Type
Description

description

string

The homepage content of the store.

Request Variable

If you'd like access to a variable that is not currently available,

If you'd like access to a variable that is not currently available,

please let us know.
please let us know.

checkout.html

Receive an ident for Tebex.js

GET /checkout/ident

Response

{
    "ident":"null if customer is not logged in"
}

Using Tebex.js

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:

This endpoint will return an ident for the current basket, which is required by when launching a checkout modal.

To learn how to add Tebex.js to your store, please view the or view the demo over at .

Tebex.js
Add Tebex.js to your store
Tebex.js
associated documentation
https://js.tebex.io
Receive the current baskets ident
Launch the Tebex.js modal

store

The global store object contains all information associated with the project itself, such as store name.

Variables
Type
Description

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.

Request Variable

If you'd like access to a variable that is not currently available,

please let us know.

Pages

The entry point for each page on your store.

The only pages that are not accessible to the public are the following:

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 ).

If you'd like access to a variable that is not currently available,

Page

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.

Assets
please let us know.
Asset
Sidebar Modules

username.html

The username.html page is responsible for allowing your customers login to your store.

Root Object

Variables
Type
Description

external

Boolean

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.

External Login

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>

Non-External Login

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>

Full Working Example

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 %}

Request Variable

options.html

Root Object

Variables
Type
Description

options.package

An object containing information about the current package.

options.variables

Package Object

Variable
Type
Description

name

string

The name of the package.

chooseServer

boolean

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.

Variable Object

Variable
Type
Description

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

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.

Variable Option Object

Variable
Type
Description

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.

Request Variable

package.html

Root Object

Request Variable

cms/page.html

Root Object

Request Variable

module.communitygoal.html

Request Variable

module.featuredpackage.html

The featured package module allows you to feature a package, bringing more attention to it on your store.

Request Variable

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.

If you'd like access to a variable that is not currently available,

The options.html page is shown to the customer when adding a package that requires customisation, such as when you are using .

array[]

An array containing the the customer needs to select.

If the package requires the customer to select a .

array[]

If you'd like access to a variable that is not currently available,

The package.html page displays details about a specific on your store.

Variables
Type
Description

If you'd like access to a variable that is not currently available,

The cms/page.html page displays any that you have created on your store.

Variables
Type
Description

If you'd like access to a variable that is not currently available,

The community goal module displays the current progress of a community goal which you have configured within your creator panel on the section.

Variables
Type
Description

If you'd like access to a variable that is not currently available,

Variables
Type
Description

If you'd like access to a variable that is not currently available,

please let us know.
variables
please let us know.

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.

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.

layout.html

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:

layout.html

<!DOCTYPE html>
<html>
    <body>
        {% block content %}{% endblock %} {# The content of checkout.html will be shown #}
    </body>
</html>

checkout.html

{% extends "layout.html" %}

{% block content %}
    Hello, world!
{% endblock %}
variables
game server
package
please let us know.
custom pages
please let us know.
community goals
please let us know.
please let us know.
Non-External Login
Package Object
Variable
Variable Option

category.html

Root Object

Request Variable

Sidebar Modules

Dynamic modules to display useful information on your store.

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:

module.header

string

The header of the module.

module.package

The package to feature.

The category.html page lists the that are available to purchase in the current category being viewed on your store.

Variable
Type
Description

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,

Modules allow you to add dynamic modules on your store, which you can configure from within your creator panel on the section.

Please ensure to use the raw , as the modules variable contains HTML that will be escaped automatically by TWIG if this filter is not used.

Package Object
packages
please let us know.
{{ modules|raw }}
Package Objects
sidebar
filter

module.giftcardbalance.html

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.

Variables
Type
Description

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.

Request Variable

If you'd like access to a variable that is not currently available,

please let us know.

module.payments.html

The payments module allows you to display a selection of recent payments received from customers on your store.

Payment Object

Variable
Type
Description

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.

Request Variable

Variables
Type
Description

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.

If you'd like access to a variable that is not currently available,

please let us know.
Payment

module.goal.html

The goal module allows you to show a goal of how much money you'd like to earn over a specific period.

Variables
Type
Description

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.

Request Variable

If you'd like access to a variable that is not currently available,

please let us know.

module.textbox.html

The textbox module allows a store owner to define a module with arbitrary text.

Variables
Type
Description

module.header

string

The header of the module.

module.text

string

The content of the textbox module.

Request Variable

Tags

The available control structures within Twig.

Tags are control structures within Twig. They allow you to change the flow of code within your template.

Available Tags

Please ensure to use the raw on the module.text variable as it contains HTML and will be automatically escaped by TWIG if not used.

If you'd like access to a variable that is not currently available,

If you'd like access to a TWIG tag that is not available below,

Tag
Documentation
filter
please let us know.
please let us know.

Assets

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:

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:

This allows you to create code that is easily reusable across multiple locations in your template.

if

for

block

extends

include

set

View
View
View
View
View
View
<script defer src="{{ asset('scripts.js') }}"></script>
{% include "navigation.twig" %}

Package Slugs

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.

Template Changes

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.

Cover

Webstore Builder

Create custom store designs that perfectly align with your brand identity.

Cover

Headless API

Seamlessly integrate Tebex into your own website or directly within your game.

Cover

Checkout API

Create sophisticated and customized checkout experiences.

Cover

Tebex.js

A checkout experience that aligns with your brand, all without leaving your website.

Cover

Webhooks

Receive real-time notifications of payments to facilitate automatic product delivery.

Cover

Game Server API

Integrate automatic product delivery into your game server using our API or official plugins.

module.serverstatus.html

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.

Variables
Type
Description

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.

Request Variable

Schema

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.

Example Schema

{
  "author": "Tebex",
  "support_email": "support@tebex.io",
  "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"
        }
      ]
    }
  ]
}

Available Config Types

You're able to implement several different types of config options within your template schema, from colour pickers to text boxes.

Colour Picker

Displays a colour picker for selecting a custom HEX code.

{
   "id": "primary-colour",
   "name": "Primary Colour",
   "default": "#0000FF",
   "description": "Select your primary colour.",
   "type": "colour-picker"
}
File Uploader

Display a file upload option, useful for favicons, or other assets.

{
   "id": "my-file",
   "name": "My File",
   "default": "",
   "description": "Upload a file.",
   "type": "file"
}
Image Uploader

Display an image uploader config option.

{
   "id": "custom-image",
   "name": "Custom Image",
   "default": "",
   "description": "Upload an image here.",
   "type": "image-uploader"
}
Select

Display a select dropdown to allow the store to select from multiple 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"
    ]
}        
Slider

Display a slider to allow the store to select between a range of numbers - useful for customising.

{
   "id": "width",
   "name": "Button Width",
   "default": "",
   "description": "Select the width of buttons.",
   "type": "slider",
   "min": 0,
   "max": 100
}
Textarea
{
   "id": "header-box",
   "name": "Header Content",
   "default": "",
   "description": "Enter the text you'd like to appear in the header.",
   "type": "textarea"
}
Url
{
   "id": "discord-link",
   "name": "Discord Invite Link",
   "default": "",
   "description": "Enter the URL of your discord invite link.",
   "type": "url"
}

Accessing Config Options

basket

The global basket object contains all information relevant to the customers basket, such as price & packages.

Request Variable

Cover

Example Store

Cover

Hypixel

Footer

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:

  1. 100 payment method integrations

  2. Sales tax collection and remittance worldwide

  3. Fraud protection & our chargeback guarantee

  4. Easy to integrate product delivery for your game studio & server

Styling the footer to match your own brand

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:

An example of setting the CSS variables can be seen below, which you could place in your templates CSS file:

If you'd like access to a variable that is not currently available,

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 .

To dynamically access the config option from within your template you can use the 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.

Variables
Type
Description

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,

Variable
please let us know.
creator panel
please let us know.
config()

--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

:root {
  --tebex-legal-footer-background-color: #fcba03;
  --tebex-legal-footer-text-color: #4c00ff;
}
Tebex.js
https://example.tebex.io
https://store.hypixel.net

Adding Packages

When adding packages, there may be certain Variables associated with them. These can be filled by providing a variable_data object.

Deliverable Types and Variable Data

Gift Card

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:

Discord Action

Packages that deliver Discord actions should include the user's discord_id:

Game Server Commands

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.

Custom Data

You can also provide custom data when adding packages which can be referenced by the seller as part of the transaction.

Specifying the Package's Game Server

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.

"variable_data": {
    "variable_identifier": "value"
}
{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "giftcard_to": "tebex-integrations@overwolf.com"
    }
}
{
    "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"
    }
}
Tebex Control Panel

Overview

Tebex Headless API allows integration of your store directly into your own frontend or in-game.

The Headless API works with your existing packages, coupons, sales & creator codes.

You can query 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).

Headless API Flow

Packages & Listings

You can retrieve your store's listings in JSON format and display them however you wish:

Creating Baskets

In order to purchase items, a basket must be created for the customer. Create a basket and allow the customer to login with their username or other OAuth login mechanism (e.g Steam or FiveM).

Adding and Removing Packages

You can add or remove packages programmatically to the created basket via the API as needed when the user interacts with your application.

Coupons, Gift Cards, and Creator Codes

Once all packages and quantities are selected, apply any relevant coupons, gift cards, or creator codes with these endpoints.

Checkout

When the user is ready to checkout, fetch the basket and direct the user to the links.checkout URL.

Starter Template

Examples

The following websites are built using the Headless API - hosted via our customers own infrastructure, using frontend frameworks such as Vue or React.

Getting Your Listings

You can retrieve your packages & category listings in JSON format and display them however you wish.

Authenticated Requests

Guides

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:

module.topdonator.html

The top donator module allows you to display the highest spending customer on your store.

Request Variable

Creating a Basket

Depending on the type of Tebex store you are integrating, additional parameters may be necessary before the basket can be successfully created.

Authorizing Baskets

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.

Minecraft and Overwolf Stores

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.

Universal Stores

If you haven't already done so, we recommend having a read of our before beginning integration.

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.

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.

Variables
Type
Description

If you'd like access to a variable that is not currently available,

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 .

quick start guide
Tebex.js
Endpoints
tebexio/Headless-Template

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.

{
  "complete_url": "https://example.tebex.io/thank-you",
  "cancel_url": "https://tebex.io/",
  "custom": {
    "foo": "bar"
  },
  "complete_auto_redirect": true,
  "username": "TebexDev",
}
Package Slugs
please let us know.
Adding Packages

MCC Island

Power Scripts

Cover
Cover

Overview

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.

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.

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.

Terminology

Term
Description

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

Checkout API Flow

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.

Option 1. Using the Checkout 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:

Option 2. Using the Tebex Basket

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:

  1. 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.

  1. Add or remove packages from the customer's basket as desired.

  1. Add any desired sales / discounts to the basket

  1. Direct the user to the basket's links.checkout URL in order to complete payment.

  1. After payment is complete, you may verify payment if you wish by checking the links.payment URL associated with the customer's basket.

Recurring Payments

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.

OpenAPI Schema and SDKs

Postman Schema

Examples

The following websites are integrated using the Checkout API.

Applying Discounts / Creator Codes

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.

Developer Plan

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.

Gifting Packages

Gifting a Package to Another Player

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.

Gifting Example

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.

Directing to Checkout

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.

Endpoints

Webstores

Baskets

Categories

Package

Creator Codes

Gift Cards

Coupons

Adding / Removing Packages

Updating Quantities

If you haven't already done so, we recommend having a read of our before beginning integration.

The Checkout 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 implementing the Checkout API. This should be considered a general guideline. For a full list of endpoints available, see the page.

Tebex Checkout is documented with OpenAPI. To view the schema and available SDKs, see our on GitHub.

An importable Postman collection can always be downloaded from on GitHub.

If you'd like to apply to become a Tebex Certified Designer, .

If you'd like the user to stay on your site during checkout, use 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. .

https://store.mccisland.net
https://power-scripts.com
quick start guide
Tebex.js
Endpoints
releases
Tebex Checkout's repository
please apply here
{
    "package_id": "6276316",
    "target_username_id": "069a79f444e94726a5befca90e38aaf5"
}
{
    "package_id": "6276316",
    "target_username": "TebexDev"
}
Tebex.js
Read more here

Lunarclient

Cover

Start the Checkout Process

When you are ready to redirect the customer to checkout, there are two ways of beginning the checkout experience:

1. Embedded - via Tebex.js

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.

2. External - via Redirect

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.

Headers and Authentication

As a creator using Checkout API, you must authenticate directly with the API as opposed to individual customers authenticating.

Authorization

We use HTTP BASIC for authorization, and all requests are made over HTTPS so that your credentials are protected.

Username (Project ID)

Password (Private Key)

Your store's Private Key should never be shared publicly. If your key is ever compromised, it can be reset in your Webstore panel.

Content Type

All requests use application/json as the Content-Type. Ensure this is set with all requests to our Checkout API.

Example

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);
// etc

Checkout Webhooks

Your server can receive Webhooks from Tebex after events occur on our platform (successful payment, refunds, etc.)

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.

Head over to the to get started.

Your Project ID (you can get this from )

Your Private Key (you can get this from )

Please see our for a guide on working with Webhooks.

https://store.lunarclient.com/
Tebex.js documentation
https://creator.tebex.io/developers/api-keys
https://creator.tebex.io/developers/api-keys
Webhooks Overview

Endpoints

Overview

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.

Demo

You can experience a live demo of Tebex.js by heading over to or taking a look at the gallery below.

Upselling
Payment Methods
https://js.tebex.io

Web Components

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:

<html>
    <head>
        <script defer src="https://js.tebex.io/v/1.js"></script>
    </head>
    <body>
        <tebex-checkout></tebex-checkout>
    </body>
</html>

Due to Web Component quirks, you must include both opening and closing HTML tags (like <tebex-checkout></tebex-checkout>). Using a self-closing tag (<tebex-checkout/>) is not valid.

Modes

Two modes are available for tebex-checkout:

Popup Mode

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:

<tebex-checkout ident="...">
    <button>Open Checkout</button>
</tebex-checkout>

You don't have to use a button here, it could be any HTML - styled however you see fit - as long as it's clickable!

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:

<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>

Inline Mode

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:

<tebex-checkout inline ident="..." height="800"></tebex-checkout>

Common Attributes

Attribute
Details

ident

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.

For example:

<tebex-checkout theme="dark" color-primary="#ff0000"></tebex-checkout>

Framework Integration

Example

In Vue, this is how you could include an inline tebex-checkout component and call a function when the payment complete event fires:

<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>

As an alternative to using the Tebex.checkout JavaScript API, Tebex.js also provides a 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 .

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 .

HTML attributes take the place of 's config options, along with a couple of extra options:

Required. This should be the checkout request ident received via the or .

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.

Web Component
skip component resolution
Tebex.checkout.launch()
Tebex.checkout.render()
Tebex.checkout.init()
Headless API
Checkout API

Login Webhooks

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.

Please only use this feature if you know how to use it, incorrectly using this system (such as using a Discord webhook) will prevent customers from logging in to your store.

How To Setup Player Verification

  1. Go to Webhooks.

Accepting Notifications And Returning A Response

Example Request

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=US

Request Query Parameters

  1. ign - The username of the customer attempting to log in.

  2. ip - The IP address of the customer attempting to log in.

  3. country - The country code of the customer (Based on GEO locating their IP address).

Example Response

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."
}
โ€‹

Integration

Tebex.js enables you to integrate a seamless checkout experience for customers without them leaving your website or game.

Installation

From NPM

Tebex.js is available as an NPM package, which you can install using your preferred JS package manager:

npm install @tebexio/tebex.js

The Tebex object can then be imported into your code like so:

import Tebex from "@tebexio/tebex.js";

From Our CDN

Alternatively, we also provide Tebex.js via our own CDN, which you can add as a script within the <head> tag of your website:

<script defer src="https://js.tebex.io/v/1.js"></script>

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:

<script>
    addEventListener("load", function() {
        // Configure Tebex.js here
    });
</script>

Config

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:

Tebex.checkout.init({
    ident: "checkout request ident"
});

Options

Option
Details
Default

ident

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

[]

You're able to retrieve the checkout request ident by using the {{ basket.ident }} global Twig variable if you are using a Tebex hosted webstore.

Brand Color Config

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:


Tebex.checkout.init({
    //..
    colors: [
        {
            name: "primary",
            color: "#910f0f",
        },
        {
            name: "secondary",
            color: "#25c235"
        }
    ]
});

Launch

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:

<!-- 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>

Custom Render Location

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():

Enter the full URL of your endpoint in the login webhooks config box, for example, . You can use any programming language to create your endpoint as long as it returns the response as listed below.

We will automatically update v/1.js with new minor and patch releases of Tebex.js. This shouldn't present any breaking changes, but if you would prefer to stay on a fixed version, you can specify the full version number in the URL, for example https://js.tebex.io/v/1.1.1.js. Our version history can be found on our releases page.

Required. This should be the checkout request ident received via the , or .

Checkout .

http://example.com/tebex/verification.php
GitHub
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
);
Webstore Builder
Headless API
Checkout API
brand colors

Errors

We also use standardised HTTP response codes to describe each error:

  1. 400 Bad Request - User data validation error

  2. 401 / 403 - Authentication / Authorization (depending on if it's pre- or post- authentication

  3. 404 - Requested resource doesn't exist

  4. 5xx - Server side transitory errors.

{
  "type": "Not Found",
  "title": "Resource not found",
  "status": 404,
  "detail": "The requested resource does not exist.",
  "instance": "/account/12345"
}

Overview

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've created an SDK or game server plugin, please send an email to support@tebex.io and we'd be happy to showcase it on this site.

Official Game Server Plugins

The source code for these plugins can also be found in the following GitHub repositories:

RCON Adapter

Overview

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.

How To Setup Webhooks Endpoints

  1. Go to Developers > Webhooks > Endpoints.

  2. Click Add Endpoint.

  3. Enter the URL of your webhook endpoint.

  4. Select the types of webhooks that you'd like to subscribe to.

  5. 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.

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.

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.

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.

Verifying Webhook Authenticity

IP Address

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.

Signature

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.

If the signature that you generate doesn't match the X-Signature header, please disregard the webhook because it is not from Tebex.

Some frameworks such as Express (Node.js) automatically parse JSON request bodies which can result in a signature mismatch. Please ensure the signature is calculated using the raw request body and not a parsed version of the body.

Handling Webhooks

All of our webhooks are sent using the standardised format with the following properties:

When handling a webhook, please ensure you respond with a 2XX status code (anywhere between 200-299). If your endpoint responds with any other status code we will automatically try to resend the webhook later-on.

After several attempts of retrying we will mark the webhook as failed and your endpoint may require validating again.

Webhook Types

  • payment.completed Sent when a payment is completed.

  • payment.declined Sent when a payment is declined.

  • payment.refunded Sent when a payment is refunded.

  • payment.dispute.opened Sent when a dispute is opened against a payment.

  • payment.dispute.won Sent when a dispute against a payment is won.

  • payment.dispute.lost Sent when a dispute against a payment is lost.

  • payment.dispute.closed Sent when a dispute against a payment is closed.

  • recurring-payment.started Sent when a recurring payment starts.

  • recurring-payment.renewed Sent when a recurring payment renews.

  • recurring-payment.ended Sent when a recurring payment ends and the purchased products should be revoked from the customer.

  • recurring-payment.cancellation.requested Sent when a customer requests to cancel a recurring payment. The cancellation will take place at the end of the current billing period (i.e. when renewal would typically occur) and a recurring-payment.ended webhook will be sent.

  • recurring-payment.cancellation.aborted Sent when a customer aborts the outstanding cancellation request. The recurring payment will renew as normal.

  • validation.webhook Sent when initially adding a new webhook endpoint.

Webhook Subjects

Useful Status IDs

Decline Reasons

Useful Status IDs

Testing Webhooks

Our webhook testing feature allows you to manually trigger webhooks from your control panel. Please follow the steps below to send a test webhook.

  1. Navigate to Developers > Webhooks in your control panel.

  2. Click the Send Test button.

  3. Choose the type of webhook you'd like to send.

  4. Provide a valid transaction ID if you've selected a payment webhook type, or enter a recurring payment reference if you've chosen a recurring payment webhook type.

  5. Click the Send Test button.

Events

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:

Available events are as follows:

All errors returned by the Tebex Checkout APIs follow the RFC 7807 standard ().

If you haven't already done so, we recommend having a read of our before beginning integration.

You can download compiled versions of the official plugins that implement this API from the section of the creator panel.

If we don't have a plugin available for your game you're also able to make use of the .

id: This property represents the unique ID of the webhook. : The type of webhook we are sending, for example payment.completed. date: This is the date that the webhook was generated. : The data within this property will differ depending on the type of webhook. To view the different subject formats please see the subject types below.

ID
Status
Code
Message
ID
Status
Description
Active

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 instead.

Name
Fired Upon

All events that can be listened to with are exposed on the element as custom DOM events, which means you can use addEventListener to subscribe to them:

https://datatracker.ietf.org/doc/html/rfc7807#section-3.1
quick start guide
Game Servers
BuycraftX (Minecraft: Java Edition)
Tebex-Oxide (Rust, 7 Days To Die and Hurtworld)
Tebex-Ark (ARK: Survival Evolved)
Tebex-FiveM (FiveM / GTA V)
Tebex-Forge
Tebex-uMod
Tebex-Atlas
Tebex-TorchAPI
Tebex-Gmod
Tebex-Unturned
Tebex-Arma3
RCON Adapter
{
  "id": "2c116b11-1110-91e0-b266-b792c8da5f11",
  "type": "validation.webhook",
  "date": "2021-08-24T12:21:47+00:00",
  "subject": {}
}
{
  "id": "2c116b11-1110-91e0-b266-b792c8da5f11"
}
$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...
});
{
  "transaction_id": "tbx-xxxxxxxx",
  "status": {
    ,
    "description": "Refund"
  },
  "payment_sequence": "oneoff",
  "created_at": "2021-08-19T13:03:30.000000Z",
  "price": {
    "amount": 13.2,
    "currency": "GBP"
  },
  "price_paid": {
    "amount": 13.2,
    "currency": "GBP"
  },
  "payment_method": {
    "name": "PayPal",
    "refundable": true
  },
  "fees" : {
    "tax" : {
      "amount" : 0,
      "currency" : "USD"
    },
    "gateway" : {
      "amount" : 0.73,
      "currency" : "USD"
    }
  },
  "customer": {
    "first_name": "Test",
    "last_name": "Test",
    "email": "test@test.com",
    "ip": "1.2.3.4",
    "username": {
      "id": "1234",
      "username": "Test"
    },
    "marketing_consent": true,
    "country": "GB",
    "postal_code": "TE57 1NG"
  },
  "products": [
    {
      "id": 4,
      "name": "Example Package",
      "quantity": 1,
      "base_price": {
        "amount": 11,
        "currency": "GBP"
      },
      "paid_price": {
        "amount": 11,
        "currency": "GBP"
      },
      "variables": [
        {
          "identifier": "server",
          "option": "3"
        }
      ],
      "expires_at": null,
      "custom": null,
      "username": {
        "id": "1234",
        "username": "Test"
      }
    }
  ],
  "coupons": [],
  "gift_cards": [],
  "recurring_payment_reference": null,
  "decline_reason": {
    ,
    "message": "You entered incorrect card information. Please check your card details are correct and then try again."
  }
}

1

Complete

2

Refund

3

Chargeback

18

Declined

19

Pending Checkout

21

Refund Pending

rejected

The payment method was declined by the customers payment method provider. We recommend asking the customer to contact their bank/provider to have this issue resolved.

fraud_card_issuer

The payment method was declined by the customers card issuer or their bank due to suspected fraud. We recommend asking the customer to contact their bank to have this issue resolved.

fraud_tebex

Tebex implements artificial intelligence to determine if a transaction is fraudulent. Based on the data we have collected, we have decided this transaction to be too risky to accept. Do not tell the customer that they have been blocked due to fraud.

incorrect_card_information

The customer has entered incorrect card details during the checkout process. Please advise the customer to try again with the correct details.

network_failure

There was a failure in the payment network. Please advise the customer to try again later.

insufficient_funds

The payment method was declined due to the customer having insufficient funds.

fraud_history

Tebex reviews the fraud history of customers as part of our fraud assessment. Based on the data we have collected, the fraud history of this customer makes this transaction too risky to accept. Do not tell the customer that they have been blocked due to fraud.

{
  "reference": "tbx-r-xxxxx",
  "created_at": "2021-08-23T11:33:51.000000Z",
  "next_payment_at": "2021-09-23T11:34:13.000000Z",
  "status": {
    ,
    "description": "Cancelled"
  },
  "initial_payment": ,
  "last_payment": ,
  "fail_count": 0,
  "price": {
    "amount": 20,
    "currency": "GBP"
  },
  "cancelled_at": "2021-08-24T14:46:05.000000Z",
  "cancel_reason": "Cancelled by webstore on request"
}

2

Active

The recurring payment is active.

3

Overdue

We couldn't charge the customer for the renewal, but we will automatically retry tomorrow.

4

Expired

After multiple attempts, we couldn't renew the recurring payment.

5

Cancelled

The recurring payment has been cancelled as requested by the creator/customer.

7

Pending Downgrade

Only applies to recurring payments for packages in Tiered Categories:

The customer has requested to downgrade their recurring payment to a lower priced package.

Tebex.checkout.on("payment:complete", (event) => {
    console.log("Payment completed!", event);
});

"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.

<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>

Error Handling

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.

Referrals

Create Referral

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.

Headers

Name
Type
Description

Authorization

string

Bearer <Your API Key>

Request Body

Name
Type
Description

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.

email

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 Referral

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.

Path Parameters

Name
Type
Description

reference

string

The reference provided when you created the referral.

Headers

Name
Type
Description

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 Referral Config File

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.

Path Parameters

Name
Type
Description

platform

string

The plugin platform such as bukkit or forge.

reference

string

The reference provided when you created the referral.

Headers

Name
Type
Description

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-GB

Game Types

Get Game Types

GET https://affiliate.tebex.io/api/game-types

Retrieve a list of all games that the Tebex Platform supports.

Headers

Name
Type
Description

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"
    }
  ]
}

Webhooks

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:

  1. Download the Tebex plugin and install it onto the game server using the provided url.

  2. 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).

  3. Restart the game server to allow the Tebex Plugin to notify us that the plugin has been installed and authenticated against the webstore.

Setup Your Webhook URL

You can specify the url of your webhook handler (such as serverhost.com/tebex.php) within the settings section of your affiliate control panel.

Authentication

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";
}

Example Webhook Notification

{
    "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"
}
Webhooks
type
subject
Tebex.checkout.on()

Authentication

How to authenticate when accessing the Game Server API.

Supply the secret key by setting the X-Tebex-Secret header in all requests to the API.

Please note that all requests to the API must be sent via HTTPS.

Overview

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.

Integration Example

  1. Your customers click Install Tebex within your server management panel.

  2. You send an API request to Tebex alerting us of the customers request.

  3. We send an email to the customer with a link that allows them to create a webstore.

  4. 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).

  5. 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.

Requirements

To ensure you receive JSON responses, please provide an Accept: application/json header with all API requests.

To access the Plugin API, all requests need to be authenticated via a Game Server secret key which is found in the of your creator panel.

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 .

game servers section
contact
Settings page

Gets all categories available in the webstore.

get

Gets all categories from a webstore. This does not include package information. To include package information, add ?includePackages=1 to the URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

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

get

Gets all categories from a webstore including packages.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

Gets information about a specific category

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category without package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category without package information.

{
  "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"
    }
  ]
}

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

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category with package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category with package information.

{
  "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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets a package from a webstore by ID.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
packageIdnumberRequired

The package's ID.

Example: 1272441812
Responses
200
Successful response returns the package information.
application/json
get
GET /api/accounts/{token}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the package information.

{
  "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"
    }
  ]
}

Fetch all packages from a webstore

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of package information.
application/json
get
GET /api/accounts/{token}/packages HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of package information.

{
  "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 authentication links for a basket.

get

Fetches a basket's auth URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
returnUrlstringRequired

The URL you would like to redirect the user to after successful basket authentication.

Example: https://example.tebex.io/
Responses
200
Successful response returns the basket auth information.
application/json
422
The provided webstore ID or basket ID is invalid.
get
GET /api/accounts/{token}/baskets/{basketIdent}/auth HTTP/1.1
Host: headless.tebex.io
Accept: */*
[
  {
    "name": "FiveM",
    "url": "https://ident.tebex.io/"
  }
]

Remove a creator code from the basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Creator code removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Remove a coupon from the basket.

post

Removes a coupon code from a basket

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/coupons/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Fetch a basket from a webstore by its identifier

get

Gets a basket associated with the provided identifier.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response returns the basket information.
application/json
get
GET /api/accounts/{token}/baskets/{basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the basket information.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Gets all categories available in the webstore.

get

Gets all categories from a webstore. This does not include package information. To include package information, add ?includePackages=1 to the URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

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

get

Gets all categories from a webstore including packages.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

Gets information about a specific category

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category without package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category without package information.

{
  "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"
    }
  ]
}

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

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category with package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category with package information.

{
  "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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets a package from a webstore by ID.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
packageIdnumberRequired

The package's ID.

Example: 1272441812
Responses
200
Successful response returns the package information.
application/json
get
GET /api/accounts/{token}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the package information.

{
  "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"
    }
  ]
}

Fetch all packages from a webstore

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of package information.
application/json
get
GET /api/accounts/{token}/packages HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of package information.

{
  "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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
ipAddressstringRequired

An IP address can be provided with authenticated requests.

Example: 127.0.0.1
Responses
200
Successful response returns a list of package information.
application/json
422
The provided request is invalid.
get
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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
ipAddressstringRequired

An IP address can be provided with authenticated requests.

Example: 127.0.0.1
Responses
200
Successful response returns a list of package information.
application/json
422
The provided request is invalid.
get
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 authentication links for a basket.

get

Fetches a basket's auth URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
returnUrlstringRequired

The URL you would like to redirect the user to after successful basket authentication.

Example: https://example.tebex.io/
Responses
200
Successful response returns the basket auth information.
application/json
422
The provided webstore ID or basket ID is invalid.
get
GET /api/accounts/{token}/baskets/{basketIdent}/auth HTTP/1.1
Host: headless.tebex.io
Accept: */*
[
  {
    "name": "FiveM",
    "url": "https://ident.tebex.io/"
  }
]

Remove a creator code from the basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Creator code removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Remove a coupon from the basket.

post

Removes a coupon code from a basket

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/coupons/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Fetch a basket from a webstore by its identifier

get

Gets a basket associated with the provided identifier.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response returns the basket information.
application/json
get
GET /api/accounts/{token}/baskets/{basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the basket information.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Fetch a webstore by its identifier

get

Gets the webstore associated with the provided identifier.

Path parameters
tokenstringRequired

The webstore identifier.

Example: some-uuid
Responses
200
Successful response returns the webstore's information.
application/json
get
GET /api/accounts/{token} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the webstore's information.

{
  "data": {
    "schema": {
      "id": 1,
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris fermentum eget tellus et cursus. Pellentesque vel vehicula velit, sit amet tincidunt diam. Aliquam sit amet fermentum lorem.</p>",
      "name": "Minecraft Store",
      "webstore_url": "https://example.tebex.io",
      "currency": "USD",
      "lang": "en",
      "logo": "https://example.com",
      "platform_type": "Minecraft: Java Edition",
      "platform_type_id": "minecraft",
      "created_at": "2023-05-25T09:49:37+00:00"
    }
  }
}

Fetch the custom pages associated with the store.

get

Gets a list of custom pages associated with the webstore. These contain a content variable with the HTML content of the page.

Path parameters
tokenstringRequired

The webstore identifier.

Example: some-uuid
Responses
200
Successful response returns the webstore's pages.
application/json
get
GET /api/accounts/{token}/pages HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the webstore's pages.

{
  "data": [
    {
      "id": 127,
      "created_at": "2023-11-13T20:59:54.000000Z",
      "updated_at": "2023-11-13T20:59:54.000000Z",
      "account_id": 244,
      "title": "About",
      "slug": "about",
      "private": false,
      "hidden": false,
      "disabled": false,
      "sequence": false,
      "content": "<p>This is a custom page which you can add your own content to if you wish.</p>\n\n<p>You can modify your pages by going to <strong>Webstore</strong> &gt; <strong>Pages</strong> from within the\nTebex Store control panel.</p>\n\n<p>Make sure to take a look at our <a href=\"https://help.tebex.io\" rel=\"noreferrer\" target=\"_blank\">knowledgebase</a>\nfor helpful guides on getting started.</p>"
    }
  ]
}

Fetch a basket from a webstore by its identifier

get

Gets a basket associated with the provided identifier.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response returns the basket information.
application/json
get
GET /api/accounts/{token}/baskets/{basketIdent} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the basket information.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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 authentication links for a basket.

get

Fetches a basket's auth URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
returnUrlstringRequired

The URL you would like to redirect the user to after successful basket authentication.

Example: https://example.tebex.io/
Responses
200
Successful response returns the basket auth information.
application/json
422
The provided webstore ID or basket ID is invalid.
get
GET /api/accounts/{token}/baskets/{basketIdent}/auth HTTP/1.1
Host: headless.tebex.io
Accept: */*
[
  {
    "name": "FiveM",
    "url": "https://ident.tebex.io/"
  }
]

Gets all categories available in the webstore.

get

Gets all categories from a webstore. This does not include package information. To include package information, add ?includePackages=1 to the URL.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

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

get

Gets all categories from a webstore including packages.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of category information.
application/json
get
GET /api/accounts/{token}/categories HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of category information.

{
  "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"
    }
  ]
}

Gets information about a specific category

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category without package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category without package information.

{
  "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"
    }
  ]
}

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

get

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

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
categoryIdstringRequired

The ID of the category to fetch.

Example: 127244343
Responses
200
Successful response returns the category with package information.
application/json
get
GET /api/accounts/{token}/categories/{categoryId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the category with package information.

{
  "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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets a package from a webstore by ID.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
packageIdnumberRequired

The package's ID.

Example: 1272441812
Responses
200
Successful response returns the package information.
application/json
get
GET /api/accounts/{token}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns the package information.

{
  "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"
    }
  ]
}

Fetch all packages from a webstore

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Responses
200
Successful response returns a list of package information.
application/json
get
GET /api/accounts/{token}/packages HTTP/1.1
Host: headless.tebex.io
Accept: */*
200

Successful response returns a list of package information.

{
  "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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
ipAddressstringRequired

An IP address can be provided with authenticated requests.

Example: 127.0.0.1
Responses
200
Successful response returns a list of package information.
application/json
422
The provided request is invalid.
get
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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response returns a list of package information.
application/json
422
The provided request is invalid.
get
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"
    }
  ]
}

Fetch a package from a webstore by its identifier

get

Gets all packages from a webstore.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
ipAddressstringRequired

An IP address can be provided with authenticated requests.

Example: 127.0.0.1
Responses
200
Successful response returns a list of package information.
application/json
422
The provided request is invalid.
get
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"
    }
  ]
}

Remove a creator code from the basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Creator code removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/creator-codes/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Remove a coupon from the basket.

post

Removes a coupon code from a basket

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Responses
200
Successful response.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
POST /api/accounts/{token}/baskets/{basketIdent}/coupons/remove HTTP/1.1
Host: headless.tebex.io
Accept: */*

No content

Create a new basket

post

Creates a new basket for use during checkout.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Body
complete_urlstringOptional

A URL the user can return to when checkout is completed.

Example: https://example.tebex.io/thank-you
cancel_urlstringOptional

A URL the user can return to when cancelling checkout.

Example: https://tebex.io/
customobjectOptional

Custom data you wish to associate with the basket. This data will be included with webhook responses and GET requests associated with the Basket.

Example: {"foo":"bar"}
complete_auto_redirectbooleanOptional

True if the user should automatically be redirected to the relevant complete/cancel URL

Example: true
Responses
200
Successful response returns the basket information.
application/json
422
The provided webstore ID is invalid.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Add a package to a basket

post

Add a package with the given ID to the basket.

Path parameters
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
package_idstringOptionalExample: 6276316
quantitynumberOptionalExample: 1
Responses
200
Successful response.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
  "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"
  }
}

Remove a package from a basket

post

Remove the given package ID from the basket.

Path parameters
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
package_idstringOptionalExample: 6276316
Responses
200
Successful response returns the basket.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
  "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"
  }
}

Apply a creator code to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
creator_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Apply a gift card to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Remove a gift card from the basket.

post

Removes a gift card from the basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Gift card removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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"
}

No content

Apply a coupon to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
coupon_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Create a new basket

post

Creates a new basket for use during checkout.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Body
complete_urlstringOptional

A URL the user can return to when checkout is completed.

Example: https://example.tebex.io/thank-you
cancel_urlstringOptional

A URL the user can return to when cancelling checkout.

Example: https://tebex.io/
customobjectOptional

Custom data you wish to associate with the basket. This data will be included with webhook responses and GET requests associated with the Basket.

Example: {"foo":"bar"}
complete_auto_redirectbooleanOptional

True if the user should automatically be redirected to the relevant complete/cancel URL

Example: true
Responses
200
Successful response returns the basket information.
application/json
422
The provided webstore ID is invalid.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Apply a creator code to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
creator_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Apply a gift card to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Remove a gift card from the basket.

post

Removes a gift card from the basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Gift card removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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"
}

No content

Apply a coupon to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
coupon_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Create a new basket

post

Creates a new basket for use during checkout.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
Body
complete_urlstringOptional

A URL the user can return to when checkout is completed.

Example: https://example.tebex.io/thank-you
cancel_urlstringOptional

A URL the user can return to when cancelling checkout.

Example: https://tebex.io/
customobjectOptional

Custom data you wish to associate with the basket. This data will be included with webhook responses and GET requests associated with the Basket.

Example: {"foo":"bar"}
complete_auto_redirectbooleanOptional

True if the user should automatically be redirected to the relevant complete/cancel URL

Example: true
Responses
200
Successful response returns the basket information.
application/json
422
The provided webstore ID is invalid.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Apply a creator code to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
creator_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
    "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"
    }
  }
}

Apply a gift card to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Remove a gift card from the basket.

post

Removes a gift card from the basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
card_numberstringOptionalExample: 0127 0244 7210 1111
Responses
200
Gift card removed successfully.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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"
}

No content

Apply a coupon to a basket.

post

Applies a creator code to a basket.

Path parameters
tokenstringRequired

The webstore identifier.

Example: t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cb
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
coupon_codestringOptionalExample: Academy10
Responses
200
Successful response returns the basket.
application/json
post
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"
}
200

Successful response returns the basket.

{
  "data": {
    "id": 244127617,
    "ident": "1a-55fff4107740a1f40d844ff89607557f45bfafb3",
    "complete": false,
    "email": "support@tebex.io",
    "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"
    }
  }
}

Add a package to a basket

post

Add a package with the given ID to the basket.

Path parameters
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
package_idstringOptionalExample: 6276316
quantitynumberOptionalExample: 1
Responses
200
Successful response.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
  "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"
  }
}

Remove a package from a basket

post

Remove the given package ID from the basket.

Path parameters
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
Body
package_idstringOptionalExample: 6276316
Responses
200
Successful response returns the basket.
application/json
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
post
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": "support@tebex.io",
  "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"
  }
}

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

put

Sets the quantity of the given item in the basket.

Path parameters
basketIdentstringRequired

The basket identifier.

Example: c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2c
packageIdnumberRequired

The package identifier.

Example: 6276316
Body
quantitynumberOptionalExample: 1
Responses
200
Successful response.
422
The provided request is invalid. The error response will include detail as to which parameter failed validation.
put
PUT /api/baskets/{basketIdent}/packages/{packageId} HTTP/1.1
Host: headless.tebex.io
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "quantity": 1
}

No content

Remove a row from the basket

delete

This will remove the given {rows.id} from the basket {ident}. The basket must be re-fetched after running to receive updated totals.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
rows.idintegerRequired

The id of the basket.rows row to remove.

Example: 1
Responses
204
Successfully deleted a row from the basket.
404
Row or basket not found.
delete

No content

Fetch a basket by its identifier

get

Gets the basket associated with the provided identifier.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Successful 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.
application/json
404
Basket not found.
get

Fetch a recurring payment (subscription) by its reference

get
Authorizations
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Successfully fetched recurring payment.
application/json
404
Recurring payment not found.
get

Cancel a recurring payment

delete

This cancels the recurring payment for the reference provided. Recurring payment references start with tbx-r-

Authorizations
Path parameters
referencestringRequired

The recurring payment reference to cancel.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Recurring payment cancelled successfully.
application/json
404
Recurring payment not found.
delete

Fetch a basket by its identifier

get

Gets the basket associated with the provided identifier.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Successful 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.
application/json
404
Basket not found.
get

Remove a row from the basket

delete

This will remove the given {rows.id} from the basket {ident}. The basket must be re-fetched after running to receive updated totals.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
rows.idintegerRequired

The id of the basket.rows row to remove.

Example: 1
Responses
204
Successfully deleted a row from the basket.
404
Row or basket not found.
delete

No content

Fetch a payment by its transaction ID

get

This will fetch the given payment associated with this transaction id. Single payment transaction IDs begin with tbx-

Authorizations
Path parameters
txnIdstringRequired

The payment reference to fetch.

Example: tbx-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Payment fetched successfully.
application/json
404
Transaction not found.
get

Refund a payment by its transaction ID

post

This will refund the given payment associated with this transaction id.

Authorizations
Path parameters
txnIdstringRequired

The payment reference to refund.

Example: tbx-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Payment refunded successfully. The payment details are returned.
application/json
404
Payment not found.
422
The payment cannot be refunded. Payments can only be refunded when a payment's `status` is Completed.
post

Fetch a recurring payment (subscription) by its reference

get
Authorizations
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Successfully fetched recurring payment.
application/json
404
Recurring payment not found.
get

Cancel a recurring payment

delete

This cancels the recurring payment for the reference provided. Recurring payment references start with tbx-r-

Authorizations
Path parameters
referencestringRequired

The recurring payment reference to cancel.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
200
Recurring payment cancelled successfully.
application/json
404
Recurring payment not found.
delete

Create a checkout request

post

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.

Authorizations
Body
Responses
200
Successfully created basket. The basket will be returned with `links` containing the URLs you should direct the customer to in order to complete payment.
application/json
400
Bad Request. See ErrorResponse.
post
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": "example@tebex.io",
    "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": "example@tebex.io",
    "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"
  }
}

Create a basket that can be used to pay for items

post

This will create and return a Basket that can be paid for by redirecting the user to links.checkout

Authorizations
Body
return_urlstringOptional

The URL a customer can return to without completing checkout

Example: https://example.tebex.io/
complete_urlstringOptional

URL the customer can return to after completing payment

Example: https://example.tebex.io/complete
customobjectOptional

Any custom data to be passed through the request. This will be returned in a post-completion webhook.

Example: {"foo":"bar"}
first_namestringOptional

The first name of the customer

Example: Neil
last_namestringOptional

The last name of the customer

Example: McNeil
emailstringOptional

The email address of the customer

Example: example@tebex.io
expires_atstringOptional

An ISO8601 formatted date. After this date the basket cannot be used to checkout.

Example: 2025-01-27T18:09:51Z
complete_auto_redirectbooleanOptional

Automatically redirect to the complete_url provided

Example: true
countrystringOptional

An ISO 3166-1 alpha-2 character code representing the customer's country.

Example: US
creator_codestringOptional

The creator code is used to share a percentage of the payment with another party. See more about creator codes at https://docs.tebex.io/creators/tebex-control-panel/engagement/creator-codes

ipstringOptional

The IP address of the customer using this basket. Provide the IP if creating a basket on your server backend.

Example: 1.2.3.4
Responses
200
Basket created successfully
application/json
post
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": "example@tebex.io",
  "expires_at": "2025-01-27T18:09:51Z",
  "complete_auto_redirect": true,
  "country": "US",
  "creator_code": null,
  "ip": "1.2.3.4"
}
200

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": "example@tebex.io",
    "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"
  }
}

Add a package to the basket

post

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.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Body
qtyintegerOptional

The quantity of package in this basket. This is not the total quantity of overall items in the basket.

Example: 2
typestring ยท enumOptional

The type of payment, either single for one-time payments or subscription.

Example: singlePossible values:
Responses
200
Package is successfully added to the basket, and basket is returned.
application/json
400
Improperly formatted package. See ErrorResponse.
404
Basket not found.
post
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": "example@tebex.io",
    "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"
  }
}
DELETE /api/baskets/{ident}/packages/{rows.id} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*

Add a sale to the basket

post

Adds a Sale to the basket with {ident}. Sales cannot be applied to baskets with revenue_share set.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Body
namestringOptional

The name of the sale (displayed to the customer)

Example: Test Sale
discount_typestring ยท enumOptional

The type of discount, either percentage for deducting a percentage of each item, or amount to deduct a fixed amount from each item.

Example: amountPossible values:
amountnumberOptional

The amount or percentage to deduct

Example: 4.99
Responses
200
Successfully adds sale to basket.
application/json
400
Bad request. Improperly formatted Sale or this basket cannot accept sales. See ErrorResponse.
404
Basket not found.
post
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": "example@tebex.io",
    "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"
  }
}
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": "example@tebex.io",
    "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"
  }
}
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}

Update a subscription with a new product / amount to pay - replacing the existing product

put

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.

Authorizations
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Body
Responses
200
Successfully updated subscription. The updated `RecurringPayment` is returned.
application/json
400
Bad Request.
404
Recurring payment not found.
put
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}

Pause or reactivate a recurring payment

put
Authorizations
Path parameters
referencestringRequired

The recurring payment reference to update.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Body
statusstring ยท enumRequired

Your desired state of the recurring payment. Provide Paused with paused_until to pause a recurring payment. Otherwise, provide Active to resume a recurring payment.

Example: PausedPossible values:
paused_untilstringOptional

To pause a payment, provide a ISO8601 formatted date on which the payment should be reactivated.

Example: 2025-01-27T16:43:53.000000Z
Responses
200
Successfully paused or reactivated a payment. The `RecurringPayment` is returned.
application/json
404
Recurring payment not found.
422
Unprocessible Entity. An invalid status was provided or the recurring payment cannot be processed. See ErrorResponse.
put
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}
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": "example@tebex.io",
    "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"
  }
}

Create a basket that can be used to pay for items

post

This will create and return a Basket that can be paid for by redirecting the user to links.checkout

Authorizations
Body
return_urlstringOptional

The URL a customer can return to without completing checkout

Example: https://example.tebex.io/
complete_urlstringOptional

URL the customer can return to after completing payment

Example: https://example.tebex.io/complete
customobjectOptional

Any custom data to be passed through the request. This will be returned in a post-completion webhook.

Example: {"foo":"bar"}
first_namestringOptional

The first name of the customer

Example: Neil
last_namestringOptional

The last name of the customer

Example: McNeil
emailstringOptional

The email address of the customer

Example: example@tebex.io
expires_atstringOptional

An ISO8601 formatted date. After this date the basket cannot be used to checkout.

Example: 2025-01-27T18:09:51Z
complete_auto_redirectbooleanOptional

Automatically redirect to the complete_url provided

Example: true
countrystringOptional

An ISO 3166-1 alpha-2 character code representing the customer's country.

Example: US
creator_codestringOptional

The creator code is used to share a percentage of the payment with another party. See more about creator codes at https://docs.tebex.io/creators/tebex-control-panel/engagement/creator-codes

ipstringOptional

The IP address of the customer using this basket. Provide the IP if creating a basket on your server backend.

Example: 1.2.3.4
Responses
200
Basket created successfully
application/json
post
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": "example@tebex.io",
  "expires_at": "2025-01-27T18:09:51Z",
  "complete_auto_redirect": true,
  "country": "US",
  "creator_code": null,
  "ip": "1.2.3.4"
}
200

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": "example@tebex.io",
    "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"
  }
}

Add a package to the basket

post

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.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Body
qtyintegerOptional

The quantity of package in this basket. This is not the total quantity of overall items in the basket.

Example: 2
typestring ยท enumOptional

The type of payment, either single for one-time payments or subscription.

Example: singlePossible values:
Responses
200
Package is successfully added to the basket, and basket is returned.
application/json
400
Improperly formatted package. See ErrorResponse.
404
Basket not found.
post
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": "example@tebex.io",
    "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"
  }
}
DELETE /api/baskets/{ident}/packages/{rows.id} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*

Add a sale to the basket

post

Adds a Sale to the basket with {ident}. Sales cannot be applied to baskets with revenue_share set.

Authorizations
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Body
namestringOptional

The name of the sale (displayed to the customer)

Example: Test Sale
discount_typestring ยท enumOptional

The type of discount, either percentage for deducting a percentage of each item, or amount to deduct a fixed amount from each item.

Example: amountPossible values:
amountnumberOptional

The amount or percentage to deduct

Example: 4.99
Responses
200
Successfully adds sale to basket.
application/json
400
Bad request. Improperly formatted Sale or this basket cannot accept sales. See ErrorResponse.
404
Basket not found.
post
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": "example@tebex.io",
    "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"
  }
}

Create a checkout request

post

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.

Authorizations
Body
Responses
200
Successfully created basket. The basket will be returned with `links` containing the URLs you should direct the customer to in order to complete payment.
application/json
400
Bad Request. See ErrorResponse.
post
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": "example@tebex.io",
    "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": "example@tebex.io",
    "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"
  }
}
GET /api/payments/{txnId} HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
  "transaction_id": "tbx-26929122a56954-0e15be",
  "status": {
    "id": 1,
    "description": "Complete"
  },
  "payment_sequence": "oneoff",
  "created_at": "2022-10-19T15:49:15.000000Z",
  "price": {
    "amount": 5.35,
    "currency": "USD"
  },
  "fees": {
    "tax": {
      "amount": 0,
      "currency": "USD"
    },
    "gateway": {
      "amount": 0.45,
      "currency": "USD"
    }
  },
  "customer": {
    "first_name": "Test",
    "last_name": "Test",
    "email": "test@test.com",
    "ip": "1.2.3.4",
    "username": "text",
    "marketing_consent": false,
    "country": "TS",
    "postal_code": "text"
  },
  "products": [
    {
      "id": "text",
      "name": "text",
      "quantity": 1,
      "base_price": {
        "amount": 1,
        "currency": "text"
      },
      "paid_price": {
        "amount": 1,
        "currency": "text"
      },
      "variables": [
        "text"
      ],
      "expires_at": "2025-05-09T06:53:32.933Z",
      "custom": {},
      "username": "text"
    }
  ],
  "coupons": [
    {}
  ],
  "gift_cards": [
    {}
  ],
  "recurring_payment_reference": "text",
  "custom": {}
}
POST /api/payments/{txnId}/refund HTTP/1.1
Host: checkout.tebex.io
Authorization: Basic username:password
Accept: */*
{
  "transaction_id": "tbx-26929122a56954-0e15be",
  "status": {
    "id": 1,
    "description": "Complete"
  },
  "payment_sequence": "oneoff",
  "created_at": "2022-10-19T15:49:15.000000Z",
  "price": {
    "amount": 5.35,
    "currency": "USD"
  },
  "fees": {
    "tax": {
      "amount": 0,
      "currency": "USD"
    },
    "gateway": {
      "amount": 0.45,
      "currency": "USD"
    }
  },
  "customer": {
    "first_name": "Test",
    "last_name": "Test",
    "email": "test@test.com",
    "ip": "1.2.3.4",
    "username": "text",
    "marketing_consent": false,
    "country": "TS",
    "postal_code": "text"
  },
  "products": [
    {
      "id": "text",
      "name": "text",
      "quantity": 1,
      "base_price": {
        "amount": 1,
        "currency": "text"
      },
      "paid_price": {
        "amount": 1,
        "currency": "text"
      },
      "variables": [
        "text"
      ],
      "expires_at": "2025-05-09T06:53:32.933Z",
      "custom": {},
      "username": "text"
    }
  ],
  "coupons": [
    {}
  ],
  "gift_cards": [
    {}
  ],
  "recurring_payment_reference": "text",
  "custom": {}
}
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}

Update a subscription with a new product / amount to pay - replacing the existing product

put

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.

Authorizations
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Body
Responses
200
Successfully updated subscription. The updated `RecurringPayment` is returned.
application/json
400
Bad Request.
404
Recurring payment not found.
put
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}

Pause or reactivate a recurring payment

put
Authorizations
Path parameters
referencestringRequired

The recurring payment reference to update.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Body
statusstring ยท enumRequired

Your desired state of the recurring payment. Provide Paused with paused_until to pause a recurring payment. Otherwise, provide Active to resume a recurring payment.

Example: PausedPossible values:
paused_untilstringOptional

To pause a payment, provide a ISO8601 formatted date on which the payment should be reactivated.

Example: 2025-01-27T16:43:53.000000Z
Responses
200
Successfully paused or reactivated a payment. The `RecurringPayment` is returned.
application/json
404
Recurring payment not found.
422
Unprocessible Entity. An invalid status was provided or the recurring payment cannot be processed. See ErrorResponse.
put
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-05-09T06:53:32.933Z",
  "paused_until": "2025-05-09T06:53:32.933Z",
  "next_payment_date": "2022-12-30T16:43:06",
  "reference": "88",
  "account_id": 1,
  "interval": "P2W",
  "cancelled_at": "2025-05-09T06:53:32.933Z",
  "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"
    ]
  }
}