curl --request GET \
--url https://prod-api.pcxpay.com/v1/payments-init/callbackimport requests
url = "https://prod-api.pcxpay.com/v1/payments-init/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://prod-api.pcxpay.com/v1/payments-init/callback', 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/payments-init/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod-api.pcxpay.com/v1/payments-init/callback"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prod-api.pcxpay.com/v1/payments-init/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payments-init/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"error": "Payment not found"
}Browser callback after hosted checkout
Browser redirect endpoint that payment providers send the customer to after hosted checkout finishes. You do not call this endpoint yourself — PCX registers it with the provider during redirect checkout flows (next_action: redirect). It requires no authentication.
PCX looks up the payment from the query parameters, then issues a 302 redirect to the return_url you supplied at initiation, appending status and reference query parameters. status is completed or failed where the provider outcome maps to a final state; otherwise the raw provider status is passed through. reference is your client_reference from initiation, or the first 10 characters of the payment ID when no client_reference was supplied.
If no return_url was stored for the payment, or the stored URL is invalid, the customer is redirected to the PCX remittances page instead.
curl --request GET \
--url https://prod-api.pcxpay.com/v1/payments-init/callbackimport requests
url = "https://prod-api.pcxpay.com/v1/payments-init/callback"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://prod-api.pcxpay.com/v1/payments-init/callback', 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/payments-init/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod-api.pcxpay.com/v1/payments-init/callback"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prod-api.pcxpay.com/v1/payments-init/callback")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payments-init/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"error": "Payment not found"
}Query Parameters
PCX payment ID used to look up the payment. The aliases merchantPaymentId and merchant_payment_id are also accepted.
Provider-side payment ID, used as a fallback lookup when no PCX payment ID is present. The aliases transactionId and paymentId are also accepted.
Provider-reported payment status. The alias paymentStatus is also accepted. success, successful, settled, and completed map to completed; failed maps to failed.
Response
Redirect to the stored return_url with status and reference query parameters appended, or to the PCX remittances page when no valid return_url is stored.