Tansik API and webhooks: connect your store to your systems
API tokens limited to the sites and actions you choose, and signed webhooks that tell your system the moment an order, booking or form reply arrives.
As your business grows, other systems appear: a warehouse program, a CRM, a reporting dashboard, a sheet your sales team follows. Instead of copying orders and bookings from your site into them by hand, the Tansik API and webhooks connect them directly. This article is for the business owner and their developer alike.
Before you code: what is already connected?
A lot is connected in Tansik with no code at all, so check that first:
- Payments: Moyasar (cards, mada and Apple Pay), Tabby and Tamara, on your own accounts.
- Shipping: Aramex and SMSA labels and tracking.
- Invoicing and accounting: ZATCA tax invoices with the QR code and Fatoora reporting, and invoices in Daftra, Qoyod or Wafeq for every confirmed order.
- Marketing: Google Ads, the Meta, TikTok and Snapchat pixels, and product feeds for their shops.
- Appointments: Google Calendar and Zoom.
If what you need is on this list, you don’t need the API. If your system is your own, read on.
What does the API do?
It is a REST API that returns JSON, documented with OpenAPI so your developer or their tools can read it. It covers:
- Sites: the sites the token can reach.
- Products: read them, create a new product, update an existing one.
- Orders: read them in detail, and update an order’s status, for example to “shipped” when it leaves your warehouse.
- Customers: your store’s customers.
- Bookings and form replies: read only.
Results come in pages of 50, and each token has a limit on requests per minute.
Tokens with the access you choose
Not every system needs everything. When you create a token you choose:
- The sites it works on, one or more.
- The actions it may take: read products, change them, read orders, update them, and so on.
- An expiry if you want one: 30, 90 or 365 days.
A token never does more than the person who made it can do; a team member who can’t see orders can’t give a token that reads them. You can revoke any token at any time.
Webhooks: your system knows the moment it happens
Instead of your system asking Tansik every minute “anything new?”, Tansik sends it a request as soon as one of these events happens:
order.created: a new order.order.status_changed: an order’s status changed.booking.created: a new booking.form.submitted: a new form reply.product.updated: a product was changed.
You add your system’s URL and choose the events, for one site or for every site in your account. Each request is signed with a Tansik-Signature header (HMAC-SHA256 with a secret for that URL), so your system can check it really came from Tansik. If delivery fails, Tansik retries up to six times over several hours. From the dashboard you can send a test request, see the delivery log, redeliver any request, and change the secret whenever you like.
Practical examples
- A store and a warehouse:
order.createdreaches the warehouse system, which starts packing, then updates the order’s status through the API, and the customer sees the update on their order page. - A clinic and a CRM: every
booking.createdbecomes a record for the front desk. - A services company: every
form.submittedfrom a “request a quote” form lands in the sales sheet. - An agency: collects its clients’ orders in one reporting dashboard. Read the guide for agencies.
Get started
The API and webhooks come with the plans that include them; see the plans. Then create a token in your dashboard, give it to your developer with the OpenAPI document, and add your first webhook. If you are just starting your store, begin with selling online in Saudi Arabia.
Questions
Do I need a developer to use the API?
Usually, yes: it is for connecting other systems to Tansik. Payments, shipping, accounting and ads are already connected without code.
How do I know a webhook request came from Tansik?
Every request carries a Tansik-Signature header with an HMAC-SHA256 signature made with your URL’s secret, which your system checks before accepting it.
Can a token delete my data?
No. The API reads, creates and updates products, and updates order statuses only, within the sites and actions you chose for the token.
Start your site on Tansik and turn on what you read about from your dashboard.