Cupons
Atualizar Cupom
PUT
/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 as configurações de um cupom, como validade ou limite de usos.
Atualizar cupom
Mesmos campos de POST exceto code (todos opcionais).
Body
application/json
Content-Type:application/json
{
"name": "Desconto de 15%",
"discountValue": 15,
"maxRedemptions": 200
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | - | - |
discountValue | number | - | - |
maxRedemptions | number | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/coupons/:couponId';
const options = {
method: 'PUT',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Desconto de 15%",
"discountValue": 15,
"maxRedemptions": 200
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"couponId": "cou_xxx",
"discountValue": 15
}404404
{
"code": "COUPON_NOT_FOUND"
}