Capture
Capture an authorized payment to collect funds.
Capture
Version: 3.0.0
Prerequisite: Capture only works on a transaction that was authorized with action: "AUTH" and capture_method: "MANUAL" via the Payment Request API. The transaction must still be in an authorizable state (not voided and not already fully captured).
When and Why to Use Capture
Use Capture to collect money from a previously authorized transaction:
- Auth + Capture — Hold funds at checkout, capture after shipping or fulfillment.
- Manual capture — If the order used
capture_method: "MANUAL", you must call this endpoint to settle funds.
Auto-capture vs Manual capture:
- Auto-capture (
AUTOMATICor SALE): Funds settle at payment time — do not call Capture. - Manual capture (
MANUAL): You must call Capture before the authorization expires. The deadline is configured per MID asautoCaptureWithinTime(hours from authorization). Card networks may release holds earlier than this window — contact PayOrc support for extended-hold use cases (e.g. hotels, rentals).
Endpoint
Capture, Void, and Refund share the same Manage Payment endpoint — only action changes.
| Method | URL |
|---|---|
| POST | https://api.payorc.com/orders/v1/transaction |
Please use the test credentials for sandbox testing.
Headers
| Field | Type | Required | Description |
|---|---|---|---|
merchant-key | String | Yes | Your merchant API key |
merchant-secret | String | Yes | Your merchant API secret |
Content-Type | String | Yes | Must be application/json |
Request Body
The request body is flat (not nested under data).
| Field | Type | Required | Description |
|---|---|---|---|
action | String | Yes | Must be CAPTURE |
transaction_id | String | Yes | PayOrc transaction ID from the authorization / webhook (transaction_id) |
amount | Object | Yes | Amount to capture |
amount.currencyCode | String | Yes | ISO currency code (e.g. AED) — must match the original order |
amount.value | Number | Yes | Amount to capture (full or partial) |
reason | String | No | Merchant notes for your records |
Code Examples
Example 1 — Full Capture
curl --location 'https://api.payorc.com/orders/v1/transaction' \
--header 'merchant-key: {merchant-key}' \
--header 'merchant-secret: {merchant-secret}' \
--header 'Content-Type: application/json' \
--data '{
"action": "CAPTURE",
"transaction_id": "1000010118",
"amount": {
"currencyCode": "AED",
"value": 100.00
},
"reason": "Order shipped - full capture"
}'Example 2 — Partial Capture
curl --location 'https://api.payorc.com/orders/v1/transaction' \
--header 'merchant-key: {merchant-key}' \
--header 'merchant-secret: {merchant-secret}' \
--header 'Content-Type: application/json' \
--data '{
"action": "CAPTURE",
"transaction_id": "1000010118",
"amount": {
"currencyCode": "AED",
"value": 50.00
},
"reason": "Partial shipment - capturing available items only"
}'Partial capture: You can capture less than the authorized amount when your PSP and MID support it. The order must still be in a capturable state.
Example 3 — Node.js
const axios = require('axios');
const config = {
method: 'post',
url: 'https://api.payorc.com/orders/v1/transaction',
headers: {
'merchant-key': '{merchant-key}',
'merchant-secret': '{merchant-secret}',
'Content-Type': 'application/json'
},
data: {
action: 'CAPTURE',
transaction_id: '1000010118',
amount: {
currencyCode: 'AED',
value: 100.00
},
reason: 'Order fulfilled'
}
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error.response?.data || error));Example 4 — Python
import requests
import json
url = 'https://api.payorc.com/orders/v1/transaction'
payload = {
"action": "CAPTURE",
"transaction_id": "1000010118",
"amount": {
"currencyCode": "AED",
"value": 30.00
},
"reason": "Partial shipment - item 1 of 3"
}
headers = {
'merchant-key': '{merchant-key}',
'merchant-secret': '{merchant-secret}',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))Response — Success (200)
{
"data": {
"status": "CAPTURED",
"m_order_id": "ORD-2024-001",
"p_order_id": 1000010228,
"transaction_id": 1000010223,
"amount": "100.00",
"currency": "AED",
"date": "04/08/2023"
},
"message": "Transaction successfully Captured.",
"status": "success",
"code": "00"
}Capture, Void, and Refund share the same data shape: status, m_order_id, p_order_id, transaction_id, amount, currency, date.
Response — Error
{
"message": "Transaction can't be captured, already voided or not in state of to be captured",
"status": "fail",
"code": "E0044"
}Auth vs Capture — Summary
| Aspect | Auto-Capture / SALE | Manual Capture |
|---|---|---|
| When funds settle | At payment time | After you call Capture |
| Use case | Retail, digital goods | Hotels, rentals, marketplaces |
| Requires this endpoint? | No | Yes |
| Authorization expires? | N/A | Yes — per MID autoCaptureWithinTime (hours); card issuer may expire sooner |