# Delayed Capture (CCCAPTURE)

Capture funds against a previously placed authorization, in full or in partial amounts.

Source: https://developer.inoviopay.com/api/capture.html  
Markdown: https://developer.inoviopay.com/api/capture.md

In order to capture a pending authorization, merchants must send a capture request. The Payment Service allows multiple partial captures as long as the original authorized amount is not exceeded.

**POST** `https://api.inoviopay.com/payment/pmt_service.cfm`

### Request Parameters

| Parameter | Description |
|---|---|
| `REQUEST_ACTION` (required) | Must be set to `CCCAPTURE`. |
| `REQUEST_REF_PO_ID` (required) | Reference Order ID (`PO_ID`) of the original authorization. |
| `LI_VALUE_1` (required) | Amount to capture. This value can be less than or equal to the originally authorized amount. |

### Handling the Response

Monitor these key fields to verify the funds from your original authorization have been successfully captured and queued for settlement.

| Field Name | Description |
|---|---|
| `TRANS_STATUS_NAME` | Check this to ensure the capture was `APPROVED`. |
| `TRANS_VALUE_SETTLED` | The exact amount that was successfully captured and will be settled to your account. |
| `TRANS_ID` | The unique Transaction ID for this specific capture event (this will be different from the original authorization's TRANS_ID). |
| `PO_ID` | The overarching Purchase Order ID tying this capture to the original authorization. |

**cURL**

```bash
curl -X POST "https://api.inoviopay.com/payment/pmt_service.cfm" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "request_action=CCCAPTURE&req_username=api_user&req_password=P%40ssw0rd%21&site_id=12345&request_api_version=4.14&request_response_format=JSON&request_ref_po_id=18103630&li_value_1=49.99"
```

**PHP**

```php
use Inovio\Gateway\{Credentials, InovioClient};
use Inovio\Gateway\Model\Money;
use Inovio\Gateway\Refs\Refs;

$client = new InovioClient(new Credentials('api_user', 'P@ssw0rd!', '12345'), 'SANDBOX');

$cap = $client->capture(Refs::order('18103630'), Money::of('49.99', 'USD'));

echo $cap->status, "\n";
echo 'settled=', var_export($cap->settled, true), "\n";   // batch flips this later — not a failure

// Omit the amount to capture the full authorized amount instead:
//   $client->capture(Refs::order('18103630'));
```

**Node**

```ts
import { InovioClient, Money, Refs } from '@inovio/gateway-sdk';

const client = new InovioClient(
  { reqUsername: 'api_user', reqPassword: 'P@ssw0rd!', siteId: '12345' },
  { environment: 'SANDBOX' }
);

const cap = await client.capture(Refs.order('18103630'), Money.of('49.99', 'USD'));

console.log(cap.status);
console.log('settled=', cap.settled);   // batch flips this later — not a failure

// Omit the amount to capture the full authorized amount instead:
//   await client.capture(Refs.order('18103630'));
```

**Python**

```python
from inovio_gateway import Credentials, InovioClient, Money, Refs

client = InovioClient(Credentials("api_user", "P@ssw0rd!", "12345"), environment="SANDBOX")

cap = client.capture(Refs.order("18103630"), Money.of("49.99", "USD"))

print(cap.status.value)
print("settled=", cap.settled)   # batch flips this later — not a failure

# Omit the amount to capture the full authorized amount instead:
#   client.capture(Refs.order("18103630"))
```

**Java**

```java
import com.inoviopay.gateway.refs.Refs;

TransactionResult cap = client.capture(Refs.order("18103630"), Money.of("49.99", "USD"));

System.out.println(cap.status());
System.out.println("settled=" + cap.settled());   // batch flips this later — not a failure

// Omit the amount to capture the full authorized amount instead:
//   client.capture(Refs.order("18103630"));
```

**Response**

```json
{
  "REQUEST_ACTION": "CCCAPTURE",
  "REQ_ID": "74839201",
  "TRANS_STATUS_NAME": "APPROVED",
  "TRANS_VALUE": 49.99,
  "CURR_CODE_ALPHA": "USD",
  "TRANS_VALUE_SETTLED": 49.99,
  "CURR_CODE_ALPHA_SETTLED": "USD",
  "TRANS_EXCH_RATE": "",
  "TRANS_ID": 3948572109,
  "CUST_ID": 7382910,
  "XTL_CUST_ID": "xT883mP",
  "PO_ID": 18103630,
  "XTL_ORDER_ID": "INV-999",
  "BATCH_ID": 883921,
  "PROC_NAME": "Inovio Primary",
  "MERCH_ACCT_ID": 110203,
  "CARD_BRAND_NAME": "Visa",
  "CARD_TYPE": "VISA CLASSIC",
  "CARD_CLASS": "Consumer Debit",
  "CARD_PREPAID": 1,
  "CARD_BANK": "BOFI FEDERAL BANK",
  "CARD_COUNTRY": "USA",
  "CARD_DETAIL": "Debit",
  "CARD_BALANCE": "",
  "PMT_L4": "2921",
  "PMT_ID": 4895565,
  "PMT_ID_XTL": "",
  "PMT_AAU_UPDATE_DT": "",
  "PMT_AAU_UPDATE_DESC": "",
  "PROC_UDF01": "",
  "ANI_RESP_DECISION": "",
  "PROC_UDF02": "",
  "PROC_AUTH_RESPONSE": "AUTH881",
  "PROC_RETRIEVAL_NUM": "7D8A9F0E-1B2C-3D4E-5F6A-7B8C9D0E1F2A",
  "PROC_REFERENCE_NUM": "REF44920193",
  "PROC_REDIRECT_URL": "",
  "AVS_RESPONSE": "M",
  "CVV_RESPONSE": "M",
  "CARD_BRAND_TRANSID": "",
  "REQUEST_API_VERSION": "4.14",
  "P3DS_VENDOR": "",
  "P3DS_RESPONSE": "",
  "PO_LI_ID_1": "9928173",
  "PO_LI_COUNT_1": 1,
  "PO_LI_AMOUNT_1": 49.99,
  "PO_LI_PROD_ID_1": 111205,
  "MBSHP_ID_1": "",
  "TRANS_NTOKEN_USED": 0
}
```
