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-stayorgeneral-admission, and Teak maps each one to the protection it offers. You send them with each item asproduct_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
locationvalues 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.
| Key | Format | How it's used |
|---|---|---|
| Public key | pk_... | Sent with the secret key to Create an access token. |
| Secret key | sk_... | 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.
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
| Environment | Base URL |
|---|---|
| Sandbox | https://api.sandbox.helloteak.com/v1 |
| Production | https://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 send | From your system | Details |
|---|---|---|
| Item name, ID, and product types | Your inventory | Build the request |
| Item cost, as a string | Your pricing, including taxes and fees | Build the request |
| Event or trip, with its start and end times | Your inventory | Build the request |
| Where the customer is | Their geo: country and region, or IP address | Send the customer's location |
| The person booking, and their billing address | Your checkout | Confirm 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:
- Price and show protection from your server.
- Learn how a session carries one purchase from the first price to the order.
Updated 9 days ago
