Skip to content

Create Swap

POST /api-access/transactions/client/sessions/swap

Create a new swap transaction to exchange currency between wallets or swap and send 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/json

Request

Transaction Specification

You can specify the details of the swap in one of two ways:

  1. Using a Quote ID: Provide a swap_quote_id (for a simple swap) or a payout_quote_id (for a swap-and-send) that you obtained from the Swap Calculator or Swap & Send Calculator. When using a quote ID, you do not need to provide the transaction object.
  2. Using a Transaction Object: Provide a transaction object with the full details of the swap (amount, currencies, etc.). Use this method if you do not have a quote ID.

You must use one of these methods, but not both in the same request.

Body Parameters:

ParameterTypeRequiredDescription
descriptionstringNoDescription of the swap
swap_quote_idstringConditionalSwap quote ID from calculator. Required if transaction object is not provided.
payout_quote_idstringConditionalPayout quote ID (for swap and send). Required if transaction object is not provided.
transactionobjectConditionalTransaction details object. Required if a quote ID is not provided.
transaction.amountnumberYesAmount to swap
transaction.from_currencystringYesSource currency (e.g., xof, cad)
transaction.to_currencystringYesTarget currency (e.g., xof, cad)
transaction.countrystringYesCountry code (e.g., bf, ca)
transaction.prioritystringNoPriority level (e.g., standard)
source_walletstringYesSource wallet ID
destination_walletstringConditionalDestination wallet ID (for wallet-to-wallet swap)
session_typestringYesSession type (e.g., swap_transaction, swap_and_send)
recipientobjectConditionalRecipient for swap source (if applicable)
payout_recipientobjectConditionalPayout recipient (required for swap and send)
metadataobjectNoAdditional metadata
swap_typestringYesSwap type (e.g., SWAP, SWAP_SEND)

Recipient Objects:

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

1. Wallet-to-Wallet Swap with Quote ID

This example shows how to perform a simple currency exchange between two of your wallets using a swap_quote_id from the calculator.

bash
curl -X POST "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap" \
  -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": "Currency exchange",
    "swap_quote_id": "quote-swap-123",
    "source_wallet": "wallet-xof-456",
    "destination_wallet": "wallet-cad-789",
    "session_type": "swap_transaction",
    "metadata": {},
    "swap_type": "SWAP"
  }'
javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/swap', {
  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: "Currency exchange",
    swap_quote_id: "quote-swap-123",
    source_wallet: "wallet-xof-456",
    destination_wallet: "wallet-cad-789",
    session_type: "swap_transaction",
    metadata: {},
    swap_type: "SWAP"
  })
});
python
import requests

response = requests.post(
    'https://sandbox.mara.boo/api-access/transactions/client/sessions/swap',
    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": "Currency exchange",
        "swap_quote_id": "quote-swap-123",
        "source_wallet": "wallet-xof-456",
        "destination_wallet": "wallet-cad-789",
        "session_type": "swap_transaction",
        "metadata": {},
        "swap_type": "SWAP"
    }
)
go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]interface{}{
        "description": "Currency exchange",
        "swap_quote_id": "quote-swap-123",
        "source_wallet": "wallet-xof-456",
        "destination_wallet": "wallet-cad-789",
        "session_type": "swap_transaction",
        "metadata": map[string]interface{}{},
        "swap_type": "SWAP",
    }
    jsonData, _ := json.Marshal(payload)
    client := &http.Client{}
    req, _ := http.NewRequest("POST", "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap", 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()
}
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonPayload = "{\"description\":\"Currency exchange\",\"swap_quote_id\":\"quote-swap-123\",\"source_wallet\":\"wallet-xof-456\",\"destination_wallet\":\"wallet-cad-789\",\"session_type\":\"swap_transaction\",\"metadata\":{},\"swap_type\":\"SWAP\"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox.mara.boo/api-access/transactions/client/sessions/swap"))
    .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 = "Currency exchange",
    swap_quote_id = "quote-swap-123",
    source_wallet = "wallet-xof-456",
    destination_wallet = "wallet-cad-789",
    session_type = "swap_transaction",
    metadata = new {},
    swap_type = "SWAP"
};
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap");
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);

2. Wallet-to-Wallet Swap with Transaction Object

This example shows how to perform the same swap by providing the transaction details directly.

