Listar cupons
curl --request GET \
--url https://api.upag.io/v1/coupons \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/coupons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/coupons';
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
Listar cupons
Lista os cupons da conta, do mais novo para o mais antigo
GET
https://api.upag.io
/
v1
/
coupons
Listar cupons
curl --request GET \
--url https://api.upag.io/v1/coupons \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.upag.io/v1/coupons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/coupons';
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 -G https://api.upag.dev/v1/coupons \
-H "Authorization: Bearer sk_test_your_api_key" \
-d "page=1" \
-d "limit=15"
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const { data, count } = await upag.coupons.list({ page: 1, limit: 15 });
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
integer
default:"1"
Página (mínimo 1).
integer
default:"15"
Itens por página (mínimo 1).
Resposta
200 OK
Response
{
"data": [
{
"id": "a3c4d5e6-7f80-4912-8abc-0d1e2f3a4b5c",
"name": "Black Friday",
"description": null,
"active": true,
"type": "percentage",
"code": "BLACK20",
"currency": null,
"amountOff": null,
"percentOff": 20,
"uses": 3,
"maxUses": 100,
"appliesTo": "all",
"appliesToProducts": null,
"expiresAt": "2026-12-01T00:00:00.000Z",
"createdAt": "2026-03-18T11:10:00.000Z",
"updatedAt": "2026-03-18T11:10:00.000Z"
}
],
"count": 1
}