Skip to content
SwapWalletDocs
فارسیGet an API key

Transactions

A transaction records one movement of funds in your account: a deposit, a withdrawal, a transfer, a swap, a payment. Its type says which, and decides which detail object comes with it:

typeDetail object
CRYPTO_DEPOSITcryptoDeposit
CRYPTO_WITHDRAWcryptoWithdraw
FIAT_DEPOSITfiatDeposit
FIAT_WITHDRAWfiatWithdraw
TRANSFERtransfer
TRADEtrade
PAYMENTpayment
CREDITcredit

Only the matching detail object is present; the others are left out of the response rather than set to null.

Deposits, transfers, swaps and payments are recorded once they’re complete, so they appear with status SUCCEED and never change after that. Withdrawals start as PENDING and turn SUCCEED under the same id.

The Transaction object

One movement of funds in your account, with the detail object for its type.

Attributes

  • idintegerRequired

    Transaction ID. Unique across all types.

  • supportCodestringRequired

    Code to quote to support, such as SW-K7NP2QR-MXVT.

  • timestampintegerRequired

    When SwapWallet recorded the transaction, in Unix milliseconds. For a crypto deposit, the time it was credited, not its block time.

  • typeenumRequired

    What kind of transaction this is. Decides which detail object is present.

    Possible values

    • CRYPTO_DEPOSITCrypto received from a blockchain address. Details in cryptoDeposit.
    • CRYPTO_WITHDRAWCrypto sent to a blockchain address. Details in cryptoWithdraw.
    • FIAT_DEPOSITToman deposited. Details in fiatDeposit.
    • FIAT_WITHDRAWToman withdrawn to a bank account. Details in fiatWithdraw.
    • TRANSFERA transfer between SwapWallet users, in either direction. Details in transfer.
    • TRADEA swap. Details in trade.
    • PAYMENTAn invoice paid from your balance, such as a Telegram purchase. Details in payment.
    • CREDITCredit added or taken back by SwapWallet. Details in credit.
    • APPLICATION_SETTLEMENTIncome from your payment gateway settled to your wallet. Details in applicationSettlement.
    • REQUEST_INVOICEA payment request between users, paid or received. Details in requestInvoice. Filter it with PAYMENT or APPLICATION_SETTLEMENT.
    • INTERNAL_MOVE_BALANCEA move between your main balance and a Box. Details in boxMove.
    • P2P_PURCHASEA peer-to-peer purchase. Details in p2pPurchase.
  • statusenumRequired

    Deposits, transfers, trades, payments and credits are recorded only once complete, so they are always SUCCEED. Only withdrawals start as PENDING.

    Possible values

    • SUCCEEDComplete.
    • PENDINGA crypto withdrawal not yet confirmed on the network, or a Toman withdrawal not yet taken by the bank in full.
  • networkenumRequired

    The network the transaction ran on. INTERNAL for anything that stays inside SwapWallet.

    Possible values

    • INTERNALInside SwapWallet, with no blockchain involved.
    • TRON
    • ETHEREUM
    • BSCBNB Smart Chain.
    • TON
    • POLYGON
    • ARBITRUM
    • AVALANCHE
    • OPTIMISM
    • SOLANA
    • FANTOM
    • SUI
    • DOGE
    • BTC
    • ADA
    • XRP
    • NEAR
  • exchangeFeeMoneyRequired

    Fee SwapWallet charged: the withdrawal fee for a crypto withdrawal, the sum of the transfer fees for a Toman withdrawal. Always 0 for a trade, whose fee is in its rate, and for deposits and transfers.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • transferobject

    Present only when type is TRANSFER.

    Show child attributesHide child attributes
    • amountMoneyRequired

      Amount transferred. Transfers between SwapWallet users have no fee.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • fromUserobjectRequired

      The sender.

      Show child attributesHide child attributes
      • idintegerRequired

        SwapWallet user ID.

      • isYoubooleanRequired

        Whether this user is you, the owner of the API key.

      • namestringRequired

        The name you saved for this contact, or the user's display name.

      • profileUrlstringnullable

        Profile picture URL. null when the user has none.

    • toUserobjectRequired

      The recipient. The transfer is incoming when toUser.isYou is true.

      Show child attributesHide child attributes
      • idintegerRequired

        SwapWallet user ID.

      • isYoubooleanRequired

        Whether this user is you, the owner of the API key.

      • namestringRequired

        The name you saved for this contact, or the user's display name.

      • profileUrlstringnullable

        Profile picture URL. null when the user has none.

  • tradeobject

    Present only when type is TRADE.

    Show child attributesHide child attributes
    • marketstringRequired

      The market, as BASE/QUOTE, for example TON/USDT.

    • sideenumRequired

      Direction, seen from the market’s base token.

      Possible values

      • BUYYou received the base token.
      • SELLYou gave the base token.
    • typeenumRequired

      How the trade was made.

      Possible values

      • OTCA swap, from the app or this API.
      • BOXA trade inside one of your Boxes.
      • TOKEN_REPLACEMENTA token SwapWallet replaced for you, for example after a token migration.
      • MANUAL_OTCA sale settled outside the platform and recorded by SwapWallet.
    • sourceAmountMoneyRequired

      Amount you gave.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • sourceValueMoneyRequired

      sourceAmount in US dollars.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • sourceUserCurrencyValueMoneyRequired

      sourceAmount in your display currency, at the current rate.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • destinationAmountMoneyRequired

      Amount you received.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • destinationValueMoneyRequired

      destinationAmount in US dollars.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • destinationUserCurrencyValueMoneyRequired

      destinationAmount in your display currency, at the current rate.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • marketRatedecimal stringRequired

      Price of the base token in the quote token that this trade got, fee included.

  • cryptoDepositobject

    Present only when type is CRYPTO_DEPOSIT.

    Show child attributesHide child attributes
    • amountMoneyRequired

      Amount credited to your balance.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • contractenum

      The token standard on the network. Left out for a network's own coin, such as TRX on Tron.

      Possible values

      • TRC20Tron token.
      • ERC20Ethereum, Arbitrum or Polygon token.
      • BEP20BNB Smart Chain token.
      • JETTONTON token.
      • SPLSolana token.
    • sourceAddressstringRequired

      The address the funds came from.

    • destinationAddressstringRequired

      Your SwapWallet deposit address that received them.

    • hashstringRequired

      Transaction hash on the network.

    • memostring

      Memo or tag of the deposit. Left out when there is none.

    • blockScanUrlstringRequired

      Link to the transaction on a block explorer.

  • cryptoWithdrawobject

    Present only when type is CRYPTO_WITHDRAW.

    Show child attributesHide child attributes
    • amountMoneyRequired

      Amount sent to the destination address.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • contractenum

      The token standard on the network. Left out for a network's own coin, such as TRX on Tron.

      Possible values

      • TRC20Tron token.
      • ERC20Ethereum, Arbitrum or Polygon token.
      • BEP20BNB Smart Chain token.
      • JETTONTON token.
      • SPLSolana token.
    • sourceAddressstring

      SwapWallet’s sending address. Left out until the withdrawal is sent.

    • destinationAddressstringRequired

      The address you withdrew to.

    • hashstring

      Transaction hash on the network. Left out until the withdrawal is sent.

    • memostring

      The memo sent with the withdrawal. Left out when there is none.

    • blockScanUrlstring

      Link to the transaction on a block explorer. Left out until the withdrawal is sent.

    • workflowarray of objectsRequired

      The withdrawal’s progress, one entry per step, always in this order.

      Show child attributesHide child attributes
      • stepenumRequired

        The step.

        Possible values

        • TRANSACTION_CREATEDThe request was recorded and the amount taken from your balance.
        • ACCEPTED_BY_ADMINApproved for sending, automatically or after a review.
        • PUBLISHED_TO_NETWORKSent to the network; hash is now set.
        • CONFIRMED_BY_NETWORKConfirmed on the network. The transaction’s status turns SUCCEED.
      • donebooleanRequired

        Whether the step is complete.

      • dateISO 8601 timestampnullable

        When the step completed. null until then.

  • fiatDepositobject

    Present only when type is FIAT_DEPOSIT.

    Show child attributesHide child attributes
    • amountMoneyRequired

      Amount credited, in IRT.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • methodenumRequired

      How the Toman arrived.

      Possible values

      • IR_GATEWAYCard payment through a bank gateway.
      • CASH_IN_CODEBank transfer with your deposit ID.
      • A2AAccount-to-account transfer within one bank.
      • ACHPAYA transfer.
      • RTGSSATNA transfer.
      • DIRECT_DEBITDirect debit from your bank account.
      • BANK_TRANSFERA bank transfer matched to your account.
      • ADMINRecorded by SwapWallet support.
    • invoiceobject

      Gateway payment details. Present when method is IR_GATEWAY.

    • cashInCodeobject

      Deposit-ID transfer details. Present when method is CASH_IN_CODE.

    • directDepositobject

      Direct debit details. Present when method is DIRECT_DEBIT.

    • bankTransferobject

      Matched bank transfer details. Present when method is BANK_TRANSFER.

  • fiatWithdrawobject

    Present only when type is FIAT_WITHDRAW.

    Show child attributesHide child attributes
    • amountMoneyRequired

      Total amount sent to the bank account, in IRT, across all transfers.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • ibanstringRequired

      Destination IBAN (Sheba).

    • bankstringRequired

      Bank of the IBAN, such as SAMAN or MELLAT.

    • holderNamestringRequired

      Account holder’s name.

    • predictedDoneTimeISO 8601 timestamp

      When the bank is expected to settle it. Left out when there is no estimate still ahead.

    • publicReceiptUrlstring

      Link to the bank receipt. Present only for a single-transfer withdrawal that the bank has taken.

    • trackingCodestring

      Bank tracking code. Present only for a single-transfer withdrawal that the bank has taken.

    • trackingCodeMethodenum

      Which kind of code trackingCode is.

      Possible values

      • A2AAccount-to-account; the code is a tracking number (شماره پیگیری).
      • ACHPAYA; the code is a reference code (کد رهگیری).
      • RTGSSATNA; the code is a reference code (کد رهگیری).
    • transfersarray of objectsRequired

      The bank transfers the withdrawal is paid in. A large withdrawal is split into several, sent one after another.

      Show child attributesHide child attributes
      • idintegerRequired

        ID of this transfer.

      • amountMoneyRequired

        Amount of this transfer.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • feeMoneyRequired

        Withdrawal fee for this transfer.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • statusenumRequired

        Whether the bank has taken this transfer.

        Possible values

        • PENDINGNot yet sent to or taken by the bank.
        • SUCCEEDThe bank has taken it.
      • methodenum

        How it’s paid. Left out until it’s sent.

        Possible values

        • A2AAccount-to-account; the code is a tracking number (شماره پیگیری).
        • ACHPAYA; the code is a reference code (کد رهگیری).
        • RTGSSATNA; the code is a reference code (کد رهگیری).
      • predictedDoneTimeISO 8601 timestamp

        Expected settlement time, when there is one still ahead.

      • publicReceiptUrlstring

        Link to the bank receipt, once there is one.

      • trackingCodestring

        Bank tracking code, once there is one.

      • trackingCodeMethodenum

        Which kind of code trackingCode is.

        Possible values

        • A2AAccount-to-account; the code is a tracking number (شماره پیگیری).
        • ACHPAYA; the code is a reference code (کد رهگیری).
        • RTGSSATNA; the code is a reference code (کد رهگیری).
  • paymentobject

    Present only when type is PAYMENT.

    Show child attributesHide child attributes
    • invoiceobjectRequired

      The invoice this transaction paid.

      Show child attributesHide child attributes
      • idintegerRequired

        Invoice ID. Pass it to Pay an invoice.

      • supportCodestringRequired

        Code to quote to support.

      • statusenumRequired

        Where the invoice stands.

        Possible values

        • PENDINGWaiting for payment.
        • PAIDPaid.
        • DELIVEREDPaid and the product delivered.
        • EXPIREDNot paid before expiredAt.
        • CANCELEDCanceled.
      • titlestringRequired

        Machine-readable product title, such as TELEGRAM_STARS, TELEGRAM_PREMIUM or TELEGRAM_ADS.

      • readableTitlestringnullable

        Product title in your account’s language.

      • typeenumRequired

        What the invoice is for.

        Possible values

        • JETTONTelegram Premium or Stars from the shop.
        • TELEGRAM_ADSA Telegram Ads top-up.
        • SHOP_ORDERAn order from the SwapWallet shop.
        • GIFT_CARDA gift card.
        • EXTERNAL_APPLICATIONA payment to a merchant’s payment gateway.
        • GIVEAWAYA giveaway.
        • AD_CHEQUEAn ad cheque.
        • AD_CHEQUE_TOP_UPAn ad cheque top-up.
        • HONGBAO_PACKETA red-envelope (hongbao) packet.
        • EXTRA_USER_WALLETAn extra wallet for your account.
        • AI_CREDITAI credit.
      • amountMoneyRequired

        Amount to pay, fee included.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • valueMoneyRequired

        amount in Toman (IRT).

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • allowedPaymentTokensarray of stringsRequired

        Tokens the invoice accepts in the app.

      • allowedLockedFundsbooleanRequired

        Whether the invoice may be paid with crypto still held by the 72-hour rule (see Crypto withdrawals).

      • feeMoneyRequired

        Fee included in amount.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • createdAtISO 8601 timestampRequired

        When the invoice was created.

      • expiredAtISO 8601 timestampnullable

        Payment deadline.

      • paidWithMoneynullable

        What it was paid with. null until paid.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • paidAtISO 8601 timestampnullable

        When it was paid. null until then.

      • originalAmountMoneynullable

        Amount before a discount code. null without one.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • discountAmountMoneynullable

        Discount applied. null without one.

        Show child attributesHide child attributes
        • numberdecimal stringRequired

          The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

        • unitstringRequired

          The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

      • discountCodestringnullable

        Discount code applied. null without one.

    • amountMoneyRequired

      Amount paid.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • creditobject

    Present only when type is CREDIT.

    Show child attributesHide child attributes
    • typeenumRequired

      Why the credit was added or taken back.

      Possible values

      • REFERRAL_REWARDReferral reward.
      • CASHBACKCashback.
      • GIFT_CARDA redeemed gift card.
      • SHOP_ORDER_REFUNDRefund of a shop order.
      • JETTON_REFUNDRefund of a Telegram Premium or Stars purchase.
      • WITHDRAW_RETURNA withdrawal that came back.
      • TRANSACTIONS_CORRECTIONCorrection by SwapWallet.
      • EXPIRED_GIFTAn unused campaign gift taken back (negative amount).
      • LOANA loan.
      • GIVEAWAYGiveaway prize.
      • AD_CHEQUE_ACTIVATION
      • AD_CHEQUE_REFERRAL
      • DOGS_TASK
      • DOGS_TASK_REFERRAL
      • DOGS_REFERRAL
      • MOONCampaign reward.
      • ISWAPCampaign reward.
      • ISWAP_REFERRALCampaign reward.
      • GOOGLE_27_BIRTHCampaign reward.
      • CAKE_PRIZECampaign reward.
      • WORLDCUP_PRIZECampaign reward.
    • amountMoneyRequired

      Amount credited.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      Value in US dollars (USD) at the time of the transaction.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • applicationSettlementobject

    Settlement of your payment gateway. Present only when type is APPLICATION_SETTLEMENT.

  • requestInvoiceobject

    The payment request and who paid whom. Present only when type is REQUEST_INVOICE.

  • boxMoveobject

    Present only when type is INTERNAL_MOVE_BALANCE.

    Show child attributesHide child attributes
    • directionenumRequired

      Which way the funds moved.

      Possible values

      • TO_BOXFrom your main balance into the Box.
      • TO_MAINFrom the Box back to your main balance.
    • amountMoneyRequired

      Amount moved.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • userCurrencyValueMoneyRequired

      The same value in your account's display currency, usually IRT. It's converted at the current rate each time you read it, so it moves with the market.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • boxobject

    The Box this transaction belongs to, such as a trade made inside a Box. Left out otherwise.

    Show child attributesHide child attributes
    • idintegerRequired

      Box ID.

    • namestringRequired

      Box name.

    • typeenumRequired

      Kind of Box.

      Possible values

      • SIMPLEA single-asset Box.
      • PIEA mix of several assets.
    • operationIdintegernullable

      The Box operation that made this transaction, if any.

  • p2pPurchaseobject

    Present only when type is P2P_PURCHASE.

  • balanceChangesarray of objects

    How this transaction moved your balance, one entry per token. Only Retrieve a transaction returns it; lists leave it out.

    Show child attributesHide child attributes
    • tokenstringRequired

      Token symbol.

    • amountMoneyRequired

      Change in your total balance; negative when it went down.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • beforeMoneyRequired

      Total balance before, on-hold amounts included.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • afterMoneyRequired

      Total balance after, on-hold amounts included.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

