Basic Fiat Operations

Every request listed on this page requires authorization to be successfully completed.

Withdrawal fee

GET https://public.api.0xpay.app/merchants/withdrawals/fiat/fee

This method is used to get a fee for sending a desired amount of assets (ticker) on a chosen blockchain. Learn how fees work here

Request Body

NameTypeDescription

ticker*

string

KZT only

amount*

string

amount in decimal format

{
  "value":  "0.1" //decimal fee value
}

Supported fiat assets

GET https://public.api.0xpay.app/merchants/assets/fiat

This method is used to fetch all available fiat assets of your merchant.

//In response, you'll get an Array of all assets with their ticker , name, price, and blockchain network: 
[
    {
        "name": "Ukrainian hryvnia",
        "ticker": "UAH",
        "price": {
            "value": "40.21",
            "ticker": "USD"
        }
    }
    
    {
        "name": "Kazakhstan Tenhe",
        "ticker": "KZT",
        "price": {
            "value": "1640.21",
            "ticker": "USD"
        }
    }
]

Send fiat (single tx)

POST https://public.api.0xpay.app/merchants/withdrawals/fiat

Creates an outgoing fiat transaction (for example, UAH or KZT payment to a banking card)

Amount limits: For KZT: 20000 KZT.

After creation, 0xpay API will produce notifications according to status updates on your withdrawal.

Request Body

NameTypeDescription

ticker*

string

UAH or KZT

to*

string

Destination card address

amount*

string

amount in decimal format

fee

string

you can specify withdrawal fees that have to be greater than the actual fee, which can be useful for better fee calculation options on your side. If not the specified – fee will be set automatically

localId

string

if was specified error will be thrown if not unique, can be useful on your side to avoid the double-spend issue

meta

string

your metadata that will be passed along to you later with a notification

{
    "id": "123e4567-e89b-12d3-a456-426614174000" //internal ID has been assigned to the tx
}

Send fiat assets as batch (no amount limits)

POST https://public.api.0xpay.app/merchants/withdrawals/fiat/batch

Splits large fiat transactions into several smaller payments and sends them to destination. You can also send KZT transactions as a batch withdrawal, with amount limits ranging from KZT 20000-299000.

After creation, 0xpay API will produce notifications according to status updates on your withdrawal.

Example: You want to send KZT 100,000 to a banking card. Normally, that'd require creating 7 different requests of ~KZT 14,500. With batched payments, your transaction amount will be automatically split into smaller portions (13800 + 13611 + 14120 + 13900 + 13831 + 13822 + 8447 + 8469 = 100 000), then sent as a batch of payments.

Request Body

NameTypeDescription

ticker*

string

KZT

to*

string

Receiving card number

amount*

string

amount in decimal format

fee

string

you can specify withdrawal fees that have to be greater than the actual fee, which can be useful for better fee calculation options on your side. If not the specified – fee will be set automatically

localId

string

if was specified error will be thrown if not unique, can be useful on your side to avoid the double-spend issue

meta

string

your metadata that will be passed along to you later with a notification

{
    "id": "123e4567-e89b-12d3-a456-426614174000" //internal ID has been assigned to the tx
}

Check details of fiat batch withdrawal and tx's status

GET https://public.api.0xpay.app/merchants/withdrawals/fiat/batch/:id

Send this request to receive info about all payments in a selected fiat batch withdrawals.

Path Parameters

NameTypeDescription

*

String

In response, you'll receive this information regarding each transaction from a selected batch withdrawal.

{
  id: string
  ticker: FiatBalanceTicker
  status: FiatWithdrawStatus
  to: { cardNumber?: string }
  time: number
  withdraws: Array<{ amount: string; id: string; fee: string; status: FiatWithdrawStatus }>
  localId?: string
  meta?: string
}

Example of such request:

{
    "id": "bc5e1e74-8a8c-4b0e-96c3-941c9cd2ffcf",
    "ticker": "UAH",
    "status": "QUEUED",
    "to": {
        "cardNumber": "4441114418446124"
    },
    "time": 1677591616602,
    "withdraws": [
        {
            "id": "ffc06f31-df21-48ac-97c0-9044ae707543",
            "status": "QUEUED",
            "amount": "4769.05",
            "fee": "47.69"
        },
        {
            "id": "b87da903-c7b2-484f-953c-f5c5c8af1f8e",
            "status": "QUEUED",
            "amount": "4899.02",
            "fee": "48.99"
        },
        {
            "id": "b6fe2e07-5852-436e-bb36-6a311c194c63",
            "status": "QUEUED",
            "amount": "4844.04",
            "fee": "48.44"
        },
        {
            "id": "ad151b77-378a-44f2-b741-08da8f644f13",
            "status": "QUEUED",
            "amount": "487.89",
            "fee": "4.88"
        }
    ],
    "localId": "your_info_123",
    "meta": "your_info"
}

Check details of fiat withdrawal and tx's status

GET https://public.api.0xpay.app/merchants/withdrawals/fiat/:id

Send this request to receive info about withdrawal. Statuses (strings): 1. "CREATED" – withdraw was just created 2. "QUEUED" – withdraw is in the queue and will be processed soon 3. "DONE" – final status, withdrawal happened 4. "FAILED" – final status, withdrawal not happened: something goes wrong, refunded to merchant's balance

Path Parameters

NameTypeDescription

*

String

In response, you'll receive this information regarding each transaction from a selected batch withdrawal.

{
  id: string
  ticker: FiatBalanceTicker
  status: FiatWithdrawStatus
  to: { cardNumber?: string }
  time: number
  amount: string 
  fee: string
  localId?: string
  meta?: string
}

Example of such request:

{
    "id": "ffc06f31-df21-48ac-97c0-9044ae707543",
    "ticker": "UAH",
    "status": "QUEUED",
    "to": {
        "cardNumber": "4441114418446124"
    },
    "time": 1677591616602,
    "amount": "487.89",
    "fee": "4.88"
    "localId": "your_info_123",
    "meta": "your_info"
}

Last updated