Authentication
Partner requests use two credentials:
- API key (
x-api-key) — identifies the key / company - Signing secret (
dtx_sk_…) — never sent on the wire; used only to compute an HMAC signature
Both are shown once when Danatorex creates (or rotates) the key. Treat them as secrets.
Headers
GET /partner/v1/prices HTTP/1.1
Host: <api-host>
x-api-key: dtx_pk_…
x-danatorex-timestamp: 1730000000
x-danatorex-nonce: nonce_abcdefghijklmnopqrstuvwxyz
x-danatorex-signature: <hex hmac>
| Header | Purpose |
|---|---|
x-api-key | API key identity |
x-danatorex-timestamp | Unix seconds when you signed |
x-danatorex-nonce | Random one-time string (16–64 chars: A–Z a–z 0–9 _ -) |
x-danatorex-signature | Hex HMAC-SHA256 of the canonical request |
Request signing (HMAC)
Canonical string (newline-separated, no trailing newline):
v1
partner-api
METHOD
/path?query
timestamp
nonce
sha256Hex(rawBody)
METHODis uppercase (GET,POST, …).path?queryis the request path including the query string (no scheme/host).- For body-less requests (typical
GET), hash the empty string. - Signature =
hex(HMAC-SHA256(signingSecret, canonicalString)).
Example (Node):
import crypto from 'crypto';
function signPartnerRequest({
signingSecret,
method,
pathWithQuery,
timestamp,
nonce,
rawBody = '',
}) {
const bodyHash = crypto.createHash('sha256').update(rawBody, 'utf8').digest('hex');
const canonical = [
'v1',
'partner-api',
method.toUpperCase(),
pathWithQuery,
String(timestamp),
nonce,
bodyHash,
].join('\n');
return crypto
.createHmac('sha256', signingSecret)
.update(canonical, 'utf8')
.digest('hex');
}
Replay protection
- Timestamp skew must be within 300 seconds.
- Each nonce may be used once per key inside that window. Replays return
PARTNER_REQUEST_NONCE_REPLAYED.
Cutoff / migration
PARTNER_REQUEST_SIGNING_REQUIRED_AT controls enforcement:
- Before the cutoff: unsigned requests still work. If you send any signing header, the signature must be valid.
- After the cutoff (default is process start unless ops sets a future grace time): every partner route requires a valid signature.
Keys without a signing secret must rotate one in admin before signed calls succeed (PARTNER_SIGNING_SECRET_REQUIRED).
Company-bound keys
Keys are issued by Danatorex operations and bound to a company omnibus account.
- Balances, conversions, and withdrawals debit/credit that company actor.
externalUserIdon conversions and withdrawals is correlation-only; it is not a Danatorex retail user id.- Legacy read-only keys without a company binding cannot call company-scoped endpoints (assets, conversions, withdrawals).
Rate limits
Per API key, fixed one-minute windows:
| Bucket | Limit |
|---|---|
| Read scopes | 1200 / min |
Write scopes (*:write) | 300 / min |
When limited, expect HTTP 429 with PARTNER_RATE_LIMIT_EXCEEDED and retryAfterSeconds. Prefer backoff and reuse idempotency keys on writes.