curl --request POST \
--url https://api.sandpay.dev/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25000,
"currency": "FCFA",
"operator": "orange",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ORDER-2026-A1",
"scenario": "success"
}
'import requests
url = "https://api.sandpay.dev/v1/payments"
payload = {
"amount": 25000,
"currency": "FCFA",
"operator": "orange",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ORDER-2026-A1",
"scenario": "success"
}
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: 25000,
currency: 'FCFA',
operator: 'orange',
country: 'CI',
msisdn: '+22507123456',
reference: 'ORDER-2026-A1',
scenario: 'success'
})
};
fetch('https://api.sandpay.dev/v1/payments', 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.sandpay.dev/v1/payments",
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' => 25000,
'currency' => 'FCFA',
'operator' => 'orange',
'country' => 'CI',
'msisdn' => '+22507123456',
'reference' => 'ORDER-2026-A1',
'scenario' => 'success'
]),
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.sandpay.dev/v1/payments"
payload := strings.NewReader("{\n \"amount\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\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.sandpay.dev/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandpay.dev/v1/payments")
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\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\n}"
response = http.request(request)
puts response.read_body{
"id": "TX_8K3M9F",
"type": "collection",
"parentTxId": null,
"orderRef": "ORDER-2026-A1",
"orderUrl": null,
"isUrlProtected": false,
"amount": 25000,
"commission": 250,
"netAmount": 25000,
"customerTotal": 25250,
"merchantAbsorptionPct": 100,
"merchantShare": 250,
"customerShare": 0,
"commissionMode": "customer",
"currency": "FCFA",
"operator": "mtn",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ZANA-PAY-20260531221015-8E2884A47B1C",
"status": "SUCCESS",
"latencyMs": 1240,
"createdAt": "2023-11-07T05:31:56Z",
"raw": {
"_simulated": true,
"amount": "25000",
"currency": "FCFA",
"externalId": "ORDER-2026-A1",
"payer": {
"partyIdType": "MSISDN",
"partyId": "22507123456"
},
"payerMessage": "Payment",
"payeeNote": "ORDER-2026-A1",
"status": "SUCCESSFUL",
"financialTransactionId": "SIM_A1B2C3D4"
},
"scenario": "success"
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}Create a payment
Simulate a Mobile Money payment for the given operator / country pair.
Pass an explicit scenario to deterministically drive the outcome
(handy for testing failure paths); omit it to use the default
success path or to defer to a test_client prompt.
curl --request POST \
--url https://api.sandpay.dev/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25000,
"currency": "FCFA",
"operator": "orange",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ORDER-2026-A1",
"scenario": "success"
}
'import requests
url = "https://api.sandpay.dev/v1/payments"
payload = {
"amount": 25000,
"currency": "FCFA",
"operator": "orange",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ORDER-2026-A1",
"scenario": "success"
}
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: 25000,
currency: 'FCFA',
operator: 'orange',
country: 'CI',
msisdn: '+22507123456',
reference: 'ORDER-2026-A1',
scenario: 'success'
})
};
fetch('https://api.sandpay.dev/v1/payments', 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.sandpay.dev/v1/payments",
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' => 25000,
'currency' => 'FCFA',
'operator' => 'orange',
'country' => 'CI',
'msisdn' => '+22507123456',
'reference' => 'ORDER-2026-A1',
'scenario' => 'success'
]),
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.sandpay.dev/v1/payments"
payload := strings.NewReader("{\n \"amount\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\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.sandpay.dev/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandpay.dev/v1/payments")
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\": 25000,\n \"currency\": \"FCFA\",\n \"operator\": \"orange\",\n \"country\": \"CI\",\n \"msisdn\": \"+22507123456\",\n \"reference\": \"ORDER-2026-A1\",\n \"scenario\": \"success\"\n}"
response = http.request(request)
puts response.read_body{
"id": "TX_8K3M9F",
"type": "collection",
"parentTxId": null,
"orderRef": "ORDER-2026-A1",
"orderUrl": null,
"isUrlProtected": false,
"amount": 25000,
"commission": 250,
"netAmount": 25000,
"customerTotal": 25250,
"merchantAbsorptionPct": 100,
"merchantShare": 250,
"customerShare": 0,
"commissionMode": "customer",
"currency": "FCFA",
"operator": "mtn",
"country": "CI",
"msisdn": "+22507123456",
"reference": "ZANA-PAY-20260531221015-8E2884A47B1C",
"status": "SUCCESS",
"latencyMs": 1240,
"createdAt": "2023-11-07T05:31:56Z",
"raw": {
"_simulated": true,
"amount": "25000",
"currency": "FCFA",
"externalId": "ORDER-2026-A1",
"payer": {
"partyIdType": "MSISDN",
"partyId": "22507123456"
},
"payerMessage": "Payment",
"payeeNote": "ORDER-2026-A1",
"status": "SUCCESSFUL",
"financialTransactionId": "SIM_A1B2C3D4"
},
"scenario": "success"
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}{
"error": "quota_exceeded",
"message": "Monthly simulation quota exceeded.",
"detail": {}
}Corps
Réponse
Payment created.
Who absorbed the operator commission for this payment (B113):
customer (default) — client pays amount + commission, merchant
receives the full amount; merchant — client pays amount,
merchant receives amount − commission. null for legacy rows.
customer, merchant "customer"
Caller-supplied idempotency reference (unique per org). Recommended canonical shape ORIGIN-OP-TS-CODE (e.g. ZANA-PAY-20260531221015-8E2884A47B1C): ORIGIN = your app slug (SP for SandPay), OP ∈ PAY/REF/DIS/ABO, TS = compact UTC datetime YYYYMMDDHHMMSS, CODE = 12-char uppercase hex. Any string is accepted — this is a recommended convention, not enforced. Distinct from order_ref.
1 - 80"ZANA-PAY-20260531221015-8E2884A47B1C"
Native operator response payload. In sandbox this is synthesized
to mirror the real operator shape (MTN MoMo, Orange Money, Moov
Africa, Airtel Money) — with _simulated: true set on the
top level so consumers can detect sandbox payloads. In production
this is the verbatim payload returned by the upstream operator
API.
This field lets you write integration code (e.g.
tx.raw.financialTransactionId for MTN, tx.raw.responseCode
for Moov) against sandbox transactions and have the same code
work in production without changes.
null for legacy rows persisted before raw passthrough shipped.
{
"_simulated": true,
"amount": "25000",
"currency": "FCFA",
"externalId": "ORDER-2026-A1",
"payer": {
"partyIdType": "MSISDN",
"partyId": "22507123456"
},
"payerMessage": "Payment",
"payeeNote": "ORDER-2026-A1",
"status": "SUCCESSFUL",
"financialTransactionId": "SIM_A1B2C3D4"
}