> For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-public-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/capture-a-payment-request.md).

# Capture a Payment Request

This reference describes the server-side API used to capture a payment. Use this endpoint after a transaction has been authorized to finalize the payment process.

### Endpoint

Method: `POST`

<table><thead><tr><th width="159.71484375">Environment</th><th>Base URL</th></tr></thead><tbody><tr><td>Sandbox</td><td><code>https://sandbox.codapayments.com/airtime/api/restful/v2.0/Payment/capture</code></td></tr><tr><td>Production</td><td><code>https://airtime.codapayments.com/airtime/api/restful/v2.0/Payment/capture</code></td></tr></tbody></table>

### Request Body

The request body must be sent in JSON format and include the following parameters:

<table data-full-width="true"><thead><tr><th width="292.19921875">Parameter</th><th width="85.40234375">Type</th><th width="113.66015625">Required</th><th width="300.98828125">Description</th></tr></thead><tbody><tr><td><code>capturePaymentRequest.apiKey</code></td><td>string</td><td>Yes</td><td>Your Coda API key for authentication.</td></tr><tr><td><code>capturePaymentRequest.projectId</code></td><td>string</td><td>Yes</td><td>The unique identifier for your project.</td></tr><tr><td><code>capturePaymentRequest.txnId</code></td><td>string</td><td>Yes</td><td>The transaction ID associated with the payment to be captured.</td></tr></tbody></table>

**Example Request**

```json
{
  "capturePaymentRequest": {
    "apiKey": "your_api_key_here",
    "projectId": "your_project_id",
    "txnId": "123456789"
  }
}
```

### Response

A successful request returns a confirmation that the capture request has been acknowledged.

**Example Response**

```json
{
  "capturePaymentResult": {
    "status": "received",
    "txnId": "123456789"
  }
}
```
