istifSaasDevelopers · API v3Geliştiriciler · API v3
istifSaas Public API · v3

Connect your ERP to the warehouseERP'nizi depoya bağlayın

A REST/JSON API for two-way integration with the istifSaas warehouse management system. Send products, customers and orders in; get shipments, goods receipts, stock and real-time events out.

istifSaas depo yönetim sistemiyle iki yönlü entegrasyon için REST/JSON API. Ürün, cari ve siparişleri gönderin; sevkiyat, mal kabul, stok ve anlık olayları alın.

First, choose how istifSaas runs for youÖnce istifSaas'ın nasıl çalıştığını seçin

The API is identical in both; addresses, client IDs and a few network rules differ. Every example on this page follows your choice, and you can switch at any time from the top bar.

API her ikisinde de aynıdır; adresler, istemci kimlikleri ve birkaç ağ kuralı farklıdır. Bu sayfadaki tüm örnekler seçiminize göre değişir; üst çubuktan istediğiniz zaman değiştirebilirsiniz.

—operationsişlem
13scopesizin
12event typesolay türü
OAuth 2.0client credentialsclient credentials

What you can buildNeler yapabilirsiniz

DirectionYönDataVeriTypical useTipik kullanım
You → WMSSiz → WMSProducts, barcodes and bundles, customers and suppliers, sales orders, purchase ordersÜrünler, barkodlar ve setler, müşteri ve tedarikçiler, satış siparişleri, satınalma siparişleriSend records created in the ERP to the warehouseERP'de oluşan kaydı depoya iletmek
WMS → youWMS → sizOrder status, stock by warehouse and bin, stock movements, shipments, goods receipts, returns, stock counts, transfersSipariş durumu, depo ve hücre bazında stok, stok hareketleri, sevkiyat, mal kabul, iade, sayım, transferPost what happened in the warehouse to the ERP: delivery notes, invoices, stockDepoda olanı ERP'ye işlemek: irsaliye, fatura, stok
Real timeAnlıkSigned webhooks or a pollable event feedİmzalı webhook'lar ya da çekilebilir olay akışıKnow the moment an order ships, goods arrive or stock changesSiparişin sevk edildiğini, malın geldiğini, stoğun değiştiğini anında öğrenmek

Base URLTemel adres

Base URL
%BASE%

Replace acme with your company code, or use the address the company gave you. The company is identified by the token, so every request after sign-in goes to the same company automatically.acme yerine firma kodunu yazın ya da firmanın size verdiği adresi kullanın. Firma token'dan anlaşılır; giriş sonrası her istek otomatik olarak aynı firmaya gider.

Use the host name or IP address of the server where the company runs the istifSaas API. Ask the company's IT team for the address and whether it is reachable from your network.Firmanın istifSaas API'sini çalıştırdığı sunucunun adını ya da IP adresini kullanın. Adresi ve sizin ağınızdan erişilebilir olup olmadığını firmanın BT ekibine sorun.

An interactive OpenAPI reference is served at /swagger on the same host.Etkileşimli OpenAPI başvurusu aynı sunucuda /swagger adresindedir.

GuidesKılavuzlar

QuickstartHızlı başlangıç

Four steps from credentials to your first order in the warehouse.

Kimlik bilgilerinden depodaki ilk siparişinize dört adım.

1. Get API credentials1. API kimlik bilgilerini alın

An administrator of the company creates a client for you in istifSaas under Settings › Integrations › API access, picks the scopes you need, and sends you a client_id and client_secret. The secret is shown only once; store it in a secret manager or environment variable, never in source code.

Firmanın yöneticisi istifSaas'ta Ayarlar › Entegrasyonlar › API erişimi ekranından sizin için bir istemci oluşturur, gereken izinleri seçer ve size client_id ile client_secret gönderir. Anahtar yalnızca bir kez gösterilir; kaynak kodda değil, bir gizli anahtar kasasında ya da ortam değişkeninde saklayın.

2. Request an access token2. Erişim token'ı alın

curl -X POST %BASE%/oauth/token \
  -u "%CID%:$ISTIF_CLIENT_SECRET" \
  -d grant_type=client_credentials
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text;
using System.Text.Json;

