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

Telegram services

Buy Telegram products for any Telegram user straight from your SwapWallet balance.

Stars and Premium take one call. You pay in USDT at the product’s price from Shop prices, the payment is taken at once, and delivery to the Telegram account follows automatically. The result is a PAYMENT transaction.

Telegram Ads takes two calls:

  1. Create a Telegram Ads top-up. This creates an invoice for the top-up amount plus a 1 TON + 1% fee, valid for 3 minutes. Nothing is charged yet.
  2. Pay the invoice. The ads account is then topped up with the amount you asked for.

Paying from your balance counts toward your crypto withdrawal limits, and the 72-hour rule applies to it (see Crypto withdrawals). Premium for your own Telegram account is the exception: it can be paid with crypto still under that rule.

The Telegram username isn’t checked before payment. If delivery fails, for example because the username doesn’t exist, contact support; a refund comes back as a CREDIT transaction of type JETTON_REFUND.

The Invoice object

A bill to be paid from your balance, such as a Telegram Ads top-up. Purchases embed it as payment.invoice.

Attributes

  • idintegerRequired

    Invoice ID. Pass it to Pay an invoice.

  • supportCodestringRequired

    Code to quote to support.

  • statusenumRequired

    Where the invoice stands.

    Possible values

    • PENDINGWaiting for payment.
    • PAIDPaid.
    • DELIVEREDPaid and the product delivered.
    • EXPIREDNot paid before expiredAt.
    • CANCELEDCanceled.
  • titlestringRequired

    Machine-readable product title, such as TELEGRAM_STARS, TELEGRAM_PREMIUM or TELEGRAM_ADS.

  • readableTitlestringnullable

    Product title in your account’s language.

  • typeenumRequired

    What the invoice is for.

    Possible values

    • JETTONTelegram Premium or Stars from the shop.
    • TELEGRAM_ADSA Telegram Ads top-up.
    • SHOP_ORDERAn order from the SwapWallet shop.
    • GIFT_CARDA gift card.
    • EXTERNAL_APPLICATIONA payment to a merchant’s payment gateway.
    • GIVEAWAYA giveaway.
    • AD_CHEQUEAn ad cheque.
    • AD_CHEQUE_TOP_UPAn ad cheque top-up.
    • HONGBAO_PACKETA red-envelope (hongbao) packet.
    • EXTRA_USER_WALLETAn extra wallet for your account.
    • AI_CREDITAI credit.
  • amountMoneyRequired

    Amount to pay, fee included.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • valueMoneyRequired

    amount in Toman (IRT).

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • allowedPaymentTokensarray of stringsRequired

    Tokens the invoice accepts in the app.

  • allowedLockedFundsbooleanRequired

    Whether the invoice may be paid with crypto still held by the 72-hour rule (see Crypto withdrawals).

  • feeMoneyRequired

    Fee included in amount.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • createdAtISO 8601 timestampRequired

    When the invoice was created.

  • expiredAtISO 8601 timestampnullable

    Payment deadline.

  • paidWithMoneynullable

    What it was paid with. null until paid.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • paidAtISO 8601 timestampnullable

    When it was paid. null until then.

  • originalAmountMoneynullable

    Amount before a discount code. null without one.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • discountAmountMoneynullable

    Discount applied. null without one.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • discountCodestringnullable

    Discount code applied. null without one.

The Invoice object
{
  "id": 98251,
  "supportCode": "NN-7KQ2M4D-XR3T",
  "status": "PENDING",
  "title": "TELEGRAM_ADS",
  "readableTitle": "شارژ تبلیغات تلگرام",
  "type": "TELEGRAM_ADS",
  "amount": {
    "number": "21.2",
    "unit": "TON"
  },
  "value": {
    "number": "5659340",
    "unit": "IRT"
  },
  "allowedPaymentTokens": [
    "USDT",
    "IRT",
    "TON"
  ],
  "allowedLockedFunds": false,
  "fee": {
    "number": "1.2",
    "unit": "TON"
  },
  "createdAt": "2026-11-20T11:20:00.204517Z",
  "expiredAt": "2026-11-20T11:23:00.204517Z",
  "paidWith": null,
  "paidAt": null,
  "originalAmount": null,
  "discountAmount": null,
  "discountCode": null
}

