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.
Cancel an existing hosted checkout that is still pending. BotSubscription expires the provider session first, then updates the local payment request—so a payment that completes at the same moment always wins over the cancellation.
POST /v2/projects/ {project_id} /payment-requests/ {payment_request_id} /cancel CopyTry it Authorization Bearer Token Required
The request body and query string must both be empty. A project or API-key token needs the payment-requests:update permission; a user token may only cancel a payment request it owns.
Path Parameters The unique identifier of the project.
The unique identifier of the payment request to cancel (UUID).
curl -X POST "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/payment-requests/11111111-1111-1111-1111-111111111111/cancel" \
-H "Authorization: Bearer YOUR_TOKEN" const project_id = 'YOUR_PROJECT_ID' ;
const payment_request_id = '11111111-1111-1111-1111-111111111111' ;
const response = await fetch ( `https://api.botsubscription.com/v2/projects/${ project_id }/payment-requests/${ payment_request_id }/cancel` , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer YOUR_TOKEN'
}
});
const data = await response. json (); import requests
project_id = 'YOUR_PROJECT_ID'
payment_request_id = '11111111-1111-1111-1111-111111111111'
response = requests.post(
f 'https://api.botsubscription.com/v2/projects/ { project_id } /payment-requests/ { payment_request_id } /cancel' ,
headers = { 'Authorization' : 'Bearer YOUR_TOKEN' }
)
data = response.json() $project_id = 'YOUR_PROJECT_ID' ;
$payment_request_id = '11111111-1111-1111-1111-111111111111' ;
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api.botsubscription.com/v2/projects/{ $project_id }/payment-requests/{ $payment_request_id }/cancel" );
curl_setopt ($ch, CURLOPT_POST , true );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ 'Authorization: Bearer YOUR_TOKEN' ]);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
$response = curl_exec ($ch); Checkout cancelled application/json
{
"ok" : true ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "POST" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/payment-requests/11111111-1111-1111-1111-111111111111/cancel" ,
"code" : 200 ,
"data" : {
"payment_request_id" : "11111111-1111-1111-1111-111111111111" ,
"status" : "expired"
}
} Provider session could not be safely expired application/json
{
"ok" : false ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "POST" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/payment-requests/11111111-1111-1111-1111-111111111111/cancel" ,
"code" : 409 ,
"error" : {
"error_code" : "CONFLICT" ,
"message" : "The payment provider could not confirm the session was cancellable"
}
} Payment request not found application/json
{
"ok" : false ,
"request_id" : "11111111-1111-1111-1111-111111111111" ,
"method" : "POST" ,
"path" : "/v2/projects/YOUR_PROJECT_ID/payment-requests/11111111-1111-1111-1111-111111111111/cancel" ,
"code" : 404 ,
"error" : {
"error_code" : "NOT_FOUND" ,
"message" : "Payment request not found"
}
} If the provider returns an indeterminate result, BotSubscription responds with a retryable error rather than guessing at the outcome—retry the cancellation once the provider's state is clear.
Last updated: August 31, 2026
PreviousResume Checkout Next List Settings