TanqoryDocs

Webhooks

Webhooks go both ways: Tanqory tells apps when a store's data changes, and Tanqory receives events from the payment and billing providers it works with.

Webhooks Tanqory sends to apps

An app subscribes to a topic, such as products/create, with webhookSubscriptionCreate. Each event on that topic is then sent to the subscription's endpoint as an HTTP POST whose body is the changed resource, in JSON (or XML for a subscription in that format), with these headers:

HeaderValue
Content-Typeapplication/json, or application/xml for a subscription in XML.
User-AgentTanqory-Webhooks/1.0
X-Tanqory-TopicThe topic, such as products/create.
X-Tanqory-Hmac-Sha256The signature of the body: see below.
X-Tanqory-Shop-DomainThe store's domain.
X-Tanqory-API-VersionThe subscription's API version; the body follows that version.
X-Tanqory-Webhook-IdThe id of this delivery. It stays the same when the delivery is retried.
X-Tanqory-Event-IdThe id of the event. Every subscription to one event gets the same one.
X-Tanqory-Triggered-AtWhen the change happened (ISO 8601).
X-Tanqory-NameThe subscription's name, when it has one.

Checking that a delivery comes from Tanqory

Compute an HMAC-SHA256 of the raw request body with your app's client secret, encode it in base64 and compare it with X-Tanqory-Hmac-Sha256 in constant time. A webhook a merchant creates in the store's settings is signed with the store's signing secret instead, shown on that settings page. Use the raw bytes of the body, before any JSON parsing.

import { createHmac, timingSafeEqual } from 'node:crypto';

function fromTanqory(rawBody, header, secret) {
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const given = Buffer.from(header ?? '', 'base64');
  return given.length === expected.length && timingSafeEqual(given, expected);
}

Answering and retries

  • Answer with any 2xx status within 5 seconds. Do the work after answering.
  • Any other answer, or none in time, is retried: up to 9 attempts in all, waiting 1, 2, 4, 8, 16, 32, 64, 128 minutes between them (about 4 hours 15 minutes in total).
  • A retry carries the same X-Tanqory-Webhook-Id. Use it to process each delivery once.

Webhooks Tanqory receives

Every webhook Tanqory receives from a third party has its address under one path: https://api.tanqory.com/v1/webhooks/<provider>[/…]. These addresses are for the providers Tanqory works with, not for apps.

MethodAddressReceives
POSThttps://api.tanqory.com/v1/webhooks/easyshipProvider events.
GEThttps://api.tanqory.com/v1/webhooks/payments/{storeId}/{connectionId}Events from a payment gateway account a store connected. Tanqory gives the gateway this address when the merchant connects the account.
POSThttps://api.tanqory.com/v1/webhooks/payments/{storeId}/{connectionId}Events from a payment gateway account a store connected. Tanqory gives the gateway this address when the merchant connects the account.
GEThttps://api.tanqory.com/v1/webhooks/payments/{storeId}/{connectionId}/returnProvider events.
POSThttps://api.tanqory.com/v1/webhooks/stripeStripe Billing events of Tanqory's own billing: store plans, charges and invoices.
POSThttps://api.tanqory.com/v1/webhooks/stripe/connectStripe Connect events of stores' payment accounts. They finish payments the buyer completed away from checkout, such as PromptPay or 3-D Secure.
  • Each receiver checks the provider's signature over the raw body, and answers 401 when it does not verify, without saying whether the event, account or store exists.
  • Each event is processed once: the same event delivered again answers 200 and changes nothing.

Built from commit c0b3fb3fdef7 · API version 2026-10