API essentials
Request signing (HMAC)
Every API v2 request is an HTTP POST with
Content-Type: application/x-www-form-urlencoded and exactly four fields:
| Field | Value |
|---|---|
app_id | Your application ID from the Apaczka panel |
request | The method payload, JSON-serialized to a string |
expires | Unix timestamp until which the request is valid (max +15 minutes) |
signature | HMAC-SHA256 signature — see below |
The signature
The string to sign is four values joined with :
Code
where route is the method path including path parameters and the
trailing slash — e.g. order_send/, points/INPOST/, or
waybill/123456/. The signature is the lowercase-hex HMAC-SHA256 of that
string, keyed with your app_secret.
Worked example (PHP)
Code
Sign exactly the string you send as request. Re-serializing the
payload after signing (different key order, whitespace, escaping) is the
most common cause of Invalid signature errors.
Common pitfalls
- Missing trailing slash in
route—order_sendsigns differently thanorder_send/. The server signs with the trailing slash. - Path parameters belong in the route — for
waybill/123456/you sign the full route including the order ID. expirestoo far in the future — the limit is 15 minutes.- HTTP 200 does not mean success — see Error semantics.
Full method-by-method reference: API v2.
Last modified on

