Initiate PayIn
curl --request POST \
--url https://sandbox.getmipay.com/api/payments/payin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'operation: <operation>' \
--header 'service: <service>' \
--data '
{
"amount": 1000,
"currency": "XAF",
"wallet": "690000000",
"description": "Payment for Order #123",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"callback_url": "https://yourapp.com/webhooks/payment"
}
'import requests
url = "https://sandbox.getmipay.com/api/payments/payin"
payload = {
"amount": 1000,
"currency": "XAF",
"wallet": "690000000",
"description": "Payment for Order #123",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"callback_url": "https://yourapp.com/webhooks/payment"
}
headers = {
"operation": "<operation>",
"service": "<service>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
operation: '<operation>',
service: '<service>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
currency: 'XAF',
wallet: '690000000',
description: 'Payment for Order #123',
customer_name: 'John Doe',
customer_email: 'john@example.com',
callback_url: 'https://yourapp.com/webhooks/payment'
})
};
fetch('https://sandbox.getmipay.com/api/payments/payin', 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.getmipay.com/api/payments/payin",
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' => 1000,
'currency' => 'XAF',
'wallet' => '690000000',
'description' => 'Payment for Order #123',
'customer_name' => 'John Doe',
'customer_email' => 'john@example.com',
'callback_url' => 'https://yourapp.com/webhooks/payment'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"operation: <operation>",
"service: <service>"
],
]);
$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.getmipay.com/api/payments/payin"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("operation", "<operation>")
req.Header.Add("service", "<service>")
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://sandbox.getmipay.com/api/payments/payin")
.header("operation", "<operation>")
.header("service", "<service>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/payments/payin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["operation"] = '<operation>'
request["service"] = '<service>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment initiated successfully",
"data": {
"transaction_reference": "MPAYIN_ABC123DEF456",
"soleaspay_reference": "MLS690d472dd7ee7B",
"amount": 1000,
"fee_amount": 50,
"net_amount": 950,
"currency": "XAF",
"status": "pending",
"service_used": "3",
"service_name": "OM CI",
"otp_required": true,
"payment_url": "null",
"webhook_urls": {
"success": "https://getmipay.com/api/webhooks/success",
"failure": "https://getmipay.com/api/webhooks/failure"
}
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}Payments
Collect payment (Pay-In)
Collect payment from a customer via mobile money. Requires Authorization: Bearer <jwt>. Also send service and operation headers. OTP is required only for OTP-required services such as OM CI, OM SN, and OM BF.
POST
/
payments
/
payin
Initiate PayIn
curl --request POST \
--url https://sandbox.getmipay.com/api/payments/payin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'operation: <operation>' \
--header 'service: <service>' \
--data '
{
"amount": 1000,
"currency": "XAF",
"wallet": "690000000",
"description": "Payment for Order #123",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"callback_url": "https://yourapp.com/webhooks/payment"
}
'import requests
url = "https://sandbox.getmipay.com/api/payments/payin"
payload = {
"amount": 1000,
"currency": "XAF",
"wallet": "690000000",
"description": "Payment for Order #123",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"callback_url": "https://yourapp.com/webhooks/payment"
}
headers = {
"operation": "<operation>",
"service": "<service>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
operation: '<operation>',
service: '<service>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
currency: 'XAF',
wallet: '690000000',
description: 'Payment for Order #123',
customer_name: 'John Doe',
customer_email: 'john@example.com',
callback_url: 'https://yourapp.com/webhooks/payment'
})
};
fetch('https://sandbox.getmipay.com/api/payments/payin', 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.getmipay.com/api/payments/payin",
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' => 1000,
'currency' => 'XAF',
'wallet' => '690000000',
'description' => 'Payment for Order #123',
'customer_name' => 'John Doe',
'customer_email' => 'john@example.com',
'callback_url' => 'https://yourapp.com/webhooks/payment'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"operation: <operation>",
"service: <service>"
],
]);
$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.getmipay.com/api/payments/payin"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("operation", "<operation>")
req.Header.Add("service", "<service>")
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://sandbox.getmipay.com/api/payments/payin")
.header("operation", "<operation>")
.header("service", "<service>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/payments/payin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["operation"] = '<operation>'
request["service"] = '<service>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"XAF\",\n \"wallet\": \"690000000\",\n \"description\": \"Payment for Order #123\",\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"john@example.com\",\n \"callback_url\": \"https://yourapp.com/webhooks/payment\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Payment initiated successfully",
"data": {
"transaction_reference": "MPAYIN_ABC123DEF456",
"soleaspay_reference": "MLS690d472dd7ee7B",
"amount": 1000,
"fee_amount": 50,
"net_amount": 950,
"currency": "XAF",
"status": "pending",
"service_used": "3",
"service_name": "OM CI",
"otp_required": true,
"payment_url": "null",
"webhook_urls": {
"success": "https://getmipay.com/api/webhooks/success",
"failure": "https://getmipay.com/api/webhooks/failure"
}
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}Authorizations
JWT bearer token returned by POST /action/auth. Send protected requests with: Authorization: Bearer . Tokens expire after 24 hours.
Headers
Operation type - must be '2' for PayIn
Available options:
2 Example:
"2"
Service identifier for the payment method.
Services requiring OTP:
3- OM CI (Orange Money Côte d'Ivoire)4- OM SN (Orange Money Senegal)5- OM BF (Orange Money Burkina Faso)
Example:
"1"
One-Time Password for Orange Money services.
Required only for: OM CI (service: 3), OM SN (service: 4), OM BF (service: 5) Format: Maximum 8 characters/digits Note: This header is optional for services that don't require OTP
Maximum string length:
8Example:
"123456"
Body
application/json
Payment details to collect from customer
Amount in smallest currency unit (100 XAF = 1€)
Required range:
x >= 100Example:
1000
Available options:
XAF, XOF Example:
"XAF"
Customer mobile money wallet number
Example:
"690000000"
Maximum string length:
255Example:
"Payment for Order #123"
Maximum string length:
255Example:
"John Doe"
Example:
"john@example.com"
URL to receive payment status updates
Example:
"https://yourapp.com/webhooks/payment"
