curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"transactionId": "e0b0731e-7170-4b64-8a21-7d835eebd641",
"amount": 1000,
"merchant_id": "< Merchant ID >",
"notes": "Capturing authorised amount"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture"
payload = {
"transactionId": "e0b0731e-7170-4b64-8a21-7d835eebd641",
"amount": 1000,
"merchant_id": "< Merchant ID >",
"notes": "Capturing authorised amount"
}
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactionId: 'e0b0731e-7170-4b64-8a21-7d835eebd641',
amount: 1000,
merchant_id: '< Merchant ID >',
notes: 'Capturing authorised amount'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture', 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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/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([
'transactionId' => 'e0b0731e-7170-4b64-8a21-7d835eebd641',
'amount' => 1000,
'merchant_id' => '< Merchant ID >',
'notes' => 'Capturing authorised amount'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-api-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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture"
payload := strings.NewReader("{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Amount successfully captured.",
"code": "INFO0001"
},
"merchant_details": {
"legal_name": "Tink15 Factory",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe"
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "264302",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "5200000000001005",
"exp_month": "12",
"exp_year": "29"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "9dfd39ec-eb4a-4f8b-a526-17abf140a717",
"ref": 74819,
"timestamp": "2024-11-25T08:41:15.000Z",
"merchant_txn_ref": "qwe"
}
}Capture API
The Capture API is used to finalize a payment by transferring the funds that were previously authorised via the Authorsation API.
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"transactionId": "e0b0731e-7170-4b64-8a21-7d835eebd641",
"amount": 1000,
"merchant_id": "< Merchant ID >",
"notes": "Capturing authorised amount"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture"
payload = {
"transactionId": "e0b0731e-7170-4b64-8a21-7d835eebd641",
"amount": 1000,
"merchant_id": "< Merchant ID >",
"notes": "Capturing authorised amount"
}
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactionId: 'e0b0731e-7170-4b64-8a21-7d835eebd641',
amount: 1000,
merchant_id: '< Merchant ID >',
notes: 'Capturing authorised amount'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture', 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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/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([
'transactionId' => 'e0b0731e-7170-4b64-8a21-7d835eebd641',
'amount' => 1000,
'merchant_id' => '< Merchant ID >',
'notes' => 'Capturing authorised amount'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-api-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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture"
payload := strings.NewReader("{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-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://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/capture")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"e0b0731e-7170-4b64-8a21-7d835eebd641\",\n \"amount\": 1000,\n \"merchant_id\": \"< Merchant ID >\",\n \"notes\": \"Capturing authorised amount\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Amount successfully captured.",
"code": "INFO0001"
},
"merchant_details": {
"legal_name": "Tink15 Factory",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe"
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "264302",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "5200000000001005",
"exp_month": "12",
"exp_year": "29"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "9dfd39ec-eb4a-4f8b-a526-17abf140a717",
"ref": 74819,
"timestamp": "2024-11-25T08:41:15.000Z",
"merchant_txn_ref": "qwe"
}
}Key Points
- The Capture API completes the payment process by moving the authorized funds from the customer’s account to the merchant’s account.
- This API is typically used after an authorisation when the final amount is confirmed, such as after goods are shipped or services are provided.
- Only the amount that was previously authorised can be captured. If the capture is for a lesser amount, the remaining funds will be released.
Flow diagram
Api Parameters
Authorizations
API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'
API Key specific to x-api-key.
Body
The request payload to capture a transaction.
The original transaction ID of the authorized transaction.
36"e0b0731e-7170-4b64-8a21-7d835eebd641"
The amount to be captured. This should not exceed the amount authorized. Amount limit depends on the bank.
1000
The merchant ID (DASMID).
10"< Merchant ID >"
The reference of the capture transaction (optional).
128"Capturing authorised amount"
Response
Transaction captured successfully
True on successful transaction, false on failure.
true
The status code of the transaction.
201
True if live transaction, false if test transaction.
false
The transaction type (e.g., CAPTURE).
"CAPTURE"
A JSON object containing the response from the gateway.
Show child attributes
Show child attributes
A JSON object containing the details of the merchant.
Show child attributes
Show child attributes
A JSON object containing the payment details of the transaction.
Show child attributes
Show child attributes
A JSON object containing details of the transaction.
Show child attributes
Show child attributes