# Creating White-Label Payment

This endpoint allows you to create white-labeled payments, providing a seamless payment experience while utilizing the OxaPay payment gateway behind the scenes. Rather than generating an Invoice, this method provides detailed payment information, including the payment address, currency, amount, expiration time, and more.

To enhance flexibility and user convenience, you can utilize URI formats, such as the Bitcoin Improvement Proposal (BIP-0021). This format allows you to generate a payment link with the crypto address embedded within it. By using the generated URI link, the payer can initiate the payment directly from their preferred wallet application.

Furthermore, you have the option to generate QR codes that contain the URI link. QR codes are easily scannable by wallet applications, allowing the payer to effortlessly open their wallet app and proceed with the payment by simply scanning the QR code. The simplest way to create a QR code is to use [Google Chart Service.](https://developers.google.com/chart/infographics/docs/qr_codes)

Using URI formats and QR codes simplifies the payment process for the payer, as they can quickly open their wallet application with the specified address and amount pre-filled. This user-friendly approach enhances the convenience and efficiency of the payment experience.

<mark style="color:green;">`POST`</mark> `https://api.oxapay.com/merchants/request/whitelabel`

#### Request Body

<table><thead><tr><th width="174">Name</th><th width="100">Type</th><th width="481">Description</th></tr></thead><tbody><tr><td>merchant<mark style="color:red;">*</mark></td><td>string</td><td>Your merchant API key for authentication and authorization.</td></tr><tr><td>payCurrency<mark style="color:red;">*</mark></td><td>string</td><td>Specify the <a href="supported-currencies">currency symbol</a> if you want the invoice to be paid in a specific currency. Defines the currency in which you wish to receive your settlements.</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>long</td><td>The amount for the payment. If the <code>currency</code> field is not filled, the amount should be specified in dollars. If the <code>currency</code> field is filled, the amount should correspond to the specified currency.</td></tr><tr><td>email</td><td>string</td><td>Provide the payer's email address for reporting purposes.</td></tr><tr><td>orderId</td><td>string</td><td>Specify a unique order ID for reference in your system.</td></tr><tr><td>description</td><td>string</td><td>Provide order details or any additional information that will be shown in different reports.</td></tr><tr><td>callbackUrl</td><td>string</td><td>The URL where payment information will be sent. Use this to receive notifications about the payment status.</td></tr><tr><td>underPaidCover</td><td>decimal</td><td><p>Specify the acceptable inaccuracy in payment. Determines the maximum acceptable difference between the requested and paid amount (0-60.00).</p><p><strong>Default:</strong> Merchant setting.</p></td></tr><tr><td>feePaidByPayer</td><td>decimal</td><td>Specify whether the payer will cover the invoice commission. <code>1</code> indicates that the payer will pay the fee, while <code>0</code> indicates that the merchant will pay the fee. <strong>Default</strong>: Merchant setting.</td></tr><tr><td>lifeTime</td><td>integer</td><td><p>Set the expiration time for the payment link in minutes (15-2880).</p><p><strong>Default</strong>: 60.</p></td></tr><tr><td>network</td><td>string</td><td>The blockchain <a href="supported-networks">network</a> on which the payment should be created. If not specified, the default network will be used.</td></tr><tr><td>currency</td><td>string</td><td>Specify the <a href="supported-currencies">currency symbol</a> if you want the invoice amount calculated with a specific currency. You can also create invoices in <a href="supported-fiat-currencies">fiat currencies</a>.</td></tr></tbody></table>

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

```json
{
  "result": integer, // Request result. More information about this number can be found in the Result Code table.
  "message": string, // The message containing the result of the request.
  "trackId": string, // The unique identifier of each payment session of the OxaPay payment gateway, which can be used to query the payment status and report requests (if the request is successful).
  "amount": long, // The requested payment amount.
  "currency": string, // The requested payment currency.
  "payAmount": long, // The actual payment amount.
  "payCurrency": string, // The actual payment currency.
  "network": string, // The blockchain network on which the cryptocurrency is expected to be received.
  "address": string, // The generated cryptocurrency address for the payment.
  "callbackUrl": string, // The specified callback to receive payment notifications
  "description": string, // The specified description
  "email": string, // The specified email
  "feePaidByPayer": decimal, // The specified feePaidByPayer
  "lifeTime": integer, // The specified lifeTime
  "orderId": string, // The specified orderId
  "underPaidCover": decimal, // The specified underPaidCover
  "rate": decimal, // The exchange rate of the specified cryptocurrency.
  "expiredAt": string, // The expiration time of payment to the address.
  "createdAt": string, // The created invoice time
  "QRCode": string // the QRCode image link for coin and amount
}
```

{% endtab %}
{% endtabs %}

Please note that a successful request will return a result code 100. In case of any issues or validation problems, refer to the corresponding [result codes](https://docs.oxapay.com/legacy/api-reference/result-code-table) for further details.

### Example codes

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

```bash
curl -X POST https://api.oxapay.com/merchants/request/whitelabel \
  -d '{
    "merchant": "YOUR_MERCHANT_API_KEY",
    "amount": 100,
    "currency": "USD",
    "payCurrency": "TRX",
    "lifeTime": 90,
    "feePaidByPayer": 1,
    "underPaidCover": 10,
    "callbackUrl": "https://example.com/callback",
    "description": "Order #12345",
    "orderId": "12345",
    "email": "customer@example.com"
  }'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.oxapay.com/merchants/request/whitelabel';

$data = array(
    'merchant' => 'YOUR_MERCHANT_API_KEY',
    'amount' => 100,
    'currency' => 'USD',
    'payCurrency' => 'TRX',
    'lifeTime' => 90,
    'feePaidByPayer' => 1,
    'underPaidCover' => 10,
    'callbackUrl' => 'https://example.com/callback',
    'description' => 'Order #12345',
    'orderId' => '12345',
    'email' => 'payer@example.com'
);

$options = array(
    'http' => array(
        'header' => 'Content-Type: application/json',
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response);
var_dump($result);
?>
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const axios = require('axios');
const url = 'https://api.oxapay.com/merchants/request/whitelabel';
const data = JSON.stringify({
    merchant: 'YOUR_MERCHANT_API_KEY',
    amount: 100,
    currency: 'USD',
    payCurrency: "TRX",
    lifeTime: 90,
    feePaidByPayer: 1,
    underPaidCover: 10,
    callbackUrl: 'https://example.com/callback',
    description: 'Order #12345',
    orderId: 'ORD-12345',
    email: 'customer@example.com'
});

axios.post(url, data)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = 'https://api.oxapay.com/merchants/request/whitelabel'
data = {
    'merchant': 'YOUR_MERCHANT_API_KEY',
    'amount': 100,
    'currency': 'USD',
    'payCurrency': 'TRX',
    'lifeTime': 90,
    'feePaidByPayer': 1,
    'underPaidCover': 10,
    'callbackUrl': 'https://example.com/callback',
    'description': 'Order #12345',
    'orderId': '12345',
    'email': 'payer@example.com'
}

response = requests.post(url, data=json.dumps(data))
result = response.json()
print(result)
```

{% endtab %}
{% endtabs %}