var http = new HttpClient { BaseAddress = new Uri("%BASE%/") };
var basic = Convert.ToBase64String(Encoding.UTF8.GetBytes(
    "%CID%:" + Environment.GetEnvironmentVariable("ISTIF_CLIENT_SECRET")));

var request = new HttpRequestMessage(HttpMethod.Post, "oauth/token")
{
    Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["grant_type"] = "client_credentials" })
};
request.Headers.Authorization = new AuthenticationHeaderValue("Basic", basic);

var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();
var token = (await response.Content.ReadFromJsonAsync<JsonElement>()).GetProperty("access_token").GetString();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
import os, requests

BASE = "%BASE%"
r = requests.post(
    f"{BASE}/oauth/token",
    auth=("%CID%", os.environ["ISTIF_CLIENT_SECRET"]),
    data={"grant_type": "client_credentials"},
    timeout=30,
)
r.raise_for_status()
token = r.json()["access_token"]
session = requests.Session()
session.headers["Authorization"] = f"Bearer {token}"
const BASE = "%BASE%";
const basic = Buffer.from(`%CID%:${process.env.ISTIF_CLIENT_SECRET}`).toString("base64");

const res = await fetch(`${BASE}/oauth/token`, {
  method: "POST",
  headers: { Authorization: `Basic ${basic}`, "Content-Type": "application/x-www-form-urlencoded" },
  body: "grant_type=client_credentials",
});
if (!res.ok) throw new Error(`token request failed: ${res.status}`);
const { access_token } = await res.json();
Response · 200
{
  "access_token": "eyJhbGciOiJIUzI1NiIs…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "orders:write documents:write events:read"
}

3. Make your first call3. İlk çağrınızı yapın

GET /me confirms the token works and shows which company and scopes it carries.

GET /me token'ın çalıştığını doğrular; hangi firmaya ve izinlere sahip olduğunu gösterir.

curl %BASE%/me -H "Authorization: Bearer $TOKEN"
var me = await http.GetFromJsonAsync<JsonElement>("me");
Console.WriteLine(me);
print(session.get(f"{BASE}/me", timeout=30).json())
const me = await fetch(`${BASE}/me`, { headers: { Authorization: `Bearer ${access_token}` } });
console.log(await me.json());

4. Send a sales order4. Satış siparişi gönderin

Use your ERP document ID as the Idempotency-Key, so a retry after a timeout can never create the order twice.

ERP belge kimliğinizi Idempotency-Key olarak kullanın; zaman aşımından sonraki bir tekrar siparişi asla iki kez oluşturmaz.

curl -X POST %BASE%/orders \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ERP-SO-2026-000123" \
  -d '{
    "orderNumber": "SO2026000123",
    "warehouseCode": "100",
    "accountCode": "C0042",
    "lines": [
      { "reference": "123-1", "sku": "DM-KRT-001", "quantity": 10, "unitPrice": 120.50, "vatRate": 20 }
    ]
  }'
var order = new
{
    orderNumber = "SO2026000123",
    warehouseCode = "100",
    accountCode = "C0042",
    lines = new[] { new { reference = "123-1", sku = "DM-KRT-001", quantity = 10, unitPrice = 120.50m, vatRate = 20 } }
};
using var msg = new HttpRequestMessage(HttpMethod.Post, "orders") { Content = JsonContent.Create(order) };
msg.Headers.Add("Idempotency-Key", "ERP-SO-2026-000123");
var created = await http.SendAsync(msg);   // 201 Created, or 409 order_exists
order = {
    "orderNumber": "SO2026000123",
    "warehouseCode": "100",
    "accountCode": "C0042",
    "lines": [{"reference": "123-1", "sku": "DM-KRT-001", "quantity": 10, "unitPrice": 120.50, "vatRate": 20}],
}
r = session.post(f"{BASE}/orders", json=order,
                 headers={"Idempotency-Key": "ERP-SO-2026-000123"}, timeout=30)
