extensions / Commerce extension
PATCH
/api/projects/{project_id}/sales/coupons/{coupon_id}Update Coupon
Updates a project coupon from the submitted coupon payload and dispatches a coupon-updated event.
Authentication
- Requirement
- Required
- Credential type
- Bearer API key
- Scopes
- Not specified
Permissions
- Requests are scoped to the target project_id. API-key requests must use a key with an active connection to that project.
Headers
| Name | Required | Type | Details |
|---|---|---|---|
Authorization | Yes | Not specified | Description: Bearer credential used to authenticate the request. |
Path Parameters
| Name | Required | Type | Details |
|---|---|---|---|
project_id | Yes | Not specified | Description: Target project identifier. |
coupon_id | Yes | Not specified | Description: Identifier for coupon. |
Query Parameters
Request Body
Schema: CouponPayload
| Field | Required | Type | Details |
|---|---|---|---|
code | Yes | string | Description: Text value. |
discount_type | No | string | Description: Text value. |
amount | Yes | number | Description: Numeric amount. |
target_scope | No | string | Description: Text value. |
allow_stack | No | boolean | Description: Boolean flag. |
max_uses | No | integer | Description: Integer value. |
max_uses_per_customer | No | integer | Description: Integer value. |
starts_at | No | string | Description: Text value. |
ends_at | No | string | Description: Text value. |
is_active | No | boolean | Description: Boolean flag. |
Response Body
Example 200 response
json
{
"id": 1,
"project_id": 1,
"code": "string",
"discount_type": "string",
"amount": "string",
"target_scope": "string",
"allow_stack": 1,
"max_uses": 1,
"uses": 1,
"max_uses_per_customer": 1,
"starts_at": "2026-01-01T00:00:00Z",
"ends_at": "2026-01-01T00:00:00Z",
"is_active": 1,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}Errors
400 bad_request404 not_foundAvailability
- Available in
- v0.1.0
- Available since
- v0.1.0
- Implementation
- Available
- Deprecation
- Not specified
- Rate limits
- Not specified

