Capture Payment
This endpoint captures a previously authorised card payment created via the JavaScript SDK or API.
Use this only when the payment status is authorised. Once captured, the status will transition to waiting.
⚠️ Only full amount capture is supported. Partial capture is not allowed.
⚠️ Each payment can only be captured once. Attempting to capture a payment that is not in authorised state or already captured will return an error.
curl --request POST \
--url https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"uuid": "PSADT5CE"
}
'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment"
payload = { "uuid": "PSADT5CE" }
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({uuid: 'PSADT5CE'})
};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment",
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([
'uuid' => 'PSADT5CE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment"
payload := strings.NewReader("{\n \"uuid\": \"PSADT5CE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"PSADT5CE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"PSADT5CE\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "test@example.com",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "waiting",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "USD",
"amount": 10000,
"total": 10000,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": {
"total_amount": 123,
"refund_amount": 123,
"description": "<string>"
},
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "4242",
"card_country": "US"
}
},
"created_at": "2025-05-28T04:22:21.567+0000"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Transaction must be in authorised status before it can be captured."
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
The unique ID of the authorised payment (e.g., VMMAOTFQ).
"PSADT5CE"
Response
Capture successful
"7PPPMXIGH"
"Testing"
"test@example.com"
"wc_order_6C1hcvg4T7Pom"
pending, authorised, waiting, received, expired, return_pending, return_expired, partially_refunded, return_received, return_rejected, failed, in_dispute, dispute_lost "waiting"
Show child attributes
Show child attributes
"USD"
10000
10000
0
true
"card"
""
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"2025-05-28T04:22:21.567+0000"
curl --request POST \
--url https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"uuid": "PSADT5CE"
}
'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment"
payload = { "uuid": "PSADT5CE" }
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({uuid: 'PSADT5CE'})
};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment",
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([
'uuid' => 'PSADT5CE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment"
payload := strings.NewReader("{\n \"uuid\": \"PSADT5CE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"PSADT5CE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/capture_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"PSADT5CE\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "test@example.com",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "waiting",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "USD",
"amount": 10000,
"total": 10000,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": {
"total_amount": 123,
"refund_amount": 123,
"description": "<string>"
},
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "4242",
"card_country": "US"
}
},
"created_at": "2025-05-28T04:22:21.567+0000"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Transaction must be in authorised status before it can be captured."
}
}