Before you start

Get your API keys, your account set up, and sandbox access for the server-to-server path.

Server-to-server and AI integrations are for enterprise partners only. Teak Solutions Team works with partners to determine the appropriate integration solution.

Get your account set up

Your Teak integration contact sets up your account with you. Ask them for these:

  • Sandbox access to the Teak Dashboard, where you manage webhooks and see test orders.
  • Sandbox API keys: a public key (pk_...) and a secret key (sk_...).
  • TeakOS enabled on your account. Until it is, Teak's API returns 403.
  • The calls to confirm orders, which your server uses in Confirm the order.
  • Timing for the new way to request offers. Teak is replacing the Programs API with it, so agree when you'll build against it. See Coming soon.
  • Your product types mapped. List the product types your inventory system uses, such as hotel-stay or general-admission, and Teak maps each one to the protection it offers. You send them with each item as product_types.
  • Whether each product is optional or embedded. Teak sets this for each protection product:
    • Optional protection is offered to the customer, who accepts or declines it. You send their choice when you confirm the order.
    • Embedded protection is included in the item's price. The customer can't remove it, so there's no choice to ask for.
  • Sandbox test data: the product types and location values that return a price in sandbox, so you can test a full purchase on your own.

You get separate production keys when you're ready to go live.

If you're a platform selling for several businesses, onboard each one as a client first, and use its keys in this guide.

Where each key goes

On this path, both keys stay on your server. There's no browser code.

KeyFormatHow it's used
Public keypk_...Sent with the secret key to Create an access token.
Secret keysk_...Sent with the public key to Create an access token, and nowhere else.

Every other call in this guide authenticates with the short-lived access token you get back. See Which key for which call.

Keep your secret key on your server

Store it in a secret manager or environment variable. Don't put it in apps or source control. If it's exposed, ask your Teak integration contact to replace it.

Environments

EnvironmentBase URL
Sandboxhttps://api.sandbox.helloteak.com/v1
Productionhttps://api.helloteak.com/v1

Build and test in sandbox first. See Environments and keys for how authentication works.

Map your data

Before you write any calls, check you can supply this for every item and every customer:

You sendFrom your systemDetails
Item name, ID, and product typesYour inventoryBuild the request
Item cost, as a stringYour pricing, including taxes and feesBuild the request
Event or trip, with its start and end timesYour inventoryBuild the request
Where the customer isTheir geo: country and region, or IP addressSend the customer's location
The person booking, and their billing addressYour checkoutConfirm the order

Set up webhooks

Two webhooks are required to go live:

  • Contract Issued: confirms protection was issued, so you can record it and reconcile your invoice.
  • Contract Void: tells you when protection is removed, so you can refund the customer.

If customers can exchange items, Contract Downgraded is also required.

You'll use them while testing. Set them up now, following Receiving webhooks.

Next steps

With your keys and sandbox ready, price your first items:


Did this page help you?