Try It Live
Check payment status
Retrieves the current state of a transaction.
Call this after the customer is redirected back to your site, and before fulfilling
any order. A redirect to your success_url does not by itself confirm that funds were
collected — only a paymentStatus of CAPTURED does.
Also use this endpoint for reconciliation and to confirm the outcome of a refund.
POST
/
ws
/
paymentgateway
/
get-payment-details
Check payment status
curl --request POST \
--url https://development.payzah.net/ws/paymentgateway/get-payment-details \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trackid": "1000",
"payment_id": "2023020818520981564303"
}
'import requests
url = "https://development.payzah.net/ws/paymentgateway/get-payment-details"
payload = {
"trackid": "1000",
"payment_id": "2023020818520981564303"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({trackid: '1000', payment_id: '2023020818520981564303'})
};
fetch('https://development.payzah.net/ws/paymentgateway/get-payment-details', 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://development.payzah.net/ws/paymentgateway/get-payment-details",
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([
'trackid' => '1000',
'payment_id' => '2023020818520981564303'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://development.payzah.net/ws/paymentgateway/get-payment-details"
payload := strings.NewReader("{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://development.payzah.net/ws/paymentgateway/get-payment-details")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.payzah.net/ws/paymentgateway/get-payment-details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"payzahRefrenceCode": "2023020818520981564303",
"trackId": "1000",
"UDF1": "",
"UDF2": "",
"UDF3": "",
"UDF4": "",
"UDF5": "",
"knetPaymentId": "100202303935749373",
"paymentId": "100202303935749373",
"transactionNumber": "202303935759799",
"trackingNumber": "12992052519157",
"paymentDate": "2023-02-08 18 52 09",
"paymentStatus": "CAPTURED"
}
}Authorizations
Your private key, Base64-encoded.
Encode the key before sending it — for example base64_encode($privateKey) in PHP or
Buffer.from(privateKey).toString('base64') in Node.js. Paste the already-encoded
value here when testing from these docs.
Use your test key here. This console only calls the sandbox environment, so a production key will not authenticate.
Body
application/json
⌘I
Check payment status
curl --request POST \
--url https://development.payzah.net/ws/paymentgateway/get-payment-details \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trackid": "1000",
"payment_id": "2023020818520981564303"
}
'import requests
url = "https://development.payzah.net/ws/paymentgateway/get-payment-details"
payload = {
"trackid": "1000",
"payment_id": "2023020818520981564303"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({trackid: '1000', payment_id: '2023020818520981564303'})
};
fetch('https://development.payzah.net/ws/paymentgateway/get-payment-details', 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://development.payzah.net/ws/paymentgateway/get-payment-details",
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([
'trackid' => '1000',
'payment_id' => '2023020818520981564303'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://development.payzah.net/ws/paymentgateway/get-payment-details"
payload := strings.NewReader("{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://development.payzah.net/ws/paymentgateway/get-payment-details")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.payzah.net/ws/paymentgateway/get-payment-details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trackid\": \"1000\",\n \"payment_id\": \"2023020818520981564303\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"payzahRefrenceCode": "2023020818520981564303",
"trackId": "1000",
"UDF1": "",
"UDF2": "",
"UDF3": "",
"UDF4": "",
"UDF5": "",
"knetPaymentId": "100202303935749373",
"paymentId": "100202303935749373",
"transactionNumber": "202303935759799",
"trackingNumber": "12992052519157",
"paymentDate": "2023-02-08 18 52 09",
"paymentStatus": "CAPTURED"
}
}
