WDK logoWDK documentation

Manage Transactions

Poll MoonPay for transaction status and inspect returned details.

This guide shows how to check transaction status and read transaction details with getTransactionDetail(). Pass the identifier MoonPay returns after checkout (for example from your redirect URL or webhook payload).

Check transaction status

You can read the high-level state of a buy with getTransactionDetail():

Buy transaction status
const buyTx = await moonpay.getTransactionDetail(moonpayTransactionId, 'buy')

console.log('Status:', buyTx.status)

status is one of completed, failed, or in_progress as described in the API reference.

Read transaction details

You can load the same record to inspect assets and currencies using getTransactionDetail():

Buy transaction fields
const buyTx = await moonpay.getTransactionDetail(moonpayTransactionId, 'buy')

console.log('Crypto asset:', buyTx.cryptoAsset)
console.log('Fiat currency:', buyTx.fiatCurrency)
console.log('Metadata:', buyTx.metadata)

You can query a sell the same way by passing sell as the direction to getTransactionDetail():

Sell transaction details
const sellTx = await moonpay.getTransactionDetail(moonpayTransactionId, 'sell')

console.log('Status:', sellTx.status)
console.log('Crypto asset:', sellTx.cryptoAsset)
console.log('Fiat currency:', sellTx.fiatCurrency)

The second argument defaults to buy when omitted; set it explicitly for sell flows.

Next Steps

On this page