bash
curl -X POST "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap" \
  -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": "Currency exchange",
    "transaction": {
      "amount": 50000,
      "from_currency": "xof",
      "to_currency": "cad",
      "country": "bf",
      "priority": "standard"
    },
    "source_wallet": "wallet-xof-456",
    "destination_wallet": "wallet-cad-789",
    "session_type": "swap_transaction",
    "metadata": {},
    "swap_type": "SWAP"
  }'
javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/swap', {
  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: "Currency exchange",
    transaction: {
      amount: 50000,
      from_currency: "xof",
      to_currency: "cad",
      country: "bf",
      priority: "standard"
    },
    source_wallet: "wallet-xof-456",
    destination_wallet: "wallet-cad-789",
    session_type: "swap_transaction",
    metadata: {},
    swap_type: "SWAP"
  })
});
python
import requests

response = requests.post(
    'https://sandbox.mara.boo/api-access/transactions/client/sessions/swap',
    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": "Currency exchange",
        "transaction": {
            "amount": 50000,
            "from_currency": "xof",
            "to_currency": "cad",
            "country": "bf",
            "priority": "standard"
        },
        "source_wallet": "wallet-xof-456",
        "destination_wallet": "wallet-cad-789",
        "session_type": "swap_transaction",
        "metadata": {},
        "swap_type": "SWAP"
    }
)
go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]interface{}{
        "description": "Currency exchange",
        "transaction": map[string]interface{}{
            "amount": 50000,
            "from_currency": "xof",
            "to_currency": "cad",
            "country": "bf",
            "priority": "standard",
        },
        "source_wallet": "wallet-xof-456",
        "destination_wallet": "wallet-cad-789",
        "session_type": "swap_transaction",
        "metadata": map[string]interface{}{},
        "swap_type": "SWAP",
    }
    jsonData, _ := json.Marshal(payload)
    client := &http.Client{}
    req, _ := http.NewRequest("POST", "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap", 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()
}
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonPayload = "{\"description\":\"Currency exchange\",\"transaction\":{\"amount\":50000,\"from_currency\":\"xof\",\"to_currency\":\"cad\",\"country\":\"bf\",\"priority\":\"standard\"},\"source_wallet\":\"wallet-xof-456\",\"destination_wallet\":\"wallet-cad-789\",\"session_type\":\"swap_transaction\",\"metadata\":{},\"swap_type\":\"SWAP\"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox.mara.boo/api-access/transactions/client/sessions/swap"))
    .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 = "Currency exchange",
    transaction = new {
        amount = 50000,
        from_currency = "xof",
        to_currency = "cad",
        country = "bf",
        priority = "standard"
    },
    source_wallet = "wallet-xof-456",
    destination_wallet = "wallet-cad-789",
    session_type = "swap_transaction",
    metadata = new {},
    swap_type = "SWAP"
};
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap");
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);

3. Swap and Send with Quote ID

This example shows how to swap currency and send it to an external recipient in a single transaction, using a payout_quote_id.

bash
curl -X POST "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap" \
  -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": "Send money to Canada",
    "payout_quote_id": "quote-payout-456",
    "source_wallet": "wallet-xof-123",
    "payout_recipient": {
      "id": "recipient-789"
    },
    "session_type": "swap_and_send",
    "metadata": {},
    "swap_type": "SWAP_SEND"
  }'
javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/swap', {
  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: "Send money to Canada",
    payout_quote_id: "quote-payout-456",
    source_wallet: "wallet-xof-123",
    payout_recipient: {
      id: "recipient-789"
    },
    session_type: "swap_and_send",
    metadata: {},
    swap_type: "SWAP_SEND"
  })
});
python
import requests

