How Teak works

The four steps of every Teak integration, the pieces involved, and how to choose your path.

Every TeakOS integration follows the same four steps, whichever way you connect. What changes is who makes each call.

The four steps

StepWhat happens
1. OfferTeak prices protection for one item or many, for example a cart or a page of search results, and starts a session for the purchase.
2. ConfirmThe customer accepts or declines optional protection, and the price is locked. Embedded protection is included in the price, so there's nothing to ask.
3. SubmitYour systems place the order with the customer's details. Teak issues protection for each protected item at the confirmed price.
4. NotifyTeak sends your systems webhooks as protection is issued, and whenever it changes after purchase.

The parts of an integration

A Teak integration has three parts: the widget in your checkout, your server, and Teak. On the server-to-server path, your server does the widget's job too.

CUSTOMER'S BROWSERYOUR SERVERTeakOS Widgetyour checkout pageTeakquotes, issues, notifiesCheckout backendWebhook endpoint1-2Quote + choice3Session ID4Submit order5Contract Issued webhook
PartWhat it does
TeakOS WidgetShows the protection offer, prices it for the cart, and saves the customer's choice to Teak. Runs in the customer's browser with your public key.
Your serverPlaces the order with Teak when checkout completes, using your secret key, and receives webhooks. On the server-to-server path, it also gets protection prices and sends the customer's choices.
TeakPrices protection, issues it for each protected item, emails the customer about optional protection, and sends webhooks as protection changes.

Choose your path

TeakOS WidgetServer to server
OfferThe widget prices the cart when it loads, and shows the offer.Your server calls the Programs API, and you show the offer in your own interface.
ConfirmThe widget saves the customer's choice.Your server sends the customer's choices when it confirms the order.
SubmitYour server calls Teak's Order Submit endpoint.Your server places the order. See Confirm the order.
NotifyWebhooks to your server.Webhooks to your server.
Best forA web checkout you control.Booking tools, apps, AI agents, and checkouts that can't run the widget.
Start hereTeakOS integration guideServer-to-server guide

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

The life of an order

Step through an order from the first price to issued protection.

With the TeakOS Widget

CUSTOMER'S BROWSERYOUR SERVERTeakOS Widgetyour checkout pageTeakquotes, issues, notifiesCheckout backendWebhook endpoint1Quote3Session ID4Submit order5Contract Issued webhook

The widget loads with the items in the cart. Teak prices protection and creates a session that holds the quote. The widget shows the offer.

teak('configure', {
  apiKey: 'pk_...',
  items: [{ name: 'GA Ticket', referenceNumber: 'ITEM-1', productTypes: ['general-admission'], cost: 120, event: { location: 'Austin, TX' } }],
});

Add the widget

Server to server

CUSTOMER-FACINGYOUR SERVERYour appsearch and checkoutTeakprices, issues, notifiesCheckout backendWebhook endpoint1Programs API2Offer and choice4Webhooks

Your server sends items and the customer's location to the Programs API: a page of search results, or the cart at checkout. Teak returns a protection price for each item and creates a session for the purchase.

POST /v1/programs
{ "currency": "USD", "locale": "en_US", "location": { "country": "US", "region": "TX" }, "items": [ ... ] }

200 OK
{ "session_id": "3f1c9a2e-...", "items": [ { "reference_id": "ITEM-1", "estimated_premium": "4.60", ... } ] }

Price and show protection

Notifications after purchase

Teak sends a signed, asynchronous webhook each time protection changes after checkout, on both paths:

EventsWhen Teak sends themWhat you do
Contract IssuedTeak issues protection for an item, once per item.Record the protection against your order. Required.
Contract VoidProtection is removed: the customer voids it within its look period, or the order doesn't pass Teak's checks.Refund the customer the protection price. Required.
Contract Canceled, On Hold, ChargebackProtection is canceled, paused, or disputed.Update the protection's status in your system. Don't refund a cancellation.
Contract Upgraded, Downgraded, ExchangedAn item changes after purchase, for example an exchange.Update the protection and its price. Downgraded is required if customers can exchange items.
Refund request eventsA customer files a refund request, and as Teak reviews and decides it.Keep your support team informed.

Verify each webhook's signature, and respond 2xx to every event, including ones you don't act on.

Billing

The customer pays you for protection as part of their order. Teak bills you for issued contracts on your regular invoice. Teak doesn't take payment from your customers, so you don't send card or payment details to Teak.

Next steps

Get your sandbox keys, then build your integration step by step:


Did this page help you?