Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-16
Browse: SET API

One key for the SET API and Direct Deposit, a separate approver key, and keys pinned to your servers (UC-A-03)

Status: current as of 2026-11-16.

Who this is for

A platform that collects with the SET API, pays people with the Direct Deposit API, and wants one secret per service, a second person on every payout, and keys that work only from its own servers. When you finish, one service key opens the SET API and Direct Deposit from your addresses only, and each payout it asks for waits for a different key to approve it.

Before you start

  • Account: a SET API platform account, on the SET API plan.
  • Keys: a key with write to issue keys and ask for payouts; a key with approve to approve them; read for the event list. A key can only give scopes it holds itself, so the first key holding direct_deposit, and the first holding approve, come from SET.
  • Switches: none.
  • What must exist: the addresses or CIDR ranges your servers call from; for step 2, a funded wallet and a recipient (Pay suppliers abroad, steps 1 and 2).

By API

  1. Issue the service key, pinned to your servers. The secret (key) is shown once; SET keeps only its hash. Send it as the Bearer token on /v1/* and on /api/partner/*. POST /v1/api_keys · Idempotency-Key ``json { "scopes": ["read", "write", "direct_deposit"], "label": "…", "allowedCidrs": ["203.0.113.0/24"] } ` The next step uses: key, id, prefix, allowedCidrs`.
  1. Ask for a payout that waits for a second key. It answers 202 with state: "pending_approval"; nothing is sent. POST /v1/payouts · Idempotency-Key ``json { "wallet": "wal_…", "recipient": "rcp_…", "amount": "250.00", "approval": "required" } ` The next step uses: id, state, approval`.
  1. Approve it with the approver key, or reject it. A key cannot approve a payout it asked for. POST /v1/payouts/{id}/approve or POST /v1/payouts/{id}/reject · Idempotency-Key; no body. The answer to check: state, approval.
  1. Pin a key later, or change its list. [] allows any address again. POST /v1/api_keys/{id}/allowed_cidrs · Idempotency-Key ``json { "allowedCidrs": ["203.0.113.0/24"] } ` The answer to check: allowedCidrs`.
  1. Route events on type and api. The SET API and Direct Deposit write to one event list; api is set_api, direct_deposit or account. GET /v1/events The fields to read: type, api, seq.

In SET Console

  1. Issue a key and pin it. Console: not available. Use the API call. The signed-in console never shows a key's secret. In the demo console, Platform View, Workflows, Create keys and pin them shows the form: Label, Scopes and Server addresses (one a line), then Review and Confirm.
  2. Ask for a payout that waits for approval. Console: not available. Use the API call.
  3. In Platform View, open Approvals. Under Payouts waiting for approval, choose Approve or Reject on the payout. The same list opens from Workflows, Approve waiting payouts. Only an admin or finance member can decide, and the person who asked for a payout cannot approve it.
  4. Change a key's address list. Console: not available. Use the API call.
  5. Read events in Developers, Events.

Check it worked

  • GET /v1/api_keys: each key's prefix, scopes, label and allowedCidrs. In SET Console: Developers, Keys.
  • GET /v1/payouts/{id}: state and approval.
  • Webhooks: api_key.created, api_key.allowed_cidrs_changed, payout.pending_approval, then payout.approved or payout.rejected.

If it fails

  • 400 scopes_invalid: scopes other than read, write, approve and direct_deposit.
  • 403 scope_exceeds_caller: the new key asks for a scope the calling key does not hold.
  • 409 too_many_keys: at most 10 active keys; revoke one first.
  • 400 cidrs_invalid: more than 20 entries, or one that is not an IPv4 or IPv6 address or CIDR range.
  • 409 would_lock_out: the list leaves out the address the calling key is using; add it, or change the list with another key.
  • 403 ip_not_allowed: a request from an address outside the key's list, refused before anything runs.
  • 400 approval_invalid: approval is not "required".
  • 409 approver_is_requester: the approving key asked for the payout.
  • 409 payout_not_pending_approval: the payout is not waiting for approval.
  • 403 operator_cannot_approve: SET's operator cannot approve a payout.
  • 403 merchant_no_direct_deposit: a SET API business-account key cannot open the Direct Deposit API.
  • 401 api_key_invalid, 403 scope_missing, 429 rate_limited: the key, its scopes, or the rate limit.

All codes: Errors. Retrying a POST safely: Idempotency.

Changes

  • 2026-11-16: Every use case step by step, by API and in the console.
  • 2026-11-16: The modernized API Reference, the sandbox-key form, Direct Deposit without a revenue share.