OxaPay Docs
v1
v1
  • Introduction
    • Welcome to OxaPay
    • Integrations
      • Payment Link
      • Donation Service
      • Merchant Service
      • Payout Service
      • Swap Service
      • Plugins
        • WooCommerce
        • WISECP
        • Clientexec
        • Blesta
        • WHMCS
        • PrestaShop
        • Easy Digital Downloads
        • Paid Memberships Pro
        • Gravity Forms
        • Restrict Content Pro
  • API Reference
    • Payment
      • Generate Invoice
      • Generate White Label
      • Generate Static Address
      • Revoking Static Address
      • Static Address List
      • Payment Information
      • Payment History
      • Accepted Currencies
      • Payment Status Table
    • Payout
      • Generate Payout
      • Payout Information
      • Payout History
      • Payout Status Table
    • Swap
      • Swap Request
      • Swap History
      • Swap Pairs
      • Swap Calculate
      • Swap Rate
    • Common
      • Account Balance
      • Prices
      • Supported Currencies
      • Supported Fiat Currencies
      • Supported Networks
      • System Status
    • Error
  • Webhook
  • Use Cases
Powered by GitBook
On this page
  • API Request Sample Codes
  • API Response Example
  1. API Reference
  2. Payment

Generate White Label

This endpoint allows you to generate white-labeled payment solutions, delivering a fully branded payment experience powered by the OxaPay gateway. Instead of generating an invoice URL, this endpoint provides comprehensive payment details, including the payment address, currency, amount, expiration time, and other relevant information, enabling you to manage the payment process within your own interface.

POST https://api.oxapay.com/v1/payment/white-label

Authentication

You must include the Merchant API Key in the request header to authenticate your access to the API.

Name
Type
Description

merchant_api_key*

string

Your merchant API Key for authentication and authorization.

Request Body

Name
Type
Description

pay_currency*

string

amount*

decimal

The amount for the payment. If the currency field is not filled, the amount should be specified in dollars. If the currency field is filled, the amount should correspond to the specified currency.

currency

string

network

string

lifetime

integer

Set the expiration time for the payment link in minutes (15-2880).

Default: 60.

fee_paid_by_payer

decimal

Specify whether the payer will cover the invoice commission. 1 indicates that the payer will pay the fee, while 0 indicates that the merchant will pay the fee. Default: Merchant setting.

under_paid_coverage

decimal

Specify the acceptable inaccuracy in payment. Determines the maximum acceptable difference between the requested and paid amount (0-60.00).

Default: Merchant setting.

to_currency

string

auto_withdrawal

boolean

1 indicates that the received currency will be sent to the address specified in your Address List on the Settings page and 0 indicates that the amount will be credited to your OxaPay balance.

callback_url

string

The URL where payment information will be sent. Use this to receive notifications about the payment status.

email

string

Provide the payer's email address for reporting purposes.

order_id

string

Specify a unique order ID for reference in your system.

description

string

Provide order details or any additional information that will be shown in different reports.

{
    "data": {
        "track_id": string, // Unique identifier for the payment
        "amount": decimal, // The amount of currency for the invoice
        "currency": string, // The currency in which the amount is specified (e.g., "usd")
        "pay_amount": decimal, // The amount to be paid in the payment currency (e.g., BTC value)
        "pay_currency": string, // The currency in which the payment is made (e.g., "btc")
        "network": string, // The blockchain network being used (e.g., "Bitcoin Network")
        "address": string, // The wallet address where the payment will be sent
        "callback_url": string, // The URL to which payment status updates will be sent
        "description": string, // A description for the invoice
        "email": string, // The email address of the payer
        "fee_paid_by_payer": decimal, // Indicates if the payer is responsible for paying the network fees (1 = yes, 0 = no)
        "lifetime": integer, // The lifetime of the invoice in minutes before it expires
        "order_id": string, // A unique identifier for the order associated with this invoice
        "under_paid_coverage": decimal, // The percentage of underpayment that will still be considered valid
        "rate": decimal, // The exchange rate between the base currency and the payment currency
        "qr_code": string, // URL to a QR code representing the payment address and amount
        "expired_at": integer, // Timestamp (UNIX epoch) when the invoice will expire
        "date": integer // Timestamp (UNIX epoch) of when the invoice was created
    },
    "message": string,  // A message containing additional information about the result of the request.
    "error": {
        "type": string, 
        "key": string, 
        "message": string 
    } || {}, // An object that provides details about any errors that occurred.
    "status": integer, // The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
    "version": string // The version of the API being used.
}

If the payer sends the exact amount or a higher amount, you will receive the paid amount.

API Request Sample Codes

