The SohoPay API is a REST API over HTTPS with JSON request and response bodies. This page covers the conventions shared by every endpoint; the per-endpoint pages in the sidebar are generated from the OpenAPI spec and include an interactive playground.

Base URLs

The environments are fully isolated — keys, agents, and data never cross between them. See Environment Setup for configuration details.

Authentication

Authenticate with an API key in the Authorization header:
Sandbox keys start with sk_test_, mainnet keys with sk_live_. Missing or invalid keys return 401 INVALID_API_KEY. Full key lifecycle — generation, storage, rotation — is covered in Authentication & Security.

Rate limiting

Every response includes rate-limit state: When you exceed the limit the API returns 429 with code RATE_LIMITED. Wait the number of seconds in Retry-After before retrying; retrying sooner extends the penalty. Per-agent transaction limits are enforced separately by the Policy Service — see Rate Limits.

Errors

Every error response uses one envelope:
  • code — a stable machine-readable string. Branch on this, never on message.
  • message — human-readable detail; wording may change without notice.
  • request_id — include it in any support request so the team can trace the call.
The complete code table with recovery steps is in the error reference.

Idempotency

All POST endpoints accept an Idempotency-Key header. Send a unique key (a UUID works) with each logical operation; if the request is retried — a timeout, a network blip, a crashed worker — the API returns the original result instead of executing twice.
Keys are retained for 24 hours; after that a reused key is treated as a new request. Always set an idempotency key on payment and order creation — it makes retry-on-timeout safe.
Generate the idempotency key before the first attempt and reuse it on every retry of that operation. Generating a fresh key per retry defeats the purpose.

Pagination

List endpoints use cursor pagination with two query parameters:
  • limit — items per page (default 20, max 100)
  • cursor — opaque token from the previous page
Iterate until has_more is false. Cursors are opaque — never parse or construct them.

Versioning

The current API version is v1, encoded in the URL path. Backwards-compatible changes — new fields, new endpoints, new webhook event types — ship to v1 without notice, so write parsers that tolerate unknown fields. Breaking changes get a new version path (e.g. /v2), and the previous version enters a 6-month deprecation window with dates announced by email and in the beta Slack channel. Nothing breaks under a version path you’ve pinned.
SohoPay is pre-mainnet; v1 is the only version and no deprecations are scheduled.

Interactive playground

The endpoint pages in the sidebar are generated from the OpenAPI spec at /api-reference/openapi.json. Each one includes an interactive playground — paste a sandbox key, edit the request body, and send real calls against the sandbox without leaving the docs. You can also import the spec into Postman or Insomnia; see OpenAPI Tools.

Next steps

Error Reference

Every error code with status, cause, and recovery.

Webhook Events

Event catalog, payloads, and signature verification.

TypeScript SDK

Skip raw HTTP with the official SDK.