> For the complete documentation index, see [llms.txt](https://docs.tylt.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tylt.money/tylt-crossramp-fiat-crypto-solutions/eu-open-banking/open-banking-payout-usdc-eur/approve-payout.md).

# Approve Payout

The Approve Payout endpoint is used by the Merchant to explicitly approve a payout request before it is sent for processing. This step is required only when `autoMerchantApproval = 0`. Once approved, the payout transitions from a pending / queued state to processing, triggering the downstream fiat disbursement.

***

#### When to Use

Call this endpoint when:

* `autoMerchantApproval = 0`
* A payout has been created and is in a **pending / awaiting approval** state
* All required user inputs, KYC (where applicable), and validations are complete

***

#### Flow Context

1. Merchant creates a payout request
2. End user submits required details and completes KYC (if applicable)
3. Payout enters pending approval state
4. Merchant calls `approvePayout` (this endpoint)
5. Payout moves to processing
6. EUR is disbursed to beneficiary via Open Banking rails
7. Merchant’s USDC balance is debited accordingly

#### **Flow outcome:**

* The merchant initiates a transfer of USDC to the end user
* The end user completes the off-ramp flow via the hosted widget
* The corresponding fiat amount is made available to the end user via SEPA instant
* The merchant’s USDC balance is debited for the corresponding amount (including applicable fees, if any)

**Endpoint**

<mark style="color:green;">**`POST`**</mark>`https://api.tylt.money/v2/prime-fiat/instance/payout/approve`

**Request Headers**

{% tabs %}
{% tab title="First Tab" %}

<table data-full-width="true"><thead><tr><th width="133">Name</th><th width="79">Type</th><th width="167">Example</th><th>Description</th></tr></thead><tbody><tr><td>X-TLP-APIKEY</td><td>string</td><td>93ee3c5e133697251b5362bcf9cc8532476785t8768075616f58d88</td><td>Your Tylt API Key, used to identify your account in API requests.</td></tr><tr><td>X-TLP-SIGNATURE</td><td>string</td><td>d0afef3853dfc8489c8b9affa5825171fdd7y7685675e4966a05f66ed2b3eaf9462b3c9c0</td><td>HMAC SHA-256 signature generated using the API Secret Key to secure the request.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
When using the API, ensure to include your API Key and generate the signature for the request payload using your API Secret. The tables provided above contain example values for illustration purposes only. Please refer to the code snippets for detailed instructions on how to sign the request and generate the signature properly.
{% endhint %}

**Request Body**

{% tabs %}
{% tab title="Body" %}

<table data-header-hidden><thead><tr><th width="204"></th><th width="121"></th><th></th></tr></thead><tbody><tr><td><strong>Field Name</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>merchantOrderId</code></td><td><code>String</code></td><td>Mandatory. A UUID used by the merchant to reference this instance or any transaction related to it.</td></tr></tbody></table>

{% endtab %}
{% endtabs %}

**Code Snippet**

{% tabs %}
{% tab title="JavaScript (Axios)" %}

```javascript
const axios = require('axios');
const crypto = require('crypto');

// Replace with your API Key and Secret
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

// Request body
const requestBody = {
    merchantOrderId: 'b73b73b-87wtbc-q36gbc-331n3' // please use a unique order id per request
}
// Convert request body to JSON
const raw = JSON.stringify(requestBody);

// Function to create HMAC SHA-256 signature
const createSignature = (secret, data) => {
    return crypto.createHmac('sha256', secret)
                 .update(data)
                 .digest('hex');
};

// Generate signature
const signature = createSignature(apiSecret, raw);

// Define headers
const headers = {
    "Content-Type": 'application/json',
    "X-TLP-APIKEY": apiKey,
    "X-TLP-SIGNATURE": signature
};

// Send the request
axios.post('https://api.tylt.money/v2/prime-fiat/instance/payout/approve', raw, { headers })
    .then(response => console.log("Success:", response.data))
    .catch(error => console.error("Error:", error));

```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "msg": "Payout instance accepted successfully",
  "data": {}
}
```

{% endtab %}

{% tab title="Response Fields" %}

{% endtab %}
{% endtabs %}
