Coupons
Update a coupon
selectkey<token>
API key para requisições autenticadas. Envie sua chave no cabeçalho selectkey (sandbox sk_test_…, produção sk_live_…).
In: header
Path Parameters
couponId*string
Public identifier (dis_/coup_…)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/v1/coupons/string" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Ltda", "code": "string", "type": "flat", "value": 5000, "enabled": true, "minCartAmount": 5000, "maxCartAmount": 5000, "minCartItems": 0, "maxCartItems": 0, "usageLimit": 0, "usageQuantity": 0, "limitOneUsePerCustomer": true, "isCumulative": true, "initDate": "2026-01-15T12:00:00.000Z", "endDate": "2026-01-15T12:00:00.000Z", "allowedItemIds": [ "id_0a1b2c3d4e5f60718293" ], "allowedCustomerIds": [ "cus_0a1b2c3d4e5f60718293" ], "scope": "firstCharge", "recurringCycles": 1 }'{
"id": "dis_0a1b2c3d4e5f60718293",
"name": "Acme Ltda",
"code": "string",
"type": "flat",
"value": 5000,
"enabled": true,
"minCartAmount": 5000,
"maxCartAmount": 5000,
"minCartItems": 0,
"maxCartItems": 0,
"usageLimit": 0,
"usageQuantity": 0,
"limitOneUsePerCustomer": true,
"isCumulative": true,
"initDate": "string",
"endDate": "string",
"allowedItemIds": [],
"allowedCustomerIds": [],
"scope": "firstCharge",
"recurringCycles": 0,
"createdAt": "string",
"updatedAt": "string"
}{
"error": {
"status": "Bad Request",
"statusCode": 400,
"category": "validation",
"code": "invalidParameters",
"message": "Validation errors occurred.",
"resource": "server"
}
}{
"error": {
"status": "Unauthorized",
"statusCode": 401,
"category": "authentication",
"code": "unauthorized",
"message": "Authentication is required to access this resource.",
"resource": "server"
}
}{
"error": {
"status": "Forbidden",
"statusCode": 403,
"category": "authorization",
"code": "forbidden",
"message": "You do not have permission to perform this action.",
"resource": "server"
}
}{
"error": {
"status": "Internal Server Error",
"statusCode": 500,
"category": "server",
"code": "notFound",
"message": "An unexpected error occurred.",
"resource": "server"
}
}{
"error": {
"status": "Conflict",
"statusCode": 409,
"category": "client",
"code": "idempotencyInProgress",
"message": "A request with this idempotency key is already being processed.",
"resource": "server"
}
}{
"error": {
"status": "Bad Request",
"statusCode": 400,
"category": "validation",
"code": "invalidParameters",
"message": "Validation errors occurred.",
"resource": "server"
}
}{
"error": {
"status": "Internal Server Error",
"statusCode": 500,
"category": "server",
"code": "serverError",
"message": "An unexpected error occurred. Please try again later.",
"resource": "server",
"details": "If the problem persists, contact support with the correlationId from the response headers."
}
}