api.botsubscription.com
GET /v1/endpoint
Authentication Bearer
Token
Stays in this tab. Required for this endpoint — the value below is what gets sent.
Request GET Response —
cURL Node Python PHP Go Ruby
Copy curl --request GET \
--url https://api.botsubscription.com/v1/endpoint \
--header 'Authorization: Bearer sk_live_•••'— — · — · —
Response will appear here.
Modify an existing discount coupon's settings. Change the discount amount, update targeting rules, toggle auto-apply, or archive the coupon to stop new redemptions. Only the fields you include in the request body are updated.
PATCH /v2/projects/ {project_id} /coupons/ {coupon_id} CopyTry it Authorization Bearer Token Required
Path Parameters The unique identifier of the project.
The unique identifier of the coupon.
Request Body Display name for the coupon.
A description of the coupon.
The discount percentage (for percentage type coupons).
The fixed discount amount (for fixed type coupons).
Whether to auto-apply this coupon.
Coupon status: active or archived.
Who can use: all, new_users, existing_users.
When applicable: any, first_payment, renewals.
Which plans: all or specific.
Custom metadata for the coupon.
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"
}' const project_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479' ;
const coupon_id = 'coupon_abc123' ;
const response = await fetch ( `https://api.botsubscription.com/v2/projects/${ project_id }/coupons/${ coupon_id }` , {
method: 'PATCH' ,
headers: {
'Authorization' : 'Bearer YOUR_TOKEN' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
discount_value: 25 ,
valid_until: '2024-09-30T23:59:59.000Z'
})
});
const data = await response. json (); import requests
project_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
coupon_id = 'coupon_abc123'
response = requests.patch(
f 'https://api.botsubscription.com/v2/projects/ { project_id } /coupons/ { coupon_id } ' ,
headers = {
'Authorization' : 'Bearer YOUR_TOKEN' ,
'Content-Type' : 'application/json'
},
json = {
'discount_value' : 25 ,
'valid_until' : '2024-09-30T23:59:59.000Z'
}
)
data = response.json() $project_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479' ;
$coupon_id = 'coupon_abc123' ;
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api.botsubscription.com/v2/projects/{ $project_id }/coupons/{ $coupon_id }" );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , 'PATCH' );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [
'Authorization: Bearer YOUR_TOKEN' ,
'Content-Type: application/json'
]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , json_encode ([
'discount_value' => 25 ,
'valid_until' => '2024-09-30T23:59:59.000Z'
]));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
$response = curl_exec ($ch); Coupon updated application/json
{
"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" : {}
}
} Coupon not found application/json
{
"ok" : false ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "PATCH" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/coupons/11111111-1111-1111-1111-111111111111" ,
"code" : 404 ,
"error" : {
"error_code" : "NOT_FOUND" ,
"message" : "Requested resource could not be found"
}
} Last updated: May 28, 2026
PreviousCreate Coupon Next Delete Coupon