curl -X POST https://sandbox.api.simiz.io/v1/payments \
-H "Authorization: Bearer smz_test_sk_abc123" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"returnUrl": "https://merchant.com/payment/success",
"cancelUrl": "https://merchant.com/payment/cancel",
"description": "Order #1234"
}'const response = await fetch('https://sandbox.api.simiz.io/v1/payments', {
method: 'POST',
headers: {
'Authorization': 'Bearer smz_test_sk_abc123',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userId: '550e8400-e29b-41d4-a716-446655440000',
amount: 5000,
currency: 'XAF',
returnUrl: 'https://merchant.com/payment/success',
cancelUrl: 'https://merchant.com/payment/cancel',
description: 'Order #1234',
}),
});
const payment = await response.json();
console.log(payment.token, payment.paymentUrl);
import requests
resp = requests.post(
"https://sandbox.api.simiz.io/v1/payments",
headers={"Authorization": "Bearer smz_test_sk_abc123"},
json={
"userId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"returnUrl": "https://merchant.com/payment/success",
"cancelUrl": "https://merchant.com/payment/cancel",
"description": "Order #1234",
},
)
payment = resp.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.simiz.io/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([
'userId' => '550e8400-e29b-41d4-a716-446655440000',
'amount' => 5000,
'currency' => 'XAF',
'returnUrl' => 'https://merchant.com/payment/success',
'cancelUrl' => 'https://merchant.com/payment/cancel',
'description' => 'Order #1234 — 2 items'
]),
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.simiz.io/v1/payments"
payload := strings.NewReader("{\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\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.simiz.io/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simiz.io/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 \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"token": "pay_abc123xyz789",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"status": "PENDING",
"paymentUrl": "https://pay.simiz.io/pay/pay_abc123xyz789",
"description": "Order #1234 — 2 items",
"livemode": false,
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": null
}{
"statusCode": 400,
"message": "amount must not be less than 100",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": "Too Many Requests"
}Create a payment
Initiate a new Mobile Money payment. Returns a unique token and a paymentUrl to redirect the customer to.
The customer will receive a USSD prompt on their phone to confirm the payment.
curl -X POST https://sandbox.api.simiz.io/v1/payments \
-H "Authorization: Bearer smz_test_sk_abc123" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"returnUrl": "https://merchant.com/payment/success",
"cancelUrl": "https://merchant.com/payment/cancel",
"description": "Order #1234"
}'const response = await fetch('https://sandbox.api.simiz.io/v1/payments', {
method: 'POST',
headers: {
'Authorization': 'Bearer smz_test_sk_abc123',
'Content-Type': 'application/json',
},
body: JSON.stringify({
userId: '550e8400-e29b-41d4-a716-446655440000',
amount: 5000,
currency: 'XAF',
returnUrl: 'https://merchant.com/payment/success',
cancelUrl: 'https://merchant.com/payment/cancel',
description: 'Order #1234',
}),
});
const payment = await response.json();
console.log(payment.token, payment.paymentUrl);
import requests
resp = requests.post(
"https://sandbox.api.simiz.io/v1/payments",
headers={"Authorization": "Bearer smz_test_sk_abc123"},
json={
"userId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"returnUrl": "https://merchant.com/payment/success",
"cancelUrl": "https://merchant.com/payment/cancel",
"description": "Order #1234",
},
)
payment = resp.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.simiz.io/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([
'userId' => '550e8400-e29b-41d4-a716-446655440000',
'amount' => 5000,
'currency' => 'XAF',
'returnUrl' => 'https://merchant.com/payment/success',
'cancelUrl' => 'https://merchant.com/payment/cancel',
'description' => 'Order #1234 — 2 items'
]),
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.simiz.io/v1/payments"
payload := strings.NewReader("{\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\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.simiz.io/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simiz.io/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 \"userId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": 5000,\n \"currency\": \"XAF\",\n \"returnUrl\": \"https://merchant.com/payment/success\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"description\": \"Order #1234 — 2 items\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"token": "pay_abc123xyz789",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5000,
"currency": "XAF",
"status": "PENDING",
"paymentUrl": "https://pay.simiz.io/pay/pay_abc123xyz789",
"description": "Order #1234 — 2 items",
"livemode": false,
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": null
}{
"statusCode": 400,
"message": "amount must not be less than 100",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": "Too Many Requests"
}Authorizations
Use your Simiz API key as the Bearer token.
Keys starting with smz_test_sk_ target sandbox, smz_live_sk_ target production.
Headers
Unique key for idempotent requests. Same key within 24h returns original response.
"idem_a1b2c3d4e5"
Body
UUID of the user initiating the payment
"550e8400-e29b-41d4-a716-446655440000"
Payment amount in base currency unit (e.g. 5000 = 5,000 XAF). Minimum: 100
x >= 1005000
Redirect URL after successful payment
"https://merchant.com/payment/success"
Redirect URL if payment is cancelled
"https://merchant.com/payment/cancel"
ISO 4217 currency code. Default: XAF
XAF, XOF "XAF"
Payment description shown to the customer
"Order #1234 — 2 items"
Response
Payment created successfully
Unique payment token
"pay_abc123xyz789"
5000
"XAF"
Transaction lifecycle:
PENDING— Awaiting payer confirmationPROCESSING— Payment being processed by providerCOMPLETED— Payment received successfullyFAILED— Payment failedCANCELLED— Cancelled by merchant or payerEXPIRED— Payer did not confirm in timeREFUNDED— Fully refundedPARTIALLY_REFUNDED— Partially refunded
PENDING, PROCESSING, COMPLETED, FAILED, CANCELLED, EXPIRED, REFUNDED, PARTIALLY_REFUNDED Payment methods supported:
ORANGE_MONEY— Orange MoneyMTN_MOMO— MTN Mobile MoneyUNKNOWN— Fallback / not yet determined
ORANGE_MONEY, MTN_MOMO, UNKNOWN URL to redirect the customer for payment
Whether this is a production transaction