The Transaction object
{
  "id": 3051210,
  "supportCode": "SW-K7NP2QR-MXVT",
  "timestamp": 1795164000000,
  "type": "CRYPTO_DEPOSIT",
  "status": "SUCCEED",
  "network": "TRON",
  "exchangeFee": {
    "number": "0",
    "unit": "USDT"
  },
  "cryptoDeposit": {
    "amount": {
      "number": "50",
      "unit": "USDT"
    },
    "value": {
      "number": "50",
      "unit": "USD"
    },
    "userCurrencyValue": {
      "number": "13620000",
      "unit": "IRT"
    },
    "contract": "TRC20",
    "sourceAddress": "TQ9yLxm1yC6uX3YgYvG6S4w7HxQvQ1pNnA",
    "destinationAddress": "TJ4qN2b8pW3mXvKc7RtYf5HsLd9eUa1oZG",
    "hash": "8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e",
    "blockScanUrl": "https://tronscan.org/#/transaction/8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e"
  }
}

List transactions

GET/v2/transaction

Returns your transactions, newest first, filtered by any combination of the parameters below. Array parameters repeat the key: types=CRYPTO_DEPOSIT&types=TRANSFER.

The list is paged with an ID cursor:

  1. Walk back through history (the default order): pass the last item’s id as beforeId.
  2. Walk forward from a known point: set sortDir=ASC and pass the last item’s id as afterId.

