A transaction records one movement of money in your business balance:
type | What happened | Details in |
|---|---|---|
EXTERNAL_PAYMENT | A customer sent crypto on the blockchain to an invoice's temporary wallet. | externalPaymentTransactionDto |
INTERNAL_PAYMENT | A customer paid from their SwapWallet account, or paid a Toman receipt. | internalPaymentTransactionDto |
SETTLEMENT | Funds 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.
One movement of money in your business balance. Only the details object that matches type is set; the other two are null.
idintegerUnique identifier of the transaction.
typeenumWhat 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.amountobjectAmount of the transaction, with its value at that time.
amountMoneyAmount, in the token or currency it moved in.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
usdValueMoneyValue in US dollars (USD).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
irtValueMoneyValue in Toman (IRT).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
feeMoneySwapWallet's fee on this transaction, deducted from what your business receives. 0 for settlements.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
feeValueMoneyfee in US dollars (USD).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
timestampISO 8601 timestampWhen the transaction happened. For a blockchain payment, the time of its block.
supportCodestringCode to quote to SwapWallet support. For a blockchain payment, it's the invoice's support code.
internalPaymentTransactionDtoobjectnullableDetails of an INTERNAL_PAYMENT.
applicationInvoiceobjectThe invoice this payment was for, as it is now.
invoiceIdUUIDID of the invoice.
typeenumHow 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.amountMoneynullableAmount the invoice asks for.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paidAmountMoneynullableTotal received for the invoice.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
supportCodestringThe invoice's support code.
customerobjectnullableWho paid, for a payment made from a SwapWallet account. null for blockchain payments.
namestringnullableThe payer's name in SwapWallet.
avatarstringnullableURL of the payer's profile picture.
telegramIdintegernullableThe payer's Telegram user ID.
emailstringnullableThe userEmail you sent with the invoice.
phoneNumberstringnullableThe userPhoneNumber you sent with the invoice.
orderIdstringnullableYour order ID.
descriptionstringnullableThe invoice's description.
createdAtISO 8601 timestampWhen the invoice was created.
statusenumCurrent 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.extraStatusenumnullableFor 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.amountobjectSame as the transaction's amount.
amountMoneyAmount, in the token or currency it moved in.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
usdValueMoneyValue in US dollars (USD).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
irtValueMoneyValue in Toman (IRT).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
externalPaymentTransactionDtoobjectnullableDetails of an EXTERNAL_PAYMENT.
applicationInvoiceobjectThe invoice this payment was for, as it is now.
invoiceIdUUIDID of the invoice.
typeenumHow 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.amountMoneynullableAmount the invoice asks for.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paidAmountMoneynullableTotal received for the invoice.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
supportCodestringThe invoice's support code.
customerobjectnullableWho paid, for a payment made from a SwapWallet account. null for blockchain payments.
namestringnullableThe payer's name in SwapWallet.
avatarstringnullableURL of the payer's profile picture.
telegramIdintegernullableThe payer's Telegram user ID.
emailstringnullableThe userEmail you sent with the invoice.
phoneNumberstringnullableThe userPhoneNumber you sent with the invoice.
orderIdstringnullableYour order ID.
descriptionstringnullableThe invoice's description.
createdAtISO 8601 timestampWhen the invoice was created.
statusenumCurrent 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.extraStatusenumnullableFor 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.settlementTransactionDtoobjectnullableDetails of a SETTLEMENT.
typeenumWhere the funds went.
Possible values
OWNERThe owner's SwapWallet account.settlementWalletobjectnullableAlways null for a settlement to the owner's account.
cryptoWithdrawobjectnullableAlways null for a settlement to the owner's account.
{
"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
}/v1/merchants/transactionsLists the transactions of your business balance, newest first by default. Filter by type, or find one by its support code.
limitintegerNumber of items per page.
pageintegerPage number, starting at 0.
sortedByenumField to sort by. Any other value sorts by id.
Possible values
idtimestampdirectionenumSort order.
Possible values
DESCNewest or largest first.ASCOldest or smallest first.supportCodestringReturns transactions whose support code contains this text, ignoring case.
transactionTypesarray of enumsReturns 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 a page of Transaction objects in result.data, along with page, perPage, totalItems and totalPages.
curl -G https://swapwallet.app/api/v1/merchants/transactions \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY" \
-d transactionTypes=EXTERNAL_PAYMENT \
-d transactionTypes=INTERNAL_PAYMENTconst response = await fetch('https://swapwallet.app/api/v1/merchants/transactions?transactionTypes=EXTERNAL_PAYMENT&transactionTypes=INTERNAL_PAYMENT', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.get(
"https://swapwallet.app/api/v1/merchants/transactions",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
params={"transactionTypes": ["EXTERNAL_PAYMENT", "INTERNAL_PAYMENT"]},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/transactions?transactionTypes=EXTERNAL_PAYMENT&transactionTypes=INTERNAL_PAYMENT');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://swapwallet.app/api/v1/merchants/transactions?transactionTypes=EXTERNAL_PAYMENT&transactionTypes=INTERNAL_PAYMENT", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"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
}
]
}
}/v1/merchants/transactions/{transactionId}Retrieves one transaction of your business balance by its ID.
transactionIdintegerRequiredID of the transaction.
Returns a Transaction object.
TRANSACTION_NOT_FOUNDNo transaction of your business has this ID.
curl https://swapwallet.app/api/v1/merchants/transactions/4410387 \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/transactions/4410387', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.get(
"https://swapwallet.app/api/v1/merchants/transactions/4410387",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/transactions/4410387');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://swapwallet.app/api/v1/merchants/transactions/4410387", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"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
}
}{
"status": "OK",
"result": {
"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
}
}{
"status": "OK",
"result": {
"id": 4410391,
"type": "SETTLEMENT",
"amount": {
"amount": {
"number": "9.0882",
"unit": "USDT"
},
"usdValue": {
"number": "9.0882",
"unit": "USD"
},
"irtValue": {
"number": "2475625",
"unit": "IRT"
}
},
"fee": {
"number": "0",
"unit": "USDT"
},
"feeValue": {
"number": "0",
"unit": "USD"
},
"timestamp": "2026-11-23T09:19:42.104331Z",
"supportCode": "PAY-3HD8W2K-QM7C",
"internalPaymentTransactionDto": null,
"externalPaymentTransactionDto": null,
"settlementTransactionDto": {
"type": "OWNER",
"settlementWallet": null,
"cryptoWithdraw": null
}
}
}