Cupons
Atualizar Cupom Parcialmente
PATCH
/v1/coupons/:couponIdBase URL Produção:
https://api.validapay.com.brBase URL Sandbox:
https://sandbox.validapay.com.brAutenticação
bearerAuthorizationstring · header · obrigatório
Envie no header:
Authorization: Bearer {{token}}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| couponId | string | Required | Couponid |
Atualiza parcialmente um cupom, alterando apenas os campos enviados na requisição.
Alterar status do cupom
| Campo | Obrig. | Tipo | Valores |
|---|---|---|---|
status | ✅ | string | ACTIVE PAUSED INACTIVE |
Body
application/json
Content-Type:application/json
{
"status": "PAUSED"
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
status | string | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/coupons/:couponId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"status": "PAUSED"
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"couponId": "cou_xxx",
"status": "PAUSED"
}400400
{
"code": "COUPON_INACTIVE_FINAL",
"message": "Cupom inativo não pode ser reativado"
}