# Invoices An invoice is the basis and the record of a Tilia transaction. Tilia supports these invoice types: - **Standard invoice**: A standard purchase invoice involves collecting funds from the buyer and transferring them directly to the recipient or seller. Standard invoices work well in standard payment processing applications. - **Escrow invoice**: An escrow purchase invoice involves collecting funds from the buyer and holding them in an escrow account, until an agreed-upon condition is met. Once escrowed, funds can either be transferred to the seller, or refunded back to the buyer. Escrow invoices are commonly used with non-fungible tokens (NFTs) and products on a blockchain. - **Virtual token purchase**: This type of invoice enables a user to purchase tokens from you for use in other transactions. Tokens can be spent using both standard invoices or escrow invoices. - **Virtual token conversion**: This is a special type of invoice that can be used to exchange a user's convertible tokens to fiat currency. Refer to [Virtual Tokens](../../core-concepts/virtual-tokens) for more information. - **Payout**: Payout invoices are used to request that funds be transferred from a user's fiat wallet to an external account (e.g. PayPal.) Refer to [Payouts](../../core-concepts/payouts) for more information. Tilia supports these transactions from: - **User to user**: When the one user pays another user for a good or service. A user-to-user invoice can include user-to-user line items, user-to-integrator line items, and line items with recipients that are users and a recipient that's the publisher. - **User to integrator**: When the user pays you, the publisher, for a good or service Both **Standard** and **Escrow** invoices support transactions in tokens or in fiat currency. ### See Tilia invoices in action Our [Tutorials](/tutorials) walk you through the process of creating invoices for many different transaction types. ## Invoice properties The following diagram shows how the contents of an invoice are organized. ![Invoice elements](/assets/concepts-invoice-contents.d25da5ade62dde77fa4c51cef6aa64608c57eacc697038af58fc8ffd2323cae2.9c1bb791.png) An **Invoice** contains one or more **Line items**. The Line items of a **User to user** transaction can contain one or more **Recipients**. ### Invoice heading The Invoice contains information that applies to the entire transaction, such as: - **The invoice's unique ID.** You can use this ID to retrieve the invoice. For example: ```bash GET https://invoicing.tilia-inc.com/v2/invoice/{invoice_id} ``` - **The payer's account ID** - **A description of the transaction overall** - **The payment methods** that provide the funds for the transactions. Payment methods include credit cards, Tilia wallets, and PayPal. - and other details and metadata about the invoice. ### Line item Each line item contains information about a single item being exchanged in the transaction. Information, such as: - **Product identification** such as SKU, product code, purchase price, and other metadata. - **Recipient information** (user-to-user invoice only) In a user-to-user transaction, each user to receive payment from the transaction is described individually. Line items in a user-to-user invoice can have recipients that are users as well as a recipient that's the publisher. In a user-to-integrator transaction, the recipient is the publisher and needs no additional information. ### Recipient Each user to receive funds from the transaction is listed individually in the Line item. This information includes: - **Descriptive information** data and metadata that describes the transaction. - **Amount information** that describes the currency type and amount the recipient is to receive. - **Funding information** that describes the wallet or payment method that provides the funds, and the account or wallet to receive the funds. ## Invoice lifecycle A standard invoice moves through the following states: `open`, `processing`, and `success`. The following diagram shows the invoice states as an invoice moves through its lifecycle. ![Standard invoice lifecycle](/assets/concepts-invoice-lifecycle.37ecb8c65b89c813789259a5f9a876b8da2207817ed44776eecbae3a08195fbb.9c1bb791.png) If an invoice can't be processed, it is assigned a state of `failed`. This could happen, for example, if the user's credit card was declined. An unprocessed invoice can also be canceled, in which case it is assigned a state of `cancelled`. After a week, unpaid invoices sare automatically canceled. ## Webhooks You can use our webhooks to keep track of an invoice throughout its lifecycle. For information about using webhooks, visit [Webhooks](/webhooks).