TeakOS integration guide
Offer your refund protection with the TeakOS Widget and submit orders from your server.
This guide takes you from a blank checkout to a live integration. You add the TeakOS Widget to your checkout page, and your server tells Teak when the customer completes their purchase.
Follow Migrate from the Legacy API instead. It maps each part of your current integration to this one.
How it works
Prefer a step-by-step view? Step through the life of an order.
- The widget quotes and records the choice. When the widget loads, Teak prices protection for the items you pass in and creates a session. The session holds the quote and the customer's opt-in or opt-out. The widget keeps it up to date as the customer changes their choice or you update the cart.
- Your server submits the order. When the customer completes checkout, your page sends the session ID to your server along with the order. Your server calls Submit an order with the session ID, your order number, and the customer's details.
- Teak issues the protection. Teak creates the order and issues protection for each item the customer opted in to. Teak then sends you a Contract Issued webhook for each one.
You never send prices to Submit: the session already holds them, so what the customer saw in the widget is what Teak issues.
Prefer to start from code? The quickstart shows the whole flow, from your checkout page to your server, in Node.js or Python:
Or run the complete checkout example from teak-examples, in Node.js or Python, with Docker.
Steps
- Before you start: get your keys and set up your sandbox.
- Add the widget to your checkout page.
- Handle the customer's choice: callbacks, cart updates, and errors.
- Submit the order from your server.
- After checkout: reset the widget, confirm issuance, and show the customer their links.
- Go live.
Current limitations
- One protection product per checkout. Support for offering several products together is coming.
- The widget session is shared between pages on the same domain only. If your cart and checkout run on different domains, show the widget on the checkout domain.
Next steps
Start with step 1:
- Get your API keys and sandbox access before you write any code.
- Plan your integration: answer a few questions and get a ticket for each step, for your team's tracker.
Updated 19 days ago
