curl -X POST "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/cancel-or-refund" \
-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 '{
"description": "string",
"reason": "DUPLICATE",
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"split_marketplace": [
{
"recipient_id": "string",
"provider_recipient_id": "string",
"description": "string",
"type": "PURCHASE",
"merchant_reference": "string",
"recipient_type": "MEAL",
"amount": {
"value": 0,
"currency": "string"
},
"liability": {
"processing_fee": "MERCHANT",
"chargebacks": true
}
}
],
"simplified_mode": false,
"response_additional_data": {
"receipt": true,
"receipt_language": "ES"
},
"customer_payer": {
"first_name": "string",
"last_name": "string",
"gender": "M",
"date_of_birth": "string",
"email": "string",
"nationality": "string",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
},
"payment_method": {
"detail": {
"bank_transfer": {
"account_type": "CHECKINGS",
"bank_name": "string",
"bank_id": "string",
"beneficiary_name": "string",
"bank_account": "string",
"beneficiary_document_type": "string",
"beneficiary_document": "string",
"reference": "string",
"bank_account_mask_number": "string",
"mandate": {
"id": "string",
"info": "string",
"received_status": "string",
"existing_status": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
}
}
}
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/payments/${ payment_id }/transactions/${ transaction_id }/cancel-or-refund` , {
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 ({
"description" : "string" ,
"reason" : "DUPLICATE" ,
"merchant_reference" : "string" ,
"amount" : {
"currency" : "string" ,
"value" : 0
},
"split_marketplace" : [
{
"recipient_id" : "string" ,
"provider_recipient_id" : "string" ,
"description" : "string" ,
"type" : "PURCHASE" ,
"merchant_reference" : "string" ,
"recipient_type" : "MEAL" ,
"amount" : {
"value" : 0 ,
"currency" : "string"
},
"liability" : {
"processing_fee" : "MERCHANT" ,
"chargebacks" : true
}
}
],
"simplified_mode" : false ,
"response_additional_data" : {
"receipt" : true ,
"receipt_language" : "ES"
},
"customer_payer" : {
"first_name" : "string" ,
"last_name" : "string" ,
"gender" : "M" ,
"date_of_birth" : "string" ,
"email" : "string" ,
"nationality" : "string" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"billing_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
},
"shipping_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
}
},
"payment_method" : {
"detail" : {
"bank_transfer" : {
"account_type" : "CHECKINGS" ,
"bank_name" : "string" ,
"bank_id" : "string" ,
"beneficiary_name" : "string" ,
"bank_account" : "string" ,
"beneficiary_document_type" : "string" ,
"beneficiary_document" : "string" ,
"reference" : "string" ,
"bank_account_mask_number" : "string" ,
"mandate" : {
"id" : "string" ,
"info" : "string" ,
"received_status" : "string" ,
"existing_status" : "string" ,
"created_at" : "1970-01-01T00:00:00.000Z" ,
"updated_at" : "1970-01-01T00:00:00.000Z"
}
}
}
}
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/payments/ {payment_id} /transactions/ {transaction_id} /cancel-or-refund" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" , "X-Idempotency-Key" : "<X-Idempotency-Key>" },
json = {
"description" : "string" ,
"reason" : "DUPLICATE" ,
"merchant_reference" : "string" ,
"amount" : {
"currency" : "string" ,
"value" : 0
},
"split_marketplace" : [
{
"recipient_id" : "string" ,
"provider_recipient_id" : "string" ,
"description" : "string" ,
"type" : "PURCHASE" ,
"merchant_reference" : "string" ,
"recipient_type" : "MEAL" ,
"amount" : {
"value" : 0 ,
"currency" : "string"
},
"liability" : {
"processing_fee" : "MERCHANT" ,
"chargebacks" : True
}
}
],
"simplified_mode" : False ,
"response_additional_data" : {
"receipt" : True ,
"receipt_language" : "ES"
},
"customer_payer" : {
"first_name" : "string" ,
"last_name" : "string" ,
"gender" : "M" ,
"date_of_birth" : "string" ,
"email" : "string" ,
"nationality" : "string" ,
"document" : {
"document_number" : "string" ,
"document_type" : "DNI"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"billing_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
},
"shipping_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AR" ,
"state" : "string" ,
"zip_code" : "string"
}
},
"payment_method" : {
"detail" : {
"bank_transfer" : {
"account_type" : "CHECKINGS" ,
"bank_name" : "string" ,
"bank_id" : "string" ,
"beneficiary_name" : "string" ,
"bank_account" : "string" ,
"beneficiary_document_type" : "string" ,
"beneficiary_document" : "string" ,
"reference" : "string" ,
"bank_account_mask_number" : "string" ,
"mandate" : {
"id" : "string" ,
"info" : "string" ,
"received_status" : "string" ,
"existing_status" : "string" ,
"created_at" : "1970-01-01T00:00:00.000Z" ,
"updated_at" : "1970-01-01T00:00:00.000Z"
}
}
}
}
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/transactions/<transaction_id>/cancel-or-refund" );
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 , '{
"description": "string",
"reason": "DUPLICATE",
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"split_marketplace": [
{
"recipient_id": "string",
"provider_recipient_id": "string",
"description": "string",
"type": "PURCHASE",
"merchant_reference": "string",
"recipient_type": "MEAL",
"amount": {
"value": 0,
"currency": "string"
},
"liability": {
"processing_fee": "MERCHANT",
"chargebacks": true
}
}
],
"simplified_mode": false,
"response_additional_data": {
"receipt": true,
"receipt_language": "ES"
},
"customer_payer": {
"first_name": "string",
"last_name": "string",
"gender": "M",
"date_of_birth": "string",
"email": "string",
"nationality": "string",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
},
"payment_method": {
"detail": {
"bank_transfer": {
"account_type": "CHECKINGS",
"bank_name": "string",
"bank_id": "string",
"beneficiary_name": "string",
"bank_account": "string",
"beneficiary_document_type": "string",
"beneficiary_document": "string",
"reference": "string",
"bank_account_mask_number": "string",
"mandate": {
"id": "string",
"info": "string",
"received_status": "string",
"existing_status": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
}
}
}
}' );
$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>/cancel-or-refund" , strings. NewReader ( `{
"description": "string",
"reason": "DUPLICATE",
"merchant_reference": "string",
"amount": {
"currency": "string",
"value": 0
},
"split_marketplace": [
{
"recipient_id": "string",
"provider_recipient_id": "string",
"description": "string",
"type": "PURCHASE",
"merchant_reference": "string",
"recipient_type": "MEAL",
"amount": {
"value": 0,
"currency": "string"
},
"liability": {
"processing_fee": "MERCHANT",
"chargebacks": true
}
}
],
"simplified_mode": false,
"response_additional_data": {
"receipt": true,
"receipt_language": "ES"
},
"customer_payer": {
"first_name": "string",
"last_name": "string",
"gender": "M",
"date_of_birth": "string",
"email": "string",
"nationality": "string",
"document": {
"document_number": "string",
"document_type": "DNI"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AR",
"state": "string",
"zip_code": "string"
}
},
"payment_method": {
"detail": {
"bank_transfer": {
"account_type": "CHECKINGS",
"bank_name": "string",
"bank_id": "string",
"beneficiary_name": "string",
"bank_account": "string",
"beneficiary_document_type": "string",
"beneficiary_document": "string",
"reference": "string",
"bank_account_mask_number": "string",
"mandate": {
"id": "string",
"info": "string",
"received_status": "string",
"existing_status": "string",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
}
}
}
}` ))
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>/cancel-or-refund" ))
. 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 \" description \" : \" string \" , \n \" reason \" : \" DUPLICATE \" , \n \" merchant_reference \" : \" string \" , \n \" amount \" : { \n \" currency \" : \" string \" , \n \" value \" : 0 \n }, \n \" split_marketplace \" : [ \n { \n \" recipient_id \" : \" string \" , \n \" provider_recipient_id \" : \" string \" , \n \" description \" : \" string \" , \n \" type \" : \" PURCHASE \" , \n \" merchant_reference \" : \" string \" , \n \" recipient_type \" : \" MEAL \" , \n \" amount \" : { \n \" value \" : 0, \n \" currency \" : \" string \"\n }, \n \" liability \" : { \n \" processing_fee \" : \" MERCHANT \" , \n \" chargebacks \" : true \n } \n } \n ], \n \" simplified_mode \" : false, \n \" response_additional_data \" : { \n \" receipt \" : true, \n \" receipt_language \" : \" ES \"\n }, \n \" customer_payer \" : { \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" gender \" : \" M \" , \n \" date_of_birth \" : \" string \" , \n \" email \" : \" string \" , \n \" nationality \" : \" string \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" billing_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 \" shipping_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 \" payment_method \" : { \n \" detail \" : { \n \" bank_transfer \" : { \n \" account_type \" : \" CHECKINGS \" , \n \" bank_name \" : \" string \" , \n \" bank_id \" : \" string \" , \n \" beneficiary_name \" : \" string \" , \n \" bank_account \" : \" string \" , \n \" beneficiary_document_type \" : \" string \" , \n \" beneficiary_document \" : \" string \" , \n \" reference \" : \" string \" , \n \" bank_account_mask_number \" : \" string \" , \n \" mandate \" : { \n \" id \" : \" string \" , \n \" info \" : \" string \" , \n \" received_status \" : \" string \" , \n \" existing_status \" : \" string \" , \n \" created_at \" : \" 1970-01-01T00:00:00.000Z \" , \n \" updated_at \" : \" 1970-01-01T00:00:00.000Z \"\n } \n } \n } \n } \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>/cancel-or-refund" )
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 \" description \" : \" string \" , \n \" reason \" : \" DUPLICATE \" , \n \" merchant_reference \" : \" string \" , \n \" amount \" : { \n \" currency \" : \" string \" , \n \" value \" : 0 \n }, \n \" split_marketplace \" : [ \n { \n \" recipient_id \" : \" string \" , \n \" provider_recipient_id \" : \" string \" , \n \" description \" : \" string \" , \n \" type \" : \" PURCHASE \" , \n \" merchant_reference \" : \" string \" , \n \" recipient_type \" : \" MEAL \" , \n \" amount \" : { \n \" value \" : 0, \n \" currency \" : \" string \"\n }, \n \" liability \" : { \n \" processing_fee \" : \" MERCHANT \" , \n \" chargebacks \" : true \n } \n } \n ], \n \" simplified_mode \" : false, \n \" response_additional_data \" : { \n \" receipt \" : true, \n \" receipt_language \" : \" ES \"\n }, \n \" customer_payer \" : { \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" gender \" : \" M \" , \n \" date_of_birth \" : \" string \" , \n \" email \" : \" string \" , \n \" nationality \" : \" string \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" DNI \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" billing_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 \" shipping_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 \" payment_method \" : { \n \" detail \" : { \n \" bank_transfer \" : { \n \" account_type \" : \" CHECKINGS \" , \n \" bank_name \" : \" string \" , \n \" bank_id \" : \" string \" , \n \" beneficiary_name \" : \" string \" , \n \" bank_account \" : \" string \" , \n \" beneficiary_document_type \" : \" string \" , \n \" beneficiary_document \" : \" string \" , \n \" reference \" : \" string \" , \n \" bank_account_mask_number \" : \" string \" , \n \" mandate \" : { \n \" id \" : \" string \" , \n \" info \" : \" string \" , \n \" received_status \" : \" string \" , \n \" existing_status \" : \" string \" , \n \" created_at \" : \" 1970-01-01T00:00:00.000Z \" , \n \" updated_at \" : \" 1970-01-01T00:00:00.000Z \"\n } \n } \n } \n } \n }"
response = http. request (request)
puts response. body ⧉