print(r.status_code, r.json())   # 201, or 409 order_exists
const order = {
  orderNumber: "SO2026000123",
  warehouseCode: "100",
  accountCode: "C0042",
  lines: [{ reference: "123-1", sku: "DM-KRT-001", quantity: 10, unitPrice: 120.5, vatRate: 20 }],
};
const created = await fetch(`${BASE}/orders`, {
  method: "POST",
  headers: { Authorization: `Bearer ${access_token}`, "Content-Type": "application/json", "Idempotency-Key": "ERP-SO-2026-000123" },
  body: JSON.stringify(order),
});
console.log(created.status, await created.json()); // 201, or 409 order_exists

Next, listen for order.shipped with a webhook, or poll unacknowledged shipments. The integration recipes show the full loop.

Ardından order.shipped olayını bir webhook ile dinleyin ya da onaylanmamış sevkiyatları çekin. Entegrasyon tarifleri tam döngüyü gösterir.

GuidesKılavuzlar

AuthenticationKimlik doğrulama

The API uses the OAuth 2.0 client credentials grant. Exchange your client ID and secret for a short-lived bearer token at POST /oauth/token, then send it on every request as Authorization: Bearer <token>.

API, OAuth 2.0 client credentials akışını kullanır. İstemci kimliği ve anahtarınızı POST /oauth/token ile kısa ömürlü bir bearer token'a çevirin ve her istekte Authorization: Bearer <token> olarak gönderin.

  • Credentials can be sent as HTTP Basic auth (recommended), as form fields client_id / client_secret, or in a JSON body.
  • Kimlik bilgileri HTTP Basic (önerilen), client_id / client_secret form alanları ya da JSON gövde ile gönderilebilir.
  • Tokens last 60 minutes by default (the company can set 5–1440 minutes per client). There is no refresh token; request a new one shortly before expires_in runs out.
  • Token varsayılan olarak 60 dakika geçerlidir (firma istemci başına 5–1440 dakika ayarlayabilir). Refresh token yoktur; expires_in dolmadan kısa süre önce yenisini alın.
  • Add scope=orders:write inventory:read to request a token with fewer scopes than the client has.
  • İstemcinin izinlerinden daha azını taşıyan bir token için scope=orders:write inventory:read ekleyin.
  • Token requests are limited to 60 per minute per IP address.
  • Token isteği IP başına dakikada 60 ile sınırlıdır.
  • If the client is disabled, deleted, its secret rotated, or its scopes or IP allowlist change, tokens already issued stop working within 30 seconds with 401 token_revoked.
  • İstemci kapatılır, silinir, anahtarı yenilenir ya da izinleri / IP listesi değişirse verilmiş tokenlar en geç 30 saniyede 401 token_revoked ile çalışmaz olur.
  • Token endpoint errors use the OAuth format: invalid_request, unsupported_grant_type, invalid_client, invalid_scope.
  • Token uç noktası hataları OAuth biçimindedir: invalid_request, unsupported_grant_type, invalid_client, invalid_scope.
SaaSThe company is resolved from the company subdomain (acme.istifwms.com), from an optional X-Tenant: acme header, or from the client ID prefix (acme.). After sign-in the token carries the company; a token used against another company's address gets 403 tenant_forbidden.Firma; alt alan adından (acme.istifwms.com), isteğe bağlı X-Tenant: acme başlığından ya da istemci kimliğinin önekinden (acme.) bulunur. Girişten sonra firma token'ın içindedir; başka bir firmanın adresinde kullanılan token 403 tenant_forbidden alır.
On-premOn-premisesAn on-premises installation serves one company, so no company header is needed. Client IDs start with wms..On-premises kurulum tek firmaya hizmet verir; firma başlığı gerekmez. İstemci kimlikleri wms. ile başlar.

Scopesİzinler (scope)

Each client gets only the scopes it needs. A write scope includes read access to the same area: orders:write also grants orders:read.

Her istemciye yalnızca gereken izinler verilir. Yazma izni aynı alanın okumasını da kapsar: orders:write, orders:read iznini de verir.

ScopeGrantsVerdiği yetki

