> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.senjaropay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.senjaropay.com/_mcp/server.

# Create bank payout

POST https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer
Content-Type: application/json

Sends a bank payout (cashout) from the merchant wallet.
Currently for TZS bank transfers. Always send currency explicitly.
x-idempotency-key is required. Generate a new UUID for each payout.


Reference: https://docs.senjaropay.com/api-documentation/payouts/create-payout-transfer

## Authentication

- `x-api-key` header (required) — Dashboard Public Key. Maps to x-api-key.
- `x-api-secret` header (required) — Dashboard Secret Key. Maps to x-api-secret. Server-side only.

## Request

### Headers

- `x-idempotency-key` (string, required) — Unique per payout. Generate a new UUID for each transfer (for example crypto.randomUUID() or a uuid library). Reuse the same value only to retry this exact request.

### Body (application/json)

This endpoint expects a PayoutTransferRequest.

- `amount` (integer, required) — Gross amount to debit from the merchant wallet, in major units.
- `currency` (enum, required) — Wallet and payout currency. Bank payouts currently support TZS. Additional currencies (for example USD) will be documented when available.
  - Allowed values: `TZS`
- `bank` (string, required) — Bank shortcode, for example ABSA, CRDBBANK, NMB. Prefer the same value used at account-name lookup.
- `account` (string, required) — Beneficiary bank account number.
- `name` (string, required) — Beneficiary name from account-name lookup.

## Response

### 200

Payout accepted

- `status` (string, required)
- `code` (integer, required)
- `data` (PayoutTransferResponseData, required)

## Errors

### 400 Bad Request Error

Validation error

- `status` (string, optional)
- `code` (integer, optional)
- `error_code` (string, optional)
- `message` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `status` (string, optional)
- `code` (integer, optional)
- `error_code` (string, optional)
- `message` (string, optional)

## Types

### PayoutTransferResponseData

- `success` (boolean, optional)
- `withdrawal_id` (string, optional) — SenjaroPay payout identifier. Store for reconciliation.
- `transaction_reference` (string, optional)
- `amount` (integer, optional) — Requested debit amount.
- `fee` (integer, optional) — Payout fee charged on this transfer.
- `net_amount` (integer, optional) — Amount credited to the beneficiary after fees.
- `currency` (string, optional)
- `payout_amount` (integer, optional)
- `payout_currency` (string, optional)
- `fx_rate` (double, optional, nullable) — FX rate when payout_currency differs from wallet currency. Null for same-currency TZS payouts.
- `balance` (PayoutTransferResponseDataBalance, optional) — Merchant wallet balances after the payout is accepted.
- `status` (string, optional) — Payout processing state. PROCESSING means the bank transfer is in flight.
- `account_name` (string, optional)
- `account` (string, optional)
- `bank` (string, optional)

### PayoutTransferResponseDataBalance

Merchant wallet balances after the payout is accepted.

- `currency` (string, optional)
- `collections` (integer, optional)
- `bill_payments` (integer, optional)
- `withdrawals` (integer, optional)
- `international_transfers` (integer, optional)
- `available` (integer, optional)

## Examples

**Request**

```json
{
  "amount": 10000,
  "currency": "TZS",
  "bank": "ABSA",
  "account": "0001234567",
  "name": "Test Customer"
}
```

**Response**

```json
{
  "status": "success",
  "code": 200,
  "data": {
    "success": true,
    "withdrawal_id": "c4fbdacb-6ac4-4159-ad23-50286a001ba4",
    "transaction_reference": "WDMVTEJ1P9VXJ8",
    "amount": 10000,
    "fee": 500,
    "net_amount": 9500,
    "currency": "TZS",
    "payout_amount": 9500,
    "payout_currency": "TZS",
    "fx_rate": null,
    "balance": {
      "currency": "TZS",
      "collections": 50000,
      "bill_payments": 5000,
      "withdrawals": 20000,
      "international_transfers": 10000,
      "available": 15000
    },
    "status": "PROCESSING",
    "account_name": "Test Customer",
    "account": "0001234567",
    "bank": "ABSA"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer"

payload = {
    "amount": 10000,
    "currency": "TZS",
    "bank": "ABSA",
    "account": "0001234567",
    "name": "Test Customer"
}
headers = {
    "x-api-secret": "<apiSecret>",
    "x-idempotency-key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer';
const options = {
  method: 'POST',
  headers: {
    'x-api-secret': '<apiSecret>',
    'x-idempotency-key': '7c9e6679-7425-40de-944b-e07fc1f90ae7',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"amount":10000,"currency":"TZS","bank":"ABSA","account":"0001234567","name":"Test Customer"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer"

	payload := strings.NewReader("{\n  \"amount\": 10000,\n  \"currency\": \"TZS\",\n  \"bank\": \"ABSA\",\n  \"account\": \"0001234567\",\n  \"name\": \"Test Customer\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-secret", "<apiSecret>")
	req.Header.Add("x-idempotency-key", "7c9e6679-7425-40de-944b-e07fc1f90ae7")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-secret"] = '<apiSecret>'
request["x-idempotency-key"] = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 10000,\n  \"currency\": \"TZS\",\n  \"bank\": \"ABSA\",\n  \"account\": \"0001234567\",\n  \"name\": \"Test Customer\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer")
  .header("x-api-secret", "<apiSecret>")
  .header("x-idempotency-key", "7c9e6679-7425-40de-944b-e07fc1f90ae7")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 10000,\n  \"currency\": \"TZS\",\n  \"bank\": \"ABSA\",\n  \"account\": \"0001234567\",\n  \"name\": \"Test Customer\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer', [
  'body' => '{
  "amount": 10000,
  "currency": "TZS",
  "bank": "ABSA",
  "account": "0001234567",
  "name": "Test Customer"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-api-secret' => '<apiSecret>',
    'x-idempotency-key' => '7c9e6679-7425-40de-944b-e07fc1f90ae7',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-secret", "<apiSecret>");
request.AddHeader("x-idempotency-key", "7c9e6679-7425-40de-944b-e07fc1f90ae7");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 10000,\n  \"currency\": \"TZS\",\n  \"bank\": \"ABSA\",\n  \"account\": \"0001234567\",\n  \"name\": \"Test Customer\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-secret": "<apiSecret>",
  "x-idempotency-key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 10000,
  "currency": "TZS",
  "bank": "ABSA",
  "account": "0001234567",
  "name": "Test Customer"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.senjaropay.com/senjaropay/merchant/cashout/api/transfer")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```