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

Transactions

A transaction records one movement of money in your business balance:

typeWhat happenedDetails in
EXTERNAL_PAYMENTA customer sent crypto on the blockchain to an invoice's temporary wallet.externalPaymentTransactionDto
INTERNAL_PAYMENTA customer paid from their SwapWallet account, or paid a Toman receipt.internalPaymentTransactionDto
SETTLEMENTFunds moved from your business balance to the owner's SwapWallet account.settlementTransactionDto

An invoice paid in several transfers has one EXTERNAL_PAYMENT per transfer. Use transactions for accounting and reconciliation; to decide whether an order is paid, read the invoice.

The transaction object

One movement of money in your business balance. Only the details object that matches type is set; the other two are null.

Attributes

  • idinteger

    Unique identifier of the transaction.

  • typeenum

    What happened.

    Possible values

    • EXTERNAL_PAYMENTA blockchain transfer to an invoice's temporary wallet.
    • INTERNAL_PAYMENTA payment from a SwapWallet account, including a paid Toman receipt.
    • SETTLEMENTFunds moved from your business balance to the owner's SwapWallet account.
  • amountobject

    Amount of the transaction, with its value at that time.

    Show child attributesHide child attributes
    • amountMoney

      Amount, in the token or currency it moved in.

      Show child attributesHide child attributes
      • numberdecimal string

        The amount as a decimal string, without trailing zeros.

      • unitstring

        Currency or token code, such as USDT, IRT (Toman) or USD.

    • usdValueMoney

      Value in US dollars (USD).

      Show child attributesHide child attributes
      • numberdecimal string

        The amount as a decimal string, without trailing zeros.

      • unitstring

        Currency or token code, such as USDT, IRT (Toman) or USD.

    • irtValueMoney

      Value in Toman (IRT).

      Show child attributesHide child attributes
      • numberdecimal string

        The amount as a decimal string, without trailing zeros.

      • unitstring

        Currency or token code, such as USDT, IRT (Toman) or USD.

  • feeMoney

    SwapWallet's fee on this transaction, deducted from what your business receives. 0 for settlements.

    Show child attributesHide child attributes
    • numberdecimal string

      The amount as a decimal string, without trailing zeros.

    • unitstring

      Currency or token code, such as USDT, IRT (Toman) or USD.

  • feeValueMoney

    fee in US dollars (USD).

    Show child attributesHide child attributes
    • numberdecimal string

      The amount as a decimal string, without trailing zeros.

    • unitstring

      Currency or token code, such as USDT, IRT (Toman) or USD.

  • timestampISO 8601 timestamp

    When the transaction happened. For a blockchain payment, the time of its block.

  • supportCodestring

    Code to quote to SwapWallet support. For a blockchain payment, it's the invoice's support code.

  • internalPaymentTransactionDtoobjectnullable

    Details of an INTERNAL_PAYMENT.

    Show child attributesHide child attributes
    • applicationInvoiceobject

      The invoice this payment was for, as it is now.

      Show child attributesHide child attributes
      • invoiceIdUUID

        ID of the invoice.

      • typeenum

        How the invoice is paid.

        Possible values

        • TEMP_WALLETPaid, or waiting to be paid, by a blockchain transfer to a temporary wallet.
        • CRYPTO_INVOICEPaid from a SwapWallet account.
        • FIAT_INVOICEA Toman receipt.
      • amountMoneynullable

        Amount the invoice asks for.

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • paidAmountMoneynullable

        Total received for the invoice.

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • supportCodestring

        The invoice's support code.

      • customerobjectnullable

        Who paid, for a payment made from a SwapWallet account. null for blockchain payments.

        Show child attributesHide child attributes
        • namestringnullable

          The payer's name in SwapWallet.

        • avatarstringnullable

          URL of the payer's profile picture.

        • telegramIdintegernullable

          The payer's Telegram user ID.

        • emailstringnullable

          The userEmail you sent with the invoice.

        • phoneNumberstringnullable

          The userPhoneNumber you sent with the invoice.

      • orderIdstringnullable

        Your order ID.

      • descriptionstringnullable

        The invoice's description.

      • createdAtISO 8601 timestamp

        When the invoice was created.

      • statusenum

        Current status of the invoice.

        Possible values

        • ACTIVEWaiting for payment. Transfers so far, if any, don't cover it yet.
        • PAIDPaid. The funds are in your business balance.
        • SETTLEDPaid, and the funds have moved to the owner's SwapWallet account.
        • EXPIREDexpiredAt passed before the invoice was paid.
        • CANCELEDCanceled. Not used for invoices created through this API.
      • extraStatusenumnullable

        For blockchain payments, how paidAmount compares with amount. null when they match or the invoice was paid from a SwapWallet account.

        Possible values

        • OVER_PAIDMore than amount arrived.
        • UNDER_PAIDLess than amount arrived.
    • amountobject

      Same as the transaction's amount.

      Show child attributesHide child attributes
      • amountMoney

        Amount, in the token or currency it moved in.

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • usdValueMoney

        Value in US dollars (USD).

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • irtValueMoney

        Value in Toman (IRT).

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

  • externalPaymentTransactionDtoobjectnullable

    Details of an EXTERNAL_PAYMENT.

    Show child attributesHide child attributes
    • applicationInvoiceobject

      The invoice this payment was for, as it is now.

      Show child attributesHide child attributes
      • invoiceIdUUID

        ID of the invoice.

      • typeenum

        How the invoice is paid.

        Possible values

        • TEMP_WALLETPaid, or waiting to be paid, by a blockchain transfer to a temporary wallet.
        • CRYPTO_INVOICEPaid from a SwapWallet account.
        • FIAT_INVOICEA Toman receipt.
      • amountMoneynullable

        Amount the invoice asks for.

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • paidAmountMoneynullable

        Total received for the invoice.

        Show child attributesHide child attributes
        • numberdecimal string

          The amount as a decimal string, without trailing zeros.

        • unitstring

          Currency or token code, such as USDT, IRT (Toman) or USD.

      • supportCodestring

        The invoice's support code.

      • customerobjectnullable

        Who paid, for a payment made from a SwapWallet account. null for blockchain payments.

        Show child attributesHide child attributes
        • namestringnullable

          The payer's name in SwapWallet.

        • avatarstringnullable

          URL of the payer's profile picture.

        • telegramIdintegernullable

          The payer's Telegram user ID.

        • emailstringnullable

          The userEmail you sent with the invoice.

        • phoneNumberstringnullable

          The userPhoneNumber you sent with the invoice.

      • orderIdstringnullable

        Your order ID.

      • descriptionstringnullable

        The invoice's description.

      • createdAtISO 8601 timestamp

        When the invoice was created.

      • statusenum

        Current status of the invoice.

        Possible values

        • ACTIVEWaiting for payment. Transfers so far, if any, don't cover it yet.
        • PAIDPaid. The funds are in your business balance.
        • SETTLEDPaid, and the funds have moved to the owner's SwapWallet account.
        • EXPIREDexpiredAt passed before the invoice was paid.
        • CANCELEDCanceled. Not used for invoices created through this API.
      • extraStatusenumnullable

        For blockchain payments, how paidAmount compares with amount. null when they match or the invoice was paid from a SwapWallet account.

        Possible values

        • OVER_PAIDMore than amount arrived.
        • UNDER_PAIDLess than amount arrived.
  • settlementTransactionDtoobjectnullable

    Details of a SETTLEMENT.

    Show child attributesHide child attributes
    • typeenum

      Where the funds went.

      Possible values

      • OWNERThe owner's SwapWallet account.
    • settlementWalletobjectnullable

      Always null for a settlement to the owner's account.

    • cryptoWithdrawobjectnullable

      Always null for a settlement to the owner's account.

