Create Withdrawal
POST /api-access/transactions/client/sessions/withdrawal
Create a new withdrawal transaction to send funds to your own pre-configured accounts.
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 withdrawal |
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 withdraw |
transaction.country | string | Yes | 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 (recommended) |
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.
Note: Withdrawals are payments to your own accounts. Use destination_account_id for pre-configured accounts or provide recipient details for new accounts.
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/withdrawal" \
-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": "Withdrawal to bank account",
"destination_account_id": "account-123",
"quote_id": "quote-789",
"transaction": {
"amount": 10000,
"country": "ca",
"channel": "eft",
"currency": "cad"
},
"metadata": {},
"wallet_id": "wallet-456"
}'javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/withdrawal', {
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: "Withdrawal to bank account",
destination_account_id: "account-123",
quote_id: "quote-789",
transaction: {
amount: 10000,
country: "ca",
channel: "eft",
currency: "cad"
},
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/withdrawal',
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": "Withdrawal to bank account",
"destination_account_id": "account-123",
"quote_id": "quote-789",
"transaction": {
"amount": 10000,
"country": "ca",
"channel": "eft",
"currency": "cad"
},
"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": "Withdrawal to bank account",
"destination_account_id": "account-123",
"quote_id": "quote-789",
"transaction": map[string]interface{}{
"amount": 10000,
"country": "ca",
"channel": "eft",
"currency": "cad",
},
"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/withdrawal", 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": "Withdrawal to bank account",
"destination_account_id": "account-123",
"quote_id": "quote-789",
"transaction": {
"amount": 10000,
"country": "ca",
"channel": "eft",
"currency": "cad"
},
"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/withdrawal"))
.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 = "Withdrawal to bank account",
destination_account_id = "account-123",
quote_id = "quote-789",
transaction = new
{
amount = 10000,
country = "ca",
channel = "eft",
currency = "cad"
},
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/withdrawal");
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();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 |