Skip to content

Overview

Documents @snap4id-sdk/partner-api 1.0.0

Server-to-server API between your backend and Snap4ID: unlock a job after you verified a store purchase, read a job and its files, and receive the signed job.paid webhook. Server-side only: requests are signed with your Ed25519 private key, which never leaves your backend. @snap4id-sdk/partner-api signs, retries and parses for you; these pages are the wire contract. The OpenAPI document ships in the SDK repository under contracts/.

Errors

Errors are { "error": { "code": "<code>" } }. 5XX answers are retryable with a fresh request id. A job is visible only to the partner that embedded it; anything else answers 404 not_found, exactly like a missing job.

Request signing

Every request except GET /api/v1/partner/webhook-keys carries five headers: x-partner-id, x-key-id, x-timestamp, x-request-id, x-signature. The signature is Ed25519, base64 (standard, padded), over these fields joined by \n (LF), UTF-8, no trailing newline:

  1. partner_id (x-partner-id)
  2. key_id (x-key-id)
  3. METHOD (upper case)
  4. path (request target up to the first “?”, not normalised)
  5. timestamp (x-timestamp, verbatim)
  6. request_id (x-request-id, verbatim)
  7. body_sha256 (lower-case hex SHA-256 of the raw body bytes; empty body: SHA-256 of “”)

Timestamp skew at most 5 minutes; a request id is accepted once within 10 minutes; body at most 128 KiB. A failure answers 401 unauthorized (the reason is only in Snap4ID’s logs).

Webhook signing

job.paid deliveries carry x-snap4id-key-id, x-timestamp, x-signature. The signature is Ed25519, base64 (standard, padded), over these fields joined by \n (LF), UTF-8, no trailing newline:

  1. key_id (x-snap4id-key-id)
  2. timestamp (x-timestamp, verbatim)
  3. body_sha256 (lower-case hex SHA-256 of the raw body bytes)

Skew at most 5 minutes. Delivery is retried for 72 hours; answer 410 only to stop an event for good. Keys: GET /api/v1/partner/webhook-keys.

Information

  • OpenAPI version: 3.1.0

Your partner_id.

Security scheme type: apiKey

Header parameter name: x-partner-id

Id of one of your registered, active Ed25519 keys (rotation: register a new key, switch, revoke the old one).

Security scheme type: apiKey

Header parameter name: x-key-id

Unix epoch milliseconds (decimal digits); accepted within ±300000 ms.

Security scheme type: apiKey

Header parameter name: x-timestamp

UUID v4, fresh per request (also per retry); a repeat within 600000 ms is rejected.

Security scheme type: apiKey

Header parameter name: x-request-id

Standard padded base64 of the 64-byte Ed25519 signature over the canonical request (see the signing section of the overview).

Security scheme type: apiKey

Header parameter name: x-signature