curl --request PATCH \
--url https://api.example.com/coupons/{couponId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "SAVE20",
"name": "Save 20% Updated",
"type": "PERCENTAGE",
"amount": 20,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": null,
"redeemBy": null,
"timesRedeemed": 0,
"amountRedeemed": 0,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z",
"deletedBy": null,
"deletedAt": null
}
Atualizar nome, descricao ou limites de uso de um cupom.
curl --request PATCH \
--url https://api.example.com/coupons/{couponId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "SAVE20",
"name": "Save 20% Updated",
"type": "PERCENTAGE",
"amount": 20,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": null,
"redeemBy": null,
"timesRedeemed": 0,
"amountRedeemed": 0,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z",
"deletedBy": null,
"deletedAt": null
}
coupon:write.{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "SAVE20",
"name": "Save 20% Updated",
"type": "PERCENTAGE",
"amount": 20,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": null,
"redeemBy": null,
"timesRedeemed": 0,
"amountRedeemed": 0,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-03-25T14:30:00.000Z",
"deletedBy": null,
"deletedAt": null
}
curl -X PATCH https://api.awsales.io/admin/coupons/019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Discount Updated"
}'
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
404 | coupon.not_found | Cupom nao encontrado |
500 | internal_server_error | Ocorreu um erro inesperado |