curl -X POST https://api.oxapay.com/v1/payment/white-label \
  -H "merchant_api_key: YOUR_MERCHANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100,
    "currency": "USD",
    "pay_currency": "TRX",
    "network": "TRC20",
    "lifetime": 60,
    "fee_paid_by_payer": 1,
    "under_paid_coverage": 20,
    "to_currency": "USDT",
    "auto_withdrawal": false,
    "callback_url": "https://example.com/callback",
    "email": "customer@oxapay.com",
    "order_id": "ORD-12345",
    "description": "Order #12345",
  }'
<?php

$url = 'https://api.oxapay.com/v1/payment/white-label';

$data =  [
    "amount" => 100,
    "currency" => "USD",
    "pay_currency" => "TRX",
    "network" => "TRC20",
    "lifetime" => 60,
    "fee_paid_by_payer" => 1,
    "under_paid_coverage" => 20,
    "to_currency" => "USDT",
    "auto_withdrawal" => false,
    "callback_url" => "https://example.com/callback",
    "email" => "customer@oxapay.com",
    "order_id" => "ORD-12345",
    "description" => "Order #12345"
];

$headers = [
    'Content-Type: application/json',
    'merchant_api_key: YOUR_MERCHANT_API_KEY'
];

$options = array(
    'http' => array(
        'header'  => implode("\r\n", $headers),
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);
if ($response === FALSE) {
    die('Error occurred');
}
$result = json_decode($response, true);
var_dump($result);
?>
const axios = require('axios');

const url = 'https://api.oxapay.com/v1/payment/white-label';

const data = {
  amount: 100,
  currency: "USD",
  pay_currency: "TRX",
  network: "TRC20",
  lifetime: 60,
  fee_paid_by_payer: 1,
  under_paid_coverage: 20,
  to_currency: "USDT",
  auto_withdrawal: false,
  callback_url: "https://example.com/callback",
  email: "customer@oxapay.com",
  order_id: "ORD-12345",
  description: "Order #12345"
};

const headers = {
  'merchant_api_key': `YOUR_MERCHANT_API_KEY`,
  'Content-Type': 'application/json',
};

axios.post(url, data, { headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error);
  });
import requests
import json

url = 'https://api.oxapay.com/v1/payment/white-label'

data = {
    "amount": 100,
    "currency": "USD",
    "pay_currency": "TRX",
    "network": "TRC20",
    "lifetime": 60,
    "fee_paid_by_payer": 1,
    "under_paid_coverage": 20,
    "to_currency": "USDT",
    "auto_withdrawal": False,
    "callback_url": "https://example.com/callback",
    "email": "customer@oxapay.com",
    "order_id": "ORD-12345",
    "description": "Order #12345",
}

headers = {
    'merchant_api_key': 'YOUR_MERCHANT_API_KEY',
    'Content-Type': 'application/json'
}

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

Please make sure to replace YOUR_MERCHANT_API_KEY in the code snippets with your actual merchant API Key.

These example code snippets demonstrate how to request the "Generate White Label" endpoint using different programming languages. You can customize the data parameters according to your specific requirements.

API Response Example

{
    "data": {
        "track_id": "197218291",
        "amount": 1,
        "currency": "usd",
        "pay_amount": 3.6819352872888,
        "pay_currency": "trx",
        "network": "Tron Network",
        "address": "TQraad2MBFgYUYhTFYeXS5jVpaLZuBwr3w",
        "callback_url": "https://example.com/callback",
        "description": "Order #12345",
        "email": "customer@oxapay.com",
        "fee_paid_by_payer": 1,
        "lifetime": 60,
        "order_id": "ORD-12345",
        "under_paid_coverage": 20,
        "rate": 3.67376929,
        "qr_code": "https://api.qrserver.com/v1/create-qr-code/?data=tron:TQraad2MBFgYUYhTFYeXS5jVpaLZuBwr3w?amount=3&size=150x150",
        "expired_at": 1734514150,
        "date": 1734510550
    },
    "message": "Operation completed successfully!",
    "error": {},
    "status": 200,
    "version": "1.0.0"
}

The response example above is provided to help you understand the format and structure of the response. If you have any further questions or need assistance, please feel free to contact to your account manager.

PreviousGenerate InvoiceNextGenerate Static Address

Last updated 3 months ago

Specify the if you want the invoice to be paid in a specific currency. Defines the currency in which you wish to receive your settlements.

Specify the if you want the invoice amount calculated with a specific currency. You can also create invoices in .

The blockchain on which the payment should be created. If not specified, the default network will be used.

he symbol of the cryptocurrency you want to convert to. You only can convert paid crypto currencies to USDT.

Please note that a successful request will return status 200. In case of any issues or validation problems, refer to the corresponding for further details.

error
currency symbol
currency symbol
fiat currencies
network
currency