# Endpoints

## Fetch a basket by its identifier

> Gets the basket associated with the provided identifier.

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"Basket":{"properties":{"ident":{"type":"string"},"expire":{"type":"string"},"price":{"format":"float","type":"number"},"priceDetails":{"$ref":"#/components/schemas/PriceDetails"},"isPaymentMethodUpdate":{"type":"boolean"},"returnUrl":{"nullable":true,"type":"string"},"complete":{"type":"boolean"},"tax":{"format":"int32","type":"number"},"username":{"nullable":true,"type":"string"},"email_immutable":{"type":"boolean"},"discounts":{"items":{"$ref":"#/components/schemas/Discount"},"type":"array"},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"address":{"$ref":"#/components/schemas/Address"},"rows":{"items":{"$ref":"#/components/schemas/BasketRow"},"type":"array"},"fingerprint":{"description":"Browser fingerprint to identify the user","nullable":true,"type":"string"},"creator_code":{"description":"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","type":"string"},"roundup":{"nullable":true,"type":"boolean"},"cancel_url":{"type":"string"},"complete_url":{"nullable":true,"type":"string"},"complete_auto_redirect":{"type":"boolean"},"recurring_items":{"items":{"type":"object"},"type":"array"},"payment":{"$ref":"#/components/schemas/Payment"},"custom":{"nullable":true,"type":"object"},"links":{"$ref":"#/components/schemas/BasketLinks"}},"type":"object"},"PriceDetails":{"properties":{"fullPrice":{"format":"float","type":"number"},"subTotal":{"format":"float","type":"number"},"discounts":{"items":{"type":"object"},"type":"array"},"total":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"balance":{"format":"float","type":"number"},"sales":{"items":{"$ref":"#/components/schemas/Sale"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"recurring":{"description":"Contains recurring amount. Limited to 1 subscription package in the basket at a time.","type":"boolean"},"username":{"type":"string"},"roundUp":{"nullable":true,"type":"number"}},"type":"object"},"Sale":{"properties":{"name":{"description":"The name of the sale (displayed to the customer)","type":"string"},"discount_type":{"description":"The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.","enum":["percentage","amount"],"type":"string"},"amount":{"description":"The amount or percentage to deduct","type":"number"}},"type":"object"},"GiftCard":{"type":"object"},"Discount":{"type":"object"},"Coupon":{"type":"object"},"Address":{"properties":{"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address":{"type":"string"},"email":{"type":"string"},"state_id":{"nullable":true,"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}},"type":"object"},"BasketRow":{"properties":{"id":{"type":"integer"},"basket":{"description":"Numeric basket ID","type":"integer"},"package":{"description":"Package ID associated with this item","nullable":true,"type":"integer"},"override":{"description":"Package ID associated with this item","type":"integer"},"quantity":{"type":"integer"},"server":{"nullable":true,"type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"nullable":true,"type":"integer"},"options":{"nullable":true,"type":"object"},"recurring":{"type":"boolean"},"recurring_period":{"nullable":true,"type":"string"},"recurring_next_payment_date":{"format":"date-time","nullable":true,"type":"string"},"meta":{"$ref":"#/components/schemas/BasketRow_meta"},"custom":{"nullable":true,"type":"object"},"image_url":{"nullable":true,"type":"string"},"recurring_price":{"format":"float","nullable":true,"type":"number"}},"type":"object"},"BasketRow_meta":{"properties":{"name":{"type":"string"},"rowprice":{"format":"float","type":"number"},"initialprice":{"format":"float","type":"number"},"isCumulative":{"type":"boolean"},"requiredPackages":{"items":{"type":"integer"},"type":"array"},"requiresAny":{"type":"boolean"},"category":{"type":"boolean"},"producesGiftCard":{"type":"boolean"},"allowsGiftCards":{"type":"boolean"},"servers":{"items":{"type":"integer"},"type":"array"},"limits":{"$ref":"#/components/schemas/BasketRow_meta_limits"},"hasDeliverables":{"type":"boolean"},"deliverableTypes":{"items":{"type":"string"},"type":"array"},"downloadLink":{"type":"string"},"hasSellerProtection":{"type":"boolean"},"itemType":{"nullable":true,"type":"string"},"revenue_share":{"items":{"format":"float","type":"number"},"type":"array"},"image":{"nullable":true,"type":"string"},"realprice":{"format":"float","type":"number"}},"type":"object"},"BasketRow_meta_limits":{"properties":{"user":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"global":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"packageExpiryTime":{"type":"integer"}},"type":"object"},"BasketRow_meta_limits_user":{"properties":{"enabled":{"type":"boolean"},"timestamp":{"type":"integer"},"limit":{"type":"boolean"}},"type":"object"},"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"BasketLinks":{"properties":{"payment":{"description":"The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.","type":"string"},"checkout":{"description":"The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment","type":"string"}},"type":"object"}}},"paths":{"/baskets/{ident}":{"get":{"description":"Gets the basket associated with the provided identifier.","operationId":"getBasketById","parameters":[{"description":"The basket identifier.","explode":false,"in":"path","name":"ident","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}},"description":"Successful response returns the basket.\n\nThe `links.payment` property is only returned if the basket has been paid for, and a payment exist with the **complete**/**refund**/**chargeback** status.\n\nThe `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."},"404":{"description":"Basket not found."}},"summary":"Fetch a basket by its identifier","tags":["Baskets"]}}}}
```

## Create a basket that can be used to pay for items

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"createBasket_request":{"properties":{"return_url":{"description":"The URL a customer can return to without completing checkout","type":"string"},"complete_url":{"description":"URL the customer can return to after completing payment","type":"string"},"custom":{"description":"Any custom data to be passed through the request. This will be returned in a post-completion webhook.","type":"object"},"first_name":{"description":"The first name of the customer","type":"string"},"last_name":{"description":"The last name of the customer","type":"string"},"email":{"description":"The email address of the customer","type":"string"},"complete_auto_redirect":{"description":"Automatically redirect to the complete_url provided","type":"boolean"},"country":{"description":"An ISO 3166-1 alpha-2 character code representing the customer's country.","type":"string"},"creator_code":{"description":"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","type":"string"},"ip":{"description":"The IP address of the customer using this basket. Provide the IP if creating a basket on your server backend.","type":"string"}},"type":"object"},"Basket":{"properties":{"ident":{"type":"string"},"expire":{"type":"string"},"price":{"format":"float","type":"number"},"priceDetails":{"$ref":"#/components/schemas/PriceDetails"},"isPaymentMethodUpdate":{"type":"boolean"},"returnUrl":{"nullable":true,"type":"string"},"complete":{"type":"boolean"},"tax":{"format":"int32","type":"number"},"username":{"nullable":true,"type":"string"},"email_immutable":{"type":"boolean"},"discounts":{"items":{"$ref":"#/components/schemas/Discount"},"type":"array"},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"address":{"$ref":"#/components/schemas/Address"},"rows":{"items":{"$ref":"#/components/schemas/BasketRow"},"type":"array"},"fingerprint":{"description":"Browser fingerprint to identify the user","nullable":true,"type":"string"},"creator_code":{"description":"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","type":"string"},"roundup":{"nullable":true,"type":"boolean"},"cancel_url":{"type":"string"},"complete_url":{"nullable":true,"type":"string"},"complete_auto_redirect":{"type":"boolean"},"recurring_items":{"items":{"type":"object"},"type":"array"},"payment":{"$ref":"#/components/schemas/Payment"},"custom":{"nullable":true,"type":"object"},"links":{"$ref":"#/components/schemas/BasketLinks"}},"type":"object"},"PriceDetails":{"properties":{"fullPrice":{"format":"float","type":"number"},"subTotal":{"format":"float","type":"number"},"discounts":{"items":{"type":"object"},"type":"array"},"total":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"balance":{"format":"float","type":"number"},"sales":{"items":{"$ref":"#/components/schemas/Sale"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"recurring":{"description":"Contains recurring amount. Limited to 1 subscription package in the basket at a time.","type":"boolean"},"username":{"type":"string"},"roundUp":{"nullable":true,"type":"number"}},"type":"object"},"Sale":{"properties":{"name":{"description":"The name of the sale (displayed to the customer)","type":"string"},"discount_type":{"description":"The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.","enum":["percentage","amount"],"type":"string"},"amount":{"description":"The amount or percentage to deduct","type":"number"}},"type":"object"},"GiftCard":{"type":"object"},"Discount":{"type":"object"},"Coupon":{"type":"object"},"Address":{"properties":{"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address":{"type":"string"},"email":{"type":"string"},"state_id":{"nullable":true,"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}},"type":"object"},"BasketRow":{"properties":{"id":{"type":"integer"},"basket":{"description":"Numeric basket ID","type":"integer"},"package":{"description":"Package ID associated with this item","nullable":true,"type":"integer"},"override":{"description":"Package ID associated with this item","type":"integer"},"quantity":{"type":"integer"},"server":{"nullable":true,"type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"nullable":true,"type":"integer"},"options":{"nullable":true,"type":"object"},"recurring":{"type":"boolean"},"recurring_period":{"nullable":true,"type":"string"},"recurring_next_payment_date":{"format":"date-time","nullable":true,"type":"string"},"meta":{"$ref":"#/components/schemas/BasketRow_meta"},"custom":{"nullable":true,"type":"object"},"image_url":{"nullable":true,"type":"string"},"recurring_price":{"format":"float","nullable":true,"type":"number"}},"type":"object"},"BasketRow_meta":{"properties":{"name":{"type":"string"},"rowprice":{"format":"float","type":"number"},"initialprice":{"format":"float","type":"number"},"isCumulative":{"type":"boolean"},"requiredPackages":{"items":{"type":"integer"},"type":"array"},"requiresAny":{"type":"boolean"},"category":{"type":"boolean"},"producesGiftCard":{"type":"boolean"},"allowsGiftCards":{"type":"boolean"},"servers":{"items":{"type":"integer"},"type":"array"},"limits":{"$ref":"#/components/schemas/BasketRow_meta_limits"},"hasDeliverables":{"type":"boolean"},"deliverableTypes":{"items":{"type":"string"},"type":"array"},"downloadLink":{"type":"string"},"hasSellerProtection":{"type":"boolean"},"itemType":{"nullable":true,"type":"string"},"revenue_share":{"items":{"format":"float","type":"number"},"type":"array"},"image":{"nullable":true,"type":"string"},"realprice":{"format":"float","type":"number"}},"type":"object"},"BasketRow_meta_limits":{"properties":{"user":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"global":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"packageExpiryTime":{"type":"integer"}},"type":"object"},"BasketRow_meta_limits_user":{"properties":{"enabled":{"type":"boolean"},"timestamp":{"type":"integer"},"limit":{"type":"boolean"}},"type":"object"},"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"BasketLinks":{"properties":{"payment":{"description":"The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.","type":"string"},"checkout":{"description":"The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment","type":"string"}},"type":"object"}}},"paths":{"/baskets":{"post":{"description":"This will create and return a `Basket` that can be paid for by redirecting the user to `links.checkout`","operationId":"createBasket","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createBasket_request"}}},"description":"Create a basket, returning the full basket object and payment link."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}},"description":"Basket created successfully"}},"summary":"Create a basket that can be used to pay for items","tags":["Baskets"]}}}}
```