result.hasNext is true when more transactions match beyond this page, in the order you asked for.

Detecting deposits. To see every incoming deposit without touching a blockchain, call this endpoint once a minute with types=CRYPTO_DEPOSIT&types=TRANSFER and the tokens you care about, and remember the IDs you’ve already handled. CRYPTO_DEPOSIT is a deposit from a blockchain address; TRANSFER is a transfer from another SwapWallet user, and it’s incoming when transfer.toUser.isYou is true (outgoing transfers match the same filter). With limit=20 a single call per minute is usually enough.

IDs are assigned when a transaction is created, not when it’s saved, so a transaction can appear with a lower id than one you’ve already seen. When polling, don’t rely on afterId alone: re-read a window that overlaps your last call and skip the IDs you’ve already handled.

Query parameters

  • typesarray of enums

    Only these transaction types.

    Possible values

    • CRYPTO_DEPOSITCrypto received from a blockchain address. Details in cryptoDeposit.
    • CRYPTO_WITHDRAWCrypto sent to a blockchain address. Details in cryptoWithdraw.
    • FIAT_DEPOSITToman deposited. Details in fiatDeposit.
    • FIAT_WITHDRAWToman withdrawn to a bank account. Details in fiatWithdraw.
    • TRANSFERA transfer between SwapWallet users, in either direction. Details in transfer.
    • TRADEA swap. Details in trade.
    • PAYMENTAn invoice paid from your balance, such as a Telegram purchase. Details in payment.
    • CREDITCredit added or taken back by SwapWallet. Details in credit.
    • APPLICATION_SETTLEMENTIncome from your payment gateway settled to your wallet. Details in applicationSettlement.
    • INTERNAL_MOVE_BALANCEA move between your main balance and a Box. Details in boxMove.
    • P2P_PURCHASEA peer-to-peer purchase. Details in p2pPurchase.
  • tokensarray of strings

    Only transactions in these tokens. A trade matches if either side is one of them.

  • networksarray of enums

    Only transactions on these networks. INTERNAL covers transfers, trades and payments.

    Possible values

    • INTERNALInside SwapWallet, with no blockchain involved.
    • TRON
    • ETHEREUM
    • BSCBNB Smart Chain.
    • TON
    • POLYGON
    • ARBITRUM
    • AVALANCHE
    • OPTIMISM
    • SOLANA
    • FANTOM
    • SUI
    • DOGE
    • BTC
    • ADA
    • XRP
    • NEAR
  • startDateISO 8601 timestamp

    Only transactions recorded at or after this time, such as 2026-11-01T00:00:00Z.

  • endDateISO 8601 timestamp

    Only transactions recorded at or before this time.

  • querystring

    Free-text search. Matches a support code exactly, or part of a wallet address, or the hash of a crypto deposit, case-insensitively.

  • supportCodesarray of strings

    Only transactions with these support codes.

  • idsarray of integers

    Only transactions with these IDs.

  • userIdinteger

    Only transactions with this SwapWallet user, such as transfers to or from them.

  • usernamestring

    Same as userId, by SwapWallet username.

  • recipientsarray of integers

    SwapWallet user IDs. Narrows transfers to those with any of these users; other types aren’t affected, so combine it with types=TRANSFER.

  • boxesenum

    How to treat transactions made inside a Box. Unset, they’re listed like any other. Once set, types filters only transactions outside Boxes.

    Possible values

    • HIDELeave Box transactions out.
    • ADDAdd Box transactions, whatever their type.
    • ONLYReturn Box transactions only.
  • boxIdsarray of integers

    With boxes set to ADD or ONLY, only these Boxes.

  • afterIdinteger

    Only transactions with an id greater than this. Use with sortDir=ASC to page forward.

  • beforeIdinteger

    Only transactions with an id smaller than this. Use with the default order to page back.

  • sortByarray of enums

    Field to sort by. Each sortBy pairs with the sortDir at the same position; a value without a partner is ignored.

    Default: id

    Possible values

    • id
    • timestamp
    • supportCode
    • type
    • network
  • sortDirarray of enums

    Sort direction.

    Default: DESC

    Possible values

    • DESCNewest first.
    • ASCOldest first.
  • limitinteger

    Page size. Defaults to 100 instead when beforeId is set.

    1 to 100 · Default: 20

