Directing to Checkout
When the user is ready to checkout, you can fetch the current basket and direct the user to its links.checkout URL. Here, the user will enter their payment information and complete checkout.
If you'd like the user to stay on your site during checkout, use Tebex.js alongside the Headless API.
For most stores, authorizing the user against the basket is required before checkout. You can do this by directing the user to the appropriate link provided by the /baskets/auth endpoint. Read more here.
Gets a basket associated with the provided identifier.
Path parameters
tokenstringRequiredExample: 
The webstore identifier.
t66x-7cd928b1e9312709e6810edac6dc1fd1eefc57cbbasketIdentstringRequiredExample: 
The basket identifier.
c00244-d2ac2e77418a55b25292a6bc7a719ad9c529ba2cResponses
200
Successful response returns the basket information.
application/json
get
/accounts/{token}/baskets/{basketIdent}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": "[email protected]",
    "username": null,
    "coupons": [
      {
        "coupon_code": "Academy10"
      }
    ],
    "giftcards": [
      {
        "card_number": "0127 0244 7210 1111"
      }
    ],
    "creator_code": "text",
    "cancel_url": "https://tebex.io",
    "complete_url": null,
    "complete_auto_redirect": false,
    "country": "US",
    "ip": "127.0.0.1",
    "username_id": 127244,
    "base_price": 1.27,
    "sales_tax": 0.11,
    "total_price": 1.38,
    "currency": "USD",
    "packages": [
      {
        "qty": 2,
        "type": "single",
        "revenue_share": [
          {
            "wallet_ref": "some_wallet_reference",
            "amount": 0.5,
            "gateway_fee_percent": 50
          }
        ]
      }
    ],
    "custom": {
      "foo": "bar",
      "ref": 1234
    },
    "links": {
      "payment": "https://checkout.tebex.io/api/payments/tbx-12345",
      "checkout": "https://checkout.tebex.io/checkout/1a-55fff4107740a1f40d844ff89607557f45bfafb3"
    }
  }
}Last updated
Was this helpful?

