A Toman receipt asks a customer for a fixed amount in Toman. The customer opens the payment link, signs in to SwapWallet and pays the Toman amount. SwapWallet converts the payment into token (USDT unless you choose another) at the rate of that moment and credits your business balance with the result, minus its fee.
A receipt is an invoice. Once it's created, track it with the invoice endpoints and receive the same invoice-paid webhook. Its amount is in IRT, while paidAmount and feeAmount are in the token it was converted to; its type is FIAT_INVOICE, and its payment shows up as an INTERNAL_PAYMENT transaction.
Toman receipts are off by default. Ask SwapWallet support to enable them for your business.
Endpoints
What you get back when you create a Toman receipt: its ID and the links to send the customer to.
idUUIDID of the receipt. Use it with the invoice endpoints.
paymentLinksarray of objectsWhere the customer pays. Both open the same payment page.
typeenumWhere the link opens.
Possible values
TELEGRAM_WEBAPPIn SwapWallet's Telegram mini app.WEBSITEOn swapwallet.app, in the browser.urlstringThe link.
expiredAtISO 8601 timestampWhen the receipt stops accepting payment.
createdAtISO 8601 timestampWhen the receipt was created.
{
"id": "cc8ad7e1-41df-4d02-8f8c-6e4726de19c2",
"paymentLinks": [
{
"type": "TELEGRAM_WEBAPP",
"url": "https://t.me/swapwalletbot/app?startapp=xp-resid-cc8ad7e1-41df-4d02-8f8c-6e4726de19c2"
},
{
"type": "WEBSITE",
"url": "https://swapwallet.app/webapp/express-resid/invoice?id=cc8ad7e1-41df-4d02-8f8c-6e4726de19c2"
}
],
"expiredAt": "2026-11-23T11:02:30.552190Z",
"createdAt": "2026-11-23T10:32:30.552417Z"
}/v1/merchants/residCreates a Toman receipt and returns the links where the customer pays it.
The customer pays exactly amount in Toman. What your business receives in token depends on the rate when they pay, so read paidAmount on the invoice once it's paid.
amountMoneyRequiredAmount to charge, in Toman. Must be greater than zero.
numberdecimal stringRequiredAmount in Toman, such as "1500000".
unitstringRequiredMust be IRT.
ttlintegerRequiredHow long the receipt accepts payment, in seconds.
tokenstringToken the payment is converted to and credited in. It must have an active Toman market on SwapWallet.
orderIdstringYour ID for the order. Unique per business, shared with invoices.
webhookUrlstringWhere to send this receipt's webhooks. Overrides your business webhook URL.
returnUrlstringWhere the customer goes after paying.
descriptionstringWhat the payment is for, shown on the payment page. A generic title is shown when you leave it out.
customDatastringAny text you want kept with the receipt and returned unchanged.
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. The payment page suggests it to the customer.
userTelegramIdintegerThe customer's Telegram user ID.
userDisplayNamestringThe customer's name, shown in your panel.
userLanguageenumLanguage of the payment page.
Possible values
FAPersianENEnglishRURussianZHChineseFRFrenchITItalianDEGermanESSpanishKOKoreanReturns a Toman receipt object.
API_DISABLEDToman receipts aren't enabled for your business.
amount.unit isn't IRT, or the body is invalid.
DUPLICATE_EXTERNAL_IDAn invoice or receipt with this orderId already exists.
MINIMUM_APPLICATION_INVOICE_DIDNT_MEETThe amount is below the minimum for token.
MARKET_IS_NOT_ACTIVEtoken has no active Toman market right now.
curl -X POST https://swapwallet.app/api/v1/merchants/resid \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": {
"number": "1500000",
"unit": "IRT"
},
"ttl": 1800,
"orderId": "ORD-1050",
"description": "Order #1050",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1050",
"userId": "u-58213",
"userPhoneNumber": "+989123334455",
"userDisplayName": "Parsa",
"userLanguage": "FA"
}'const response = await fetch('https://swapwallet.app/api/v1/merchants/resid', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: {
number: '1500000',
unit: 'IRT',
},
ttl: 1800,
orderId: 'ORD-1050',
description: 'Order #1050',
webhookUrl: 'https://pixelshop.example/webhooks/swapwallet',
returnUrl: 'https://pixelshop.example/orders/1050',
userId: 'u-58213',
userPhoneNumber: '+989123334455',
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/resid",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
json={
"amount": {
"number": "1500000",
"unit": "IRT",
},
"ttl": 1800,
"orderId": "ORD-1050",
"description": "Order #1050",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1050",
"userId": "u-58213",
"userPhoneNumber": "+989123334455",
"userDisplayName": "Parsa",
"userLanguage": "FA",
},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/resid');
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' => '1500000',
'unit' => 'IRT',
],
'ttl' => 1800,
'orderId' => 'ORD-1050',
'description' => 'Order #1050',
'webhookUrl' => 'https://pixelshop.example/webhooks/swapwallet',
'returnUrl' => 'https://pixelshop.example/orders/1050',
'userId' => 'u-58213',
'userPhoneNumber' => '+989123334455',
'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": "1500000",
"unit": "IRT"
},
"ttl": 1800,
"orderId": "ORD-1050",
"description": "Order #1050",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"returnUrl": "https://pixelshop.example/orders/1050",
"userId": "u-58213",
"userPhoneNumber": "+989123334455",
"userDisplayName": "Parsa",
"userLanguage": "FA"
}`)
req, _ := http.NewRequest("POST", "https://swapwallet.app/api/v1/merchants/resid", 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": "cc8ad7e1-41df-4d02-8f8c-6e4726de19c2",
"paymentLinks": [
{
"type": "TELEGRAM_WEBAPP",
"url": "https://t.me/swapwalletbot/app?startapp=xp-resid-cc8ad7e1-41df-4d02-8f8c-6e4726de19c2"
},
{
"type": "WEBSITE",
"url": "https://swapwallet.app/webapp/express-resid/invoice?id=cc8ad7e1-41df-4d02-8f8c-6e4726de19c2"
}
],
"expiredAt": "2026-11-23T11:02:30.552190Z",
"createdAt": "2026-11-23T10:32:30.552417Z"
}
}