Security checklistGüvenlik kontrol listesi

  • One client per integrating system, so each can be revoked on its own and the request log shows who did what.
  • Entegre olan her sistem için ayrı istemci: her biri ayrı kapatılabilir ve istek günlüğü kimin ne yaptığını gösterir.
  • Ask the company to set an IP allowlist (single addresses or CIDR ranges) for server-to-server integrations.
  • Sunucudan sunucuya entegrasyonlarda firmadan IP kısıtı (tek adres ya da CIDR aralığı) tanımlamasını isteyin.
  • Rotate the secret from the panel if it may have leaked; old tokens stop within 30 seconds.
  • Anahtar sızmış olabilirse panelden yenileyin; eski tokenlar 30 saniye içinde durur.
GuidesKılavuzlar

Requests and responsesİstek ve yanıtlar

JSONUTF-8 request and response bodies, Content-Type: application/json, camelCase field names.UTF-8 istek ve yanıt gövdeleri, Content-Type: application/json, camelCase alan adları.
DatesTarihlerISO 8601 in the company's local time without offset, e.g. 2026-12-02T14:30:00.Firmanın yerel saatiyle, ofset olmadan ISO 8601, ör. 2026-12-02T14:30:00.
NumbersSayılarAmounts and quantities are decimals; VAT rates are percentages (20 = 20%).Tutar ve miktarlar ondalıktır; KDV oranları yüzdedir (20 = %20).
Partial updatesKısmi güncellemeOn upserts (PUT) fields you omit keep their current value. Arrays such as barcodes replace the existing list only when sent.Upsert'lerde (PUT) göndermediğiniz alan mevcut değerini korur. barcodes gibi diziler yalnızca gönderildiğinde mevcut listenin yerini alır.
KeysAnahtarlarRecords are addressed by business keys you already know: SKU, account code, order number, PO number, document number.Kayıtlar zaten bildiğiniz iş anahtarlarıyla adreslenir: SKU, cari kodu, sipariş no, SAS no, belge no.
X-Request-IdReturned on every response. You may send your own value; it is echoed back and written to the company's request log.Her yanıtta döner. Kendi değerinizi gönderebilirsiniz; aynen geri döner ve firmanın istek günlüğüne yazılır.
Language of messages.Mesaj dili. Field names, error codes and status values are English and stable. Human-readable texts (title, detail, errors messages, statusText) are currently in Turkish. Build your logic on codes, never on message text.Alan adları, hata kodları ve durum değerleri İngilizcedir ve değişmez. Kullanıcıya yönelik metinler (title, detail, errors mesajları, statusText) şu an Türkçedir. Mantığınızı metne değil koda göre kurun.
GuidesKılavuzlar

Pagination and incremental syncSayfalama ve artımlı eşitleme

Two styles are used, depending on whether the list is a catalog or a growing log.

Listenin bir katalog mu yoksa büyüyen bir kayıt mı olduğuna göre iki yöntem kullanılır.

Page-based: products, accounts, orders, purchase orders, inventorySayfa tabanlı: ürünler, cariler, siparişler, SAS, stok

Pass page (from 1) and pageSize (default 100, max 500).

