PAYMENT STATUS

Payment Status API Endpoints

Complete documentation for all Payment Status related endpoints.

POST

Payment Status Callback

Receive payment status updates from payment processors.

Endpoint Details

HTTP Request
POST https://0xhost.net/API/on_payment_status
Parameters
Parameter Type Required Description
track_id string Yes Transaction tracking ID
status string Yes Payment status (Paid, Expired, etc.)
type string Yes Payment type
amount float Yes Payment amount
currency string Yes Currency code
order_id string Yes Order ID
Authentication
API Key Required in header
Headers
Header Value Required Description
x-api-key your_api_key_here Yes Your unique API key for authentication
Content-Type application/json Optional Recommended for consistent response handling

Response Fields

Field Type Description
success boolean Indicates if the operation was successful
message string Response message describing the result
data object/array Contains the response data

Success Response

API Response Example
{
    "error": "Transaction not found",
    "data": {
        "track_id": "123456789",
        "status": "Paid",
        "type": "invoice",
        "module_name": "demo_merchant",
        "amount": 12,
        "value": 1333,
        "currency": "USD",
        "order_id": "RECHARGE-12345",
        "email": "[email protected]",
        "note": "",
        "fee_paid_by_payer": 1,
        "under_paid_coverage": 2.5,
        "description": "Order #12345",
        "date": 1747849612,
        "txs": [
            {
                "status": "confirmed",
                "tx_hash": "demo_hash",
                "sent_amount": 0.00011388,
                "received_amount": 0.00011388,
                "value": 1333.1799830152,
                "currency": "BTC",
                "network": "Bitcoin Network",
                "sender_address": "",
                "address": "demo_address",
                "rate": 1,
                "confirmations": 10,
                "auto_convert_amount": 0,
                "auto_convert_currency": "USDT",
                "date": 1747849641
            }
        ]
    }
}

Code Examples

Programming Languages
JavaScript (Fetch API)
async function makeRequest() {
  try {
    const response = await fetch('https://0xhost.net/API/on_payment_status', {
      method: 'POST',
      headers: {
        'x-api-key': 'your_api_key_here',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
    "track_id": "demo_value",
    "status": "demo_value",
    "type": "demo_value",
    "amount": "1.0",
    "currency": "demo_value",
    "order_id": "demo_value"
})
    });
    
    const data = await response.json();
    console.log('Response:', data);
    return data;
  } catch (error) {
    console.error('Error:', error);
  }
}
Python (Requests)
import requests
import json

def make_request(api_key):
    url = 'https://0xhost.net/API/on_payment_status'
    headers = {
        'x-api-key': api_key,
        'Content-Type': 'application/json'
    }
    data = {
    "track_id": "demo_value",
    "status": "demo_value",
    "type": "demo_value",
    "amount": "1.0",
    "currency": "demo_value",
    "order_id": "demo_value"
}
    
    response = requests.request('POST', url, headers=headers, json=data)
    
    if response.status_code == 200:
        return response.json()
    else:
        print(f'Error: {response.status_code}')
        return None
PHP (cURL)
function makeRequest($apiKey) {
    $url = 'https://0xhost.net/API/on_payment_status';
    $data = {
    "track_id": "demo_value",
    "status": "demo_value",
    "type": "demo_value",
    "amount": "1.0",
    "currency": "demo_value",
    "order_id": "demo_value"
};
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'x-api-key: ' . $apiKey,
        'Content-Type: ' . $apiKey,
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    return json_decode($response, true);
}
cURL Command
curl -X POST 'https://0xhost.net/API/on_payment_status' \
  -H 'x-api-key: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "track_id": "demo_value",
    "status": "demo_value",
    "type": "demo_value",
    "amount": "1.0",
    "currency": "demo_value",
    "order_id": "demo_value"
}'