Returns

Returns result.data, an array of Transaction objects, and result.hasNext.

Errors

  • 400VALIDATION_FAILED

    limit is outside 1 to 100.

  • 400INVALID_REQUEST_PARAMETER

    A parameter has a value outside its list, or a date isn’t ISO 8601.

  • 500INTERNAL_SERVER_ERROR

    sortBy has a value outside its list.

GET/v2/transaction
curl -G https://swapwallet.app/api/v2/transaction \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY" \
  -d types=CRYPTO_DEPOSIT \
  -d types=TRANSFER \
  -d tokens=USDT \
  -d tokens=TON \
  -d tokens=TRX \
  -d sortDir=DESC \
  -d limit=20
Response
{
  "status": "OK",
  "result": {
    "hasNext": false,
    "data": [
      {
        "id": 3051234,
        "supportCode": "SW-M3NP8QR-TXVW",
        "timestamp": 1795164100000,
        "type": "TRANSFER",
        "status": "SUCCEED",
        "network": "INTERNAL",
        "exchangeFee": {
          "number": "0",
          "unit": "TON"
        },
        "transfer": {
          "amount": {
            "number": "5",
            "unit": "TON"
          },
          "value": {
            "number": "4.9",
            "unit": "USD"
          },
          "userCurrencyValue": {
            "number": "1334760",
            "unit": "IRT"
          },
          "fromUser": {
            "id": 4821,
            "isYou": false,
            "name": "علی رضایی",
            "profileUrl": null
          },
          "toUser": {
            "id": 52310,
            "isYou": true,
            "name": "مریم کاظمی",
            "profileUrl": "https://swapwallet.app/media/public/profile-picture/52310/4be1c0d2.png"
          }
        }
      },
      {
        "id": 3051210,
        "supportCode": "SW-K7NP2QR-MXVT",
        "timestamp": 1795164000000,
        "type": "CRYPTO_DEPOSIT",
        "status": "SUCCEED",
        "network": "TRON",
        "exchangeFee": {
          "number": "0",
          "unit": "USDT"
        },
        "cryptoDeposit": {
          "amount": {
            "number": "50",
            "unit": "USDT"
          },
          "value": {
            "number": "50",
            "unit": "USD"
          },
          "userCurrencyValue": {
            "number": "13620000",
            "unit": "IRT"
          },
          "contract": "TRC20",
          "sourceAddress": "TQ9yLxm1yC6uX3YgYvG6S4w7HxQvQ1pNnA",
          "destinationAddress": "TJ4qN2b8pW3mXvKc7RtYf5HsLd9eUa1oZG",
          "hash": "8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e",
          "blockScanUrl": "https://tronscan.org/#/transaction/8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e"
        }
      }
    ]
  }
}

