# Resume Payment Request - Recover an Interrupted Checkout via API

> Resume an interrupted hosted checkout for a Telegram or Discord subscription bot without creating a duplicate payment request.

Source: https://docs.botsubscription.com/api/payment-requests/resume/

Re-open an existing hosted checkout when a customer closes their browser, loses the original payment link, or retries after the initial response is gone. BotSubscription checks the payment provider's current status first, so a payment that already completed always takes precedence over a stale checkout link—no second payment request is created.

Read `status` to determine whether a payment request is complete. An amount of `"0"` alone does not prove completion.

<ApiEndpoint method="POST" endpoint="/v2/projects/{project_id}/payment-requests/{payment_request_id}/resume" />

<ApiAuthorization type="Bearer API Key" />

The response includes the [payment-operation fields](https://docs.botsubscription.com/api/payment-requests/create/#handle-the-returned-status), not just a checkout URL and status. Customer identity and stored timestamps are available through [Get Payment Request](https://docs.botsubscription.com/api/payment-requests/get/).

**API key scope:** `payment-requests:add` (required for restricted keys).

The request body and query string must both be empty.

<ApiSection title="Path Parameters">
  <ApiParameter name="project_id" type="string" required description="The unique identifier of the project." />
  <ApiParameter name="payment_request_id" type="string" required description="The unique identifier of the payment request to resume (UUID)." />
</ApiSection>

<ApiSamplePane>

<ApiRequestSample title="Request">

```bash
curl -X POST "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/payment-requests/11111111-1111-1111-1111-111111111111/resume" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```javascript
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}/resume`, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});
const data = await response.json();
```

```python
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}/resume',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
```

```php
$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}/resume");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
```

</ApiRequestSample>

<ApiResponseTabs>
  <ApiResponse status={200} description="Checkout resumed">

```json
{
  "ok": true,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "POST",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/payment-requests/11111111-1111-1111-1111-111111111111/resume",
  "code": 200,
  "data": {
    "payment_request_id": "11111111-1111-1111-1111-111111111111",
    "request_type": "invoice",
    "amount": "1",
    "currency": "USD",
    "status": "pending",
    "provider_payment_id": "cs_test_example",
    "merchant_account_id": "22222222-2222-4222-8222-222222222222",
    "failure_reason": null,
    "payment_error_code": null,
    "payment_url": "https://checkout.stripe.com/c/pay/cs_test_example",
    "provider": "stripe",
    "payment_request_data": {},
    "reused": true
  }
}
```

  </ApiResponse>
  <ApiResponse status={200} description="Already settled — terminal state returned instead">

```json
{
  "ok": true,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "POST",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/payment-requests/11111111-1111-1111-1111-111111111111/resume",
  "code": 200,
  "data": {
    "payment_request_id": "11111111-1111-1111-1111-111111111111",
    "request_type": "invoice",
    "amount": "1",
    "currency": "USD",
    "status": "completed",
    "provider_payment_id": "cs_test_example",
    "merchant_account_id": "22222222-2222-4222-8222-222222222222",
    "failure_reason": null,
    "payment_error_code": null,
    "provider": "stripe",
    "payment_request_data": {},
    "reused": false
  }
}
```

  </ApiResponse>
  <ApiResponse status={404} description="Payment request not found">

```json
{
  "ok": false,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "POST",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/payment-requests/11111111-1111-1111-1111-111111111111/resume",
  "code": 404,
  "error": {
    "error_code": "NOT_FOUND",
    "message": "Payment request not found"
  }
}
```

  </ApiResponse>
  <ApiResponse status={401} description="Invalid or expired API key">

```json
{
  "ok": false,
  "request_id": "44444444-4444-4444-8444-444444444444",
  "method": "POST",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/payment-requests/22222222-2222-4222-8222-222222222222/resume",
  "code": 401,
  "error": {
    "message": "Invalid or expired authentication token.",
    "error_code": "UNAUTHORIZED"
  }
}
```

  </ApiResponse>
</ApiResponseTabs>

</ApiSamplePane>

`reused: true` means the returned `payment_url` points to the same checkout session—render it, don't start a new flow. When the provider reports the request as already paid or expired, the response instead reflects that terminal `status` rather than a stale URL.
