Getting a commission for making a withdrawal

The method allows you to get data on the commission that will be debited during the withdrawal

Getting a commission for making a withdrawal

post
Header parameters
x-api-public-keystringOptional

Public API-key

x-api-signaturestringOptional

Signing the request body with a private API-key

Content-typestringOptional

Request content type

Example: application/json
Body

Request body for receiving commission

addressIdstringRequired

Identifier of the address from which you want to withdraw

Example: 258e95ed-a3c2-4c85-bf6f-09f8b8f1c0be
amountstringRequired

Amount you want to withdraw

Example: 200
nativebooleanOptional

Deduct the gas fee (network fee) from the native balance of the address (available for payment addresses, PAY_OUT type)

feeInAmountbooleanOptional

(Relevant for withdrawing coins) Deduct the network commission from the withdrawal amount or from the payer's funds. By default, the network commission is deducted from the withdrawal amount.

Responses
200Success
application/json
post
POST /api-gateway/withdrawal-fee-token HTTP/1.1
Host: ocp.onchainpay.io
Content-Type: application/json
Accept: */*
Content-Length: 100

{
  "addressId": "258e95ed-a3c2-4c85-bf6f-09f8b8f1c0be",
  "amount": "200",
  "native": true,
  "feeInAmount": true
}
200Success
{
  "success": true,
  "response": {
    "blockchainFeeCurrencyUSDRate": "12.764",
    "blockchainFeeCurrency": "USDT",
    "withdrawalCurrencyUSDRate": "12.764",
    "blockchainFeeSource": "advanced_balance",
    "blockchainFee": "8.88",
    "blockchainFeeUSD": "8.88",
    "serviceFee": "1.2",
    "serviceFeeUSD": "1.2",
    "withdrawalMin": "2.0000",
    "token": "U2FsdGVkX1+vPIiq/7dwkv3tpvPiGUKv3S6HZWEtQtNk/L3Ohew8fIzUoFTKRPv6kdl2Zs4n8vZKfWfAYCa+UI8SSG+yfiwf8qiQW600rVGUdvD10Mm0CTklhd8ZZqcnz9Z9bUGm8OnatpXLrAx1uPhVoUdKwKQ/Xs1Vzmkjj3Y=",
    "until": "2025-06-09T13:18:11.520Z"
  }
}

Last updated