couponsby La Crypta
ApiMint

Mint a voucher

This is the `mintUrl` from the announcement. Signer must be the owner or an authorized minter. Returns a nonce (bearer credential) and a signed kind **20402** voucher (`phase: minted`).

POST/api/coupons/mint

This is the mintUrl from the announcement. Signer must be the owner or an authorized minter. Returns a nonce (bearer credential) and a signed kind 20402 voucher (phase: minted).

Authorization<token>

Nostr <base64 of kind 27235 event>. Tags: u, method, optional payload (sha256 hex of body), and a random nonce to avoid replay.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/coupons/mint" \  -H "Content-Type: application/json" \  -d '{    "couponId": "55b5ee4f-4dcc-4a6a-a58e-6d1d94d811a3"  }'
{  "couponId": "string",  "coupon": {    "type": "percent",    "percent": 0,    "productDs": [      "string"    ],    "cap": {      "amount": 1,      "currency": "ARS"    }  },  "name": "string",  "description": "string",  "npub": "string",  "image": "string",  "nonce": "string",  "expiresAt": 0,  "voucher": {    "id": "string",    "pubkey": "string",    "created_at": 0,    "kind": 0,    "tags": [      [        "string"      ]    ],    "content": "string",    "sig": "string"  }}