page (1'den başlar) ve pageSize (varsayılan 100, en fazla 500) verin.

GET /products?page=2&pageSize=100
{ "items": [ … ], "page": 2, "pageSize": 100, "total": 1342, "hasMore": true }

Cursor-based: documents, stock movements, eventsİmleç tabanlı: belgeler, stok hareketleri, olaylar

Pass after and limit; continue with after=nextAfter until hasMore is false. Store the last cursor to resume later without gaps.

after ve limit verin; hasMore false olana dek after=nextAfter ile devam edin. Son imleci saklayarak daha sonra boşluksuz kaldığınız yerden sürdürün.

GET /inventory/movements?after=58210&limit=500
{ "items": [ … ], "nextAfter": 58710, "hasMore": true }

Getting only what changedYalnızca değişenleri almak

Lists accept updatedSince, createdSince or changedSince. For near real-time sync, prefer webhooks or the event feed and fetch the changed record by key.

Listeler updatedSince, createdSince ya da changedSince alır. Neredeyse anlık eşitleme için webhook ya da olay akışını tercih edin ve değişen kaydı anahtarıyla okuyun.

GuidesKılavuzlar

Idempotency

Networks fail. Send an Idempotency-Key header (up to 100 characters) on every POST, PUT, PATCH and DELETE so you can safely retry. Your ERP document ID makes a good key.

Ağ hataları olur. Güvenle tekrar deneyebilmek için her POST, PUT, PATCH ve DELETE isteğinde Idempotency-Key başlığı (en fazla 100 karakter) gönderin. ERP belge kimliğiniz iyi bir anahtardır.

SituationDurumResultSonuç
First requestİlk istekProcessed normally; the response is stored for 48 hoursNormal işlenir; yanıt 48 saat saklanır
Same key, same requestAynı anahtar, aynı istekThe stored response is returned with Idempotent-Replayed: trueSaklanan yanıt Idempotent-Replayed: true ile döner
Same key, different body or pathAynı anahtar, farklı gövde ya da yol422 idempotency_key_reused
First request still runningİlk istek hâlâ işleniyor409 idempotency_in_progress; retry after a few seconds409 idempotency_in_progress; birkaç saniye sonra tekrar deneyin
5xx response5xx yanıtNot stored; retry with the same keySaklanmaz; aynı anahtarla tekrar deneyin

Order and purchase order numbers are also unique on their own: creating an existing number returns 409 order_exists / purchase_order_exists with the existing record in resource.

Sipariş ve SAS numaraları da kendi başına tekildir: var olan bir numarayı oluşturmak, mevcut kaydı resource alanında taşıyan 409 order_exists / purchase_order_exists döndürür.

GuidesKılavuzlar

Rate limitsHız sınırları

LimitSınırDefaultVarsayılanNotesNot
API requests per clientİstemci başına API isteği600 / minToken bucket; short bursts are allowed. The company can change it per client.Token bucket; kısa patlamalara izin verilir. Firma istemci başına değiştirebilir.
Token requests per IPIP başına token isteği60 / minCache tokens until they expire.Token'ı süresi dolana kadar saklayın.
Batch sizeToplu istek boyutu50 ordersPOST /orders/batch; larger batches get 400 batch_too_large.POST /orders/batch; daha büyüğü 400 batch_too_large alır.

When a limit is exceeded you get 429 rate_limited with a Retry-After header in seconds. Wait that long, then retry; use exponential backoff for repeated 429 or 5xx responses.

Sınır aşıldığında saniye cinsinden Retry-After başlığıyla 429 rate_limited alırsınız. O kadar bekleyip tekrar deneyin; tekrarlayan 429 ya da 5xx yanıtlarında üstel geri çekilme kullanın.

GuidesKılavuzlar

ErrorsHatalar

Errors follow RFC 9457 (application/problem+json). Branch on code; show detail and errors to people. Quote requestId when you contact support.

Hatalar RFC 9457 (application/problem+json) biçimindedir. Mantığı code alanına göre kurun; detail ve errors kullanıcıya gösterilmek içindir. Destekle iletişimde requestId değerini iletin.

422 · application/problem+json
{
  "type": "https://istifwms.com/docs/api/errors#validation_failed",
  "title": "Doğrulama hatası",
  "status": 422,
  "detail": "İstek gövdesi ya da parametreler geçersiz.",
  "code": "validation_failed",
  "requestId": "2143f2aa3e1d4e858524b5e877b0a1c1",
  "errors": { "lines[0].quantity": "Miktar sıfırdan büyük olmalı." }
}
HTTPcodeWhat to doNe yapılmalı
GuidesKılavuzlar

Webhooks

istifSaas sends an HTTPS POST to your endpoint within seconds of a warehouse event. Subscribe in the company's panel or through the webhooks API, choose the events (or * for all), and keep the signing secret it returns.

istifSaas, depodaki bir olaydan birkaç saniye sonra adresinize HTTPS POST gönderir. Firmanın panelinden ya da webhooks API ile abone olun, olayları (tümü için *) seçin ve dönen imza anahtarını saklayın.

SaaSThe target must be a public HTTPS address. Private and loopback addresses are refused, and every request also carries X-Istif-Tenant.Hedef herkese açık bir HTTPS adresi olmalıdır. Özel ağ ve loopback adresleri reddedilir; her istek ayrıca X-Istif-Tenant başlığını taşır.
On-premOn-premisesTargets on the company's local network (for example an ERP server at http://10.0.0.15) are allowed.Firmanın yerel ağındaki hedeflere (ör. http://10.0.0.15 adresindeki ERP sunucusu) izin verilir.

Event typesOlay türleri

EventOlaySent whenNe zamanResourceKaynak

Request formatİstek biçimi

POST https://erp.example.com/istif/webhook
Content-Type: application/json
X-Istif-Event: order.shipped
X-Istif-Event-Id: evt_1842
X-Istif-Delivery: 9001
X-Istif-Timestamp: 1796220000
X-Istif-Signature: v1=5f2b9c…%TENANTHDR%

{
  "id": "evt_1842",
  "type": "order.shipped",%TENANTFIELD%
  "occurredAt": "2026-12-02T15:04:00",
  "createdAt": "2026-12-02T15:04:03",
  "resource": { "type": "shipment", "key": "IRS2026000045" },
  "data": { … }
}

Delivery and retriesTeslim ve yeniden deneme

  • Respond with any 2xx within 10 seconds. Queue the work and answer right away.
  • 2xx ile 10 saniye içinde yanıt verin. İşi kuyruğa alıp hemen dönün.
  • Non-2xx responses and timeouts are retried after 30 s, 1, 5, 15, 30 min, then 1, 2, 4, 8, 12 and 24 h (about two days). The delivery then becomes Dead and can be resent from the panel or the API.
  • 2xx dışı yanıt ve zaman aşımında teslim 30 sn, 1, 5, 15, 30 dk, ardından 1, 2, 4, 8, 12 ve 24 sa sonra yeniden denenir (yaklaşık iki gün). Sonra teslim Dead olur; panelden ya da API'den yeniden gönderilebilir.
  • After 100 consecutive failures with no success in the last 3 days, the webhook is disabled automatically.
  • Son 3 günde hiç başarı olmadan 100 ardışık başarısızlıktan sonra webhook otomatik olarak kapatılır.
  • Delivery is at least once and order is not guaranteed. Deduplicate by event id, and re-read the record from the API when the exact state matters.
  • Teslim en az bir kez yapılır ve sıra garanti edilmez. Olayları id ile tekilleştirin; kesin durum önemliyse kaydı API'den yeniden okuyun.
  • Redirects (3xx) are not followed.
  • Yönlendirmeler (3xx) izlenmez.

Verifying signaturesİmza doğrulama

X-Istif-Signature is v1= followed by the lowercase hex HMAC-SHA256 of {X-Istif-Timestamp}.{raw body}, keyed with your webhook secret (whsec_…). Compute it over the raw bytes you received, compare in constant time, and reject timestamps older than five minutes.

X-Istif-Signature, v1= ve ardından webhook anahtarınızla (whsec_…) hesaplanan {X-Istif-Timestamp}.{ham gövde} değerinin küçük harfli hex HMAC-SHA256 özetidir. Aldığınız ham baytlar üzerinden hesaplayın, sabit zamanlı karşılaştırın ve beş dakikadan eski zaman damgalarını reddedin.

// ASP.NET Core minimal API
app.MapPost("/istif/webhook", async (HttpRequest req) =>
{
    using var ms = new MemoryStream();
    await req.Body.CopyToAsync(ms);
    var body = ms.ToArray();

    var ts = req.Headers["X-Istif-Timestamp"].ToString();
    if (!long.TryParse(ts, out var unix) || Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - unix) > 300)
        return Results.Unauthorized();

    var key = Encoding.UTF8.GetBytes(Environment.GetEnvironmentVariable("ISTIF_WEBHOOK_SECRET")!);
    var expected = "v1=" + Convert.ToHexString(
        HMACSHA256.HashData(key, [.. Encoding.UTF8.GetBytes(ts + "."), .. body])).ToLowerInvariant();

    if (!CryptographicOperations.FixedTimeEquals(
            Encoding.ASCII.GetBytes(expected),
            Encoding.ASCII.GetBytes(req.Headers["X-Istif-Signature"].ToString())))
        return Results.Unauthorized();

    // queue the body, deduplicate by "id"
    return Results.Ok();
});
import hmac, hashlib, time

