curl --request GET \
--url https://api.kori.ml/merchant/api/payment/status/{reference} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kori.ml/merchant/api/payment/status/{reference}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kori.ml/merchant/api/payment/status/{reference}', 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://api.kori.ml/merchant/api/payment/status/{reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.kori.ml/merchant/api/payment/status/{reference}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kori.ml/merchant/api/payment/status/{reference}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kori.ml/merchant/api/payment/status/{reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "SUCCESS",
"state": "success",
"status": true
}Check a payment's status with the operator
Ask the mobile-money operator what happened to a collection, by the reference
returned when you created it. Unlike GET /transactions/{id}, which reads Kori’s
stored record, this queries the operator and settles the transaction if it has
completed — so it is the authoritative answer while a payment is still open.
No authentication: the reference is the credential, which is what lets a hosted checkout page poll it from the customer’s browser.
Prefer the payment_received webhook. Poll this only while a customer is
waiting on the result, and stop once state is no longer pending — a payment
that is never confirmed stays pending and is expired by Kori after 24 hours.
curl --request GET \
--url https://api.kori.ml/merchant/api/payment/status/{reference} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kori.ml/merchant/api/payment/status/{reference}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kori.ml/merchant/api/payment/status/{reference}', 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://api.kori.ml/merchant/api/payment/status/{reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.kori.ml/merchant/api/payment/status/{reference}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kori.ml/merchant/api/payment/status/{reference}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kori.ml/merchant/api/payment/status/{reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "SUCCESS",
"state": "success",
"status": true
}Authorizations
Scoped Bearer token from POST /merchant/api/auth.
Path Parameters
The reference from the pay response, e.g. PL_2_1790206361991_03437213.
Response
The current state. pending means the operator has not confirmed yet — it is
not a failure, and the payment may still complete.