Obter cupom
curl --request GET \
--url https://api.upag.io/v1/coupons/{couponId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/coupons/{couponId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/coupons/{couponId}';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cupons
Obter cupom
Consulta um cupom pelo ID
GET
https://api.upag.io
/
v1
/
coupons
/
{couponId}
Obter cupom
curl --request GET \
--url https://api.upag.io/v1/coupons/{couponId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/coupons/{couponId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/coupons/{couponId}';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Permissão:
coupon.read (chave secreta).
Endpoint
curl https://api.upag.dev/v1/coupons/a3c4d5e6-7f80-4912-8abc-0d1e2f3a4b5c \
-H "Authorization: Bearer sk_test_your_api_key"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const coupon = await upag.coupons.retrieve('a3c4d5e6-7f80-4912-8abc-0d1e2f3a4b5c');
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string (uuid)
required
ID do cupom.
Resposta
200 OK
Response
{
"id": "a3c4d5e6-7f80-4912-8abc-0d1e2f3a4b5c",
"name": "R$ 10 off",
"description": null,
"active": true,
"type": "fixed",
"code": "DEZ",
"currency": "brl",
"amountOff": 1000,
"percentOff": null,
"uses": 0,
"maxUses": null,
"appliesTo": "specific",
"appliesToProducts": ["0b9c1f3e-6a4d-4c1e-9d55-3f1f6a7c2e10"],
"expiresAt": null,
"createdAt": "2026-03-18T11:10:00.000Z",
"updatedAt": "2026-03-18T11:10:00.000Z"
}
404 (COUPON_NOT_FOUND) se o cupom não existir ou pertencer a outra conta.