curl -X POST "https://api-sandbox.whitelabel.com/v1/currency-conversion" \
-H "Content-Type: application/json" \
-H "X-Public-Api-Key: <X-Public-Api-Key>" \
-H "X-Private-Secret-Key: <X-Private-Secret-Key>" \
-d '{
"account_id": "string",
"amount": {
"value": 0,
"currency": "string",
"currency_conversion": {
"cardholder_currency": "string"
}
},
"provider_data": {
"id": "CIBC"
},
"payment_method": {
"token": "string",
"vaulted_token": "string",
"card": {
"card_data": {
"number": "string",
"expiration_month": 0,
"expiration_year": 0,
"holder_name": "string"
}
}
}
}'
const response = await fetch(`https://api-sandbox.whitelabel.com/v1/currency-conversion`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Public-Api-Key': '<X-Public-Api-Key>', 'X-Private-Secret-Key': '<X-Private-Secret-Key>' },
body: JSON.stringify({
"account_id": "string",
"amount": {
"value": 0,
"currency": "string",
"currency_conversion": {
"cardholder_currency": "string"
}
},
"provider_data": {
"id": "CIBC"
},
"payment_method": {
"token": "string",
"vaulted_token": "string",
"card": {
"card_data": {
"number": "string",
"expiration_month": 0,
"expiration_year": 0,
"holder_name": "string"
}
}
}
})
});
const data = await response.json();
import requests
response = requests.request(
"POST",
"https://api-sandbox.whitelabel.com/v1/currency-conversion",
headers={ "X-Public-Api-Key": "<X-Public-Api-Key>", "X-Private-Secret-Key": "<X-Private-Secret-Key>" },
json={
"account_id": "string",
"amount": {
"value": 0,
"currency": "string",
"currency_conversion": {
"cardholder_currency": "string"
}
},
"provider_data": {
"id": "CIBC"
},
"payment_method": {
"token": "string",
"vaulted_token": "string",
"card": {
"card_data": {
"number": "string",
"expiration_month": 0,
"expiration_year": 0,
"holder_name": "string"
}
}
}
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api-sandbox.whitelabel.com/v1/currency-conversion");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json", "X-Public-Api-Key: <X-Public-Api-Key>", "X-Private-Secret-Key: <X-Private-Secret-Key>"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"account_id": "string",
"amount": {
"value": 0,
"currency": "string",
"currency_conversion": {
"cardholder_currency": "string"
}
},
"provider_data": {
"id": "CIBC"
},
"payment_method": {
"token": "string",
"vaulted_token": "string",
"card": {
"card_data": {
"number": "string",
"expiration_month": 0,
"expiration_year": 0,
"holder_name": "string"
}
}
}
}');
$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/currency-conversion", strings.NewReader(`{
"account_id": "string",
"amount": {
"value": 0,
"currency": "string",
"currency_conversion": {
"cardholder_currency": "string"
}
},
"provider_data": {
"id": "CIBC"
},
"payment_method": {
"token": "string",
"vaulted_token": "string",
"card": {
"card_data": {
"number": "string",
"expiration_month": 0,
"expiration_year": 0,
"holder_name": "string"
}
}
}
}`))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Public-Api-Key", "<X-Public-Api-Key>")
req.Header.Set("X-Private-Secret-Key", "<X-Private-Secret-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/currency-conversion"))
.header("Content-Type", "application/json")
.header("X-Public-Api-Key", "<X-Public-Api-Key>")
.header("X-Private-Secret-Key", "<X-Private-Secret-Key>")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"account_id\": \"string\",\n \"amount\": {\n \"value\": 0,\n \"currency\": \"string\",\n \"currency_conversion\": {\n \"cardholder_currency\": \"string\"\n }\n },\n \"provider_data\": {\n \"id\": \"CIBC\"\n },\n \"payment_method\": {\n \"token\": \"string\",\n \"vaulted_token\": \"string\",\n \"card\": {\n \"card_data\": {\n \"number\": \"string\",\n \"expiration_month\": 0,\n \"expiration_year\": 0,\n \"holder_name\": \"string\"\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/currency-conversion")
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["X-Public-Api-Key"] = "<X-Public-Api-Key>"
request["X-Private-Secret-Key"] = "<X-Private-Secret-Key>"
request.body = "{\n \"account_id\": \"string\",\n \"amount\": {\n \"value\": 0,\n \"currency\": \"string\",\n \"currency_conversion\": {\n \"cardholder_currency\": \"string\"\n }\n },\n \"provider_data\": {\n \"id\": \"CIBC\"\n },\n \"payment_method\": {\n \"token\": \"string\",\n \"vaulted_token\": \"string\",\n \"card\": {\n \"card_data\": {\n \"number\": \"string\",\n \"expiration_month\": 0,\n \"expiration_year\": 0,\n \"holder_name\": \"string\"\n }\n }\n }\n}"
response = http.request(request)
puts response.body