Preview
Build on a merchant API you can verify.
Invoices, hosted checkout and signed webhooks for your backend. The API is in preview: the reference is shared on request before the public release.
Requests
How requests are authenticated
Two schemes for the same API keys. Request signing is the recommended one.
Key and secret
Send the API key and its secret with each request over TLS. Simple to start with; the secret is checked in constant time.
HMAC-SHA256 request signing
Sign the timestamp, HTTP method, path and body with your secret. Requests outside a five-minute window are rejected, and a signature cannot be replayed on another endpoint.
Scoped keys
Each key carries its own permissions, an optional expiry date and an optional IP allow-list.
Rate limits per key
Limits apply per API key, so one integration cannot exhaust another's capacity.
One answer to failure
Every authentication failure gets the same response, so a wrong key, a wrong secret and a revoked key look alike from outside.
Idempotency
Retry without creating a second invoice
Invoice creation accepts an Idempotency-Key header. A retry with the same key returns the original response; the same key with a different request body is rejected.
Settlement
Native or converted
Each store settles either in the asset the customer paid or, with automatic conversion, in the asset you choose. Webhooks tell you which outcome happened.
Webhooks
Signed, timestamped, retried
Webhooks are signed with HMAC-SHA256 over the timestamp and the raw body, carry an event id for de-duplication, and are retried with exponential backoff if your endpoint times out or returns a server error. You can send a test delivery from the merchant console.
- Signature header:
X-iNCRYPTO-Signature: t=<unix seconds>,v1=<hex> - Signed string: the timestamp, a dot, then the body bytes
- Tolerance: five minutes either side of your clock
import hashlib
import hmac
import time
TOLERANCE = 300 # seconds; older deliveries are rejected
def verify(raw_body: bytes, header: str, secret: str) -> bool:
# header: value of X-iNCRYPTO-Signature, "t=<ts>,v1=<hex>"
# raw_body: the request body exactly as received
fields = dict(
item.split("=", 1) for item in header.split(",") if "=" in item
)
try:
ts, received = int(fields["t"]), fields["v1"]
except (KeyError, ValueError):
return False
if abs(int(time.time()) - ts) > TOLERANCE:
return False
signed = f"{ts}.".encode() + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, received) Status
What is public and what is on request
Public today
- The integration guide on docs.incrypto.me
- Webhook signature scheme and the verification code above
- Merchant console for stores, API keys, invoices and webhook tests
On request, before public release
- The full API reference: endpoints, fields and error codes
- Onboarding of your merchant account for live payments
- A public reference and example code are on the roadmap