Initiate a checkout payment
curl --request POST \
--url https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"payer_currency": "<string>",
"payer_amount": 123,
"payment_method": "<string>",
"target_amount": 123,
"org_rate_id": "<string>",
"country": "<string>"
}
'import requests
url = "https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate"
payload = {
"payer_currency": "<string>",
"payer_amount": 123,
"payment_method": "<string>",
"target_amount": 123,
"org_rate_id": "<string>",
"country": "<string>"
}
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payer_currency: '<string>',
payer_amount: 123,
payment_method: '<string>',
target_amount: 123,
org_rate_id: '<string>',
country: '<string>'
})
};
fetch('https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate', 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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate",
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([
'payer_currency' => '<string>',
'payer_amount' => 123,
'payment_method' => '<string>',
'target_amount' => 123,
'org_rate_id' => '<string>',
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate"
payload := strings.NewReader("{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Checkout
Initiate a checkout payment
Unified checkout initiate for VA-backed, escrow-backed, and regular payment links. Two stages: call without payment_method to get the payer’s available payment options for their chosen currency and amount; call again with payment_method to dispatch the payment through the orchestrator. The existing POST /payment-links/va/{link_ref}/initiate flow is unchanged.
POST
/
payment-links
/
{identifier}
/
initiate
Initiate a checkout payment
curl --request POST \
--url https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"payer_currency": "<string>",
"payer_amount": 123,
"payment_method": "<string>",
"target_amount": 123,
"org_rate_id": "<string>",
"country": "<string>"
}
'import requests
url = "https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate"
payload = {
"payer_currency": "<string>",
"payer_amount": 123,
"payment_method": "<string>",
"target_amount": 123,
"org_rate_id": "<string>",
"country": "<string>"
}
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payer_currency: '<string>',
payer_amount: 123,
payment_method: '<string>',
target_amount: 123,
org_rate_id: '<string>',
country: '<string>'
})
};
fetch('https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate', 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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate",
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([
'payer_currency' => '<string>',
'payer_amount' => 123,
'payment_method' => '<string>',
'target_amount' => 123,
'org_rate_id' => '<string>',
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate"
payload := strings.NewReader("{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-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://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payment-links/{identifier}/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payer_currency\": \"<string>\",\n \"payer_amount\": 123,\n \"payment_method\": \"<string>\",\n \"target_amount\": 123,\n \"org_rate_id\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Headers
Path Parameters
Body
application/json