LogoLogo
  • Welcome
  • Getting Started
  • Integration Methods
  • SDKs
  • Tebex for Unreal Engine 5
  • Tebex for Unity Engine
  • Webstore Builder
    • Overview
    • Getting Started
    • Twig
      • Tags
      • Filters
      • Functions
    • Global Variables
      • basket
      • store
      • page
    • Pages
      • index.html
      • checkout.html
      • username.html
      • options.html
      • package.html
      • cms/page.html
      • category.html
      • layout.html
    • Sidebar Modules
      • module.communitygoal.html
      • module.featuredpackage.html
      • module.giftcardbalance.html
      • module.goal.html
      • module.payments.html
      • module.serverstatus.html
      • module.textbox.html
      • module.topdonator.html
    • Assets
    • Schema
    • Developer Plan
    • Footer
    • Guides
      • Package Slugs
  • Headless API
    • Overview
    • Getting Your Listings
    • Creating a Basket
    • Adding Packages
    • Gifting Packages
    • Applying Discounts / Creator Codes
    • Directing to Checkout
    • Endpoints
    • Postman Config
    • Example Integration
  • Checkout API
    • Overview
    • Headers and Authentication
    • Start the Checkout Process
    • Checkout Webhooks
    • Endpoints
    • Errors
    • Postman Config
  • Tebex.js
    • Overview
    • Integration
    • Events
    • Web Components
    • Custom Render Location
    • NPM
    • GitHub
  • Webhooks
    • Overview
    • Login Webhooks
  • Game Server API
    • Overview
    • Authentication
    • Error Handling
    • Endpoints
  • Affiliate API
    • Overview
    • Referrals
    • Game Types
    • Webhooks
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Headless API

Endpoints

PreviousDirecting to CheckoutNextOverview

Last updated 11 months ago

Was this helpful?

Webstores

Baskets

Categories

Package

Creator Codes

Gift Cards

Coupons

Adding / Removing Packages

Updating Quantities

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

  • Webstores
  • GETFetch a webstore by its identifier
  • GETFetch the custom pages associated with the store.
  • Baskets
  • GETFetch a basket from a webstore by its identifier
  • POSTCreate a new basket
  • GETGet authentication links for a basket.
  • Categories
  • GETGets all categories available in the webstore.
  • GETGets a store's categories including all package information with them.
  • GETGets information about a specific category
  • GETGets information about a specific category, including all the packages in the category
  • Package
  • GETFetch a package from a webstore by its identifier
  • GETFetch all packages from a webstore
  • GETFetch a package from a webstore by its identifier
  • GETFetch a package from a webstore by its identifier
  • GETFetch a package from a webstore by its identifier
  • Creator Codes
  • POSTApply a creator code to a basket.
  • POSTRemove a creator code from the basket.
  • Gift Cards
  • POSTApply a gift card to a basket.
  • POSTRemove a gift card from the basket.
  • Coupons
  • POSTApply a coupon to a basket.
  • POSTRemove a coupon from the basket.
  • Adding / Removing Packages
  • POSTAdd a package to a basket
  • POSTRemove a package from a basket
  • Updating Quantities
  • PUTUpdates the quantity of the given package in the basket. The user must be logged in before the quantity can be changed.

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