Before you start
Get your API keys and sandbox access.
Get your account set up
Your Teak integration contact sets up your account. Ask them for:
- 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_...). - Your product types mapped. List the product types your inventory system uses, such as
general-admissionorparking, and Teak maps each one to the protection it offers. The widget sends them with each item. See Product types. - Tokenized orders enabled on your account. Until it is, Submit an order returns
403.
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
You get a pair of keys for each environment:
| Key | Format | Where it's used |
|---|---|---|
| Public key | pk_... | In the customer's browser, as the widget's apiKey. Safe to include in your pages. |
| Secret key | sk_... | On your server only. Exchanged, with the public key, for a short-lived access token. See Create an access token. |
Store it in a secret manager or environment variable. Don't put it in browser code, mobile apps, or source control. If it's exposed, contact your Teak integration contact to replace it.
Environments
Build and test in sandbox first: use your sandbox keys and set sandbox: true in the widget. See Environments and keys for the URLs and how authentication works.
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, put the widget on your checkout page:
- Add the widget to your checkout page and pass in the cart.
- Receive webhooks to learn when protection is issued, voided, or changed.
Updated 19 days ago
