LogoLogo
  • General
    • Welcome to 0xpay
    • Transaction Fees
    • Networks & Assets
  • Integration Cookbook
    • Getting Started
      • Merchant Setup
    • Receive assets
    • Send assets
    • Invoices
    • Exchanges
  • Public API
    • Authorization
      • Signature Examples
    • Endpoints
      • Merchant
      • Basic crypto operations
      • Crypto Invoices
      • Basic Fiat Operations
      • Fiat Invoices
      • Exchange
      • Exchange + Withdrawal
    • Notifications
      • Crypto Callbacks
      • Fiat Callbacks
      • Exchange Callbacks
    • JS/TS SDK
      • Getting started
      • Processing WebHook Notifications
      • Reference
  • Legal Info
    • Terms of Service
      • ANNEX 1: RISK DISCLOSURE
      • ANNEX 2: PROHIBITED BUSINESSES
      • ANNEX 3: HIGH-RISK STATES, TERRITORIES AND JURISDICTIONS
    • Privacy Policy
Powered by GitBook
On this page
  • Exchange Withdrawal
  • Exchange
  1. Public API
  2. Notifications

Exchange Callbacks

PreviousFiat CallbacksNextJS/TS SDK

Last updated 1 year ago

Exchange Withdrawal

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

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:

Field
Type
Description

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*

meta

string

localId

string

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)

Webhook request body:

Field
Type
Description

id

string*

Identifier

localId

string

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*

price

string*

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

pricePair

[string*, string*]

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"

withdraw service fee, learn more

metadata you defined when

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

Done – success exchange

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

withdraw service fee, learn more

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

✅
⏳
✅
here
here
withdrawal was created
withdrawal was created
exchange was created
here
here