The Telegram Ads top-up object

A top-up of a Telegram Ads account and the invoice that pays for it.

Attributes

  • idintegerRequired

    Top-up ID.

  • accountstringRequired

    The Telegram Ads account ID.

  • amountMoneyRequired

    Amount the ads account receives, in TON, without the fee.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

  • invoiceobjectRequired

    The invoice to pay: amount plus the fee. Pass its id and amount to Pay an invoice.

    Show child attributesHide child attributes
    • idintegerRequired

      Invoice ID. Pass it to Pay an invoice.

    • supportCodestringRequired

      Code to quote to support.

    • statusenumRequired

      Where the invoice stands.

      Possible values

      • PENDINGWaiting for payment.
      • PAIDPaid.
      • DELIVEREDPaid and the product delivered.
      • EXPIREDNot paid before expiredAt.
      • CANCELEDCanceled.
    • titlestringRequired

      Machine-readable product title, such as TELEGRAM_STARS, TELEGRAM_PREMIUM or TELEGRAM_ADS.

    • readableTitlestringnullable

      Product title in your account’s language.

    • typeenumRequired

      What the invoice is for.

      Possible values

      • JETTONTelegram Premium or Stars from the shop.
      • TELEGRAM_ADSA Telegram Ads top-up.
      • SHOP_ORDERAn order from the SwapWallet shop.
      • GIFT_CARDA gift card.
      • EXTERNAL_APPLICATIONA payment to a merchant’s payment gateway.
      • GIVEAWAYA giveaway.
      • AD_CHEQUEAn ad cheque.
      • AD_CHEQUE_TOP_UPAn ad cheque top-up.
      • HONGBAO_PACKETA red-envelope (hongbao) packet.
      • EXTRA_USER_WALLETAn extra wallet for your account.
      • AI_CREDITAI credit.
    • amountMoneyRequired

      Amount to pay, fee included.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • valueMoneyRequired

      amount in Toman (IRT).

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • allowedPaymentTokensarray of stringsRequired

      Tokens the invoice accepts in the app.

    • allowedLockedFundsbooleanRequired

      Whether the invoice may be paid with crypto still held by the 72-hour rule (see Crypto withdrawals).

    • feeMoneyRequired

      Fee included in amount.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • createdAtISO 8601 timestampRequired

      When the invoice was created.

    • expiredAtISO 8601 timestampnullable

      Payment deadline.

    • paidWithMoneynullable

      What it was paid with. null until paid.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • paidAtISO 8601 timestampnullable

      When it was paid. null until then.

    • originalAmountMoneynullable

      Amount before a discount code. null without one.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • discountAmountMoneynullable

      Discount applied. null without one.

      Show child attributesHide child attributes
      • numberdecimal stringRequired

        The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

      • unitstringRequired

        The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

    • discountCodestringnullable

      Discount code applied. null without one.

  • createdAtISO 8601 timestampRequired

    When the top-up was created.

The Telegram Ads top-up object
{
  "id": 214,
  "account": "PtYgjmUhBel31iEl2hpChYgCfrL1spNxnyVmihA-2O7",
  "amount": {
    "number": "20",
    "unit": "TON"
  },
  "invoice": {
    "id": 98251,
    "supportCode": "NN-7KQ2M4D-XR3T",
    "status": "PENDING",
    "title": "TELEGRAM_ADS",
    "readableTitle": "شارژ تبلیغات تلگرام",
    "type": "TELEGRAM_ADS",
    "amount": {
      "number": "21.2",
      "unit": "TON"
    },
    "value": {
      "number": "5659340",
      "unit": "IRT"
    },
    "allowedPaymentTokens": [
      "USDT",
      "IRT",
      "TON"
    ],
    "allowedLockedFunds": false,
    "fee": {
      "number": "1.2",
      "unit": "TON"
    },
    "createdAt": "2026-11-20T11:20:00.204517Z",
    "expiredAt": "2026-11-20T11:23:00.204517Z",
    "paidWith": null,
    "paidAt": null,
    "originalAmount": null,
    "discountAmount": null,
    "discountCode": null
  },
  "createdAt": "2026-11-20T11:20:00.211583Z"
}

Buy Telegram Stars

POST/v1/shop/telegram/stars

Buys Telegram Stars for a Telegram user and pays for them from your USDT balance at once. The stars are then delivered to that account automatically.

The counts you can buy are the TG-STARS-{count} products in List shop prices.

Body parameters

  • usernamestringRequired

    Telegram username of the recipient, without the @.

  • countintegerRequired

    Number of stars.

    A count with a TG-STARS-{count} product, such as 100, 250, 500, 1000 or 5000

Returns

Returns the Transaction object of the payment, with type PAYMENT.

Errors

  • 404PRODUCT_NOT_FOUND

    There is no product for this count.

  • 400INSUFFICIENT_USER_BALANCE

    Your USDT balance doesn’t cover the price.

  • 400USER_BALANCE_LOCKED

    The USDT needed is still under the 72-hour rule.

  • 400LIMIT_DAILY_WITHDRAW_EXCEEDED

    Over your daily crypto withdrawal limit, which payments count toward.

  • 403SHOP_CLOSED_FOR_USER

    The shop isn’t available for this account. Accounts created in Telegram need an Iranian phone number on them.

POST/v1/shop/telegram/stars
curl -X POST https://swapwallet.app/api/v1/shop/telegram/stars \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "username": "maryam_kz",
  "count": 100
}'
Response
{
  "status": "OK",
  "result": {
    "id": 3053015,
    "supportCode": "SW-HCPDS6V-PWAN",
    "timestamp": 1795172709000,
    "type": "PAYMENT",
    "status": "SUCCEED",
    "network": "INTERNAL",
    "exchangeFee": {
      "number": "0",
      "unit": "USDT"
    },
    "payment": {
      "invoice": {
        "id": 98214,
        "supportCode": "NN-2HFN9B9-NK8R",
        "status": "PAID",
        "title": "TELEGRAM_STARS",
        "readableTitle": "تلگرام استارز",
        "type": "JETTON",
        "amount": {
          "number": "1.65",
          "unit": "USDT"
        },
        "value": {
          "number": "449460",
          "unit": "IRT"
        },
        "allowedPaymentTokens": [
          "USDT",
          "IRT",
          "TON"
        ],
        "allowedLockedFunds": false,
        "fee": {
          "number": "0",
          "unit": "USDT"
        },
        "createdAt": "2026-11-20T11:05:08.912344Z",
        "expiredAt": "2026-11-20T11:08:08.912344Z",
        "paidWith": {
          "number": "1.65",
          "unit": "USDT"
        },
        "paidAt": "2026-11-20T11:05:09.130557Z",
        "originalAmount": null,
        "discountAmount": null,
        "discountCode": null
      },
      "amount": {
        "number": "1.65",
        "unit": "USDT"
      },
      "value": {
        "number": "1.65",
        "unit": "USD"
      },
      "userCurrencyValue": {
        "number": "449460",
        "unit": "IRT"
      }
    }
  }
}

Buy Telegram Premium

POST/v1/shop/telegram/premium

Buys a Telegram Premium subscription for a Telegram user and pays for it from your USDT balance at once. The subscription is then activated on that account automatically.

Body parameters

  • usernamestringRequired

    Telegram username of the recipient, without the @.

  • monthsintegerRequired

    Length of the subscription, in months.

    Possible values

    • 3
    • 6
    • 12

Returns

Returns the Transaction object of the payment, with type PAYMENT.

Errors

  • 404PRODUCT_NOT_FOUND

    months isn’t 3, 6 or 12.

  • 400INSUFFICIENT_USER_BALANCE

    Your USDT balance doesn’t cover the price.

  • 400USER_BALANCE_LOCKED

    The USDT needed is still under the 72-hour rule, and the subscription isn’t for your own Telegram account.

  • 403SHOP_CLOSED_FOR_USER

    The shop isn’t available for this account.

POST/v1/shop/telegram/premium
curl -X POST https://swapwallet.app/api/v1/shop/telegram/premium \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "username": "ali_rezaei",
  "months": 3
}'
Response
{
  "status": "OK",
  "result": {
    "id": 3053094,
    "supportCode": "SW-R6BZ1KX-DE8F",
    "timestamp": 1795173012000,
    "type": "PAYMENT",
    "status": "SUCCEED",
    "network": "INTERNAL",
    "exchangeFee": {
      "number": "0",
      "unit": "USDT"
    },
    "payment": {
      "invoice": {
        "id": 98230,
        "supportCode": "NN-5TQW8VA-LM2C",
        "status": "PAID",
        "title": "TELEGRAM_PREMIUM",
        "readableTitle": "تلگرام پریمیوم",
        "type": "JETTON",
        "amount": {
          "number": "12.99",
          "unit": "USDT"
        },
        "value": {
          "number": "3538476",
          "unit": "IRT"
        },
        "allowedPaymentTokens": [
          "USDT",
          "IRT",
          "TON"
        ],
        "allowedLockedFunds": false,
        "fee": {
          "number": "0",
          "unit": "USDT"
        },
        "createdAt": "2026-11-20T11:10:11.774102Z",
        "expiredAt": "2026-11-20T11:13:11.774102Z",
        "paidWith": {
          "number": "12.99",
          "unit": "USDT"
        },
        "paidAt": "2026-11-20T11:10:12.018863Z",
        "originalAmount": null,
        "discountAmount": null,
        "discountCode": null
      },
      "amount": {
        "number": "12.99",
        "unit": "USDT"
      },
      "value": {
        "number": "12.99",
        "unit": "USD"
      },
      "userCurrencyValue": {
        "number": "3538476",
        "unit": "IRT"
      }
    }
  }
}

Create a Telegram Ads top-up

POST/v1/fragment/telegram/ads/recharge

Creates a top-up of a Telegram Ads account and the invoice to pay for it. Nothing is charged yet: pay the invoice within 3 minutes to complete it.

The invoice is the top-up amount plus a fee of 1 TON + 1% of the amount. For 20 TON, that’s 21.2 TON.

Body parameters

  • accountstringRequired

    Telegram Ads account ID, from the Telegram Ads platform.

    43 to 64 characters: letters, digits, _ and -

  • amountMoneyRequired

    Top-up amount, in TON, without the fee.

    At least 20 TON

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

Returns

Returns a Telegram Ads top-up object in result, with its invoice in PENDING.

Errors

  • 400VALIDATION_FAILED

    account isn’t 43 to 64 allowed characters.

  • 400TELEGRAM_ADS_MINIMUM_AMOUNT_NOT_MEET

    amount is below 20 TON.

  • 404INVALID_TOKEN_ENUM

    amount.unit isn’t TON.

  • 403SHOP_CLOSED_FOR_USER

    The shop isn’t available for this account.

POST/v1/fragment/telegram/ads/recharge
curl -X POST https://swapwallet.app/api/v1/fragment/telegram/ads/recharge \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "account": "PtYgjmUhBel31iEl2hpChYgCfrL1spNxnyVmihA-2O7",
  "amount": {
    "number": "20",
    "unit": "TON"
  }
}'
Response
{
  "status": "OK",
  "result": {
    "id": 214,
    "account": "PtYgjmUhBel31iEl2hpChYgCfrL1spNxnyVmihA-2O7",
    "amount": {
      "number": "20",
      "unit": "TON"
    },
    "invoice": {
      "id": 98251,
      "supportCode": "NN-7KQ2M4D-XR3T",
      "status": "PENDING",
      "title": "TELEGRAM_ADS",
      "readableTitle": "شارژ تبلیغات تلگرام",
      "type": "TELEGRAM_ADS",
      "amount": {
        "number": "21.2",
        "unit": "TON"
      },
      "value": {
        "number": "5659340",
        "unit": "IRT"
      },
      "allowedPaymentTokens": [
        "USDT",
        "IRT",
        "TON"
      ],
      "allowedLockedFunds": false,
      "fee": {
        "number": "1.2",
        "unit": "TON"
      },
      "createdAt": "2026-11-20T11:20:00.204517Z",
      "expiredAt": "2026-11-20T11:23:00.204517Z",
      "paidWith": null,
      "paidAt": null,
      "originalAmount": null,
      "discountAmount": null,
      "discountCode": null
    },
    "createdAt": "2026-11-20T11:20:00.211583Z"
  }
}

Pay an invoice

POST/v1/invoice/pay

Pays an invoice made out to you, such as a Telegram Ads top-up, from your balance. Send exactly the invoice’s amount: the same number in the same unit (TON for an Ads top-up). The invoice must still be PENDING and not past expiredAt.

Body parameters

  • idintegerRequired

    Invoice ID.

  • amountMoneyRequired

    The invoice’s amount, exactly.

    Show child attributesHide child attributes
    • numberdecimal stringRequired

      The amount as a decimal string. Trailing zeros are dropped, so 0.5, not 0.50.

    • unitstringRequired

      The token symbol, such as USDT, TON or BTC. IRT is the Toman; USD marks a value in US dollars.

Returns

Returns the Invoice object in result, now PAID.

Errors

  • 400INVOICE_AMOUNT_IS_DIFFERENT

    amount isn’t exactly the invoice’s amount.

  • 400WRONG_INVOICE_PAYMENT_METHOD

    amount.unit isn’t one of the invoice’s allowedPaymentTokens.

  • 400INVOICE_STATUS_IS_NOT_PAYABLE

    The invoice isn’t PENDING.

  • 400INVOICE_EXPIRED

    The invoice is past expiredAt. Create a new top-up.

  • 400INSUFFICIENT_USER_BALANCE

    Your balance doesn’t cover the invoice.

  • 400USER_BALANCE_LOCKED

    The funds needed are still under the 72-hour rule.

  • 404INVOICE_NOT_FOUND

    There is no invoice with this id.

  • 401UN_AUTHORIZATION

    The invoice was made out to another account.

POST/v1/invoice/pay
curl -X POST https://swapwallet.app/api/v1/invoice/pay \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 98251,
  "amount": {
    "number": "21.2",
    "unit": "TON"
  }
}'
Response
{
  "status": "OK",
  "result": {
    "id": 98251,
    "supportCode": "NN-7KQ2M4D-XR3T",
    "status": "PAID",
    "title": "TELEGRAM_ADS",
    "readableTitle": "شارژ تبلیغات تلگرام",
    "type": "TELEGRAM_ADS",
    "amount": {
      "number": "21.2",
      "unit": "TON"
    },
    "value": {
      "number": "5659340",
      "unit": "IRT"
    },
    "allowedPaymentTokens": [
      "USDT",
      "IRT",
      "TON"
    ],
    "allowedLockedFunds": false,
    "fee": {
      "number": "1.2",
      "unit": "TON"
    },
    "createdAt": "2026-11-20T11:20:00.204517Z",
    "expiredAt": "2026-11-20T11:23:00.204517Z",
    "paidWith": {
      "number": "21.2",
      "unit": "TON"
    },
    "paidAt": "2026-11-20T11:20:41.506930Z",
    "originalAmount": null,
    "discountAmount": null,
    "discountCode": null
  }
}