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

# Initiate P2P Transfer

POST http://localhost:8080/api/v3/transactions/p2p
Content-Type: application/json

Reference: https://apidocs.sare.africa/sare-core-api/wallet/transactions/initiate-p-2-p-transfer

## Request

### Headers

- `Idempotency-Key` (string, optional) — Required by @RequireIdempotencyKey

### Body (application/json)

This endpoint expects an object.

- `amount` (integer, required)
- `sourceWalletId` (string, required)
- `destinationWalletId` (string, required)

## Response

### 200

OK

- `code` (integer, required)
- `data` (object, required)
  - `fee` (integer, required)
  - `amount` (integer, required)
  - `status` (string, required)
  - `reference` (string, required)
  - `timestamp` (datetime, required)
  - `recipientName` (string, required)
  - `transactionId` (string, required)
  - `sourceWalletId` (string, required)
- `message` (string, required)

## Errors

### 400 Bad Request Error

Bad Request

- `path` (string, required)
- `status` (integer, required)
- `message` (string, required)

## Examples

**Request**

```json
{
  "amount": 250,
  "sourceWalletId": "b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f",
  "destinationWalletId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f"
}
```

**Response**

```json
{
  "code": 200,
  "data": {
    "fee": 0,
    "amount": 250,
    "status": "INITIATED",
    "reference": "TX-2026-000123",
    "timestamp": "2026-09-17T10:00:00Z",
    "recipientName": "Jane Doe",
    "transactionId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5f",
    "sourceWalletId": "b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f"
  },
  "message": "Transfer initiated."
}
```

**SDK Code**

```python Wallet_Transactions_Initiate P2P Transfer_example
import requests

url = "http://localhost:8080/api/v3/transactions/p2p"

payload = {
    "amount": 250,
    "sourceWalletId": "b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f",
    "destinationWalletId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f"
}
headers = {
    "Idempotency-Key": "idem-{{$guid}}",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Wallet_Transactions_Initiate P2P Transfer_example
const url = 'http://localhost:8080/api/v3/transactions/p2p';
const options = {
  method: 'POST',
  headers: {'Idempotency-Key': 'idem-{{$guid}}', 'Content-Type': 'application/json'},
  body: '{"amount":250,"sourceWalletId":"b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f","destinationWalletId":"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f"}'
};

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

```go Wallet_Transactions_Initiate P2P Transfer_example
package main

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

func main() {

	url := "http://localhost:8080/api/v3/transactions/p2p"

	payload := strings.NewReader("{\n  \"amount\": 250,\n  \"sourceWalletId\": \"b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f\",\n  \"destinationWalletId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\"\n}")

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

	req.Header.Add("Idempotency-Key", "idem-{{$guid}}")
	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 Wallet_Transactions_Initiate P2P Transfer_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v3/transactions/p2p")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'idem-{{$guid}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 250,\n  \"sourceWalletId\": \"b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f\",\n  \"destinationWalletId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\"\n}"

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

```java Wallet_Transactions_Initiate P2P Transfer_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v3/transactions/p2p")
  .header("Idempotency-Key", "idem-{{$guid}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 250,\n  \"sourceWalletId\": \"b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f\",\n  \"destinationWalletId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v3/transactions/p2p', [
  'body' => '{
  "amount": 250,
  "sourceWalletId": "b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f",
  "destinationWalletId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'idem-{{$guid}}',
  ],
]);

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

```csharp Wallet_Transactions_Initiate P2P Transfer_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v3/transactions/p2p");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "idem-{{$guid}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 250,\n  \"sourceWalletId\": \"b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f\",\n  \"destinationWalletId\": \"f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Wallet_Transactions_Initiate P2P Transfer_example
import Foundation

let headers = [
  "Idempotency-Key": "idem-{{$guid}}",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 250,
  "sourceWalletId": "b1e7f6a0-9d2b-4a5b-9c3d-1a2b3c4d5e6f",
  "destinationWalletId": "f5c1d4e5-2a3b-4c5d-8e9f-0a1b2c3d4e5f"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v3/transactions/p2p")! 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()
```