The transaction object
{
  "id": 4410387,
  "type": "EXTERNAL_PAYMENT",
  "amount": {
    "amount": {
      "number": "9.18",
      "unit": "USDT"
    },
    "usdValue": {
      "number": "9.18",
      "unit": "USD"
    },
    "irtValue": {
      "number": "2500632",
      "unit": "IRT"
    }
  },
  "fee": {
    "number": "0.0918",
    "unit": "USDT"
  },
  "feeValue": {
    "number": "0.0918",
    "unit": "USD"
  },
  "timestamp": "2026-11-23T09:19:22Z",
  "supportCode": "AI-8LEYRQH-G8HM",
  "internalPaymentTransactionDto": null,
  "externalPaymentTransactionDto": {
    "applicationInvoice": {
      "invoiceId": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
      "type": "TEMP_WALLET",
      "amount": {
        "number": "9.18",
        "unit": "USDT"
      },
      "paidAmount": {
        "number": "9.18",
        "unit": "USDT"
      },
      "supportCode": "AI-8LEYRQH-G8HM",
      "customer": null,
      "orderId": "ORD-1042",
      "description": "Spotify Premium, 1 month",
      "createdAt": "2026-11-23T09:12:04.318512Z",
      "status": "SETTLED",
      "extraStatus": null
    }
  },
  "settlementTransactionDto": null
}