response = requests.post(
    'https://sandbox.mara.boo/api-access/transactions/client/sessions/swap',
    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": "Send money to Canada",
        "payout_quote_id": "quote-payout-456",
        "source_wallet": "wallet-xof-123",
        "payout_recipient": {
          "id": "recipient-789"
        },
        "session_type": "swap_and_send",
        "metadata": {},
        "swap_type": "SWAP_SEND"
    }
)
go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]interface{}{
        "description": "Send money to Canada",
        "payout_quote_id": "quote-payout-456",
        "source_wallet": "wallet-xof-123",
        "payout_recipient": map[string]interface{}{
            "id": "recipient-789",
        },
        "session_type": "swap_and_send",
        "metadata": map[string]interface{}{},
        "swap_type": "SWAP_SEND",
    }
    jsonData, _ := json.Marshal(payload)
    client := &http.Client{}
    req, _ := http.NewRequest("POST", "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap", 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()
}
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonPayload = "{\"description\":\"Send money to Canada\",\"payout_quote_id\":\"quote-payout-456\",\"source_wallet\":\"wallet-xof-123\",\"payout_recipient\":{\"id\":\"recipient-789\"},\"session_type\":\"swap_and_send\",\"metadata\":{},\"swap_type\":\"SWAP_SEND\"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox.mara.boo/api-access/transactions/client/sessions/swap"))
    .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 = "Send money to Canada",
    payout_quote_id = "quote-payout-456",
    source_wallet = "wallet-xof-123",
    payout_recipient = new {
        id = "recipient-789"
    },
    session_type = "swap_and_send",
    metadata = new {},
    swap_type = "SWAP_SEND"
};
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap");
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);

4. Swap and Send with Transaction Object

This example shows how to perform a swap-and-send by providing the transaction details directly.

bash
curl -X POST "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap" \
  -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": "Send money to Canada",
    "transaction": {
      "amount": 50000,
      "from_currency": "xof",
      "to_currency": "cad",
      "country": "ca",
      "priority": "standard"
    },
    "source_wallet": "wallet-xof-123",
    "payout_recipient": {
      "id": "recipient-789"
    },
    "session_type": "swap_and_send",
    "metadata": {},
    "swap_type": "SWAP_SEND"
  }'
javascript
const response = await fetch('https://sandbox.mara.boo/api-access/transactions/client/sessions/swap', {
  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: "Send money to Canada",
    transaction: {
      amount: 50000,
      from_currency: "xof",
      to_currency: "cad",
      country: "ca",
      priority: "standard"
    },
    source_wallet: "wallet-xof-123",
    payout_recipient: {
      id: "recipient-789"
    },
    session_type: "swap_and_send",
    metadata: {},
    swap_type: "SWAP_SEND"
  })
});
python
import requests

response = requests.post(
    'https://sandbox.mara.boo/api-access/transactions/client/sessions/swap',
    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": "Send money to Canada",
        "transaction": {
            "amount": 50000,
            "from_currency": "xof",
            "to_currency": "cad",
            "country": "ca",
            "priority": "standard"
        },
        "source_wallet": "wallet-xof-123",
        "payout_recipient": {
          "id": "recipient-789"
        },
        "session_type": "swap_and_send",
        "metadata": {},
        "swap_type": "SWAP_SEND"
    }
)
go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]interface{}{
        "description": "Send money to Canada",
        "transaction": map[string]interface{}{
            "amount": 50000,
            "from_currency": "xof",
            "to_currency": "cad",
            "country": "ca",
            "priority": "standard",
        },
        "source_wallet": "wallet-xof-123",
        "payout_recipient": map[string]interface{}{
            "id": "recipient-789",
        },
        "session_type": "swap_and_send",
        "metadata": map[string]interface{}{},
        "swap_type": "SWAP_SEND",
    }
    jsonData, _ := json.Marshal(payload)
    client := &http.Client{}
    req, _ := http.NewRequest("POST", "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap", 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()
}
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonPayload = "{\"description\":\"Send money to Canada\",\"transaction\":{\"amount\":50000,\"from_currency\":\"xof\",\"to_currency\":\"cad\",\"country\":\"ca\",\"priority\":\"standard\"},\"source_wallet\":\"wallet-xof-123\",\"payout_recipient\":{\"id\":\"recipient-789\"},\"session_type\":\"swap_and_send\",\"metadata\":{},\"swap_type\":\"SWAP_SEND\"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox.mara.boo/api-access/transactions/client/sessions/swap"))
    .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 = "Send money to Canada",
    transaction = new {
        amount = 50000,
        from_currency = "xof",
        to_currency = "cad",
        country = "ca",
        priority = "standard"
    },
    source_wallet = "wallet-xof-123",
    payout_recipient = new {
        id = "recipient-789"
    },
    session_type = "swap_and_send",
    metadata = new {},
    swap_type = "SWAP_SEND"
};
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://sandbox.mara.boo/api-access/transactions/client/sessions/swap");
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);