## Add a package to the basket

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"addPackage_request":{"properties":{"package":{"$ref":"#/components/schemas/Package"},"qty":{"description":"The quantity of `package` in this basket. This is not the total quantity of overall items in the basket.","type":"integer"},"type":{"description":"The type of payment, either `single` for one-time payments or `subscription`.","enum":["single","subscription"],"required":["single"],"type":"string"},"revenue_share":{"description":"An array of payment destination objects describing how the purchase should be split between multiple wallets. **Only available with pre-agreement from Tebex.**","items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"}}},"Package":{"properties":{"name":{"description":"The name of the item being purchased. This should be user-friendly as it is shown to the customer on checkout and receipts.","type":"string"},"price":{"description":"A float (decimal describing the price of the package in your account currency)","format":"float","type":"number"},"type":{"enum":["single","subscription"],"type":"string"},"qty":{"type":"integer"},"expiry_period":{"description":"The renewal period of this item","enum":["day","month","year"],"type":"string"},"expiry_length":{"description":"An integer representing the number of `expiry_periods` that make up the renewal period.","type":"integer"},"custom":{"description":"A map of data that is passed back to you via the webhook (for example, a tracking ID)","type":"object"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Basket":{"properties":{"ident":{"type":"string"},"expire":{"type":"string"},"price":{"format":"float","type":"number"},"priceDetails":{"$ref":"#/components/schemas/PriceDetails"},"isPaymentMethodUpdate":{"type":"boolean"},"returnUrl":{"nullable":true,"type":"string"},"complete":{"type":"boolean"},"tax":{"format":"int32","type":"number"},"username":{"nullable":true,"type":"string"},"email_immutable":{"type":"boolean"},"discounts":{"items":{"$ref":"#/components/schemas/Discount"},"type":"array"},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"address":{"$ref":"#/components/schemas/Address"},"rows":{"items":{"$ref":"#/components/schemas/BasketRow"},"type":"array"},"fingerprint":{"description":"Browser fingerprint to identify the user","nullable":true,"type":"string"},"creator_code":{"description":"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","type":"string"},"roundup":{"nullable":true,"type":"boolean"},"cancel_url":{"type":"string"},"complete_url":{"nullable":true,"type":"string"},"complete_auto_redirect":{"type":"boolean"},"recurring_items":{"items":{"type":"object"},"type":"array"},"payment":{"$ref":"#/components/schemas/Payment"},"custom":{"nullable":true,"type":"object"},"links":{"$ref":"#/components/schemas/BasketLinks"}},"type":"object"},"PriceDetails":{"properties":{"fullPrice":{"format":"float","type":"number"},"subTotal":{"format":"float","type":"number"},"discounts":{"items":{"type":"object"},"type":"array"},"total":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"balance":{"format":"float","type":"number"},"sales":{"items":{"$ref":"#/components/schemas/Sale"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"recurring":{"description":"Contains recurring amount. Limited to 1 subscription package in the basket at a time.","type":"boolean"},"username":{"type":"string"},"roundUp":{"nullable":true,"type":"number"}},"type":"object"},"Sale":{"properties":{"name":{"description":"The name of the sale (displayed to the customer)","type":"string"},"discount_type":{"description":"The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.","enum":["percentage","amount"],"type":"string"},"amount":{"description":"The amount or percentage to deduct","type":"number"}},"type":"object"},"GiftCard":{"type":"object"},"Discount":{"type":"object"},"Coupon":{"type":"object"},"Address":{"properties":{"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address":{"type":"string"},"email":{"type":"string"},"state_id":{"nullable":true,"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}},"type":"object"},"BasketRow":{"properties":{"id":{"type":"integer"},"basket":{"description":"Numeric basket ID","type":"integer"},"package":{"description":"Package ID associated with this item","nullable":true,"type":"integer"},"override":{"description":"Package ID associated with this item","type":"integer"},"quantity":{"type":"integer"},"server":{"nullable":true,"type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"nullable":true,"type":"integer"},"options":{"nullable":true,"type":"object"},"recurring":{"type":"boolean"},"recurring_period":{"nullable":true,"type":"string"},"recurring_next_payment_date":{"format":"date-time","nullable":true,"type":"string"},"meta":{"$ref":"#/components/schemas/BasketRow_meta"},"custom":{"nullable":true,"type":"object"},"image_url":{"nullable":true,"type":"string"},"recurring_price":{"format":"float","nullable":true,"type":"number"}},"type":"object"},"BasketRow_meta":{"properties":{"name":{"type":"string"},"rowprice":{"format":"float","type":"number"},"initialprice":{"format":"float","type":"number"},"isCumulative":{"type":"boolean"},"requiredPackages":{"items":{"type":"integer"},"type":"array"},"requiresAny":{"type":"boolean"},"category":{"type":"boolean"},"producesGiftCard":{"type":"boolean"},"allowsGiftCards":{"type":"boolean"},"servers":{"items":{"type":"integer"},"type":"array"},"limits":{"$ref":"#/components/schemas/BasketRow_meta_limits"},"hasDeliverables":{"type":"boolean"},"deliverableTypes":{"items":{"type":"string"},"type":"array"},"downloadLink":{"type":"string"},"hasSellerProtection":{"type":"boolean"},"itemType":{"nullable":true,"type":"string"},"revenue_share":{"items":{"format":"float","type":"number"},"type":"array"},"image":{"nullable":true,"type":"string"},"realprice":{"format":"float","type":"number"}},"type":"object"},"BasketRow_meta_limits":{"properties":{"user":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"global":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"packageExpiryTime":{"type":"integer"}},"type":"object"},"BasketRow_meta_limits_user":{"properties":{"enabled":{"type":"boolean"},"timestamp":{"type":"integer"},"limit":{"type":"boolean"}},"type":"object"},"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"BasketLinks":{"properties":{"payment":{"description":"The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.","type":"string"},"checkout":{"description":"The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment","type":"string"}},"type":"object"}}},"paths":{"/baskets/{ident}/packages":{"post":{"description":"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.**","operationId":"addPackage","parameters":[{"description":"The basket identifier.","explode":false,"in":"path","name":"ident","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/addPackage_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}},"description":"Package is successfully added to the basket, and basket is returned."},"400":{"description":"Improperly formatted package. See ErrorResponse."},"404":{"description":"Basket not found."}},"summary":"Add a package to the basket","tags":["Baskets"]}}}}
```

## Remove a row from the basket

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}}},"paths":{"/baskets/{ident}/packages/{rows.id}":{"delete":{"description":"This will remove the given `{rows.id}` from the basket `{ident}`. The basket must be re-fetched after running to receive updated totals.","operationId":"removeRowFromBasket","parameters":[{"description":"The basket identifier.","explode":false,"in":"path","name":"ident","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The `id` of the `basket.rows` row to remove.","explode":false,"in":"path","name":"rows.id","required":true,"schema":{"type":"integer"},"style":"simple"}],"responses":{"204":{"description":"Successfully deleted a row from the basket."},"404":{"description":"Row or basket not found."}},"summary":"Remove a row from the basket","tags":["Baskets"]}}}}
```

## Add a sale to the basket

> Adds a \`Sale\` to the basket with \`{ident}\`. \*\*Sales cannot be applied to baskets with \`revenue\_share\` set.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"Sale":{"properties":{"name":{"description":"The name of the sale (displayed to the customer)","type":"string"},"discount_type":{"description":"The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.","enum":["percentage","amount"],"type":"string"},"amount":{"description":"The amount or percentage to deduct","type":"number"}},"type":"object"},"Basket":{"properties":{"ident":{"type":"string"},"expire":{"type":"string"},"price":{"format":"float","type":"number"},"priceDetails":{"$ref":"#/components/schemas/PriceDetails"},"isPaymentMethodUpdate":{"type":"boolean"},"returnUrl":{"nullable":true,"type":"string"},"complete":{"type":"boolean"},"tax":{"format":"int32","type":"number"},"username":{"nullable":true,"type":"string"},"email_immutable":{"type":"boolean"},"discounts":{"items":{"$ref":"#/components/schemas/Discount"},"type":"array"},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"address":{"$ref":"#/components/schemas/Address"},"rows":{"items":{"$ref":"#/components/schemas/BasketRow"},"type":"array"},"fingerprint":{"description":"Browser fingerprint to identify the user","nullable":true,"type":"string"},"creator_code":{"description":"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","type":"string"},"roundup":{"nullable":true,"type":"boolean"},"cancel_url":{"type":"string"},"complete_url":{"nullable":true,"type":"string"},"complete_auto_redirect":{"type":"boolean"},"recurring_items":{"items":{"type":"object"},"type":"array"},"payment":{"$ref":"#/components/schemas/Payment"},"custom":{"nullable":true,"type":"object"},"links":{"$ref":"#/components/schemas/BasketLinks"}},"type":"object"},"PriceDetails":{"properties":{"fullPrice":{"format":"float","type":"number"},"subTotal":{"format":"float","type":"number"},"discounts":{"items":{"type":"object"},"type":"array"},"total":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"balance":{"format":"float","type":"number"},"sales":{"items":{"$ref":"#/components/schemas/Sale"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"recurring":{"description":"Contains recurring amount. Limited to 1 subscription package in the basket at a time.","type":"boolean"},"username":{"type":"string"},"roundUp":{"nullable":true,"type":"number"}},"type":"object"},"GiftCard":{"type":"object"},"Discount":{"type":"object"},"Coupon":{"type":"object"},"Address":{"properties":{"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address":{"type":"string"},"email":{"type":"string"},"state_id":{"nullable":true,"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}},"type":"object"},"BasketRow":{"properties":{"id":{"type":"integer"},"basket":{"description":"Numeric basket ID","type":"integer"},"package":{"description":"Package ID associated with this item","nullable":true,"type":"integer"},"override":{"description":"Package ID associated with this item","type":"integer"},"quantity":{"type":"integer"},"server":{"nullable":true,"type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"nullable":true,"type":"integer"},"options":{"nullable":true,"type":"object"},"recurring":{"type":"boolean"},"recurring_period":{"nullable":true,"type":"string"},"recurring_next_payment_date":{"format":"date-time","nullable":true,"type":"string"},"meta":{"$ref":"#/components/schemas/BasketRow_meta"},"custom":{"nullable":true,"type":"object"},"image_url":{"nullable":true,"type":"string"},"recurring_price":{"format":"float","nullable":true,"type":"number"}},"type":"object"},"BasketRow_meta":{"properties":{"name":{"type":"string"},"rowprice":{"format":"float","type":"number"},"initialprice":{"format":"float","type":"number"},"isCumulative":{"type":"boolean"},"requiredPackages":{"items":{"type":"integer"},"type":"array"},"requiresAny":{"type":"boolean"},"category":{"type":"boolean"},"producesGiftCard":{"type":"boolean"},"allowsGiftCards":{"type":"boolean"},"servers":{"items":{"type":"integer"},"type":"array"},"limits":{"$ref":"#/components/schemas/BasketRow_meta_limits"},"hasDeliverables":{"type":"boolean"},"deliverableTypes":{"items":{"type":"string"},"type":"array"},"downloadLink":{"type":"string"},"hasSellerProtection":{"type":"boolean"},"itemType":{"nullable":true,"type":"string"},"revenue_share":{"items":{"format":"float","type":"number"},"type":"array"},"image":{"nullable":true,"type":"string"},"realprice":{"format":"float","type":"number"}},"type":"object"},"BasketRow_meta_limits":{"properties":{"user":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"global":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"packageExpiryTime":{"type":"integer"}},"type":"object"},"BasketRow_meta_limits_user":{"properties":{"enabled":{"type":"boolean"},"timestamp":{"type":"integer"},"limit":{"type":"boolean"}},"type":"object"},"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"BasketLinks":{"properties":{"payment":{"description":"The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.","type":"string"},"checkout":{"description":"The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment","type":"string"}},"type":"object"}}},"paths":{"/baskets/{ident}/sales":{"post":{"description":"Adds a `Sale` to the basket with `{ident}`. **Sales cannot be applied to baskets with `revenue_share` set.**","operationId":"addSaleToBasket","parameters":[{"description":"The basket identifier.","explode":false,"in":"path","name":"ident","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sale"}}},"description":"Provide a `Sale` as an object to apply it to the basket."},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}},"description":"Successfully adds sale to basket."},"400":{"description":"Bad request. Improperly formatted Sale or this basket cannot accept sales. See ErrorResponse."},"404":{"description":"Basket not found."}},"summary":"Add a sale to the basket","tags":["Baskets"]}}}}
```

## Create a checkout request

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"checkout_request":{"properties":{"basket":{"$ref":"#/components/schemas/checkout_request_basket"},"items":{"description":"An array of `Packages` in the basket.","items":{"$ref":"#/components/schemas/CheckoutItem"},"type":"array"},"sale":{"$ref":"#/components/schemas/Sale"}},"required":["basket","items"]},"checkout_request_basket":{"description":"An object containing the customer's information, relevant links, and any custom tracking data.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"return_url":{"type":"string"},"complete_url":{"type":"string"},"custom":{"type":"object"}},"type":"object"},"CheckoutItem":{"description":"An item added to a basket as part of the `/checkout` request.","properties":{"package":{"$ref":"#/components/schemas/Package"}},"type":"object"},"Package":{"properties":{"name":{"description":"The name of the item being purchased. This should be user-friendly as it is shown to the customer on checkout and receipts.","type":"string"},"price":{"description":"A float (decimal describing the price of the package in your account currency)","format":"float","type":"number"},"type":{"enum":["single","subscription"],"type":"string"},"qty":{"type":"integer"},"expiry_period":{"description":"The renewal period of this item","enum":["day","month","year"],"type":"string"},"expiry_length":{"description":"An integer representing the number of `expiry_periods` that make up the renewal period.","type":"integer"},"custom":{"description":"A map of data that is passed back to you via the webhook (for example, a tracking ID)","type":"object"}},"type":"object"},"Sale":{"properties":{"name":{"description":"The name of the sale (displayed to the customer)","type":"string"},"discount_type":{"description":"The type of discount, either `percentage` for deducting a percentage of each item, or `amount` to deduct a fixed amount from each item.","enum":["percentage","amount"],"type":"string"},"amount":{"description":"The amount or percentage to deduct","type":"number"}},"type":"object"},"Basket":{"properties":{"ident":{"type":"string"},"expire":{"type":"string"},"price":{"format":"float","type":"number"},"priceDetails":{"$ref":"#/components/schemas/PriceDetails"},"isPaymentMethodUpdate":{"type":"boolean"},"returnUrl":{"nullable":true,"type":"string"},"complete":{"type":"boolean"},"tax":{"format":"int32","type":"number"},"username":{"nullable":true,"type":"string"},"email_immutable":{"type":"boolean"},"discounts":{"items":{"$ref":"#/components/schemas/Discount"},"type":"array"},"coupons":{"items":{"$ref":"#/components/schemas/Coupon"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"address":{"$ref":"#/components/schemas/Address"},"rows":{"items":{"$ref":"#/components/schemas/BasketRow"},"type":"array"},"fingerprint":{"description":"Browser fingerprint to identify the user","nullable":true,"type":"string"},"creator_code":{"description":"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","type":"string"},"roundup":{"nullable":true,"type":"boolean"},"cancel_url":{"type":"string"},"complete_url":{"nullable":true,"type":"string"},"complete_auto_redirect":{"type":"boolean"},"recurring_items":{"items":{"type":"object"},"type":"array"},"payment":{"$ref":"#/components/schemas/Payment"},"custom":{"nullable":true,"type":"object"},"links":{"$ref":"#/components/schemas/BasketLinks"}},"type":"object"},"PriceDetails":{"properties":{"fullPrice":{"format":"float","type":"number"},"subTotal":{"format":"float","type":"number"},"discounts":{"items":{"type":"object"},"type":"array"},"total":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"balance":{"format":"float","type":"number"},"sales":{"items":{"$ref":"#/components/schemas/Sale"},"type":"array"},"giftcards":{"items":{"$ref":"#/components/schemas/GiftCard"},"type":"array"},"recurring":{"description":"Contains recurring amount. Limited to 1 subscription package in the basket at a time.","type":"boolean"},"username":{"type":"string"},"roundUp":{"nullable":true,"type":"number"}},"type":"object"},"GiftCard":{"type":"object"},"Discount":{"type":"object"},"Coupon":{"type":"object"},"Address":{"properties":{"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address":{"type":"string"},"email":{"type":"string"},"state_id":{"nullable":true,"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}},"type":"object"},"BasketRow":{"properties":{"id":{"type":"integer"},"basket":{"description":"Numeric basket ID","type":"integer"},"package":{"description":"Package ID associated with this item","nullable":true,"type":"integer"},"override":{"description":"Package ID associated with this item","type":"integer"},"quantity":{"type":"integer"},"server":{"nullable":true,"type":"integer"},"price":{"format":"float","type":"number"},"gift_username_id":{"nullable":true,"type":"integer"},"options":{"nullable":true,"type":"object"},"recurring":{"type":"boolean"},"recurring_period":{"nullable":true,"type":"string"},"recurring_next_payment_date":{"format":"date-time","nullable":true,"type":"string"},"meta":{"$ref":"#/components/schemas/BasketRow_meta"},"custom":{"nullable":true,"type":"object"},"image_url":{"nullable":true,"type":"string"},"recurring_price":{"format":"float","nullable":true,"type":"number"}},"type":"object"},"BasketRow_meta":{"properties":{"name":{"type":"string"},"rowprice":{"format":"float","type":"number"},"initialprice":{"format":"float","type":"number"},"isCumulative":{"type":"boolean"},"requiredPackages":{"items":{"type":"integer"},"type":"array"},"requiresAny":{"type":"boolean"},"category":{"type":"boolean"},"producesGiftCard":{"type":"boolean"},"allowsGiftCards":{"type":"boolean"},"servers":{"items":{"type":"integer"},"type":"array"},"limits":{"$ref":"#/components/schemas/BasketRow_meta_limits"},"hasDeliverables":{"type":"boolean"},"deliverableTypes":{"items":{"type":"string"},"type":"array"},"downloadLink":{"type":"string"},"hasSellerProtection":{"type":"boolean"},"itemType":{"nullable":true,"type":"string"},"revenue_share":{"items":{"format":"float","type":"number"},"type":"array"},"image":{"nullable":true,"type":"string"},"realprice":{"format":"float","type":"number"}},"type":"object"},"BasketRow_meta_limits":{"properties":{"user":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"global":{"$ref":"#/components/schemas/BasketRow_meta_limits_user"},"packageExpiryTime":{"type":"integer"}},"type":"object"},"BasketRow_meta_limits_user":{"properties":{"enabled":{"type":"boolean"},"timestamp":{"type":"integer"},"limit":{"type":"boolean"}},"type":"object"},"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"BasketLinks":{"properties":{"payment":{"description":"The `links.payment` property is only returned if the basket has been paid for and a payment exists with the `complete`,`refund`, or `chargeback` status.","type":"string"},"checkout":{"description":"The `links.checkout` property is only returned if the basket has not been paid, and is the URL to send the customer to make payment","type":"string"}},"type":"object"}}},"paths":{"/checkout":{"post":{"description":"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.**","operationId":"checkout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/checkout_request"}}},"description":"Provide a `Basket`, an array of `Packages` to be added to the basket, and an optional `Sale` to complete the full checkout flow in one call. **Only one subscription item may be in the basket at a time.**"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Basket"}}},"description":"Successfully created basket. The basket will be returned with `links` containing the URLs you should direct the customer to in order to complete payment."},"400":{"description":"Bad Request. See ErrorResponse."}},"summary":"Create a checkout request","tags":["Checkout"]}}}}
```

## Fetch a payment by its transaction ID

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"Single payments (`tbx-`) can be fetched and refunded with a valid reference id.","name":"Payments"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"}}},"paths":{"/payments/{txnId}?type=txn_id":{"get":{"description":"This will fetch the given payment associated with this transaction id. Single payment transaction IDs begin with `tbx-`","operationId":"getPaymentById","parameters":[{"description":"The payment reference to fetch.","explode":false,"in":"path","name":"txnId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Payment fetched successfully."},"404":{"description":"Transaction not found."}},"summary":"Fetch a payment by its transaction ID","tags":["Payments"]}}}}
```

## Refund a payment by its transaction ID

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"Single payments (`tbx-`) can be fetched and refunded with a valid reference id.","name":"Payments"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"Payment":{"nullable":true,"properties":{"transaction_id":{"type":"string"},"status":{"$ref":"#/components/schemas/Payment_status"},"payment_sequence":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"price":{"$ref":"#/components/schemas/Payment_price"},"price_paid":{"$ref":"#/components/schemas/Payment_price"},"payment_method":{"$ref":"#/components/schemas/Payment_payment_method"},"revenue_share":{"items":{"$ref":"#/components/schemas/RevenueShare"},"type":"array"},"decline_reason":{"type":"string"},"fees":{"$ref":"#/components/schemas/Payment_fees"},"customer":{"$ref":"#/components/schemas/Payment_customer"},"products":{"items":{"$ref":"#/components/schemas/Payment_products_inner"},"type":"array"},"coupons":{"items":{"type":"object"},"type":"array"},"gift_cards":{"items":{"type":"object"},"type":"array"},"recurring_payment_reference":{"nullable":true,"type":"string"},"custom":{"type":"object"}},"type":"object"},"Payment_status":{"properties":{"id":{"type":"integer"},"description":{"type":"string"}},"type":"object"},"Payment_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_payment_method":{"properties":{"name":{},"refundable":{"type":"boolean"}},"type":"object"},"RevenueShare":{"nullable":true,"properties":{"wallet_ref":{"type":"string"},"amount":{"description":"A float (decimal) value representing the amount of this payment in your account currency that is credited to the `wallet_ref`","format":"float","type":"number"},"gateway_fee_percent":{"description":"A float (decimal) value representing the percentage of the gateway fee that should be dedicated from this wallet’s revenue share. This optional value can be anywhere between 0 - 100.","format":"float","type":"number"}},"type":"object"},"Payment_fees":{"properties":{"tax":{"$ref":"#/components/schemas/Payment_fees_tax"},"gateway":{"$ref":"#/components/schemas/Payment_fees_gateway"}},"type":"object"},"Payment_fees_tax":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_fees_gateway":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"},"Payment_customer":{"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"ip":{"type":"string"},"username":{"nullable":true,"type":"string"},"marketing_consent":{"type":"boolean"},"country":{"type":"string"},"postal_code":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner":{"properties":{"id":{"nullable":true,"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"base_price":{"$ref":"#/components/schemas/Payment_products_inner_base_price"},"paid_price":{"$ref":"#/components/schemas/Payment_products_inner_paid_price"},"variables":{"items":{"type":"string"},"type":"array"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"custom":{"description":"Any custom data associated with the payment","type":"object"},"username":{"nullable":true,"type":"string"}},"type":"object"},"Payment_products_inner_base_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}}},"Payment_products_inner_paid_price":{"properties":{"amount":{"format":"float","type":"number"},"currency":{"type":"string"}},"type":"object"}}},"paths":{"/payments/{txnId}/refund?type=txn_id":{"post":{"description":"This will refund the given payment associated with this transaction id.","operationId":"refundPaymentById","parameters":[{"description":"The payment reference to refund.","explode":false,"in":"path","name":"txnId","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"description":"Payment refunded successfully. The payment details are returned."},"404":{"description":"Payment not found."},"422":{"description":"The payment cannot be refunded. Payments can only be refunded when a payment's `status` is Completed."}},"summary":"Refund a payment by its transaction ID","tags":["Payments"]}}}}
```

## GET /recurring-payments/{reference}

> Fetch a recurring payment (subscription) by its reference

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"Payments with reference IDs like `tbx-r-`. Can be paused, reeactivated, and cancelled provided a valid reference id.","name":"Recurring Payments"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"RecurringPayment":{"properties":{"id":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"paused_at":{"format":"date-time","nullable":true,"type":"string"},"paused_until":{"format":"date-time","nullable":true,"type":"string"},"next_payment_date":{"type":"string"},"reference":{"type":"string"},"account_id":{"type":"integer"},"interval":{"type":"string"},"cancelled_at":{"format":"date-time","nullable":true,"type":"string"},"cancellation_requested_at":{"format":"date-time","nullable":true,"type":"string"},"status":{"$ref":"#/components/schemas/RecurringPayment_status"},"amount":{"$ref":"#/components/schemas/RecurringPayment_amount"},"cancel_reason":{"nullable":true,"type":"string"},"links":{"$ref":"#/components/schemas/RecurringPayment_links"}},"type":"object"},"RecurringPayment_status":{"properties":{"id":{"type":"integer"},"class":{"type":"string"},"description":{"type":"string"},"active":{"type":"integer"}},"type":"object"},"RecurringPayment_amount":{"properties":{"amount":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"period":{"type":"string"}},"type":"object"},"RecurringPayment_links":{"properties":{"initial_payment":{"type":"string"},"payment_history":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"paths":{"/recurring-payments/{reference}":{"get":{"operationId":"getRecurringPayment","parameters":[{"description":"The recurring payment reference to fetch.","explode":false,"in":"path","name":"reference","required":true,"schema":{"type":"string"},"style":"simple"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringPayment"}}},"description":"Successfully fetched recurring payment."},"404":{"description":"Recurring payment not found."}},"summary":"Fetch a recurring payment (subscription) by its reference","tags":["Recurring Payments"]}}}}
```

{% openapi src="<https://924803319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaRz9HUAxrYuZsSDWhYnu%2Fuploads%2FxlNyfP91gTDjFnH9lvfH%2Fcheckout-api.yaml?alt=media&token=b7e53337-137e-47cd-885f-bbea7aa22554>" path="/recurring-payments/{reference}" method="put" %}
[checkout-api.yaml](https://924803319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaRz9HUAxrYuZsSDWhYnu%2Fuploads%2FxlNyfP91gTDjFnH9lvfH%2Fcheckout-api.yaml?alt=media\&token=b7e53337-137e-47cd-885f-bbea7aa22554)
{% endopenapi %}

{% openapi src="<https://924803319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaRz9HUAxrYuZsSDWhYnu%2Fuploads%2FxlNyfP91gTDjFnH9lvfH%2Fcheckout-api.yaml?alt=media&token=b7e53337-137e-47cd-885f-bbea7aa22554>" path="/recurring-payments/{reference}" method="delete" %}
[checkout-api.yaml](https://924803319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaRz9HUAxrYuZsSDWhYnu%2Fuploads%2FxlNyfP91gTDjFnH9lvfH%2Fcheckout-api.yaml?alt=media\&token=b7e53337-137e-47cd-885f-bbea7aa22554)
{% endopenapi %}

## PUT /recurring-payments/{reference}/status

> Pause or reactivate a recurring payment

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"Payments with reference IDs like `tbx-r-`. Can be paused, reeactivated, and cancelled provided a valid reference id.","name":"Recurring Payments"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"updateRecurringPayment_request":{"properties":{"status":{"description":"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.","enum":["Paused","Active"],"type":"string"},"paused_until":{"description":"To pause a payment, provide a ISO8601 formatted date on which the payment should be reactivated.","type":"string"}},"required":["status"]},"RecurringPayment":{"properties":{"id":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"paused_at":{"format":"date-time","nullable":true,"type":"string"},"paused_until":{"format":"date-time","nullable":true,"type":"string"},"next_payment_date":{"type":"string"},"reference":{"type":"string"},"account_id":{"type":"integer"},"interval":{"type":"string"},"cancelled_at":{"format":"date-time","nullable":true,"type":"string"},"cancellation_requested_at":{"format":"date-time","nullable":true,"type":"string"},"status":{"$ref":"#/components/schemas/RecurringPayment_status"},"amount":{"$ref":"#/components/schemas/RecurringPayment_amount"},"cancel_reason":{"nullable":true,"type":"string"},"links":{"$ref":"#/components/schemas/RecurringPayment_links"}},"type":"object"},"RecurringPayment_status":{"properties":{"id":{"type":"integer"},"class":{"type":"string"},"description":{"type":"string"},"active":{"type":"integer"}},"type":"object"},"RecurringPayment_amount":{"properties":{"amount":{"format":"float","type":"number"},"tax":{"format":"float","type":"number"},"period":{"type":"string"}},"type":"object"},"RecurringPayment_links":{"properties":{"initial_payment":{"type":"string"},"payment_history":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"paths":{"/recurring-payments/{reference}/status":{"put":{"operationId":"updateRecurringPayment","parameters":[{"description":"The recurring payment reference to update.","explode":false,"in":"path","name":"reference","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateRecurringPayment_request"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringPayment"}}},"description":"Successfully paused or reactivated a payment. The `RecurringPayment` is returned."},"404":{"description":"Recurring payment not found."},"422":{"description":"Unprocessible Entity. An invalid status was provided or the recurring payment cannot be processed. See ErrorResponse."}},"summary":"Pause or reactivate a recurring payment","tags":["Recurring Payments"]}}}}
```

## Update a basket's details, including expiry date.

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

```json
{"openapi":"3.0.3","info":{"title":"Tebex Checkout API","version":"1.1.4"},"tags":[{"description":"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.","name":"Baskets"}],"servers":[{"url":"https://checkout.tebex.io/api"}],"security":[{"tebex_checkout_auth_basic":[]}],"components":{"securitySchemes":{"tebex_checkout_auth_basic":{"scheme":"basic","type":"http"}},"schemas":{"updateBasket_request":{"properties":{"country":{"nullable":true,"type":"string"},"name":{"nullable":true,"type":"string"},"state_id":{"nullable":true,"type":"string"},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"creator_code":{"nullable":true,"type":"string"},"complete_auto_redirect":{"nullable":true,"type":"boolean"},"expires_at":{"description":"An ISO8601 formatted date. After this date the basket cannot be used to checkout.","format":"date-time","nullable":true,"type":"string"}},"type":"object"}}},"paths":{"/baskets/{ident}":{"put":{"description":"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.","operationId":"updateBasket","parameters":[{"description":"The basket identifier.","explode":false,"in":"path","name":"ident","required":true,"schema":{"type":"string"},"style":"simple"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateBasket_request"}}},"description":"The parameters of the basket you wish to update."},"responses":{"200":{"description":"Basket updated successfully"},"404":{"description":"Basket not found."}},"summary":"Update a basket's details, including expiry date.","tags":["Baskets"]}}}}
```
