SET Crypto API Suite · With a Direct Deposit key
Approve a batch
POST/api/partner/payees/batch/{id}/approve
Approves a Payable Email batch that waits for approval, and releases its pay-to addresses. The answer is the whole batch, with items[].address filled, payTo listing what to pay, and approval: approved.
Path parameters
idstringrequired- The batch id,
pbt_and 32 hex characters. An id of any other shape does not reach this route and answers 403cross_origin, not 404.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Notes
- Direct Deposit is switched on per deployment; while it is off this call answers 503
direct_deposit_disabled. Payable Email must also be on for the deployment (503payable_email_disabled) and for your account (403payable_email_off). - Approve with a SET API key that has the
approveanddirect_depositscopes (writeis not needed on this call), or as a dashboard admin. The partner key (set_partner_…) cannot approve: 403scope_missing. - The approver must be a different key or person from whoever asked for the batch: 409
approver_is_requester. With keys alone it takes two, for example the partner key asks and a SET API key approves. - Only a batch made while batch approval was on can be approved (
POST /api/partner/batch_approval). Approving it again, or approving a batch that never waited, answers 409batch_not_pending_approval. A well-formed id that is not yours answers 404batch_unknown. - Before approval the batch reads
items[].address: nullandpayTo: []. After it,payTohas one line per payee plus, last, SET's fee line (destination: set_fee, SET's fee on the amounts paid into wallets; see Go live). - No body. Approving moves no money and reads no chain; it releases the addresses.
- An event
payable_batch.approvedis recorded, and your audit log gainspayable_batch_approved. - This example was made in the sandbox; the payees' wallet addresses are stand-ins.
- This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
503 payable_email_disabled403 payable_email_merchant403 payable_email_off404 batch_unknown409 batch_not_pending_approval409 approver_is_requester409 batch_moved403 scope_missing403 cross_origin404 not_found