Retrieve a transaction

GET/v1/transaction/{id}

Returns one transaction by its ID. Unlike the list, the response includes balanceChanges: exactly how the transaction moved your balance of each token. Use it to follow a withdrawal until its status turns SUCCEED.

Path parameters

  • idintegerRequired

    Transaction ID.

Returns

Returns a Transaction object in result, with balanceChanges.

Errors

  • 404TRANSACTION_NOT_FOUND

    No transaction of yours has this ID.

GET/v1/transaction/{id}
curl https://swapwallet.app/api/v1/transaction/3051210 \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY"
Response
{
  "status": "OK",
  "result": {
    "id": 3051210,
    "supportCode": "SW-K7NP2QR-MXVT",
    "timestamp": 1795164000000,
    "type": "CRYPTO_DEPOSIT",
    "status": "SUCCEED",
    "network": "TRON",
    "exchangeFee": {
      "number": "0",
      "unit": "USDT"
    },
    "cryptoDeposit": {
      "amount": {
        "number": "50",
        "unit": "USDT"
      },
      "value": {
        "number": "50",
        "unit": "USD"
      },
      "userCurrencyValue": {
        "number": "13620000",
        "unit": "IRT"
      },
      "contract": "TRC20",
      "sourceAddress": "TQ9yLxm1yC6uX3YgYvG6S4w7HxQvQ1pNnA",
      "destinationAddress": "TJ4qN2b8pW3mXvKc7RtYf5HsLd9eUa1oZG",
      "hash": "8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e",
      "blockScanUrl": "https://tronscan.org/#/transaction/8ce3e71ef8635d2bf27913bb680d7f88ad0238ea42c779c4b30f4e587d07da8e"
    },
    "balanceChanges": [
      {
        "token": "USDT",
        "amount": {
          "number": "50",
          "unit": "USDT"
        },
        "before": {
          "number": "1199.5",
          "unit": "USDT"
        },
        "after": {
          "number": "1249.5",
          "unit": "USDT"
        }
      }
    ]
  }
}