Change a contract

Void, cancel, or exchange a customer's protection after checkout, and when to use each.

After checkout, a customer's protection can change: they change their mind, their ticket changes hands, or they swap it for another. Each protected item has its own contract, so you change protection one item at a time.

A contract is called a policy in the API

Each contract is identified by the policy_number from its Contract Issued webhook, and its endpoints are under /policies/.

Choose the change

What happenedChangeCustomer refunded the protection price?
The customer asks to remove protection, within its look periodVoidYes, by you
You refund or cancel the customer's whole purchase, within the look periodVoidYes, by you, with the rest of the order
You refund the item after the look period has endedCancelOnly if you choose to, from your own funds
The customer transfers the ticket to someone elseCancelNo
The customer resells the ticket, for example through your resale marketplaceCancelNo
The customer swaps the item for a different oneExchangeThe difference, if the new item costs less
The customer can't attend and wants their money backNothing: they request a refund from TeakBy Teak, if the request is approved

Protection doesn't transfer to a new owner, which is why a transfer or resale cancels it.

Void a contract

Voiding removes the protection, and the customer gets the protection price back. Use it within the contract's look period, when the customer shouldn't pay for protection after all.

  • The customer: loses the protection, and gets the protection price back from you. You collected it at checkout, so you refund it.
  • You: refund the customer the contract's premium.
  • Webhook: Contract Void.

Call Void a contract with the policy_number. These samples use TEAK_API and the token function from Get an access token:

async function voidTeakContract(policyNumber) {
  const res = await fetch(`${TEAK_API}/policies/${encodeURIComponent(policyNumber)}/void`, {
    method: 'PUT',
    headers: { Authorization: `Bearer ${await getTeakToken()}` },
  });
  if (!res.ok) throw new Error(`Teak void failed: ${res.status} ${await res.text()}`);
  return res.json(); // { "status": "Voided", "void_date": "..." }
}
from urllib.parse import quote


def void_teak_contract(policy_number):
    res = requests.put(
        f"{TEAK_API}/policies/{quote(policy_number, safe='')}/void",
        headers={"Authorization": f"Bearer {get_teak_token()}"},
        timeout=10,
    )
    if not res.ok:
        raise RuntimeError(f"Teak void failed: {res.status_code} {res.text}")
    return res.json()  # {"status": "Voided", "void_date": "..."}
curl -X PUT https://api.sandbox.helloteak.com/v1/policies/4f527d2e-0053-4b1c-82dd-db095f09e743/void \
  -H 'Authorization: Bearer <token>'

The void finishes shortly after the response, and Teak then sends Contract Void. Refund the customer from your Contract Void handler, not from the response, so you refund once however the void happened. Customers can also void protection themselves, from the cancellation link in their confirmation email, and it can be voided from the Teak Dashboard. Each way sends the same webhook.

A void is rejected when:

  • The look period has ended. Cancel the contract instead.
  • The contract has an approved refund request, or it's already voided or upgraded.
  • The contract isn't issued yet. Wait for its Contract Issued webhook.
  • Your account voids whole orders rather than single contracts. Contact your Teak integration contact.

Each rejection, with its exact response, is in the Void a contract reference.

Cancel a contract

Canceling ends the protection without a refund from Teak. Use it when protection should stop but the customer isn't owed the protection price back from Teak: after the look period, or when the ticket changes hands.

  • The customer: loses the protection. They can no longer void it or request a refund under it, and Teak doesn't refund the protection price.
  • You: Teak still invoices you for the contract. If you're refunding the customer's whole purchase after the look period, you can include the protection price, but it comes from you.
  • Webhook: Contract Canceled.

Call Cancel a contract with the policy_number:

async function cancelTeakContract(policyNumber) {
  const res = await fetch(`${TEAK_API}/policies/${encodeURIComponent(policyNumber)}/cancel`, {
    method: 'POST',
    headers: { Authorization: `Bearer ${await getTeakToken()}` },
  });
  if (!res.ok) throw new Error(`Teak cancel failed: ${res.status} ${await res.text()}`);
  return res.json(); // { "status": "canceled", "cancel_date": "..." }
}
from urllib.parse import quote


def cancel_teak_contract(policy_number):
    res = requests.post(
        f"{TEAK_API}/policies/{quote(policy_number, safe='')}/cancel",
        headers={"Authorization": f"Bearer {get_teak_token()}"},
        timeout=10,
    )
    if not res.ok:
        raise RuntimeError(f"Teak cancel failed: {res.status_code} {res.text}")
    return res.json()  # {"status": "canceled", "cancel_date": "..."}
curl -X POST https://api.sandbox.helloteak.com/v1/policies/4f527d2e-0053-4b1c-82dd-db095f09e743/cancel \
  -H 'Authorization: Bearer <token>'

A contract can be canceled at any time while it's issued, unless it has a refund request that isn't denied or closed. Each rejection, with its exact response, is in the Cancel a contract reference.

Exchange an item

When a customer swaps an item for a different one, its contract moves to the new item, and Teak re-prices the protection:

New itemWebhookWhat to do
Costs moreContract UpgradedUpdate the item and the protection price.
Costs lessContract DowngradedRefund the customer the difference in protection price.
Costs the sameContract ExchangedUpdate the item details.

Exchanges need extra setup and aren't in the Teak Partner API reference. If customers can exchange items on your platform, ask your Teak integration contact how to set them up for your account. Contract Downgraded is required when they can.

Test your changes

In sandbox, void and cancel a contract and check your system handles each webhook: the UAT test cases list what to try.

Next steps

To handle what happens after a change:

  • Handle contract events, so your system reflects every change, however it was made.
  • Look up how to handle errors, and when a retry is safe.

Did this page help you?