Record reported approval
record_approvalWrite a record of what was reported as approved for a purchase on any payment rail. The approver is a name supplied by the calling agent; this does not confirm who approved. BotSupply does not hold or move the money. Returns receipt_id, a public receipt_url, and an edit_token shown once. If approver_contact is an email, also issues a single-use expiring confirm link. When no email provider is configured, the response includes confirm_url and nothing is sent; the caller delivers that link. A click is a signed hash-chain event. approver_confirmation.status stays unconfirmed until the person with access to that contact clicks Confirm or Decline. confirmed means that person clicked Confirm. It is not a legal-identity check, and an unconfirmed receipt is not a verification of the person. Without an email approver_contact, pay_allowed is true only when the price cap is under RECEIPT_CONFIRM_THRESHOLD (default 100, in the price cap currency). At or above that threshold the receipt still records and shows that confirmation is required, and pay_allowed stays false. Poll get_receipt and pay only when pay_allowed is true. Optional public_view is full (default) or redacted, with optional public_scope for the redacted public text. That display setting is outside the hash. No wallet or API key. Rate limited per IP. Same as POST /v1/receipts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | What was reported as approved, in plain text. | |
| agent_id | No | Optional id of the agent that will pay. Not a BotSupply API key. | |
| approver | Yes | Name the calling agent reports as the approver. Not confirmation that this person approved. | |
| agent_name | No | Optional display name of the paying agent. | |
| public_view | No | Public display. full (default) or redacted. Stored outside the hash, so changing it later does not break verify. redacted shows initials, hides contacts, and shortens payment refs and proof values. | |
| merchant_url | No | Optional http or https URL for the merchant. | |
| payment_rail | Yes | How the agent will pay. Examples: stripe_link, card, x402, botsupply_wallet. | |
| public_scope | No | Optional scope shown on the public receipt while public_view is redacted. The stored scope is unchanged and is what the approver confirms. | |
| merchant_name | Yes | Merchant or seller name. | |
| approver_contact | No | Optional email string, or { channel: "email", address }. An email issues a one-time confirm link. The address is stored only as a hash. sms is reserved and rejected until a sender exists. A non-email string is stored as a hash only and does not issue a link. | |
| price_cap_amount | Yes | Maximum amount reported as approved. A positive decimal, for example 25 or "19.95". | |
| price_cap_currency | Yes | Currency code, 3 to 10 letters, for example USD or USDC. | |
| external_payment_ref | No | Optional id from the payment rail. BotSupply does not look it up. | |
| confirmation_webhook_url | No | Optional public https URL. After the contact clicks Confirm or Decline, BotSupply POSTs { receipt_id, approver_confirmation }. Best-effort. Poll get_receipt if it does not arrive. Requires an email approver_contact. |