curl -X POST "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/capture" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-H "X-Idempotency-Key: <X-Idempotency-Key>" \
-d '{
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"reason": "string",
"additional_data": {
"order": {
"shipping_amount": 0,
"fee_amount": 0,
"items": [
{
"id": "string",
"name": "string",
"quantity": 0,
"unit_amount": 0,
"category": "art",
"brand": "string",
"sku_code": "string",
"manufacture_part_number": "string"
}
]
},
"airline": {
"pnr": "string",
"legs": [
{
"departure_airport": "string",
"departure_datetime": "1970-01-01T00:00:00.000Z",
"departure_airport_timezone": "string",
"arrival_airport": "string",
"carrier_code": "string",
"carrier_name": "string",
"flight_number": "string",
"fare_basis_code": "string",
"fare_class_code": "F",
"base_fare": 0,
"base_fare_currency": "string",
"stopover_code": "string"
}
],
"passengers": [
{
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"type": "A",
"date_of_birth": "2024-01-01",
"nationality": "AR",
"document": {
"document_number": "string",
"document_type": "DNI",
"country": "AR"
},
"loyalty_number": "string",
"loyalty_tier": "1",
"phone": {}
}
],
"tickets": [
{
"ticket_number": "string",
"e_ticket": true,
"restricted": true,
"total_fare_amount": 0,
"total_tax_amount": 0,
"total_fee_amount": 0,
"issue": {
"carrier_prefix_code": "string",
"travel_agent_code": "string",
"travel_agent_name": "string",
"date": "1970-01-01T00:00:00.000Z",
"address": "string",
"city": "string",
"country": "AR"
}
}
]
},
"seller_details": {
"name": "string",
"email": "string",
"reference": 0,
"website": "string",
"industry": "string",
"merchant_category_code": "string",
"country": "AR",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
}
},
"simplified_mode": true
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/payments/${ payment_id }/transactions/${ transaction_id }/capture` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' , 'X-Idempotency-Key' : '<X-Idempotency-Key>' },
body: JSON . stringify ({
"merchant_reference" : "string" ,
"amount" : {
"currency" : "string" ,
"value" : 0
},
"reason" : "string" ,
"additional_data" : {
"order" : {
"shipping_amount" : 0 ,
"fee_amount" : 0 ,
"items" : [
{
"id" : "string" ,
"name" : "string" ,
"quantity" : 0 ,
"unit_amount" : 0 ,
"category" : "art" ,
"brand" : "string" ,
"sku_code" : "string" ,
"manufacture_part_number" : "string"
}
]
},
"airline" : {
"pnr" : "string" ,
"legs" : [
{
"departure_airport" : "string" ,
"departure_datetime" : "1970-01-01T00:00:00.000Z" ,
"departure_airport_timezone" : "string" ,
"arrival_airport" : "string" ,
"carrier_code" : "string" ,
"carrier_name" : "string" ,
"flight_number" : "string" ,
"fare_basis_code" : "string" ,
"fare_class_code" : "F" ,
"base_fare" : 0 ,
"base_fare_currency" : "string" ,
"stopover_code" : "string"
}
],
"passengers" : [
{
"first_name" : "string" ,
"last_name" : "string" ,
"middle_name" : "string" ,
"type" : "A" ,
"date_of_birth" : "2024-01-01" ,
"nationality" : "AR" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI" ,
"country" : "AR"
},
"loyalty_number" : "string" ,
"loyalty_tier" : "1" ,
"phone" : {}
}
],
"tickets" : [
{
"ticket_number" : "string" ,
"e_ticket" : true ,
"restricted" : true ,
"total_fare_amount" : 0 ,
"total_tax_amount" : 0 ,
"total_fee_amount" : 0 ,
"issue" : {
"carrier_prefix_code" : "string" ,
"travel_agent_code" : "string" ,
"travel_agent_name" : "string" ,
"date" : "1970-01-01T00:00:00.000Z" ,
"address" : "string" ,
"city" : "string" ,
"country" : "AR"
}
}
]
},
"seller_details" : {
"name" : "string" ,
"email" : "string" ,
"reference" : 0 ,
"website" : "string" ,
"industry" : "string" ,
"merchant_category_code" : "string" ,
"country" : "AR" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
}
}
},
"simplified_mode" : true
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/payments/ {payment_id} /transactions/ {transaction_id} /capture" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" , "X-Idempotency-Key" : "<X-Idempotency-Key>" },
json = {
"merchant_reference" : "string" ,
"amount" : {
"currency" : "string" ,
"value" : 0
},
"reason" : "string" ,
"additional_data" : {
"order" : {
"shipping_amount" : 0 ,
"fee_amount" : 0 ,
"items" : [
{
"id" : "string" ,
"name" : "string" ,
"quantity" : 0 ,
"unit_amount" : 0 ,
"category" : "art" ,
"brand" : "string" ,
"sku_code" : "string" ,
"manufacture_part_number" : "string"
}
]
},
"airline" : {
"pnr" : "string" ,
"legs" : [
{
"departure_airport" : "string" ,
"departure_datetime" : "1970-01-01T00:00:00.000Z" ,
"departure_airport_timezone" : "string" ,
"arrival_airport" : "string" ,
"carrier_code" : "string" ,
"carrier_name" : "string" ,
"flight_number" : "string" ,
"fare_basis_code" : "string" ,
"fare_class_code" : "F" ,
"base_fare" : 0 ,
"base_fare_currency" : "string" ,
"stopover_code" : "string"
}
],
"passengers" : [
{
"first_name" : "string" ,
"last_name" : "string" ,
"middle_name" : "string" ,
"type" : "A" ,
"date_of_birth" : "2024-01-01" ,
"nationality" : "AR" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI" ,
"country" : "AR"
},
"loyalty_number" : "string" ,
"loyalty_tier" : "1" ,
"phone" : {}
}
],
"tickets" : [
{
"ticket_number" : "string" ,
"e_ticket" : True ,
"restricted" : True ,
"total_fare_amount" : 0 ,
"total_tax_amount" : 0 ,
"total_fee_amount" : 0 ,
"issue" : {
"carrier_prefix_code" : "string" ,
"travel_agent_code" : "string" ,
"travel_agent_name" : "string" ,
"date" : "1970-01-01T00:00:00.000Z" ,
"address" : "string" ,
"city" : "string" ,
"country" : "AR"
}
}
]
},
"seller_details" : {
"name" : "string" ,
"email" : "string" ,
"reference" : 0 ,
"website" : "string" ,
"industry" : "string" ,
"merchant_category_code" : "string" ,
"country" : "AR" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
}
}
},
"simplified_mode" : True
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/capture" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" , "public-api-key: <public-api-key>" , "private-secret-key: <private-secret-key>" , "X-Idempotency-Key: <X-Idempotency-Key>" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '{
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"reason": "string",
"additional_data": {
"order": {
"shipping_amount": 0,
"fee_amount": 0,
"items": [
{
"id": "string",
"name": "string",
"quantity": 0,
"unit_amount": 0,
"category": "art",
"brand": "string",
"sku_code": "string",
"manufacture_part_number": "string"
}
]
},
"airline": {
"pnr": "string",
"legs": [
{
"departure_airport": "string",
"departure_datetime": "1970-01-01T00:00:00.000Z",
"departure_airport_timezone": "string",
"arrival_airport": "string",
"carrier_code": "string",
"carrier_name": "string",
"flight_number": "string",
"fare_basis_code": "string",
"fare_class_code": "F",
"base_fare": 0,
"base_fare_currency": "string",
"stopover_code": "string"
}
],
"passengers": [
{
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"type": "A",
"date_of_birth": "2024-01-01",
"nationality": "AR",
"document": {
"document_number": "string",
"document_type": "DNI",
"country": "AR"
},
"loyalty_number": "string",
"loyalty_tier": "1",
"phone": {}
}
],
"tickets": [
{
"ticket_number": "string",
"e_ticket": true,
"restricted": true,
"total_fare_amount": 0,
"total_tax_amount": 0,
"total_fee_amount": 0,
"issue": {
"carrier_prefix_code": "string",
"travel_agent_code": "string",
"travel_agent_name": "string",
"date": "1970-01-01T00:00:00.000Z",
"address": "string",
"city": "string",
"country": "AR"
}
}
]
},
"seller_details": {
"name": "string",
"email": "string",
"reference": 0,
"website": "string",
"industry": "string",
"merchant_category_code": "string",
"country": "AR",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
}
},
"simplified_mode": true
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "POST" , "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/capture" , strings. NewReader ( `{
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"reason": "string",
"additional_data": {
"order": {
"shipping_amount": 0,
"fee_amount": 0,
"items": [
{
"id": "string",
"name": "string",
"quantity": 0,
"unit_amount": 0,
"category": "art",
"brand": "string",
"sku_code": "string",
"manufacture_part_number": "string"
}
]
},
"airline": {
"pnr": "string",
"legs": [
{
"departure_airport": "string",
"departure_datetime": "1970-01-01T00:00:00.000Z",
"departure_airport_timezone": "string",
"arrival_airport": "string",
"carrier_code": "string",
"carrier_name": "string",
"flight_number": "string",
"fare_basis_code": "string",
"fare_class_code": "F",
"base_fare": 0,
"base_fare_currency": "string",
"stopover_code": "string"
}
],
"passengers": [
{
"first_name": "string",
"last_name": "string",
"middle_name": "string",
"type": "A",
"date_of_birth": "2024-01-01",
"nationality": "AR",
"document": {
"document_number": "string",
"document_type": "DNI",
"country": "AR"
},
"loyalty_number": "string",
"loyalty_tier": "1",
"phone": {}
}
],
"tickets": [
{
"ticket_number": "string",
"e_ticket": true,
"restricted": true,
"total_fare_amount": 0,
"total_tax_amount": 0,
"total_fee_amount": 0,
"issue": {
"carrier_prefix_code": "string",
"travel_agent_code": "string",
"travel_agent_name": "string",
"date": "1970-01-01T00:00:00.000Z",
"address": "string",
"city": "string",
"country": "AR"
}
}
]
},
"seller_details": {
"name": "string",
"email": "string",
"reference": 0,
"website": "string",
"industry": "string",
"merchant_category_code": "string",
"country": "AR",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
}
},
"simplified_mode": true
}` ))
req.Header. Set ( "Content-Type" , "application/json" )
req.Header. Set ( "public-api-key" , "<public-api-key>" )
req.Header. Set ( "private-secret-key" , "<private-secret-key>" )
req.Header. Set ( "X-Idempotency-Key" , "<X-Idempotency-Key>" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/capture" ))
. header ( "Content-Type" , "application/json" )
. header ( "public-api-key" , "<public-api-key>" )
. header ( "private-secret-key" , "<private-secret-key>" )
. header ( "X-Idempotency-Key" , "<X-Idempotency-Key>" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "{ \n \" merchant_reference \" : \" string \" , \n \" amount \" : { \n \" currency \" : \" string \" , \n \" value \" : 0 \n }, \n \" reason \" : \" string \" , \n \" additional_data \" : { \n \" order \" : { \n \" shipping_amount \" : 0, \n \" fee_amount \" : 0, \n \" items \" : [ \n { \n \" id \" : \" string \" , \n \" name \" : \" string \" , \n \" quantity \" : 0, \n \" unit_amount \" : 0, \n \" category \" : \" art \" , \n \" brand \" : \" string \" , \n \" sku_code \" : \" string \" , \n \" manufacture_part_number \" : \" string \"\n } \n ] \n }, \n \" airline \" : { \n \" pnr \" : \" string \" , \n \" legs \" : [ \n { \n \" departure_airport \" : \" string \" , \n \" departure_datetime \" : \" 1970-01-01T00:00:00.000Z \" , \n \" departure_airport_timezone \" : \" string \" , \n \" arrival_airport \" : \" string \" , \n \" carrier_code \" : \" string \" , \n \" carrier_name \" : \" string \" , \n \" flight_number \" : \" string \" , \n \" fare_basis_code \" : \" string \" , \n \" fare_class_code \" : \" F \" , \n \" base_fare \" : 0, \n \" base_fare_currency \" : \" string \" , \n \" stopover_code \" : \" string \"\n } \n ], \n \" passengers \" : [ \n { \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" middle_name \" : \" string \" , \n \" type \" : \" A \" , \n \" date_of_birth \" : \" 2024-01-01 \" , \n \" nationality \" : \" AR \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \" , \n \" country \" : \" AR \"\n }, \n \" loyalty_number \" : \" string \" , \n \" loyalty_tier \" : \" 1 \" , \n \" phone \" : {} \n } \n ], \n \" tickets \" : [ \n { \n \" ticket_number \" : \" string \" , \n \" e_ticket \" : true, \n \" restricted \" : true, \n \" total_fare_amount \" : 0, \n \" total_tax_amount \" : 0, \n \" total_fee_amount \" : 0, \n \" issue \" : { \n \" carrier_prefix_code \" : \" string \" , \n \" travel_agent_code \" : \" string \" , \n \" travel_agent_name \" : \" string \" , \n \" date \" : \" 1970-01-01T00:00:00.000Z \" , \n \" address \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AR \"\n } \n } \n ] \n }, \n \" seller_details \" : { \n \" name \" : \" string \" , \n \" email \" : \" string \" , \n \" reference \" : 0, \n \" website \" : \" string \" , \n \" industry \" : \" string \" , \n \" merchant_category_code \" : \" string \" , \n \" country \" : \" AR \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AR \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \"\n } \n } \n }, \n \" simplified_mode \" : true \n }" ))
. build ();
HttpResponse < String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/capture" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Post . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "public-api-key" ] = "<public-api-key>"
request[ "private-secret-key" ] = "<private-secret-key>"
request[ "X-Idempotency-Key" ] = "<X-Idempotency-Key>"
request. body = "{ \n \" merchant_reference \" : \" string \" , \n \" amount \" : { \n \" currency \" : \" string \" , \n \" value \" : 0 \n }, \n \" reason \" : \" string \" , \n \" additional_data \" : { \n \" order \" : { \n \" shipping_amount \" : 0, \n \" fee_amount \" : 0, \n \" items \" : [ \n { \n \" id \" : \" string \" , \n \" name \" : \" string \" , \n \" quantity \" : 0, \n \" unit_amount \" : 0, \n \" category \" : \" art \" , \n \" brand \" : \" string \" , \n \" sku_code \" : \" string \" , \n \" manufacture_part_number \" : \" string \"\n } \n ] \n }, \n \" airline \" : { \n \" pnr \" : \" string \" , \n \" legs \" : [ \n { \n \" departure_airport \" : \" string \" , \n \" departure_datetime \" : \" 1970-01-01T00:00:00.000Z \" , \n \" departure_airport_timezone \" : \" string \" , \n \" arrival_airport \" : \" string \" , \n \" carrier_code \" : \" string \" , \n \" carrier_name \" : \" string \" , \n \" flight_number \" : \" string \" , \n \" fare_basis_code \" : \" string \" , \n \" fare_class_code \" : \" F \" , \n \" base_fare \" : 0, \n \" base_fare_currency \" : \" string \" , \n \" stopover_code \" : \" string \"\n } \n ], \n \" passengers \" : [ \n { \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" middle_name \" : \" string \" , \n \" type \" : \" A \" , \n \" date_of_birth \" : \" 2024-01-01 \" , \n \" nationality \" : \" AR \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \" , \n \" country \" : \" AR \"\n }, \n \" loyalty_number \" : \" string \" , \n \" loyalty_tier \" : \" 1 \" , \n \" phone \" : {} \n } \n ], \n \" tickets \" : [ \n { \n \" ticket_number \" : \" string \" , \n \" e_ticket \" : true, \n \" restricted \" : true, \n \" total_fare_amount \" : 0, \n \" total_tax_amount \" : 0, \n \" total_fee_amount \" : 0, \n \" issue \" : { \n \" carrier_prefix_code \" : \" string \" , \n \" travel_agent_code \" : \" string \" , \n \" travel_agent_name \" : \" string \" , \n \" date \" : \" 1970-01-01T00:00:00.000Z \" , \n \" address \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AR \"\n } \n } \n ] \n }, \n \" seller_details \" : { \n \" name \" : \" string \" , \n \" email \" : \" string \" , \n \" reference \" : 0, \n \" website \" : \" string \" , \n \" industry \" : \" string \" , \n \" merchant_category_code \" : \" string \" , \n \" country \" : \" AR \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AR \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \"\n } \n } \n }, \n \" simplified_mode \" : true \n }"
response = http. request (request)
puts response. body ⧉