spend
Authorize a payment by validating amount, currency, payee, and daily limit against policy, returning a signed approval or a specific denial reason for later execution.
Instructions
Asks the body to authorize a payment and records the decision; the body never moves money, so authorized: true is a signed permission for a later payment step, not a transfer. Use it before any payment so that amount, currency, payee and reference are checked against the policy: the one currency the policy names, a cap per call, a payee list and a daily limit. A call outside those bounds is refused with a signed deny naming the bound: denied:spend-cap, denied:spend-payee, denied:spend-currency or denied:spend-daily. A call within them is held for an operator on this machine and answers deferred:approval-required:; once that ref is approved (verax approve, or the panel), resending the same call with the same _ref answers allowed:, and the authorization is recorded as {authorized: true, ref, amountMinor, currency, payee, reference}. Without a spend rule in the policy every call answers denied:spend-not-wired.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _ref | No | Optional reference you choose for this call, 1 to 64 characters of letters, digits, '.', '_' or '-', starting with a letter or digit. Resend the same call with the same _ref after an operator approved it to receive allowed:<ref>; a _ref reused for a different call is refused with denied:ref-reuse. | |
| payee | Yes | Who is to be paid, spelled exactly as the policy's payee list spells it (a merchant or account name). A payee off the list is refused. | |
| currency | Yes | ISO 4217 code in upper case, for example USD, EUR or TRY. Must equal the currency the policy's spend rule names. | |
| reference | Yes | Your own reference for this payment, such as an invoice or order id. Recorded with the authorization and used by verax reconcile to match the card statement. | |
| amountMinor | Yes | Amount in the currency's minor unit as a positive integer: cents, kuruş or pence, so 1250 means 12.50. Compared against the policy's cap per call and daily limit. |