cURL
curl --request POST \ --url https://upay-sistema-api.onrender.com/api/v1/coupons \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data ' { "code": "<string>", "discountType": "PERCENTAGE", "discountValue": 1, "description": "<string>", "minPurchaseCents": 1, "maxDiscountCents": 1, "usageLimit": 2, "perUserLimit": 2, "validFrom": "2023-11-07T05:31:56Z", "validUntil": "2023-11-07T05:31:56Z", "productIds": [ "3c90c3cc-0d44-4b50-8888-8dd25736052a" ], "status": "ACTIVE" } '
{ "message": "<string>", "coupon": { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "code": "<string>", "discountType": "PERCENTAGE", "discountValue": 123, "description": "<string>", "minPurchaseCents": 123, "maxDiscountCents": 123, "usageLimit": 123, "perUserLimit": 123, "validFrom": "2023-11-07T05:31:56Z", "validUntil": "2023-11-07T05:31:56Z", "status": "<string>", "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z" } }
Cria um novo cupom de desconto
Chave de API obtida através do endpoint /api/credentials. Também aceita formato Bearer Token: Authorization: Bearer <api_key>
3 - 50
PERCENTAGE
FIXED
x >= 0
500
x >= 1
ACTIVE
INACTIVE
Cupom criado com sucesso
Show child attributes