couponsby La Crypta
ApiDefinitions

Create coupon definition

POST/api/coupons
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

curl -X POST "https://example.com/api/coupons" \  -H "Content-Type: application/json" \  -d '{    "name": "20% de verano",    "description": "No acumulable.",    "image": null,    "benefit": {      "type": "percent",      "percent": 20,      "cap": {        "amount": 5000,        "currency": "ARS"      }    },    "maxUses": 100,    "expiresAt": null  }'
{  "coupon": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "image": "string",    "benefit": {      "type": "percent",      "percent": 0,      "productDs": [        "string"      ],      "cap": {        "amount": 1,        "currency": "ARS"      }    },    "maxUses": 0,    "minted": 0,    "claimed": 0,    "expiresAt": 0,    "archivedAt": 0,    "createdAt": 0,    "updatedAt": 0  }}