Collect a payment from a customer
curl --request POST \
--url https://api.kori.ml/merchant/api/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 5000,
"customer_phone": "+22370000000",
"currency": "USD",
"customer_email": "jsmith@example.com",
"reference": "<string>",
"description": "<string>",
"return_url": "<string>",
"cancel_url": "<string>"
}
'import requests
url = "https://api.kori.ml/merchant/api/pay"
payload = {
"amount": 5000,
"customer_phone": "+22370000000",
"currency": "USD",
"customer_email": "jsmith@example.com",
"reference": "<string>",
"description": "<string>",
"return_url": "<string>",
"cancel_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5000,
customer_phone: '+22370000000',
currency: 'USD',
customer_email: 'jsmith@example.com',
reference: '<string>',
description: '<string>',
return_url: '<string>',
cancel_url: '<string>'
})
};
fetch('https://api.kori.ml/merchant/api/pay', 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/pay",
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([
'amount' => 5000,
'customer_phone' => '+22370000000',
'currency' => 'USD',
'customer_email' => 'jsmith@example.com',
'reference' => '<string>',
'description' => '<string>',
'return_url' => '<string>',
'cancel_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.kori.ml/merchant/api/pay"
payload := strings.NewReader("{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.kori.ml/merchant/api/pay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kori.ml/merchant/api/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"transaction_id": 123,
"reference": "<string>",
"amount": 123,
"currency": "<string>",
"payment_url": "<string>",
"initiated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"existing_transaction": {
"id": 123
}
}Payments
Collect a payment from a customer
Initiate a mobile-money collection. The provider pushes a prompt to the
customer’s phone (or, for Wave, returns a hosted payment_url). Responds 202
with status: "pending" — settlement happens later via webhook/reconciliation.
Requires scope pay.
POST
/
merchant
/
api
/
pay
Collect a payment from a customer
curl --request POST \
--url https://api.kori.ml/merchant/api/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 5000,
"customer_phone": "+22370000000",
"currency": "USD",
"customer_email": "jsmith@example.com",
"reference": "<string>",
"description": "<string>",
"return_url": "<string>",
"cancel_url": "<string>"
}
'import requests
url = "https://api.kori.ml/merchant/api/pay"
payload = {
"amount": 5000,
"customer_phone": "+22370000000",
"currency": "USD",
"customer_email": "jsmith@example.com",
"reference": "<string>",
"description": "<string>",
"return_url": "<string>",
"cancel_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5000,
customer_phone: '+22370000000',
currency: 'USD',
customer_email: 'jsmith@example.com',
reference: '<string>',
description: '<string>',
return_url: '<string>',
cancel_url: '<string>'
})
};
fetch('https://api.kori.ml/merchant/api/pay', 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/pay",
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([
'amount' => 5000,
'customer_phone' => '+22370000000',
'currency' => 'USD',
'customer_email' => 'jsmith@example.com',
'reference' => '<string>',
'description' => '<string>',
'return_url' => '<string>',
'cancel_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.kori.ml/merchant/api/pay"
payload := strings.NewReader("{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.kori.ml/merchant/api/pay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kori.ml/merchant/api/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 5000,\n \"customer_phone\": \"+22370000000\",\n \"currency\": \"USD\",\n \"customer_email\": \"jsmith@example.com\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"return_url\": \"<string>\",\n \"cancel_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"transaction_id": 123,
"reference": "<string>",
"amount": 123,
"currency": "<string>",
"payment_url": "<string>",
"initiated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"existing_transaction": {
"id": 123
}
}Authorizations
Scoped Bearer token from POST /merchant/api/auth.
Body
application/json
Required range:
0.01 <= x <= 1000000Example:
5000
Mobile-money provider for collections/deposits.
Available options:
OrangeMoney, Wave, Sama, Moov Example:
"+22370000000"
Example:
"USD"
Your unique idempotency reference. Auto-generated if omitted.
Redirect after success (hosted checkout providers).
Redirect after cancel (hosted checkout providers).
⌘I