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. Payout

Generate Payout

This endpoint enables you to generate a cryptocurrency payout request, allowing you to transfer funds to a specified address. It is designed to facilitate seamless and secure transactions by generating a payout request within your account.

POST https://api.oxapay.com/v1/payout

Authentication

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

Name
Type
Description

payout_api_key*

string

Your Payout API Key for authentication and authorization.

Request Body

Name
Type
Description

address*

string

The recipient's cryptocurrency address where the payout will be sent.

currency*

string

The symbol of the cryptocurrency to be sent (e.g., BTC, ETH, LTC, etc.).

amount*

decimal

The exact amount of cryptocurrency to be sent as the payout.

network

string

The blockchain network to be used for the payout. Required for currencies with multi supported networks.

callback_url

string

The URL for sending payment status updates.

memo

string

A memo or tag for transactions on supported networks (e.g., for TON).

description

string

A description or additional information for the payout, useful for reports.

{
    "data": {
        "track_id": string, // The unique identifier for the pay in the OxaPay payment gateway. You can use this track ID to query the payment status and generate reports.
        "status": string // The status of payout transaction.
    },
    "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.
}

API Request Sample Codes

curl -X POST https://api.oxapay.com/v1/payout \
  -H "payout_api_key: YOUR_PAYOUT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "RECEIVER_ADDRESS",
    "amount": 5,
    "currency": "TRX",
    "network": "TRC20",
    "callback_url": "https://example.com/callback",
    "memo": "Memo12345",
    "description": "Order #12345"
  }'
<?php

$url = 'https://api.oxapay.com/v1/payout';

$data = [
    "address" => "RECEIVER_ADDRESS",
    "amount" => 5,
    "currency" => "TRX",
    "network" => "TRC20",
    "callback_url" => "https://example.com/callback",
    "memo" => "Memo12345",
    "description" => "Order #12345"
];

$headers = [
    'Content-Type: application/json',
    'payout_api_key: YOUR_PAYOUT_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/payout';

const data = {
    address: "RECEIVER_ADDRESS",
    amount: 5,
    currency: "TRX",
    network: "TRC20",
    callback_url: "https://example.com/callback",
    memo: "Memo12345",
    description: "Order #12345"
};

const headers = {
  'payout_api_key': `YOUR_PAYOUT_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/payout'

data = {
    "address": "RECEIVER_ADDRESS",
    "amount": 5,
    "currency": "TRX",
    "network": "TRC20",
    "callback_url": "https://example.com/callback",
    "memo": "Memo12345",
    "description": "Order #12345"
}

headers = {
    'payout_api_key': 'YOUR_PAYOUT_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_PAYOUT_API_KEY in the code snippets with your actual Payout API Key.

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

API Response Example

{
    "data": {
        "track_id": "258298451",
        "status": "processing"
    },
    "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.

PreviousPayoutNextPayout Information

Last updated 3 months ago

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