Vouchers

Mint an allowance voucher

Mints one single-use voucher under the issuer's caps (per-code maximum, outstanding unredeemed value, daily mint count). The raw code is returned exactly once. Replaying idempotency_key returns the original voucher's metadata with already_minted: true and no code.

post/vouchers/v1

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/vouchers/v1
  • Auth: API key in header x-run402-issuer-key

Request body

amount_usd_microsinteger required
idempotency_keystring required
refstring nullable

Opaque issuer context; never interpreted.

expires_in_daysinteger

Example request

{
  "amount_usd_micros": 1000000
}

Response

Idempotency-key replay — original voucher, no code

voucher_idstring uuid
codestring nullable

The raw code, returned EXACTLY ONCE at first mint. Null on an idempotency-key replay: only the hash is stored, so the code cannot be re-served. An issuer that lost the first response mints a fresh code with a new idempotency key.

amount_usd_microsinteger
refstring nullable

Opaque issuer-supplied context handle. Stored verbatim, returned only to the issuing key, never interpreted by the platform.

expires_atstring date-time
created_atstring date-time
already_mintedboolean

Example response

{
  "code": "R402-K8F3-Q2W9",
  "amount_usd_micros": 1000000
}

Changes

No recorded changes to this operation across all 1 revision of this API.