Verify OTP payment
curl --request POST \
--url https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment \
--header 'Content-Type: application/json' \
--header 'x-api-secret: <x-api-secret>' \
--header 'x-message-id: <x-message-id>' \
--data '
{
"otpCode": "686435",
"billRefNo": "HY724Z749C"
}
'import requests
url = "https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment"
payload = {
"otpCode": "686435",
"billRefNo": "HY724Z749C"
}
headers = {
"x-api-secret": "<x-api-secret>",
"x-message-id": "<x-message-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-secret': '<x-api-secret>',
'x-message-id': '<x-message-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({otpCode: '686435', billRefNo: 'HY724Z749C'})
};
fetch('https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment', 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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment",
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([
'otpCode' => '686435',
'billRefNo' => 'HY724Z749C'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-secret: <x-api-secret>",
"x-message-id: <x-message-id>"
],
]);
$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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment"
payload := strings.NewReader("{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-secret", "<x-api-secret>")
req.Header.Add("x-message-id", "<x-message-id>")
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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment")
.header("x-api-secret", "<x-api-secret>")
.header("x-message-id", "<x-message-id>")
.header("Content-Type", "application/json")
.body("{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-secret"] = '<x-api-secret>'
request["x-message-id"] = '<x-message-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Success",
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billRefNo": "HY724Z749C",
"status": "PAID",
"amount": 100,
"customerName": "Walk-in Customer",
"customerPhoneNumber": "+251944719460",
"merchantName": "kaldis hq",
"merchantId": "6992cc567b78d101f42345a6",
"externalReference": "075SMPC231670253",
"paymentChannel": "OTP_ACCOUNT",
"paidAt": "25 Mar 2026, 1:56 PM",
"redirectUrl": "",
"paidAmount": 100
}
}{
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "BadRequestException",
"message": "Missing required payload data, pk and payload is required"
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "GEN_004",
"message": "An unexpected server error occurred."
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "ABC_001",
"message": "not found"
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "GEN_004",
"message": "An unexpected server error occurred."
}
}Verify OTP payment
POST
/
erp
/
verify-otp-payment
Verify OTP payment
curl --request POST \
--url https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment \
--header 'Content-Type: application/json' \
--header 'x-api-secret: <x-api-secret>' \
--header 'x-message-id: <x-message-id>' \
--data '
{
"otpCode": "686435",
"billRefNo": "HY724Z749C"
}
'import requests
url = "https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment"
payload = {
"otpCode": "686435",
"billRefNo": "HY724Z749C"
}
headers = {
"x-api-secret": "<x-api-secret>",
"x-message-id": "<x-message-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-secret': '<x-api-secret>',
'x-message-id': '<x-message-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({otpCode: '686435', billRefNo: 'HY724Z749C'})
};
fetch('https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment', 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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment",
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([
'otpCode' => '686435',
'billRefNo' => 'HY724Z749C'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-secret: <x-api-secret>",
"x-message-id: <x-message-id>"
],
]);
$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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment"
payload := strings.NewReader("{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-secret", "<x-api-secret>")
req.Header.Add("x-message-id", "<x-message-id>")
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://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment")
.header("x-api-secret", "<x-api-secret>")
.header("x-message-id", "<x-message-id>")
.header("Content-Type", "application/json")
.body("{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.starpayethiopia.com/v1/starpay-api/erp/verify-otp-payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-secret"] = '<x-api-secret>'
request["x-message-id"] = '<x-message-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"otpCode\": \"686435\",\n \"billRefNo\": \"HY724Z749C\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Success",
"data": {
"transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billRefNo": "HY724Z749C",
"status": "PAID",
"amount": 100,
"customerName": "Walk-in Customer",
"customerPhoneNumber": "+251944719460",
"merchantName": "kaldis hq",
"merchantId": "6992cc567b78d101f42345a6",
"externalReference": "075SMPC231670253",
"paymentChannel": "OTP_ACCOUNT",
"paidAt": "25 Mar 2026, 1:56 PM",
"redirectUrl": "",
"paidAmount": 100
}
}{
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "BadRequestException",
"message": "Missing required payload data, pk and payload is required"
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "GEN_004",
"message": "An unexpected server error occurred."
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "ABC_001",
"message": "not found"
}
}{
"message": "Something wrong",
"status": "error",
"timestamp": "2025-05-07T07:31:30.824Z",
"path": "/v2/starpay-api/",
"error": {
"code": "GEN_004",
"message": "An unexpected server error occurred."
}
}Headers
API secret key.
Example:
"MFUxSN98EV5IUU+RhYZh2f866adcTa4F5HJ2dGI3t8+MH3cvfk/gAZ492TnxwdiI"
Message ID from account lookup when verifying OTP payment.
Example:
"0a162ea504918e1c85f64da9733b64bf25ff400394f8e1da6cdfb656e1338b9a8fe47e1b32429f13b1495b075857bf98"
Body
application/json
⌘I