An invoice asks a customer for a payment and gives them a temporary wallet to pay into: a blockchain address that belongs to the invoice for its lifetime. You set the price in any currency SwapWallet prices (Toman, US dollars or a token); SwapWallet converts it into the token the customer pays with, and the customer sends exactly that amount to the address. With the SwapWallet link, a customer can also pay from their SwapWallet account without waiting for the network.
When a transfer is confirmed, SwapWallet credits your business balance (minus its fee), updates the invoice and sends an invoice-paid webhook. The funds then settle to the owner's SwapWallet account, right away unless your business has a hold period.
status | Meaning |
|---|---|
ACTIVE | Waiting for payment. Transfers so far, if any, don't cover it yet. |
PAID | Paid. The funds are in your business balance. |
SETTLED | Paid, and the funds have moved to the owner's SwapWallet account. |
EXPIRED | expiredAt passed before the invoice was paid. |
A customer can pay in several transfers. The invoice becomes PAID when the confirmed transfers add up to amount (or to the share you set with underPaidCoveragePercent). Transfers still count after that, so paidAmount can exceed amount, and for 12 hours after expiredAt, so a late payment can still move an EXPIRED invoice to PAID.
Fulfill an order only when the invoice's status is PAID or SETTLED. A webhook is also sent for a transfer that doesn't cover the invoice yet, and its status is still ACTIVE.
Send an orderId with every invoice. It's unique per business, so a retried request can't create a second invoice for the same order, and you can find the invoice later with Retrieve an invoice by order ID.
An invoice and its payment state. The invoice endpoints return it, and the invoice-paid webhook carries it.
idUUIDUnique identifier of the invoice.
supportCodestringShort code to quote to SwapWallet support, such as AI-8LEYRQH-G8HM.
statusenumWhere the invoice is in its lifecycle.
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.descriptionstringnullableThe description you sent.
customDatastringnullableThe customData you sent, unchanged.
walletobjectnullableThe temporary wallet the customer pays into; for a Toman receipt, deepLinks holds the SwapWallet payment link. Returned only by Retrieve an invoice; null in lists, by order ID and in webhooks.
networkstringNetwork of the address, such as BSC.
tokenstringToken to send, such as USDT.
addressstringAddress to send to.
validUntilISO 8601 timestampSame as the invoice's expiredAt.
deepLinksarray of objectsLinks that open a wallet app with the transfer filled in. Empty once the invoice is no longer ACTIVE.
nameenumThe wallet app.
Possible values
SWAP_WALLETSwapWallet, in Telegram.SWAP_WALLET_WEBSITESwapWallet, on the web.TRUST_WALLETTrust Wallet.METAMASKMetaMask.TON_KEEPERTonkeeper. TON only.TONHUBTonhub. TON only.MYTONWALLETMyTonWallet. TON only.BITYCLEBitycle.logostringURL of the app's logo.
urlstringnullableLink that opens the app with the address and amount filled in.
urlTypeenumHow the link opens.
Possible values
WEB_APPAs a Telegram mini app.URLAs a regular web or app link.textFastringPersian label for the button, such as «واریز از سواپولت».
ownerIdintegerSwapWallet user ID of the business owner.
telegramInlineMessageIdstringnullableUsed by SwapWallet's Telegram bot. Always null for invoices created through this API.
userLanguageenumnullableThe language you sent.
Possible values
FAPersianENEnglishRURussianZHChineseFRFrenchITItalianDEGermanESSpanishKOKoreanreturnUrlstringnullableThe return URL you sent.
webhookUrlstringnullableThis invoice's webhook URL. When null, webhooks go to your business webhook URL, if it's set.
orderIdstringnullableYour order ID.
amountMoneynullableWhat the customer pays: for a temporary-wallet invoice, the token amount to send; for a Toman receipt, the Toman amount (IRT). null only while a customer still has to choose the token.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
valueMoneynullableamount valued 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.
feePayerenumWho pays SwapWallet's fee. Temporary-wallet invoices always use APPLICATION.
Possible values
APPLICATIONYour business: deducted from what you receive.USERThe customer: added to what they pay.feeAmountMoneynullableSwapWallet's fee on this invoice, in the unit of paidAmount. Final once the invoice is paid; null or an estimate before that.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paymentLinksarray of objectsAlways empty here and in webhooks. Toman receipts return their links when you create them; temporary-wallet invoices use wallet.deepLinks.
paidAmountMoneynullableTotal received so far, before SwapWallet's fee. For blockchain payments it adds up every confirmed transfer, so it can be below amount (a partial payment) or above it. For a Toman receipt it's in the token the payment was converted to. null until the first payment.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paidAtISO 8601 timestampnullableWhen the first payment arrived. It's set by a transfer that doesn't cover the invoice too, so decide on status, not on paidAt.
blockchainStatusenumnullableWhat SwapWallet sees on the network for this invoice. null when it was paid from a SwapWallet account.
Possible values
NOT_SEENNo transfer to the address yet.NOT_CONFIRMA transfer is on the network but isn't confirmed yet.CONFIRMEDA transfer is confirmed.userIdstringnullableThe userId you sent.
userEmailstringnullableThe userEmail you sent.
userPhoneNumberstringnullableThe userPhoneNumber you sent.
userTelegramIdintegernullableThe userTelegramId you sent.
userDisplayNamestringnullableThe userDisplayName you sent.
lockHoursintegerHours the payment stays in your business balance before it's settled to the owner's account. Set when the invoice is paid; 0 before that.
expiredAtISO 8601 timestampWhen the invoice stops accepting payment.
createdAtISO 8601 timestampWhen the invoice was created.
{
"id": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "ACTIVE",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": {
"network": "BSC",
"token": "USDT",
"address": "0xD54960E24Ff910731C04798937a60551879e8726",
"validUntil": "2026-11-23T10:12:04.318227Z",
"deepLinks": [
{
"name": "SWAP_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/swapwallet.png",
"url": "https://t.me/swapwalletbot/app?startapp=app-invoice-bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"urlType": "WEB_APP",
"textFa": "واریز از سواپولت"
},
{
"name": "TRUST_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/trust-wallet.png",
"url": "https://link.trustwallet.com/send?asset=c20000714_t0x55d398326f99059fF775485246999027B3197955&address=0xD54960E24Ff910731C04798937a60551879e8726&amount=9.18",
"urlType": "URL",
"textFa": "واریز از تراستولت"
}
]
},
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": null,
"paymentLinks": [],
"paidAmount": null,
"paidAt": null,
"blockchainStatus": "NOT_SEEN",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}What you get back when you create an invoice: the address to show the customer, the exact amount to send, and links that open a wallet app with both filled in.
idUUIDID of the new invoice.
walletAddressstringAddress the customer sends amount.amount to, on the network you chose.
linksarray of objectsLinks that open a wallet app with the transfer filled in. Which apps appear depends on your business settings and the token; the SwapWallet link appears only when you send userTelegramId.
nameenumThe wallet app.
Possible values
SWAP_WALLETSwapWallet, in Telegram.SWAP_WALLET_WEBSITESwapWallet, on the web.TRUST_WALLETTrust Wallet.METAMASKMetaMask.TON_KEEPERTonkeeper. TON only.TONHUBTonhub. TON only.MYTONWALLETMyTonWallet. TON only.BITYCLEBitycle.logostringURL of the app's logo.
urlstringnullableLink that opens the app with the address and amount filled in.
urlTypeenumHow the link opens.
Possible values
WEB_APPAs a Telegram mini app.URLAs a regular web or app link.textFastringPersian label for the button, such as «واریز از سواپولت».
amountobjectWhat the customer must pay.
amountMoneyExact amount to send, in allowedToken. Show this number to the customer as is.
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.
userCurrencyValueMoneyValue in Toman (IRT).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
expiredAtISO 8601 timestampWhen the invoice stops accepting payment.
createdAtISO 8601 timestampWhen the invoice was created.
{
"id": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"walletAddress": "0xD54960E24Ff910731C04798937a60551879e8726",
"links": [
{
"name": "SWAP_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/swapwallet.png",
"url": "https://t.me/swapwalletbot/app?startapp=app-invoice-bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"urlType": "WEB_APP",
"textFa": "واریز از سواپولت"
},
{
"name": "TRUST_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/trust-wallet.png",
"url": "https://link.trustwallet.com/send?asset=c20000714_t0x55d398326f99059fF775485246999027B3197955&address=0xD54960E24Ff910731C04798937a60551879e8726&amount=9.18",
"urlType": "URL",
"textFa": "واریز از تراستولت"
}
],
"amount": {
"amount": {
"number": "9.18",
"unit": "USDT"
},
"usdValue": {
"number": "9.18",
"unit": "USD"
},
"userCurrencyValue": {
"number": "2500632",
"unit": "IRT"
}
},
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}/v1/merchants/invoices/temporary-walletCreates an invoice with a temporary wallet for one token on one network, and returns the address and the exact amount the customer must send.
Set amount in any currency SwapWallet prices: IRT, USD, or a token such as USDT. SwapWallet converts it into allowedToken at the current rate, rounds it up, and returns the result in amount.amount. Show the customer that number exactly, with walletAddress and the network.
allowedToken | network |
|---|---|
USDT | TRON, BSC, TON |
TON | TON |
TRX | TRON |
SwapWallet enables temporary-wallet invoices per business, and only for a verified business. SwapWallet's fee is always paid by your business on these invoices.
Show the address only until expiredAt. Transfers to it are credited to this invoice for 12 hours after it expires; after that the address can be given to another invoice.
underPaidCoveragePercent is the share of amount that must arrive, not the shortfall you accept: with 60, the invoice becomes PAID once 60% of amount has arrived. Leave it out to require the full amount.
amountMoneyRequiredThe price. Must be greater than zero.
numberdecimal stringRequiredThe amount, such as "2500000".
unitstringRequiredCurrency of number: IRT (Toman), USD, or a token code such as USDT.
allowedTokenenumRequiredToken the customer pays with.
Possible values
USDTTONTRXnetworkenumRequiredNetwork the customer sends on. See the table above for the pairs that work.
Possible values
TRONBSCTONttlintegerRequiredHow long the invoice accepts payment, in seconds.
orderIdstringYour ID for the order. Unique per business: a second invoice with the same orderId is rejected.
webhookUrlstringWhere to send this invoice's webhooks. Overrides your business webhook URL.
returnUrlstringWhere SwapWallet sends the customer after they pay on a SwapWallet page.
underPaidCoveragePercentdecimalMarks the invoice PAID once the confirmed transfers reach this percentage of amount. 0 requires the full amount.
descriptionstringWhat the payment is for. Shown to the customer on SwapWallet pages and in your panel.
customDatastringAny text you want kept with the invoice and returned unchanged, such as a JSON string.
userIdstringYour ID for the customer. Shown with the invoice in your panel.
userEmailstringThe customer's email address.
userPhoneNumberstringThe customer's phone number, such as +989123334455.
userTelegramIdintegerThe customer's Telegram user ID. The SwapWallet payment link appears in links only when you send it.
userDisplayNamestringThe customer's name, shown in your panel.
userLanguageenumLanguage of SwapWallet pages and messages for this customer.
Possible values
FAPersianENEnglishRURussianZHChineseFRFrenchITItalianDEGermanESSpanishKOKoreanReturns a Temporary wallet object. For the full invoice, call Retrieve an invoice with its id.
API_DISABLEDTemporary-wallet invoices aren't enabled for your business.
APPLICATION_NOT_VERIFIEDYour business isn't verified yet.
DUPLICATE_EXTERNAL_IDAn invoice with this orderId already exists. Retrieve it instead.
INVALID_TOKEN_ENUMallowedToken and network aren't a supported pair, or the token can't be deposited right now.
INVALID_NETWORKDeposits of the token on this network are paused.
MINIMUM_APPLICATION_INVOICE_DIDNT_MEETThe converted amount is below the token's minimum.
curl -X POST https://swapwallet.app/api/v1/merchants/invoices/temporary-wallet \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": {
"number": "2500000",
"unit": "IRT"
},
"allowedToken": "USDT",
"network": "BSC",
"ttl": 3600,
"orderId": "ORD-1042",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1042",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"userLanguage": "FA"
}'const response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/temporary-wallet', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: {
number: '2500000',
unit: 'IRT',
},
allowedToken: 'USDT',
network: 'BSC',
ttl: 3600,
orderId: 'ORD-1042',
description: 'Spotify Premium, 1 month',
customData: '{"cartId":"c-88412"}',
webhookUrl: 'https://pixelshop.example/webhooks/swapwallet',
returnUrl: 'https://pixelshop.example/orders/1042',
userId: 'u-58213',
userEmail: 'parsa@example.com',
userPhoneNumber: '+989123334455',
userTelegramId: 974181500,
userDisplayName: 'Parsa',
userLanguage: 'FA',
}),
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.post(
"https://swapwallet.app/api/v1/merchants/invoices/temporary-wallet",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
json={
"amount": {
"number": "2500000",
"unit": "IRT",
},
"allowedToken": "USDT",
"network": "BSC",
"ttl": 3600,
"orderId": "ORD-1042",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1042",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"userLanguage": "FA",
},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/temporary-wallet');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => [
'number' => '2500000',
'unit' => 'IRT',
],
'allowedToken' => 'USDT',
'network' => 'BSC',
'ttl' => 3600,
'orderId' => 'ORD-1042',
'description' => 'Spotify Premium, 1 month',
'customData' => '{"cartId":"c-88412"}',
'webhookUrl' => 'https://pixelshop.example/webhooks/swapwallet',
'returnUrl' => 'https://pixelshop.example/orders/1042',
'userId' => 'u-58213',
'userEmail' => 'parsa@example.com',
'userPhoneNumber' => '+989123334455',
'userTelegramId' => 974181500,
'userDisplayName' => 'Parsa',
'userLanguage' => 'FA',
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"amount": {
"number": "2500000",
"unit": "IRT"
},
"allowedToken": "USDT",
"network": "BSC",
"ttl": 3600,
"orderId": "ORD-1042",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1042",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"userLanguage": "FA"
}`)
req, _ := http.NewRequest("POST", "https://swapwallet.app/api/v1/merchants/invoices/temporary-wallet", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
req.Header.Set("Content-Type", "application/json")
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": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"walletAddress": "0xD54960E24Ff910731C04798937a60551879e8726",
"links": [
{
"name": "SWAP_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/swapwallet.png",
"url": "https://t.me/swapwalletbot/app?startapp=app-invoice-bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"urlType": "WEB_APP",
"textFa": "واریز از سواپولت"
},
{
"name": "TRUST_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/trust-wallet.png",
"url": "https://link.trustwallet.com/send?asset=c20000714_t0x55d398326f99059fF775485246999027B3197955&address=0xD54960E24Ff910731C04798937a60551879e8726&amount=9.18",
"urlType": "URL",
"textFa": "واریز از تراستولت"
}
],
"amount": {
"amount": {
"number": "9.18",
"unit": "USDT"
},
"usdValue": {
"number": "9.18",
"unit": "USD"
},
"userCurrencyValue": {
"number": "2500632",
"unit": "IRT"
}
},
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
}/v1/merchants/invoices/full-dataLists your invoices, newest first by default. Each item has the fields of Retrieve an invoice except the temporary wallet: wallet is always null here.
Status filters follow the clock: an unpaid invoice counts as EXPIRED from the moment expiredAt passes. To find settled invoices, filter by PAID and read status; filtering by SETTLED returns nothing.
limitintegerNumber of items per page.
pageintegerPage number, starting at 0.
sortedByenumField to sort by. Any other value sorts by createdAt.
Possible values
createdAtpaidAtexpiredAtamountdirectionenumSort order.
Possible values
DESCNewest or largest first.ASCOldest or smallest first.searchstringReturns invoices whose orderId or support code, or the support code of one of their transactions, contains this text. Ignores case.
invoiceStatusesarray of enumsReturns only these statuses. Repeat the parameter for more than one. PAID also returns settled invoices.
Possible values
ACTIVEUnpaid, and expiredAt is still ahead.PAIDPaid, settled or not.EXPIREDUnpaid, and expiredAt has passed.CANCELEDCanceled.invoiceTypesarray of enumsReturns only these types. Repeat the parameter for more than one.
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.Returns a page of Invoice objects in result.data, along with page, perPage, totalItems and totalPages.
curl -G https://swapwallet.app/api/v1/merchants/invoices/full-data \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY" \
-d invoiceStatuses=ACTIVE \
-d invoiceStatuses=PAIDconst response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/full-data?invoiceStatuses=ACTIVE&invoiceStatuses=PAID', {
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/invoices/full-data",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
params={"invoiceStatuses": ["ACTIVE", "PAID"]},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/full-data?invoiceStatuses=ACTIVE&invoiceStatuses=PAID');
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/invoices/full-data?invoiceStatuses=ACTIVE&invoiceStatuses=PAID", 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": "e41f7c2a-9b5d-4c8e-a1f3-6d2b8e0c4a17",
"supportCode": "AI-3TQW8ZN-P2KD",
"status": "ACTIVE",
"description": "Netflix Premium, 1 month",
"customData": null,
"wallet": null,
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "EN",
"returnUrl": null,
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1043",
"amount": {
"number": "25",
"unit": "USDT"
},
"value": {
"number": "25",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": null,
"paymentLinks": [],
"paidAmount": null,
"paidAt": null,
"blockchainStatus": "NOT_CONFIRM",
"userId": "u-60117",
"userEmail": null,
"userPhoneNumber": null,
"userTelegramId": null,
"userDisplayName": null,
"lockHours": 0,
"expiredAt": "2026-11-23T10:40:15.901873Z",
"createdAt": "2026-11-23T09:40:15.902114Z"
},
{
"id": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "SETTLED",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": null,
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": {
"number": "0.0918",
"unit": "USDT"
},
"paymentLinks": [],
"paidAmount": {
"number": "9.18",
"unit": "USDT"
},
"paidAt": "2026-11-23T09:19:41.552904Z",
"blockchainStatus": "CONFIRMED",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
]
}
}/v1/merchants/invoices/by-order-id/{orderId}Retrieves the invoice you created with this orderId. Use it when you kept only your own order ID, or to check whether a create request that timed out went through before you send it again.
wallet is always null in this response. For the address, call Retrieve an invoice with the invoice's id.
orderIdstringRequiredThe orderId you sent when you created the invoice.
Returns an Invoice object.
INVOICE_NOT_FOUNDYour business has no invoice with this orderId.
curl https://swapwallet.app/api/v1/merchants/invoices/by-order-id/ORD-1042 \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/by-order-id/ORD-1042', {
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/invoices/by-order-id/ORD-1042",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/by-order-id/ORD-1042');
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/invoices/by-order-id/ORD-1042", 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": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "SETTLED",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": null,
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": {
"number": "0.0918",
"unit": "USDT"
},
"paymentLinks": [],
"paidAmount": {
"number": "9.18",
"unit": "USDT"
},
"paidAt": "2026-11-23T09:19:41.552904Z",
"blockchainStatus": "CONFIRMED",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
}/v1/merchants/invoices/{invoiceId}Retrieves an invoice by its ID, with the temporary wallet the customer pays into.
Call it before you fulfill an order to confirm the payment, or poll it if you don't use webhooks. wallet.deepLinks empties once the invoice is no longer ACTIVE.
invoiceIdUUIDRequiredID of the invoice.
Returns an Invoice object.
INVOICE_NOT_FOUNDYour business has no invoice with this ID.
curl https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f', {
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/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f');
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/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f", 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": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "ACTIVE",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": {
"network": "BSC",
"token": "USDT",
"address": "0xD54960E24Ff910731C04798937a60551879e8726",
"validUntil": "2026-11-23T10:12:04.318227Z",
"deepLinks": [
{
"name": "SWAP_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/swapwallet.png",
"url": "https://t.me/swapwalletbot/app?startapp=app-invoice-bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"urlType": "WEB_APP",
"textFa": "واریز از سواپولت"
},
{
"name": "TRUST_WALLET",
"logo": "https://swapwallet.app/media/public/assets/wallets/trust-wallet.png",
"url": "https://link.trustwallet.com/send?asset=c20000714_t0x55d398326f99059fF775485246999027B3197955&address=0xD54960E24Ff910731C04798937a60551879e8726&amount=9.18",
"urlType": "URL",
"textFa": "واریز از تراستولت"
}
]
},
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": null,
"paymentLinks": [],
"paidAmount": null,
"paidAt": null,
"blockchainStatus": "NOT_SEEN",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
}{
"status": "OK",
"result": {
"id": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "SETTLED",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": {
"network": "BSC",
"token": "USDT",
"address": "0xD54960E24Ff910731C04798937a60551879e8726",
"validUntil": "2026-11-23T10:12:04.318227Z",
"deepLinks": []
},
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": {
"number": "0.0918",
"unit": "USDT"
},
"paymentLinks": [],
"paidAmount": {
"number": "9.18",
"unit": "USDT"
},
"paidAt": "2026-11-23T09:19:41.552904Z",
"blockchainStatus": "CONFIRMED",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
}