Go live

The checklist and UAT test cases for the server-to-server path, and how to switch to production.

Work through this list in sandbox, then again after switching to production.

Before Teak issues production keys, your Teak integration contact runs a UAT session with you that covers the UAT test cases below. Run them yourself first, so the session goes smoothly.

Keys and tokens

  • Both keys are only on your server, in a secret manager or environment variable.
  • You reuse an access token until it's close to expiring, and get a new one on a 401.
  • Every call for a session uses the same client's keys.

The Programs API

  • Every call sends the customer's location, with region in the US and Canada.
  • Each item has name, reference_id, product_types, and cost as a string that includes its share of taxes and fees.
  • Each item's event has a name, and start and end times with their UTC offset.
  • Items that cost 0 are left out.
  • You keep the session_id with the cart and send it on every later call for the purchase.
  • You price again whenever an item changes.
  • A slow or failed call to the Programs API never blocks your page: it times out, and your page shows without a protection price.

Show the offer

  • The offer shows the protection price from the Programs API, as returned.
  • For optional protection, accepting adds the price to the order total, and declining removes it.
  • For embedded protection, the customer is told that protection is included.

Confirm the order

  • You place the order with Teak only after your own order is confirmed.
  • Every order sends the customer's choice for every optional item, including the ones they declined.
  • Every order has a unique order number, the person booking as the customer, and payment as { "type": "invoice" }.
  • You check the HTTP status first, handle 202 and 204, treat "already placed" as accepted, and retry 503.
  • A new session is used for each purchase, and never again once the order is placed.
  • If a session expires before checkout completes, you price the cart on a new session and show the new prices.
  • A Teak error never fails the customer's order.

Webhooks

  • Subscriptions for Contract Issued and Contract Void, with a secret.
  • Subscriptions for the refund request events your support team needs. We recommend Created, Approved, Denied, and Pending Consumer.
  • If you're a partner with several clients, subscriptions are set up at the partner level, so you get events for every client.
  • Your endpoint verifies signatures and rejects invalid ones.
  • Your endpoint responds within 10 seconds and ignores repeated events.
  • Your endpoint responds 2xx to events it doesn't act on, including event types Teak adds later.
  • Contract Void refunds the customer the protection price.
  • Contract Downgraded is handled too, if customers can exchange items.
  • For embedded protection, you send the customer their protection details yourself.

UAT test cases

Run each test in sandbox. Find sandbox orders and contracts in the Teak Dashboard under Orders and Policies.

The Programs API

TestExpected result
Price a page of results, then the same item at checkout on the same session.The price at checkout matches the price on the results page.
Price an item with a product type Teak doesn't recognize, alongside a known one.The whole call returns 422, naming the item. Your page shows without a protection price.
Price with no location, or a US country with no region.The Programs API returns 422. Your system logs it and doesn't offer protection.
Send an event time without a UTC offset in testing.Your tests catch it before it reaches Teak. A time without an offset is read as UTC.

Optional protection

TestExpected result
Accept protection and complete the purchase.Teak accepts the order (202). A Contract Issued webhook arrives for each item, with reference_number matching the item's reference_id.
Decline protection and complete the purchase.Teak returns 204. No contract is created and no webhooks arrive.
Protect one item and decline another in the same cart.A Contract Issued webhook arrives only for the protected item.
Check the customer's inbox.The customer receives Teak's confirmation email.

Embedded protection

TestExpected result
Complete the purchase without asking the customer.Teak accepts the order (202), and a Contract Issued webhook arrives for each item.
Check the customer's inbox.No email from Teak. Your own confirmation includes the protection details and links from Retrieve order details.

Confirm the order

TestExpected result
Confirm the same order twice.The second attempt reports the order as already placed, and your system treats it as accepted.
Check the amounts.The protection price you charged matches the price from the Programs API, and the premium in the Contract Issued webhook.
Check the Teak Dashboard.The order appears under your client, with one contract for each protected item.

Notifications

TestExpected result
Send a request to your webhook endpoint with a wrong signature.Your endpoint responds 401 and discards it.
Send the same event twice.Your system handles it once.

Voids and cancels

TestExpected result
Void one contract within its look period, with Void a contract, the customer's cancellation link, or the Teak Dashboard.A Contract Void webhook arrives, and your system refunds the customer the protection price.
Void several contracts on the same order.A Contract Void webhook arrives for each, and your system refunds each one.
Void a contract after its look period, if you can set one up.The void is rejected with error.code 422.
Cancel a contract.A Contract Canceled webhook arrives. The customer isn't refunded.

Refund requests

TestExpected result
Submit a refund request from the customer's refund request link.A Refund Request Created webhook arrives.
Ask your Teak integration contact to approve, deny, and close sandbox refund requests.A Refund Request Approved, Denied, or Closed webhook arrives for each.

Switch to production

  1. Get your production keys from your Teak integration contact.
  2. Replace the sandbox keys on your server, and use https://api.helloteak.com/v1.
  3. Create your webhook subscriptions in the production Teak Dashboard.
  4. Place a real order with protection and confirm you receive Contract Issued.
  5. Subscribe your team to status.helloteak.com by email, Slack, Microsoft Teams, or RSS, so you hear about incidents affecting the Teak API.

Next steps

You're live. Keep these close for when something changes or goes wrong:

  • Handle contract events when protection is voided, canceled, or changed after launch.
  • Check your server handles every kind of API error: see Error handling.
  • Use Troubleshooting when a price or order doesn't do what you expect.

Did this page help you?