Update Coupon
Update an existing coupon's details.
PATCH
/v2/projects/{project_id}/coupons/{coupon_id}Authorization
Bearer TokenRequired
Path Parameters
project_idstringRequired
The unique identifier of the project.
coupon_idstringRequired
The unique identifier of the coupon.
Request Body
display_namestring
Display name for the coupon.
descriptionstring
A description of the coupon.
percentagenumber
The discount percentage (for percentage type coupons).
amountnumber
The fixed discount amount (for fixed type coupons).
auto_applyboolean
Whether to auto-apply this coupon.
statusstring
Coupon status: active or archived.
invitee_modestring
Who can use: all, new_users, existing_users.
renewal_constraintstring
When applicable: any, first_payment, renewals.
plan_scopestring
Which plans: all or specific.
metadataobject
Custom metadata for the coupon.
Request
curl -X PATCH "https://api.botsubscription.com/v2/projects/f47ac10b-58cc-4372-a567-0e02b2c3d479/coupons/coupon_abc123" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"discount_value": 25,
"valid_until": "2024-09-30T23:59:59.000Z"
}'{
"ok": true,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "PATCH",
"path": "/v2/projects/YOUR_PROJECT_ID/coupons/11111111-1111-1111-1111-111111111111",
"code": 200,
"data": {
"coupon_id": "11111111-1111-1111-1111-111111111111",
"code": "SUMMER2024",
"display_name": "Summer Sale",
"description": "Updated summer discount",
"coupon_type": "percentage",
"percentage": "25",
"auto_apply": false,
"status": "active",
"total_redemptions": 45,
"total_reservations": 0,
"invitee_mode": "all",
"renewal_constraint": "any",
"payment_count_comparator": "any",
"lifetime_revenue_comparator": "any",
"plan_scope": "all",
"created_at": "2024-05-15T10:00:00.000Z",
"metadata": {}
}
}Last updated: