Exchange + Withdrawal

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

Feature currently in beta

Estimate Crypto Exchange+Withdrawal

GET https://public.api.0xpay.app/merchants/exchange/withdrawals/crypto/estimate

You can use this endpoint to estimate your withdrawal with exchange for later creation

Query Parameters

In response, you'll get details for your upcoming exchange:

{
    "withdraw": {
        "ticker": "USDT", //ticker you want to withdraw after exchange
        "amount": "1493.32" //amount you want to withdraw
        "fee": "123" //withdraw fee, included in withdraw.amount
    },
    "spend": {
        "ticker": "ETH", //ticker you want to spend
        "amount": "1" //amount you want to spend from your balance
    },
    "exchange": {
      "amount": "0.9", // amount to be exchanged
      "fee": "0.1" //exchange fee, included in spend.amount
    },
    "price": {
        "value": "1534.00000000", //actual price of the pair                                
        "pair": [
            "ETH",        //1 ETH == 1534 USDT
            "USDT"
        ]
    },
}

Create Crypto Exchange+Withdrawal

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

This endpoint is used to create exchange withdrawal. Before sending this request, you should first estimate your exchange+withdrawal using the endpoint.

Status Notifications: After the Success response, 0xpay API will produce notifications according to status updates on your exchange.

Request Body

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

Estimate Fiat Exchange+Withdrawal

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

You can use this endpoint to estimate your withdrawal with exchange for later creation

Query Parameters

In response, you'll get details for your upcoming exchange:

{
    "withdraw": {
        "ticker": "UAH", //ticker you want to withdraw after exchange
        "amount": "32" //amount you want to withdraw
        "fee": "10.20213" //withdraw fee, included in withdraw.amount
    },
    "spend": {
        "ticker": "USDT", //ticker you want to spend
        "amount": "1" //amount you want to spend from your balance
    },
    "exchange": {
      "amount": "0.9", // amount to be exchanged
      "fee": "0.1" //exchange fee, included in spend.amount
    },
    "price": {
        "value": "32.000", //actual price of the pair                                
        "pair": [
            "USDT",        //1 USDT == 32 UAH
            "UAH"
        ]
    },
}

Create Fiat Exchange+Withdrawal

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

This endpoint is used to create exchange withdrawal. Before sending this request, you should first estimate your exchange+withdrawal using the endpoint.

Status Notifications: After the Success response, 0xpay API will produce notifications according to status updates on your exchange.

Request Body

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

Last updated