List transactions

GET/v1/merchants/transactions

Lists the transactions of your business balance, newest first by default. Filter by type, or find one by its support code.

Query parameters

  • limitinteger

    Number of items per page.

    1 to 100 · Default: 10

  • pageinteger

    Page number, starting at 0.

    0 or more · Default: 0

  • sortedByenum

    Field to sort by. Any other value sorts by id.

    Default: id

    Possible values

    • id
    • timestamp
  • directionenum

    Sort order.

    Default: DESC

    Possible values

    • DESCNewest or largest first.
    • ASCOldest or smallest first.
  • supportCodestring

    Returns transactions whose support code contains this text, ignoring case.

  • transactionTypesarray of enums

    Returns only these types. Repeat the parameter for more than one: transactionTypes=EXTERNAL_PAYMENT&transactionTypes=INTERNAL_PAYMENT. All types when omitted.

    Possible values

    • EXTERNAL_PAYMENTA blockchain transfer to an invoice's temporary wallet.
    • INTERNAL_PAYMENTA payment from a SwapWallet account, including a paid Toman receipt.
    • SETTLEMENTFunds moved from your business balance to the owner's SwapWallet account.

Returns

Returns a page of Transaction objects in result.data, along with page, perPage, totalItems and totalPages.

GET/v1/merchants/transactions
curl -G https://swapwallet.app/api/v1/merchants/transactions \
  -H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY" \
  -d transactionTypes=EXTERNAL_PAYMENT \
  -d transactionTypes=INTERNAL_PAYMENT