def verify(secret: str, ts: str, raw_body: bytes, signature: str) -> bool:
    if abs(time.time() - int(ts)) > 300:
        return False
    mac = hmac.new(secret.encode(), ts.encode() + b"." + raw_body, hashlib.sha256)
    return hmac.compare_digest("v1=" + mac.hexdigest(), signature)
import crypto from "node:crypto";

// rawBody must be the exact Buffer received, e.g. express.raw({ type: "application/json" })
export function verify(secret, ts, rawBody, signature) {
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const expected = "v1=" + crypto.createHmac("sha256", secret).update(`${ts}.`).update(rawBody).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(signature ?? "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
function istif_verify(string $secret, string $ts, string $rawBody, string $signature): bool {
    if (abs(time() - (int)$ts) > 300) return false;
    $expected = 'v1=' . hash_hmac('sha256', $ts . '.' . $rawBody, $secret);
    return hash_equals($expected, $signature);
}
// $rawBody = file_get_contents('php://input');

Use POST /webhooks/{id}/test to send a signed webhook.ping while you build the receiver, and GET /webhooks/{id}/deliveries to see each attempt with its status code.

Alıcıyı geliştirirken imzalı bir webhook.ping göndermek için POST /webhooks/{id}/test, her denemeyi durum koduyla görmek için GET /webhooks/{id}/deliveries kullanın.

GuidesKılavuzlar

Event feedOlay akışı

If your system cannot receive inbound HTTP, poll GET /events instead. It returns the same events as webhooks, in ascending ID order, kept for 30 days.

Sisteminiz dışarıdan HTTP isteği alamıyorsa bunun yerine GET /events çağırın. Webhook'larla aynı olayları, artan kimlik sırasıyla döndürür; olaylar 30 gün saklanır.

  1. On first run call GET /events?after=-1 to get the current position without history.
  2. İlk çalıştırmada geçmişi atlayıp şimdiki konumu almak için GET /events?after=-1 çağırın.
  3. Every few seconds call GET /events?after={lastId}&types=order.shipped,goods_receipt.created&limit=500.
  4. Birkaç saniyede bir GET /events?after={sonId}&types=order.shipped,goods_receipt.created&limit=500 çağırın.
  5. Process each event, then persist its id as your new lastId.
  6. Her olayı işleyin, ardından id değerini yeni sonId olarak saklayın.
last_id = load_cursor()            # -1 on first run
while True:
    r = session.get(f"{BASE}/events", params={"after": last_id, "limit": 500}, timeout=30)
    r.raise_for_status()
    page = r.json()
    for event in page["items"]:
        handle(event)              # idempotent: skip ids you have already seen
        last_id = event["id"]
        save_cursor(last_id)
    if not page["hasMore"]:
        time.sleep(5)
long lastId = LoadCursor();        // -1 on first run
while (!stoppingToken.IsCancellationRequested)
{
    var page = await http.GetFromJsonAsync<JsonElement>($"events?after={lastId}&limit=500", stoppingToken);
    foreach (var e in page.GetProperty("items").EnumerateArray())
    {
        await HandleAsync(e);      // idempotent: skip ids you have already seen
        lastId = e.GetProperty("id").GetInt64();
        SaveCursor(lastId);
    }
    if (!page.GetProperty("hasMore").GetBoolean())
        await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken);
}
GuidesKılavuzlar

Integration recipesEntegrasyon tarifleri

Most ERP integrations combine the patterns below. Each warehouse document is acknowledged once your ERP has posted it, so nothing is transferred twice or missed, even after outages.

ERP entegrasyonlarının çoğu aşağıdaki kalıpların birleşimidir. Her depo belgesi ERP'niz onu işledikten sonra onaylanır (ack); böylece kesinti sonrasında bile hiçbir şey iki kez aktarılmaz ya da atlanmaz.

Sales order to invoiceSatış siparişinden faturaya

  1. ERP
    Order is createdSipariş oluşurPOST /orders · Idempotency-Key = ERP document IDIdempotency-Key = ERP belge kimliği
  2. WMS
    Order is received and reservedSipariş alınır ve rezerve edilirorder.created · statusdurum received → ready_to_pick
  3. WMS
    Picked and packedToplanır ve paketlenirorder.packed · handheld scanners, packing stationel terminalleri, paketleme istasyonu
  4. WMS
    Shipment document is createdSevk belgesi oluşurorder.shipped webhook, orwebhook'u ya da GET /shipments?acknowledged=false
  5. ERP
    Delivery note or invoice is issuedİrsaliye ya da fatura kesilirGET /shipments/{documentNumber} · lines carry your referencekalemler sizin reference değerinizi taşır
  6. ERP
    Acknowledgement is sentOnay gönderilirPOST /shipments/{documentNumber}/ack · {"erpReference":"DN-2026-000045"}
  7. WMS
    Shipment is marked as postedSevkiyat aktarıldı olarak işaretlenirit leaves the acknowledged=false listacknowledged=false listesinden düşer

All recipesTüm tarifler

ScenarioSenaryoStepsAdımlarScopes
Master dataAna veriOn change or nightly: PUT /products/{sku}, PUT /accounts/{code}; /batch for bulk loadsDeğişiklikte ya da gece: PUT /products/{sku}, PUT /accounts/{code}; toplu yükleme için /batchcatalog:write accounts:write
SalesSatışSee the flow aboveYukarıdaki akışorders:write documents:write events:read
CancellationİptalPOST /orders/{no}/cancel; on 409 picking_started coordinate with the warehouse. A partly shipped order cancels its remainder.POST /orders/{no}/cancel; 409 picking_started dönerse depo ile görüşün. Kısmen sevk edilmiş siparişte kalan iptal edilir.orders:write
PurchasingSatınalmaPOST /purchase-orders → goods_receipt.created or GET /goods-receipts?acknowledged=false → purchase delivery note in the ERP → ack → when closed in the ERP, POST /purchase-orders/{no}/closePOST /purchase-orders → goods_receipt.created ya da GET /goods-receipts?acknowledged=false → ERP'de alış irsaliyesi → ack → ERP'de kapanınca POST /purchase-orders/{no}/closepurchasing:write documents:write
StockStokstock.changed webhook, or GET /inventory?changedSince=… on a schedulestock.changed webhook'u ya da zamanlanmış GET /inventory?changedSince=…inventory:read
Returns, counts, transfersİade, sayım, transferList with acknowledged=false → post to the ERP → ackacknowledged=false ile listele → ERP'ye işle → ackdocuments:write

Acknowledgements are per client: an ERP and an accounting system can each acknowledge the same document without affecting each other.

Onaylar istemci başınadır: bir ERP ve bir muhasebe sistemi aynı belgeyi birbirini etkilemeden ayrı ayrı onaylayabilir.

MoreDiğer

ChangelogSürüm notları

v3.0 · 2026-12First public release: OAuth 2.0 client credentials, scopes, idempotency, problem+json errors, products, accounts, sales and purchase orders, inventory, warehouse documents with acknowledgements, event feed and signed webhooks. Available for both cloud and on-premises installations.İlk genel sürüm: OAuth 2.0 client credentials, izinler, idempotency, problem+json hataları, ürünler, cariler, satış ve satınalma siparişleri, stok, onaylı depo belgeleri, olay akışı ve imzalı webhook'lar. Hem bulut hem on-premises kurulumlarda kullanılabilir.

Within v3, changes are additive: new fields, endpoints and event types may appear, so ignore fields you do not know. Breaking changes will ship as a new version path.

v3 içinde değişiklikler yalnızca eklemedir: yeni alan, uç nokta ve olay türleri gelebilir; tanımadığınız alanları yok sayın. Geriye uyumsuz değişiklikler yeni bir sürüm yoluyla gelir.

MoreDiğer

SupportDestek

When reporting a problem, include the requestId from the response (or the X-Request-Id header), the time of the request and the endpoint. The company administrator can find the same entry under Settings › Integrations › API access › Request log, together with webhook delivery history.

Bir sorun bildirirken yanıttaki requestId değerini (ya da X-Request-Id başlığını), isteğin zamanını ve uç noktayı iletin. Firma yöneticisi aynı kaydı webhook teslim geçmişiyle birlikte Ayarlar › Entegrasyonlar › API erişimi › İstek günlüğü altında bulabilir.