Excluir cupom
curl --request DELETE \
--url https://api.upag.io/v1/coupons/{couponId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', 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: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cupons
Excluir cupom
Remove um cupom da conta
DELETE
https://api.upag.io
/
v1
/
coupons
/
{couponId}
Excluir cupom
curl --request DELETE \
--url https://api.upag.io/v1/coupons/{couponId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', 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: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Exclusão lógica: o cupom deixa de aparecer na listagem e não pode mais ser aplicado.
Permissão:
coupon.write (chave secreta).
Endpoint
curl -X DELETE 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');
await upag.coupons.delete('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
204 No Content — sem corpo em caso de sucesso.
404 (COUPON_NOT_FOUND) se o cupom não existir.