Endpoints

Fetch a basket by its identifier

get

Gets the basket associated with the provided identifier.

Authorizations
AuthorizationstringRequired
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
chevron-right
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
get
/baskets/{ident}

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
AuthorizationstringRequired
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: [email protected]
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
chevron-right
200

Basket created successfully

application/json
post
/baskets
200

Basket created successfully

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
AuthorizationstringRequired
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
chevron-right
200

Package is successfully added to the basket, and basket is returned.

application/json
post
/baskets/{ident}/packages

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
AuthorizationstringRequired
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
rows.idintegerRequired

The id of the basket.rows row to remove.

Example: 1
Responses
delete
/baskets/{ident}/packages/{rows.id}

No content

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
AuthorizationstringRequired
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
chevron-right
200

Successfully adds sale to basket.

application/json
post
/baskets/{ident}/sales

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
AuthorizationstringRequired
Body
Responses
chevron-right
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
post
/checkout

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
AuthorizationstringRequired
Path parameters
txnIdstringRequired

The payment reference to fetch.

Example: tbx-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
chevron-right
200

Payment fetched successfully.

application/json
get
/payments/{txnId}?type=txn_id

Refund a payment by its transaction ID

post

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

Authorizations
AuthorizationstringRequired
Path parameters
txnIdstringRequired

The payment reference to refund.

Example: tbx-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
chevron-right
200

Payment refunded successfully. The payment details are returned.

application/json
post
/payments/{txnId}/refund?type=txn_id

Fetch a recurring payment (subscription) by its reference

get
Authorizations
AuthorizationstringRequired
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
chevron-right
200

Successfully fetched recurring payment.

application/json
get
/recurring-payments/{reference}

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
AuthorizationstringRequired
Path parameters
referencestringRequired

The recurring payment reference to fetch.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Body
Responses
chevron-right
200

Successfully updated subscription. The updated RecurringPayment is returned.

application/json
put
/recurring-payments/{reference}

Cancel a recurring payment

delete

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

Authorizations
AuthorizationstringRequired
Path parameters
referencestringRequired

The recurring payment reference to cancel.

Example: tbx-r-55fff4107740a1f40d844ff89607557f45bfafb3
Responses
chevron-right
200

Recurring payment cancelled successfully.

application/json
delete
/recurring-payments/{reference}

Pause or reactivate a recurring payment

put
Authorizations
AuthorizationstringRequired
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
chevron-right
200

Successfully paused or reactivated a payment. The RecurringPayment is returned.

application/json
put
/recurring-payments/{reference}/status

Update a basket's details, including expiry date.

put

This will update the customer's details on the basket. If the customer is already logged in and a new email is provided, they will be logged out.

Authorizations
AuthorizationstringRequired
Path parameters
identstringRequired

The basket identifier.

Example: 1a-55fff4107740a1f40d844ff89607557f45bfafb3
Body
countrystring | nullableOptional
namestring | nullableOptional
state_idstring | nullableOptional
first_namestring | nullableOptional
last_namestring | nullableOptional
postal_codestring | nullableOptional
creator_codestring | nullableOptional
complete_auto_redirectboolean | nullableOptional
expires_atstring · date-time | nullableOptional

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

Example: 2025-01-27T18:09:51Z
Responses
chevron-right
200

Basket updated successfully

No content

put
/baskets/{ident}

No content

Last updated