Dashboard
APICancel Payment Request API - Expire a Checkout | BotSubscription
api.botsubscription.com
GET/v1/endpoint
AuthenticationBearer
Token
Stays in this tab. Required for this endpoint — the value below is what gets sent.
Examples
curl --request GET \
  --url https://api.botsubscription.com/v1/endpoint \
  --header 'Authorization: Bearer sk_live_•••'

Cancel Payment Request - Expire a Pending Checkout via API

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

Authorization

Bearer API KeyRequired

The response includes the payment-operation fields. A terminal response omits the live checkout URL; use Get Payment Request for customer identity and stored timestamps.

API key scope: payment-requests:update (required for restricted keys).

The request body and query string must both be empty.

An open payable checkout can block a new automatic trial with 409 SUBSCRIPTION_IN_PROGRESS from Create Payment Request. Use this endpoint with its saved ID, or wait for provider expiry. Cancellation is provider-dependent: a 409 means it could not be safely confirmed, so do not assume the checkout is cancelled or that a new trial can start.

Path Parameters

project_idstringrequired

The unique identifier of the project.

payment_request_idstringrequired

The unique identifier of the payment request to cancel (UUID).

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: