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

Toman receipts

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.

The Toman receipt object

What you get back when you create a Toman receipt: its ID and the links to send the customer to.

Attributes

  • idUUID

    ID of the receipt. Use it with the invoice endpoints.

  • expiredAtISO 8601 timestamp

    When the receipt stops accepting payment.

  • createdAtISO 8601 timestamp

    When the receipt was created.

The Toman receipt object
{
  "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"
}

Create a Toman receipt

POST/v1/merchants/resid

Creates 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.

Body parameters

  • amountMoneyRequired

    Amount to charge, in Toman. Must be greater than zero.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      Amount in Toman, such as "1500000".

    • unitstringRequired

      Must be IRT.

  • ttlintegerRequired

    How long the receipt accepts payment, in seconds.

    300 to 86400 (24 hours)

  • tokenstring

    Token the payment is converted to and credited in. It must have an active Toman market on SwapWallet.

    Default: USDT

  • orderIdstring

    Your ID for the order. Unique per business, shared with invoices.

    Up to 255 characters

  • webhookUrlstring

    Where to send this receipt's webhooks. Overrides your business webhook URL.

    A valid URL, up to 255 characters

  • returnUrlstring

    Where the customer goes after paying.

    A valid URL, up to 255 characters

  • descriptionstring

    What the payment is for, shown on the payment page. A generic title is shown when you leave it out.

    Up to 512 characters

  • customDatastring

    Any text you want kept with the receipt and returned unchanged.

    Up to 512 characters

  • userIdstring

    Your ID for the customer. Shown with the invoice in your panel.

    Up to 255 characters

  • userEmailstring

    The customer's email address.

    A valid email address, up to 320 characters

  • userPhoneNumberstring

    The customer's phone number, such as +989123334455. The payment page suggests it to the customer.

    Up to 16 characters

  • userTelegramIdinteger

    The customer's Telegram user ID.

    0 or more

  • userDisplayNamestring

    The customer's name, shown in your panel.

    Up to 255 characters

  • userLanguageenum

    Language of the payment page.

    Default: FA

    Possible values

    • FAPersian
    • ENEnglish
    • RURussian
    • ZHChinese
    • FRFrench
    • ITItalian
    • DEGerman
    • ESSpanish
    • KOKorean

Returns

Errors

  • 400API_DISABLED

    Toman receipts aren't enabled for your business.

  • 400

    amount.unit isn't IRT, or the body is invalid.

  • 400DUPLICATE_EXTERNAL_ID

    An invoice or receipt with this orderId already exists.

  • 400MINIMUM_APPLICATION_INVOICE_DIDNT_MEET

    The amount is below the minimum for token.

  • 404MARKET_IS_NOT_ACTIVE

    token has no active Toman market right now.

POST/v1/merchants/resid
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"
}'
Response
{
  "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"
  }
}