Capture an authorized payment
curl --request POST \
--url https://checkout.kalixo.io/v1/payments/{id}/capture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{
"amount": 2
}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2})
};
fetch('https://checkout.kalixo.io/v1/payments/{id}/capture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://checkout.kalixo.io/v1/payments/{id}/capture"
payload = { "amount": 2 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.kalixo.io/v1/payments/{id}/capture",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "cap_01JABCDEF",
"object": "capture",
"payment": "<string>",
"amount": 1,
"currency": "EUR",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "amount_locked",
"message": "<string>",
"request_id": "<string>",
"decline_code": "<string>",
"param": "<string>"
}
}Payments
Capture an authorized payment
Captures a payment created with capture_method: manual. Omit amount
to capture the full remaining authorized amount. Partial captures are
allowed where the payment method supports them. Captures are
asynchronous: the result arrives as payment.captured,
payment.partially_captured or capture.failed.
POST
/
v1
/
payments
/
{id}
/
capture
Capture an authorized payment
curl --request POST \
--url https://checkout.kalixo.io/v1/payments/{id}/capture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{
"amount": 2
}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2})
};
fetch('https://checkout.kalixo.io/v1/payments/{id}/capture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://checkout.kalixo.io/v1/payments/{id}/capture"
payload = { "amount": 2 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.kalixo.io/v1/payments/{id}/capture",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "cap_01JABCDEF",
"object": "capture",
"payment": "<string>",
"amount": 1,
"currency": "EUR",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "amount_locked",
"message": "<string>",
"request_id": "<string>",
"decline_code": "<string>",
"param": "<string>"
}
}Authorizations
Secret key, kc_sk_test_... or kc_sk_live_.... Server-side only.
Headers
Unique key per logical request, reused on retries. 1 to 255 characters.
Required string length:
1 - 255Path Parameters
Body
application/json
Amount to capture. Cannot exceed the capturable amount.
Required range:
x >= 1Response
Capture requested.
Example:
"cap_01JABCDEF"
Allowed value:
"capture"Amount in the currency's minor unit.
Required range:
x >= 0ISO 4217 currency code, uppercase.
Pattern:
^[A-Z]{3}$Example:
"EUR"
Available options:
pending, succeeded, failed