Exchange Callbacks

Exchange Withdrawal

Fiat batch withdrawals are used here. Read more about that here.

Statuses

  • Exchanged - your swap is filled and balances are exchanged

  • 😡 Failed – can fire before exchanged status or after exchanged status (order not filled, withdraw is not successful and etc. In that case you should check you account in web application)

  • Done – withdrawal was sent

Webhook request body:

FieldTypeDescription

kind

"FiatExchangeWithdraw" | "CryptoExchangeWithdraw"

id

string*

Identifier

ticker

string*

"KZT"

amount

string*

amount in decimal format, look at the example

paidAmount

string*

This field can differ from amount field in specific bank cases so it should be used as source of true.

failedAmount

string*

withdraw amount that not sent on bank side

fee

string*

withdraw service fee, learn more here

meta

string

metadata you defined when withdrawal was created

localId

string

localId you defined when withdrawal was created, or it could be the id of an entity that caused this withdrawal if it happens due to auto-targeting

status

string*

"Done" | "Exchanged" | "Failed"

time

number*

timestamp when withdrawal was created in ms

exchangeFee

string*

exchange fee used

spendTicker

string*

ticker that was withdrawn from balance (exchanged)

spendAmount

string*

amount that was withdrawn from balance (exchanged)

price

string*

price value, example: 23000 for BTC -> USDT pair

pricePair

string*[2]

pair that used in exchange

exchanged

boolean

balances were swapped and exchanged succeeded

to

string*

card number

causedBy

string

If this field present, it's mean that this is auto withdrawal, caused by some deposit. Posible values: "fiat-invoice", "crypto-invoice", "crypto-replenishment"

internal

boolean

offchain withdraw to 0xpay address

Exchange

Statuses:

  • 😡 Failed – can fire before exchanged status or after exchanged status (order not filled, exchange is not successful and etc. In that case you should check you account in web application)

  • Done – success exchange

Webhook request body:

FieldTypeDescription

id

string*

Identifier

localId

string

localId you defined when exchange was created, or it could be the id of an entity that caused this exchange if it happens due to auto-targeting

time

number*

timestamp when exchange was created in ms

meta

string

metadata you defined

status

string*

"Failed", "Done"

kind

"Exchange"

targetTicker

string*

Ticker you chose to receive.

targetAmount

string*

amount that was received to balance (exchanged)

spendTicker

string*

ticker that was withdrawn from balance (exchanged)

spendAmount

string*

amount that was exchange from balance (exchanged)

fee

string*

withdraw service fee, learn more here

price

string*

price value, example: 23000 for BTC -> USDT pair

pricePair

[string*, string*]

array of two tickers (targetTicker, spendTicker). Values you can find here (Ticker column) + Fiat ticker "UAH"

merchantId

string*

your own merchant identifier

failedReason

string

reason why exchange was failed

causedBy

string

If this field present, it's mean that this is auto exchange, caused by some deposit. Posible values: "fiat-invoice", "crypto-invoice", "crypto-replenishment"

Last updated