After checkout

Reset the widget, confirm protection was issued, and give the customer their links.

Reset the widget session

Once an order is submitted, its session is closed and can't change. Clear it in the customer's browser as soon as checkout completes, for example on your order confirmation page:

teak('clearSession');

The customer's next purchase then starts a new session. If you skip this, a second purchase from the same browser within 120 minutes reuses the closed session, and the widget fails with an error when the customer makes their choice.

Confirm the protection was issued

After a 202 from Submit, Teak creates the order and issues protection, usually within a few seconds. Teak then sends a Contract Issued webhook for each protected item.

In your webhook handler:

  1. Match the webhook to your order with data.order_number, which is the reference_id you submitted.
  2. Store data.policy_number against the item, matching data.reference_number to the item's referenceNumber.
  3. Mark the protection as active in your system.

Teak invoices you for issued contracts, so these records let you reconcile your invoice.

If a Contract Issued webhook doesn't arrive within a few minutes, look the order up with Retrieve order details. Each item's status shows whether its protection was issued.

Give the customer their links

For optional protection, customers get an email from Teak with their protection details. You can also show their links, for example on your confirmation page, in your order email, or in the customer's account.

Teak doesn't email customers about embedded protection

Embedded protection is included in the item's price, and Teak sends the customer no confirmation email for it. Send them their protection details yourself, using the links below, for example in your order confirmation.

Call Retrieve order details with your order number and the customer's email:

curl "https://api.sandbox.helloteak.com/v1/orders/ORD-1001/details?email=ada%40example.com" \
  -H 'Authorization: Bearer <token>'

Each entry in primary_policies[].links includes the customer's certificate, the policy terms, and where to request a refund or cancel. Passing the customer's email returns links the customer can open directly.

The order is created a few seconds after Submit returns 202, so this call can return 404 at first. Call it from your Contract Issued webhook handler, or retry after a short wait.

Handle changes after checkout

Protection keeps changing after the order, and Teak notifies you of each change with a signed, asynchronous webhook:

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.

Respond 2xx to events you don't act on, including new event types Teak adds later.

You can also change protection yourself:

  • Void a contract within its look period, for example when the customer asks you to remove it. Refund them the protection price.
  • Cancel a contract when protection should end without a refund, for example when you refund the item after the look period, or the ticket is transferred or resold.

See Change a contract for which change fits each situation, including exchanges.

Next steps

Your integration is complete. Test it and switch to production:

  • Work through the go-live checklist to confirm your integration is ready for production.
  • Handle contract events when protection is issued, voided, canceled, or changed.

Did this page help you?