pub struct Invoice {Show 37 fields
pub invoice_id: u64,
pub hash: String,
pub currency_type: CurrencyType,
pub asset: Option<CryptoCurrencyCode>,
pub fiat: Option<FiatCurrencyCode>,
pub amount: Decimal,
pub paid_asset: Option<CryptoCurrencyCode>,
pub paid_amount: Option<Decimal>,
pub paid_fiat_rate: Option<Decimal>,
pub accept_asset: Option<Vec<CryptoCurrencyCode>>,
pub fee_asset: Option<String>,
pub fee_amount: Option<Decimal>,
pub bot_invoice_url: String,
pub mini_app_invoice_url: String,
pub web_app_invoice_url: String,
pub description: Option<String>,
pub status: InvoiceStatus,
pub swap_to: Option<SwapToAssets>,
pub is_swapped: Option<String>,
pub swapped_uid: Option<String>,
pub swapped_to: Option<SwapToAssets>,
pub swapped_rate: Option<Decimal>,
pub swapped_output: Option<Decimal>,
pub swapped_usd_amount: Option<Decimal>,
pub swapped_usd_rate: Option<Decimal>,
pub created_at: DateTime<Utc>,
pub paid_usd_rate: Option<Decimal>,
pub allow_comments: bool,
pub allow_anonymous: bool,
pub expires_date: Option<DateTime<Utc>>,
pub paid_at: Option<DateTime<Utc>>,
pub paid_anonymously: Option<bool>,
pub comment: Option<String>,
pub hidden_message: Option<String>,
pub payload: Option<String>,
pub paid_btn_name: Option<PayButtonName>,
pub paid_btn_url: Option<String>,
}Fields§
§invoice_id: u64Unique ID for this invoice.
hash: StringHash of the invoice.
currency_type: CurrencyTypeType of the price, can be “crypto” or “fiat”.
asset: Option<CryptoCurrencyCode>Optional. Cryptocurrency code. Available only if the value of the field currency_type is “crypto”. Currently, can be “USDT”, “TON”, “BTC”, “ETH”, “LTC”, “BNB”, “TRX” and “USDC” (and “JET” for testnet).
fiat: Option<FiatCurrencyCode>Optional. Fiat currency code. Available only if the value of the field currency_type is “fiat”. Currently one of “USD”, “EUR”, “RUB”, “BYN”, “UAH”, “GBP”, “CNY”, “KZT”, “UZS”, “GEL”, “TRY”, “AMD”, “THB”, “INR”, “BRL”, “IDR”, “AZN”, “AED”, “PLN” and “ILS”.
amount: DecimalAmount of the invoice for which the invoice was created.
paid_asset: Option<CryptoCurrencyCode>Optional. Cryptocurrency alphabetic code for which the invoice was paid. Available only if currency_type is “crypto” and status is “paid”.
paid_amount: Option<Decimal>Optional. Amount of the invoice for which the invoice was paid. Available only if currency_type is “fiat” and status is “paid”.
paid_fiat_rate: Option<Decimal>Optional. The rate of the paid_asset valued in the fiat currency. Available only if the value of the field currency_type is “fiat” and the value of the field status is “paid”.
accept_asset: Option<Vec<CryptoCurrencyCode>>Optional. List of assets which can be used to pay the invoice. Available only if currency_type is “fiat”. Currently, can be “USDT”, “TON”, “BTC”, “ETH”, “LTC”, “BNB”, “TRX” and “USDC” (“JET” for testnet).
fee_asset: Option<String>Optional. Asset of service fees charged when the invoice was paid. Available only if status is “paid”.
fee_amount: Option<Decimal>Optional. Amount of service fees charged when the invoice was paid. Available only if status is “paid”.
bot_invoice_url: StringURL should be provided to the user to pay the invoice.
mini_app_invoice_url: StringUse this URL to pay an invoice to the Telegram Mini App version.
web_app_invoice_url: StringUse this URL to pay an invoice to the Web version of Crypto Bot.
description: Option<String>Optional. Description for this invoice.
status: InvoiceStatusStatus of the transfer, can be “active”, “paid” or “expired”.
swap_to: Option<SwapToAssets>Optional. The asset that will be attempted to be swapped into after the user makes a payment (the swap is not guaranteed). Supported assets: “USDT”, “TON”, “TRX”, “ETH”, “SOL”, “BTC”, “LTC”.
is_swapped: Option<String>Optional. For invoices with the “paid” status, this flag indicates whether the swap was successful (only applicable if swap_to is set).
swapped_uid: Option<String>Optional. If is_swapped is true, stores the unique identifier of the swap.
swapped_to: Option<SwapToAssets>Optional. If is_swapped is true, stores the asset into which the swap was made.
swapped_rate: Option<Decimal>Optional. If is_swapped is true, stores the exchange rate at which the swap was executed.
swapped_output: Option<Decimal>Optional. If is_swapped is true, stores the amount received as a result of the swap (in the swapped_to asset).
swapped_usd_amount: Option<Decimal>Optional. If is_swapped is true, stores the resulting swap amount in USD.
swapped_usd_rate: Option<Decimal>Optional. If is_swapped is true, stores the USD exchange rate of the currency from swapped_to.
created_at: DateTime<Utc>Date the invoice was created in ISO 8601 format.
paid_usd_rate: Option<Decimal>Optional. Price of the asset in USD. Available only if status is “paid”.
allow_comments: boolTrue, if the user can add comment to the payment.
allow_anonymous: boolTrue, if the user can pay the invoice anonymously.
expires_date: Option<DateTime<Utc>>Optional. Date the invoice expires in ISO 8601 format.
paid_at: Option<DateTime<Utc>>Optional. Date the invoice was paid in ISO 8601 format.
paid_anonymously: Option<bool>True, if the invoice was paid anonymously.
comment: Option<String>Optional. Comment to the payment from the user.
Optional. Text of the hidden message for this invoice.
payload: Option<String>Optional. Previously provided data for this invoice.
paid_btn_name: Option<PayButtonName>Optional. Label of the button, can be “viewItem”, “openChannel”, “openBot” or “callback”.
paid_btn_url: Option<String>Optional. URL opened using the button.