Transfer authorization
Let your own system approve API transfers within limits your approvers set, instead of a person in the app: to trusted payees, and to new payees when your approvers allow it.
Setup, step by step#
Several steps are manual on purpose: each one is a person deciding that a machine may move money. Do them in this order, and run each step's check before the next. Every API check uses key A from step 2 unless it says otherwise.
- Support enables the features. Ask support to turn on
release_api_transfersandrelease_api_webhook_authorizationfor your workspace. Manual because it is a contract decision. Check: a member who may approve payments sees Transfer approval under Settings → Developer (it appears oncerelease_api_webhook_authorizationis on); the first check in step 2 confirms both features through the API. - Create two API keys. Key A creates transfers (
transfers:write,transfers:read; addbeneficiaries:readfor the payee checks in steps 6 and 7, andbeneficiaries:request_trustto file trust requests). Key B authorizes them (transfers:authorize) and must be created by a member who may approve and delete payments. Give key B an IP allowlist: authorizing from a key without one is refused with 403unrestricted_api_key. If you will turn on Approve transfers to new payees (step 6), give key A an IP allowlist too: a transfer to a new payee from a key without one goes to your approvers asunrestricted_api_key. Manual because the app never lets one key do both. Check:GET /api/transfer_authorizerreturns 404not_found_error(nothing enrolled yet), not 403forbidden_error(a feature from step 1 is off), and each key's scopes and IP allowlist show in Settings → Developer → API keys. - Expose your receiver on a stable HTTPS URL. Use your server, a reserved ngrok domain or a named cloudflared tunnel. A free ngrok URL changes on every restart, and an enrolled endpoint's URL cannot change, so you would have to enrol again. Check:
curl -i -X POST "https://your-receiver.example.com/"(your URL) from outside your network gets an HTTP response, even a 401 from your signature check; step 4's signed test checks that the receiver accepts a real delivery. - Create the webhook endpoint for that URL (
POST /api/webhook_endpointswithwebhook_endpoints:write, or the app). Check:POST /api/webhook_endpoints/:id/testreaches your receiver and the signature verifies. - Enrol it in Settings → Developer → Transfer approval, with the currency and both limits, and confirm with the two-factor step. Copy the signing secret: it is the one your receiver verifies webhooks with and signs challenges with. Manual because only a person may grant the privilege. Check:
GET /api/transfer_authorizerreturns 200 with"status": "active"and yourwebhook_endpoint_id. - Turn on Approve transfers to new payees at enrolment, or trust payees (a beneficiary's bank account; a transfer to one of your own accounts needs no trust). With the option on, your endpoint may approve a transfer to bank details nobody has trusted yet, up to the Limit per transfer to a new payee, and its signature trusts them. Otherwise file a trust request (below) that an approver accepts, have an approver mark the payee trusted from the Beneficiaries list, or let one approved transfer settle to it. Manual because only a person may decide that a machine picks where money goes. Check:
GET /api/transfer_authorizersays"trust_new_payees": true, orGET /api/beneficiaries/:id/external_accounts/:idsays"trusted": true. - Run a preflight (Check the authorizer has the calls). Check:
GET /api/transfer_authorizersays"status": "active"and thecurrency_codeof the account you pay from, anddaily_limitminusdaily_authorized_totalis at least the amount. The amount is at mostper_transfer_limit. The payee is one of your own accounts, orGET /api/beneficiaries/:id/external_accounts/:idsays"trusted": true, ortrust_new_payeesistrue, the amount is at mostnew_payee_limit, key A has an IP allowlist and the bank details were never trusted before (details whose trust was revoked, or edited after trusting, always go to your approvers). - Create a test transfer with key A, within both limits, with a
client_referenceyour system issued. Check: the response'sauthorizationhas statuspending. Statusrefusedwith arefusal_reasonmeans it went to your approvers; Why did my transfer go to the approvers? says why. - Answer the challenge. Verify the webhook's signature, check the transfer against your ledger, sign the challenge and call
POST /api/payments/:id/authorizewith key B. An official client does the verifying and signing for you (With an official client). Check:GET /api/payments/:idsays"status": "processing".
How it works#
By default every transfer created with POST /api/payments waits for a manager or legal representative to approve it in the app. Transfer authorization adds a second path for high-volume integrations:
- An approver enrols one of your webhook endpoints in the app, with a limit per transfer and a limit per 24 hours.
- When you create a transfer that fits inside those limits and pays a trusted payee, it is not shown to your approvers. Instead your endpoint receives a
payment.authorization_requestedwebhook carrying a one-time nonce. With Approve transfers to new payees on, a transfer to bank details your workspace never trusted is sent to your endpoint the same way, up to the limit per transfer to a new payee (see Which transfers qualify). - Your system checks the transfer against its own ledger, signs the transfer's fields with the endpoint's signing secret, and calls
POST /api/payments/:id/authorize. The transfer then executes exactly like one approved in the app.
Anything outside the limits goes to your approvers, the same as before. Nothing is rejected. That includes a payee that does not qualify, a transfer over either limit and a suspended authorizer, and it also covers a wrong or stale signature and a challenge that gets no answer within one hour.
Enrolment#
Enrolment happens only in the app: Settings → Developer → Transfer approval. The member needs permission to approve payments and to manage webhook endpoints, and confirms with their two-factor step. The API can never enrol, change limits or resume.
- Approving endpoint: one of your active webhook endpoints. While it is enrolled, its URL cannot change, and its signing secret is hidden in the app and cannot be regenerated through the API.
- Currency, limit per transfer and limit per 24 hours: both limits are required.
- Signing secret lifetime: 90 days from enrolment or the last rotation. Approvers are reminded 14, 7 and 1 days before. When it expires, transfer authorization suspends itself and transfers go to your approvers.
To rotate the secret, an approver chooses Rotate secret on the same page and confirms with their two-factor step. The new secret is shown once and the 90 days start again. For the next 24 hours, authorizations signed with either the new or the previous secret are accepted, so you can deploy the new one without failing transfers. Webhooks are signed with the new secret straight away. A secret that has already expired gets no overlap, and rotating again within the 24 hours retires the oldest secret at once. After a rotation following an expiry, an approver resumes transfer authorization.
Any approver can suspend transfer authorization with one click in the app, or from the Suspend link in every alert email. No two-factor step is needed to suspend. Resuming needs one. It also suspends itself after five invalid signatures in a row, and when the endpoint is disabled or deleted.
Which transfers qualify#
A transfer is sent to your endpoint only when all of these hold, checked when the transfer is created and again when you authorize it:
| Check | Otherwise |
|---|---|
| Transfer authorization is enrolled, not suspended, its secret has not expired and the endpoint is active | suspended / secret_expired |
| The transfer's currency is the enrolled currency | currency_mismatch |
| The amount is at most the limit per transfer | over_transfer_limit |
| Amounts authorized in the last 24 hours plus this one stay within the limit per 24 hours | over_daily_limit |
| The payee is one of your own accounts or a trusted payee, or — with Approve transfers to new payees on — bank details never trusted, created with an API key that has an IP allowlist, for an amount at most the limit per transfer to a new payee | untrusted_payee / unrestricted_api_key / over_new_payee_limit |
A payee becomes trusted automatically once a transfer an approver approved in the app has settled to those exact bank details. Approvers can also mark payees as trusted from the Beneficiaries list, or your integration can ask them to (below). Trust follows the bank details: editing a payee's account number lapses it.
Approve transfers to new payees is an option an approver turns on at enrolment or later, with the two-factor step. With it on, a transfer to bank details your workspace never trusted is sent to your endpoint too, up to the Limit per transfer to a new payee (the limit per transfer when left empty), and a valid signature both executes it and trusts those details. The 24-hour limit still applies. Details a member revoked trust for, and an account whose trusted details were edited, still go to your approvers. If the payee's bank details change while the challenge is open, it is superseded as stale.
Request trust for payees#
POST /api/payee_trust_requests
Body: external_account_ids, a list of up to 100 of your beneficiaries' bank account ids. Requires the beneficiaries:request_trust scope. The member who created the key must be allowed to create transfers. Limited to 10 requests per minute per key.
201 returns the request with status pending. Nothing is trusted yet: your approvers get one task for the whole batch and approve it in the app with a second factor. An id your workspace does not have returns 422 with param external_account_ids. A leaked key can ask, but only a person can approve.
Poll GET /api/payee_trust_requests/:id (with beneficiaries:request_trust or beneficiaries:read) for status: approved or declined. It becomes cancelled when an approver tries to approve after every requested account was deleted; deleting accounts alone does not change it. Approval trusts the bank details as they are at that moment.
curl -X POST "https://za.manza.finance/api/payee_trust_requests" \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"external_account_ids": ["<external account id>"]}'Your client reference#
Send your own id for the transfer as client_reference (a string of at most 128 characters) when you create it. It is unique per workspace: creating a second transfer with the same reference returns 409 duplicate_client_reference with the existing transfer's payment_id, so a retried create never makes a second transfer.
client_reference is part of the signed string. Only sign transfers whose client_reference your system issued. That check is what makes a leaked API key useless: a transfer an attacker creates is one your ledger has never seen.
The challenge webhook#
payment.authorization_requested is delivered only to the enrolled endpoint, signed like every other webhook (X-Manza-Signature). You cannot subscribe to it through events. It is delivered at most three times (the first attempt and two retries) within the hour the challenge stays open.
{
"event": "payment.authorization_requested",
"event_id": "01958e51-7c5a-7000-8000-000000000010",
"created_at": "2026-10-01T12:00:00Z",
"data": {
"authorization": {
"id": "01958e51-7c5a-7000-8000-000000000011",
"nonce": "9f86d081884c7d659a2feaa0c55ad015",
"expires_at": "2026-10-01T13:00:00Z",
"signature_version": "manza.transfer-authorization.v1"
},
"payment": {
"id": "01958e51-7c5a-7000-8000-000000000012",
"amount": "2500.0",
"currency_code": "ZAR",
"account_id": "01958e51-7c5a-7000-8000-000000000013",
"payee": "ext:01958e51-7c5a-7000-8000-000000000014",
"beneficiary_id": "01958e51-7c5a-7000-8000-000000000015",
"external_account_id": "01958e51-7c5a-7000-8000-000000000014",
"destination_account_id": null,
"payment_reference": "INV-2026-001",
"client_reference": "po_8812",
"transfer_method": "eft",
"payee_trusted": false
},
"signature_input": "manza.transfer-authorization.v1|01958e51-7c5a-7000-8000-000000000012|9f86d081884c7d659a2feaa0c55ad015|2500.0|ZAR|01958e51-7c5a-7000-8000-000000000013|ext:01958e51-7c5a-7000-8000-000000000014|po_8812",
"signature_input_v2": "manza.transfer-authorization.v2|01958e51-7c5a-7000-8000-000000000012|9f86d081884c7d659a2feaa0c55ad015|2500.0|ZAR|01958e51-7c5a-7000-8000-000000000013|ext:01958e51-7c5a-7000-8000-000000000014|po_8812|eft"
}
}signature_version and signature_input are the v1 string, unchanged for clients pinned to 2026-03-27. signature_input_v2 is the v2 string, which also binds payment.transfer_method (see Signing).
payment.payee_trusted says whether the payee's bank details were already trusted when the challenge was issued (always true for your own accounts). It is not part of the signed string. With Approve transfers to new payees on, use it to apply your own rule to a new payee, for example a lower amount or a check against the beneficiary you created.
GET /api/payments/:id shows the open challenge as authorization with its id, status, expires_at and refusal_reason. The nonce only ever appears in the webhook. A transfer refused when it was created has an authorization with status refused, its reason, and an expires_at equal to when it was created; no webhook is sent for it.
With an official client#
Every official SDK ships the two pieces of code this page otherwise asks you to write: a webhook verifier, which checks X-Manza-Signature and X-Manza-Timestamp against the raw request body, and a transfer-authorization signer, which builds the signed string and its HMAC. Use them rather than hand-rolling HMAC code. Signing below is for integrations without a client.
Each SDK also has a runnable examples/transfer_authorizer/: an authorizer that verifies the webhook, checks a ledger, signs and authorizes; a script that creates a test transfer; and a preflight that checks the setup steps above and prints a fix for each one that fails. Its README walks through the same setup. The method names for each language are in its README and example.
| Client | Version | Example |
|---|---|---|
| JavaScript / TypeScript | 2.0.0 or later | getmanza/manza-ts |
| Ruby | 2.0.0 or later | getmanza/manza-ruby |
| Python | 2.0.0 or later | getmanza/manza-python |
| Go | 2.0.0 or later | getmanza/manza-go |
| Rust | 2.0.0 or later | getmanza/manza-rust |
| Elixir | 2.0.0 or later | getmanza/manza-elixir |
| Crystal | 2.0.0 or later | getmanza/manza-crystal |
| PHP | 2.0.0 or later | getmanza/manza-php |
SDK 2.x signs v2: leave its Manza-Version unset or at 2026-11-13, never 2026-03-27. A 1.x client signs v1, so keep it pinned to Manza-Version: 2026-03-27 on its authorize calls until you upgrade (see Signing).
In Ruby, answering a challenge looks like this; ledger stands for your own records:
# Raises Manza::ArgumentError on a bad signature, an old timestamp or a body that is not JSON.
event = Manza::Webhook.construct_event(payload: request.body.read, headers: request.env,
secret: signing_secret)
authorization = event.dig("data", "authorization")
# Key B, not the key that created the transfer.
authorizer = Manza::Client.new(api_key: ENV.fetch("MANZA_AUTHORIZER_API_KEY"))
# Your own record of the transfer, found by the client_reference you issued.
draft = ledger.find(event.dig("data", "payment", "client_reference"))
unless draft
authorizer.payments.decline(event.dig("data", "payment", "id"),
authorization_id: authorization["id"], reason: "unknown client_reference")
return
end
# draft.payment_id is the Manza payment id you stored when you created the transfer,
# draft.amount the API's decimal string ("2500.0"), never a number, and
# draft.transfer_method the rail the create response returned (nil signs as "").
input = Manza::TransferAuthorization.signature_input(
payment_id: draft.payment_id, nonce: authorization["nonce"], amount: draft.amount,
currency_code: draft.currency_code, account_id: draft.account_id,
# Exactly one is set: a beneficiary's bank account (ext:) or one of your own accounts (own:).
payee: Manza::TransferAuthorization.payee_for(external_account_id: draft.external_account_id,
destination_account_id: draft.destination_account_id),
client_reference: draft.client_reference, transfer_method: draft.transfer_method
)
signature = Manza::TransferAuthorization.sign(secret: signing_secret, signature_input: input)
authorizer.payments.authorize(draft.payment_id, authorization_id: authorization["id"], signature:)Signing#
Join these fields with | and compute a lowercase hex HMAC-SHA256 with the endpoint's signing secret:
manza.transfer-authorization.v2|<payment id>|<nonce>|<amount>|<currency>|<source account id>|<payee>|<client_reference>|<transfer_method>amountis the decimal string the API returns (for example2500.0).payeeisext:<external_account_id>for a beneficiary's bank account, orown:<destination_account_id>for one of your own accounts.client_referenceis empty when the transfer has none.transfer_methodis the rail the create response returned: the one you sent, or the market's default when you left it out. It is empty when the response had none.
The version follows the Manza-Version your authorize request sends. A request pinned to 2026-03-27 signs v1: the same string with the v1 prefix and without transfer_method:
manza.transfer-authorization.v1|<payment id>|<nonce>|<amount>|<currency>|<source account id>|<payee>|<client_reference>Every later version, and a request with no Manza-Version header, signs v2. A v1 signature on a v2 request is an invalid signature, and so is the other way round. v1 approves only a transfer on the rail a create without transfer_method stores (the market's default, or none); a transfer on any other rail answers invalid_signature until you sign it v2. That answer leaves the challenge open and does not count toward suspension.
Build the string from your own ledger's values, not from the webhook's signature_input (v1) or signature_input_v2. Those are there so you can compare and debug. The fixed prefix means a webhook signature can never be replayed as an authorization.
input = ["manza.transfer-authorization.v2", payment_id, nonce, amount, currency,
account_id, payee, client_reference.to_s, transfer_method.to_s].join("|")
signature = OpenSSL::HMAC.hexdigest("SHA256", signing_secret, input)import { createHmac } from "node:crypto";
const input = ["manza.transfer-authorization.v2", paymentId, nonce, amount, currency,
accountId, payee, clientReference ?? "", transferMethod ?? ""].join("|");
const signature = createHmac("sha256", signingSecret).update(input).digest("hex");import hashlib, hmac
message = "|".join(["manza.transfer-authorization.v2", payment_id, nonce, amount, currency,
account_id, payee, client_reference or "", transfer_method or ""])
signature = hmac.new(signing_secret.encode(), message.encode(), hashlib.sha256).hexdigest()input := strings.Join([]string{"manza.transfer-authorization.v2", paymentID, nonce, amount,
currency, accountID, payee, clientReference, transferMethod}, "|")
mac := hmac.New(sha256.New, []byte(signingSecret))
mac.Write([]byte(input))
signature := hex.EncodeToString(mac.Sum(nil))Decline a transfer#
POST /api/payments/:id/decline
Body: authorization_id and an optional reason. No signature is needed. The transfer is deleted and 200 returns the challenge with status declined. Repeating the call returns the same answer. Same scope and creating-key rule as authorize.
Error responses#
| Scenario | Status | Type | Param |
|---|---|---|---|
| The creating API key tried to authorize or decline | 403 | same_key_forbidden | — |
| The authorizing or declining key's IP allowlist allows every address | 403 | unrestricted_api_key | — |
| Key lacks transfers:authorize | 403 | insufficient_scope | — |
| The key's creating member may not approve or delete transfers | 403 | forbidden_error | — |
| release_api_webhook_authorization not enabled | 403 | forbidden_error | — |
| Unknown transfer or authorization_id in your workspace | 404 | not_found_error | — |
| authorization_id missing | 400 | invalid_request_error | — |
| Signature missing or does not match | 422 | invalid_signature | — |
| Challenge older than one hour (sent to approvers) | 422 | authorization_expired | — |
| Transfer changed after the challenge (sent to approvers) | 422 | authorization_stale | — |
| Challenge already closed, or refused at answer time (sent to approvers) | 422 | state_error | — |
| The plan's outgoing transfers for this month are used up (nothing is sent) | 422 | plan_limit_reached | — |
| The payee's bank details were being edited, trusted or revoked at that moment (retry) | 409 | authorization_busy | — |
| Duplicate client_reference on create | 409 | duplicate_client_reference | client_reference |
| Authorization rate limit exceeded | 429 | rate_limit_error | — |
| Trust request names an unknown account, or more than 100 | 422 | validation_error | external_account_ids |
| GET /api/transfer_authorizer with nothing enrolled | 404 | not_found_error | — |
| GET /api/transfer_authorizer without a transfers scope | 403 | insufficient_scope | — |
Keeping it safe#
- Keep the signing secret and the authorizing API key on the system that holds your ledger, apart from the key that creates transfers.
- Sign only transfers whose
client_referenceyou issued and whose amount, currency and payee match your record. - Only turn on Approve transfers to new payees once your ledger check on
client_referenceis in place: with it on, your signature alone decides which new bank details get paid and trusted. The challenge names the payee byexternal_account_id, not its bank details, so for a new payee compareGET /api/beneficiaries/:id/external_accounts/:idwith the account you created before signing. - Give every key that creates transfers an IP allowlist. A transfer to a new payee from a key without one goes to your approvers (
unrestricted_api_key), so a leaked key cannot reach your signer with bank details of its own. - Approvers are alerted about every transfer your endpoint approves, on the cadence they choose: every transfer, above an amount with a daily digest, or the daily digest only. Each alert carries a Suspend link.
Testing locally#
manza listen --authorizer brings a copy of each challenge to your laptop, so the receiver you are writing runs locally without a tunnel. An authorizer must still be enrolled (setup steps 1 to 5) on a real receiver that answers deliveries with a 2xx, such as a shared staging server: an endpoint whose deliveries keep failing is disabled, which suspends the authorizer. The challenge goes to that endpoint, and your listen session gets the same event_id.
- Log in with key B against the sandbox. The key needs
transfers:authorize,webhook_listeners:writeand an IP allowlist that includes your laptop's public IP:manza login --base-url https://ma.manza.dev(https://za.manza.devfor South Africa). - Start forwarding:
manza listen --forward-to http://localhost:4242/webhooks --authorizer. - Verify each request with the listen signing secret the command prints, exactly as you verify a real delivery.
manza listen --print-secretprints only that secret, for your.env. - Answer the challenge from your code, or with
manza transfers sign --secret-env <VAR>(manza transfers --helplists its required flags) andmanza transfers authorize <id> --authorization-id <id> --signature <hex>. Sign with the enrolled endpoint's signing secret, not the listen signing secret: the API checks only the enrolled one. Theexamples/transfer_authorizer/receivers useMANZA_AUTHORIZER_SECRETfor both, so their webhook check rejects a forwarded copy until it reads the listen secret.
- Listen sessions work in the sandbox only, and need the
release_webhook_listenersfeature on your workspace: ask support. - Your registered authorizer gets every challenge too, and the first answer wins.
- Five bad signatures in a row from any answerer, your laptop included, suspend the authorizer for everyone using it.
A real endpoint instead. To test the receiver you will enrol, expose it over HTTPS on a URL that does not change, because an enrolled endpoint's URL is fixed:
- ngrok with a reserved domain:
ngrok http --url=<your-name>.ngrok.app 3000. - cloudflared with a named tunnel routed to a hostname you own:
cloudflared tunnel run <tunnel-name>. A quick tunnel (--url) gets a new hostname each run.
Before you enrol, send POST /api/webhook_endpoints/:id/test to check that a delivery reaches your receiver and that your signature check passes (see Send test event).
A complete receiver that verifies the webhook, checks a ledger, signs and authorizes is in every official client's examples/transfer_authorizer/, with a script that creates a test transfer and a preflight; With an official client links each one.
Why did my transfer go to the approvers?#
Read authorization on GET /api/payments/:id. A transfer that did not qualify has an authorization with status refused (or expired, superseded or failed once a challenge closed) and a refusal_reason. The same row appears in Settings → Developer → Transfer approval → Recent approval requests. Nothing is rejected: the approvers can still approve it in the app.
| What you see | What it means | Fix |
|---|---|---|
untrusted_payee | The payee's bank details are not trusted: never trusted with Approve transfers to new payees off, or a member revoked their trust, or they were edited after trusting | Request trust (POST /api/payee_trust_requests) and have an approver accept it; for details never trusted, an approver may instead turn on Approve transfers to new payees. Revoked or edited details always need an approver. Check trusted on the account |
unrestricted_api_key | The payee is not trusted yet and the API key that created the transfer has no IP allowlist (or one whose networks together allow every address), or was revoked since | Add an IP allowlist to that key in Settings → Developer → API keys, as the transfers:authorize key already has; a revoked key cannot be edited, so have an approver approve this transfer, or delete it in the app and create a new one (with a new client_reference) from an active key that has an IP allowlist |
over_new_payee_limit | The payee is not trusted yet and the amount is above the limit per transfer to a new payee | Pay up to that limit first (its signature trusts the payee), or have an approver raise it |
over_transfer_limit | The amount is above the limit per transfer | Split the payment, or have an approver raise the limit |
over_daily_limit | This amount plus the last 24 hours' authorized total is above the limit per 24 hours | Wait for older authorizations to leave the window, or raise the limit; see daily_authorized_total |
currency_mismatch | The source account's currency is not the enrolled currency | Pay from an account in the enrolled currency, or enrol that currency |
suspended | Transfer authorization is suspended, or its endpoint is disabled | Fix the cause in suspension_reason (re-enable the endpoint, rotate the secret); when it was already suspended, an approver then resumes it in the app |
secret_expired | The signing secret passed secret_expires_at | An approver rotates the secret in the app and resumes; deploy the new secret |
signature_failed | Five invalid signatures on one challenge | Build the signed string from the fields in Signing, with the current secret |
stale | The transfer, the payee's bank details or the enrolled endpoint changed after the challenge was sent | Create a new transfer; do not edit it or its payee while a challenge is open |
rail_limit_exceeded | The challenge was authorized, but the transfer's rail (an instant transfer's daily cap) refused it before anything was sent | Have an approver send it on the standard rail in the app, or create the next one without the instant rail |
expired | Nobody answered the challenge within one hour | Check that your receiver got the webhook and called authorize |
authorization is null | No transfer authorizer was enrolled, or the feature was off, when the transfer was created | Run the setup steps above; GET /api/transfer_authorizer returns 404 or 403 |
No webhook arrived, but authorization is pending | The delivery failed or went to an old URL | Check the endpoint's delivery log in the app and that its URL still reaches your receiver |