Server-to-server guide

Offer protection, confirm the order, and get notified, all from your server.

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

On the server-to-server path, your server talks to Teak directly. It gets protection prices, confirms the order, and receives Teak's webhooks, and you show the offer in your own pages. There's no pre-built browser widget, so it works for booking tools, apps, and AI agents as well as web checkouts.

Showing the TeakOS Widget at checkout? Follow the TeakOS integration guide instead.

How it works

OFFERCONFIRM THE ORDERNOTIFYCustomeron your site or appYour appsearch and checkoutYour serverbackendTeakPartner API1POST /programs2Prices and session ID3Your offer4Chooses, then buys5Order and choices6Confirm the order7202 Accepted8Webhook events9Your confirmation

Every TeakOS integration follows the same four steps. On this path, your server makes every call to Teak:

  1. Offer. Your server calls the Programs API for one item or many, for example a page of search results or the cart. Teak returns a protection price for each item and starts a session for the purchase. You show the offer in your own interface. See Price and show protection.
  2. Confirm. The customer accepts or declines optional protection. Embedded protection is included in the price, so there's nothing to ask.
  3. Submit. When the purchase completes, your server sends the customer's choices and details, and places the order. Teak issues protection at the price you showed. In this guide, steps 2 and 3 share a page: Confirm the order.
  4. Notify. Teak sends your server webhooks as protection is issued, and whenever it changes after purchase. See After the order.

You don't send prices when you place the order. The session already holds them, so the customer pays the price they were shown. See Sessions.

Coming soon

A new way to request offers

Teak is building a new way for your server to request offers. It brings:

  • A simpler integration. Your server sends less data with each request.
  • More accurate offers. The protection and price Teak returns fit each item more closely.
  • Greater offer flexibility. Teak can combine protection products and offer the customer the best fit.
  • The same cover wherever you offer it. One session works across the TeakOS Widget, your server, and AI agents.

When it's ready:

  • The four steps stay the same: offer, confirm, submit, and notify.
  • The Programs API will be deprecated in 2027, along with the current way of placing server-to-server orders.
  • Your Teak integration contact will let you know when it's available, and how to move over.

The TeakOS integration guide, including Submit an order, isn't affected.

What your server does instead of the widget

TaskWith the TeakOS WidgetOn this path
Price protectionThe widget prices the cart when it loads.Your server calls the Programs API.
Show the offerThe widget displays it.You display it in your own interface. See Show the offer.
Record the customer's choiceThe widget saves it.Your server sends it.
Place the orderYour server calls Teak's Order Submit endpoint.Your server confirms the order.
Listen to changesWebhooks.Webhooks.

Build with an AI agent

An AI agent that buys on a customer's behalf makes the same calls, in the same order. It also needs to:

  • Call Teak through your server or a tool you control, which holds your keys and access token. Don't put your secret key or an access token in a prompt or a model's context.
  • Show the customer the price from the Programs API as it was returned. Don't let the model calculate, round, or convert it.
  • Ask the customer before accepting optional protection, and tell them the price and what it covers. For embedded protection, tell them it's included in the price.
  • Place the order only when the purchase completes, with the details of the person booking.

To build with AI coding tools, connect them to these docs: see AI and LLM tools.

Example code

This recipe prices a page of search results in Node.js and Python:

For a complete store, run the server-to-server example in Node.js or Python. It prices search results and the cart with the Programs API and shows the offer. The Confirm the order step is one function, for you to fill in with the calls from your Teak integration contact.

Steps

  1. Before you start: get your keys, your account set up, and sandbox access.
  2. Price and show protection: get prices from the Programs API, and show the offer.
  3. Confirm the order: record the customer's choices and place the order.
  4. After the order: record issued protection and later changes, and give the customer their protection details.
  5. Go live: run the checklist and UAT cases, then switch to production.

Next steps

Start with step 1:


Did this page help you?