Create Payment
POST /api-access/transactions/client/sessions/payment
Create a new payment transaction to send funds to a recipient.
Authentication
Required Headers:
Authorization: HMAC-SHA256 PUBLIC_KEY:PRIVATE_KEY
X-Origin: third-party-api
X-Timestamp: 2025-10-12T14:30:00.000Z
Content-Type: application/jsonRequest
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
description | string | No | Description of the payment |
recipient | object | Conditional | Recipient details (required if not using destination_account_id) |
quote_id | string | No | Quote ID from payment calculator |
transaction | object | Yes | Transaction details object |
transaction.amount | number | Yes | Amount to send |
transaction.country | string | Yes | Recipient country code (e.g., ca) |
transaction.channel | string | Yes | Payment channel (e.g., interac_send) |
transaction.currency | string | Yes | Currency code (e.g., xof, cad) |
destination_account_id | string | Conditional | Pre-configured account ID (for withdrawals) |
metadata | object | No | Additional metadata |
wallet_id | string | Yes | Source wallet ID |
Recipient Object (when creating new recipient):
See Create Recipient for full recipient field documentation.
Response
Success Response (200):
json
{
"data": {
"success": false,
"transaction_id": "string",
"transaction_reference": "string",
"message": "string",
"payment_link": "string",
"status": "string",
"http_status": 0,
"session_id": "string",
"extra": {}
},
"success": true,
"message": "string",
"detail": {}
}Examples
bash
curl -X POST "https://sandbox.mara.boo/api-access/transactions/client/sessions/payment" \
-H "Authorization: HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY" \
-H "X-Origin: third-party-api" \
-H "X-Timestamp: 2025-10-12T14:30:00.000Z" \
-H "Content-Type: application/json" \
-d '{
"description": "Payment to supplier",
"recipient": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+22997123456",
"country": "bj",
"transaction_type": "mobile_money",
"recipient_type": "transaction",
"provider": "mtn",
"currency": "xof"
},
"quote_id": "quote-789",
"transaction": {
"amount": 5000,
"country": "bj",
"channel": "mobile_money",
"currency": "xof"
},
"metadata": {},
"wallet_id": "wallet-456"
}'javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/payment', {
method: 'POST',
headers: {
'Authorization': 'HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY',
'X-Origin': 'third-party-api',
'X-Timestamp': '2025-10-12T14:30:00.000Z',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: "Payment to supplier",
recipient: {
first_name: "John",
last_name: "Doe",
email: "john.doe@example.com",
phone: "+22997123456",
country: "bj",
transaction_type: "mobile_money",
recipient_type: "transaction",
provider: "mtn",
currency: "xof"
},
quote_id: "quote-789",
transaction: {
amount: 5000,
country: "bj",
channel: "mobile_money",
currency: "xof"
},
metadata: {},
wallet_id: "wallet-456"
})
});
const data = await response.json();python
import requests
response = requests.post(
'https://sandbox.mara.boo/api-access/transactions/client/sessions/payment',
headers={
'Authorization': 'HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY',
'X-Origin': 'third-party-api',
'X-Timestamp': '2025-10-12T14:30:00.000Z',
'Content-Type': 'application/json'
},
json={
"description": "Payment to supplier",
"recipient": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+22997123456",
"country": "bj",
"transaction_type": "mobile_money",
"recipient_type": "transaction",
"provider": "mtn",
"currency": "xof"
},
"quote_id": "quote-789",
"transaction": {
"amount": 5000,
"country": "bj",
"channel": "mobile_money",
"currency": "xof"
},
"metadata": {},
"wallet_id": "wallet-456"
}
)
data = response.json()go
package main
import (
"bytes"
"encoding/json"
"net/http"
"io/ioutil"
)
func main() {
payload := map[string]interface{}{
"description": "Payment to supplier",
"recipient": map[string]interface{}{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+22997123456",
"country": "bj",
"transaction_type": "mobile_money",
"recipient_type": "transaction",
"provider": "mtn",
"currency": "xof",
},
"quote_id": "quote-789",
"transaction": map[string]interface{}{
"amount": 5000,
"country": "bj",
"channel": "mobile_money",
"currency": "xof",
},
"metadata": map[string]interface{}{},
"wallet_id": "wallet-456",
}
jsonData, _ := json.Marshal(payload)
client := &http.Client{}
req, _ := http.NewRequest("POST", "https://sandbox.mara.boo/api-access/transactions/client/sessions/payment", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY")
req.Header.Set("X-Origin", "third-party-api")
req.Header.Set("X-Timestamp", "2025-10-12T14:30:00.000Z")
req.Header.Set("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
}java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
String jsonPayload = """
{
"description": "Payment to supplier",
"recipient": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+22997123456",
"country": "bj",
"transaction_type": "mobile_money",
"recipient_type": "transaction",
"provider": "mtn",
"currency": "xof"
},
"quote_id": "quote-789",
"transaction": {
"amount": 5000,
"country": "bj",
"channel": "mobile_money",
"currency": "xof"
},
"metadata": {},
"wallet_id": "wallet-456"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sandbox.mara.boo/api-access/transactions/client/sessions/payment"))
.header("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY")
.header("X-Origin", "third-party-api")
.header("X-Timestamp", "2025-10-12T14:30:00.000Z")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());csharp
using System.Net.Http;
using System.Text;
using System.Text.Json;
var payload = new
{
description = "Payment to supplier",
recipient = new
{
first_name = "John",
last_name = "Doe",
email = "john.doe@example.com",
phone = "+22997123456",
country = "bj",
transaction_type = "mobile_money",
recipient_type = "transaction",
provider = "mtn",
currency = "xof"
},
quote_id = "quote-789",
transaction = new
{
amount = 5000,
country = "bj",
channel = "mobile_money",
currency = "xof"
},
metadata = new { },
wallet_id = "wallet-456"
};
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://sandbox.mara.boo/api-access/transactions/client/sessions/payment");
request.Headers.Add("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY");
request.Headers.Add("X-Origin", "third-party-api");
request.Headers.Add("X-Timestamp", "2025-10-12T14:30:00.000Z");
var jsonContent = JsonSerializer.Serialize(payload);
request.Content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var content = await response.Content.ReadAsStringAsync();Notes
Withdrawals vs Payments:
- Withdrawals are payments made to your own pre-configured accounts (use
destination_account_id) - Regular payments are sent to recipients (use
recipientobject)
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid authentication |
| 403 | Forbidden - Missing required headers |
| 422 | Validation Error - Field validation failed |
| 500 | Internal Server Error |