Response
{
  "status": "OK",
  "result": {
    "page": 0,
    "perPage": 10,
    "totalItems": 2,
    "totalPages": 1,
    "data": [
      {
        "id": 4410387,
        "type": "EXTERNAL_PAYMENT",
        "amount": {
          "amount": {
            "number": "9.18",
            "unit": "USDT"
          },
          "usdValue": {
            "number": "9.18",
            "unit": "USD"
          },
          "irtValue": {
            "number": "2500632",
            "unit": "IRT"
          }
        },
        "fee": {
          "number": "0.0918",
          "unit": "USDT"
        },
        "feeValue": {
          "number": "0.0918",
          "unit": "USD"
        },
        "timestamp": "2026-11-23T09:19:22Z",
        "supportCode": "AI-8LEYRQH-G8HM",
        "internalPaymentTransactionDto": null,
        "externalPaymentTransactionDto": {
          "applicationInvoice": {
            "invoiceId": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
            "type": "TEMP_WALLET",
            "amount": {
              "number": "9.18",
              "unit": "USDT"
            },
            "paidAmount": {
              "number": "9.18",
              "unit": "USDT"
            },
            "supportCode": "AI-8LEYRQH-G8HM",
            "customer": null,
            "orderId": "ORD-1042",
            "description": "Spotify Premium, 1 month",
            "createdAt": "2026-11-23T09:12:04.318512Z",
            "status": "SETTLED",
            "extraStatus": null
          }
        },
        "settlementTransactionDto": null
      },
      {
        "id": 4409912,
        "type": "INTERNAL_PAYMENT",
        "amount": {
          "amount": {
            "number": "25",
            "unit": "USDT"
          },
          "usdValue": {
            "number": "25",
            "unit": "USD"
          },
          "irtValue": {
            "number": "6798750",
            "unit": "IRT"
          }
        },
        "fee": {
          "number": "0.25",
          "unit": "USDT"
        },
        "feeValue": {
          "number": "0.25",
          "unit": "USD"
        },
        "timestamp": "2026-11-22T18:05:37.214806Z",
        "supportCode": "SW-K2P9QX4-7HDA",
        "internalPaymentTransactionDto": {
          "applicationInvoice": {
            "invoiceId": "5b0a6e45-2335-4f1d-bd1f-6e2f0f6a8a88",
            "type": "CRYPTO_INVOICE",
            "amount": {
              "number": "25",
              "unit": "USDT"
            },
            "paidAmount": {
              "number": "25",
              "unit": "USDT"
            },
            "supportCode": "AI-2ZMN4TR-K1PL",
            "customer": {
              "name": "Ali Rezaei",
              "avatar": null,
              "telegramId": 112233445,
              "email": null,
              "phoneNumber": "+989121112233"
            },
            "orderId": "ORD-1039",
            "description": "YouTube Premium, 1 month",
            "createdAt": "2026-11-22T18:03:51.447120Z",
            "status": "SETTLED",
            "extraStatus": null
          },
          "amount": {
            "amount": {
              "number": "25",
              "unit": "USDT"
            },
            "usdValue": {
              "number": "25",
              "unit": "USD"
            },
            "irtValue": {
              "number": "6798750",
              "unit": "IRT"
            }
          }
        },
        "externalPaymentTransactionDto": null,
        "settlementTransactionDto": null
      }
    ]
  }
}

Retrieve a transaction

GET/v1/merchants/transactions/{transactionId}

Retrieves one transaction of your business balance by its ID.

Path parameters

  • transactionIdintegerRequired

    ID of the transaction.

Returns

Errors

  • 404TRANSACTION_NOT_FOUND

    No transaction of your business has this ID.

GET/v1/merchants/transactions/{transactionId}
curl https://swapwallet.app/api/v1/merchants/transactions/4410387 \
  -H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"
Response
{
  "status": "OK",
  "result": {
    "id": 4410387,
    "type": "EXTERNAL_PAYMENT",
    "amount": {
      "amount": {
        "number": "9.18",
        "unit": "USDT"
      },
      "usdValue": {
        "number": "9.18",
        "unit": "USD"
      },
      "irtValue": {
        "number": "2500632",
        "unit": "IRT"
      }
    },
    "fee": {
      "number": "0.0918",
      "unit": "USDT"
    },
    "feeValue": {
      "number": "0.0918",
      "unit": "USD"
    },
    "timestamp": "2026-11-23T09:19:22Z",
    "supportCode": "AI-8LEYRQH-G8HM",
    "internalPaymentTransactionDto": null,
    "externalPaymentTransactionDto": {
      "applicationInvoice": {
        "invoiceId": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
        "type": "TEMP_WALLET",
        "amount": {
          "number": "9.18",
          "unit": "USDT"
        },
        "paidAmount": {
          "number": "9.18",
          "unit": "USDT"
        },
        "supportCode": "AI-8LEYRQH-G8HM",
        "customer": null,
        "orderId": "ORD-1042",
        "description": "Spotify Premium, 1 month",
        "createdAt": "2026-11-23T09:12:04.318512Z",
        "status": "SETTLED",
        "extraStatus": null
      }
    },
    "settlementTransactionDto": null
  }
}