> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gigstack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Understand a sale in five minutes

> Know which record to create, when money moves, and when a CFDI exists.

This guide explains **Mexican CFDI**. For Colombian identification and invoice fields,
read [Colombia](/countries/colombia); for common API fields, read [Shared fields](/concepts/shared-fields).

You sell one hour of consulting for **MXN 1,000 plus MXN 160 of IVA**.
The customer pays **MXN 1,160**. Start with that sale; choose the API operation that
matches what has actually happened.

| What happened? | What to create | Small example |
| - | - | - |
| You know who the customer is. | **Client** | Save their contact and fiscal details once. |
| You want to review a bill before issuing it. | **Invoice draft** | Save the consulting line and preview its PDF. |
| You are ready to issue the fiscal document. | **Income invoice**, CFDI type `I` | Stamp the draft and save the returned UUID. |
| The customer already sent the money. | **Registered payment** | Record the MXN 1,160 bank transfer. |
| You want the customer to pay through a link. | **Payment request** | Create a checkout link; wait for payment confirmation. |
| The customer will provide fiscal details later. | **Receipt** | Give them a self-invoicing link. |
| A customer pays an invoice you issued on credit. | **Payment complement**, CFDI type `P` | Link the amount received to the original invoice UUID. |
| You need a credit note for a return or discount. | **Egress invoice**, CFDI type `E` | Reference the original invoice. |

A registered payment records money already received. An invoice records the fiscal sale.
These are separate records; the API can automate the relationship when you explicitly request it.

## Three IDs you will use

| Value | What it identifies | Where to get it |
| - | - | - |
| `client_...` | A saved customer | `data.id` from `POST /clients` |
| `inv-draft_...` | A document you can still edit | `data.id` from `POST /invoices/draft` |
| A UUID such as `00000000-0000-4000-8000-000000000001` | A stamped CFDI | `data.uuid` from the stamping response |

After stamping a draft, use the **returned UUID** to fetch the invoice. Do not assume the
old draft ID is the issued invoice's ID. The draft-stamping response can omit `data.id`.

## The fiscal words, translated into decisions

* **CFDI**: the Mexican electronic fiscal document. Its XML contains the fiscal data;
  a PDF is a readable representation.
* **Timbrar / stamp**: issue the CFDI through the invoicing provider. A saved draft has
  not completed this step.
* **RFC**: the tax identity of the issuing business or recipient.
* **Uso CFDI (`use`)**: the recipient's stated fiscal use of the document. Ask them;
  a code in an example is not a default for every customer.
* **Régimen fiscal (`tax_system`)**: the recipient's registered tax regime.
* **Forma de pago (`payment_form`)**: how money was paid, such as `03` for bank transfer.
* **Método de pago (`payment_method`)**: whether the invoice is paid in one payment
  (`PUE`) or deferred / in installments (`PPD`).

## Paid now or paid later?

For the simple **already paid in full** example, use `PUE` with the actual payment form.
For a sale **unpaid when you issue the invoice**, the ordinary flow is `PPD` with `99`
(por definir), followed by a payment complement when payment arrives. Special fiscal
cases have additional rules; these recipes cover the ordinary flows.

The SAT explains the fields in its [CFDI filling guides](https://www.sat.gob.mx/minisitio/Factura/emite_materialdeayudaparafactura.htm)
and [payment-complement guidance](https://wwwmat.sat.gob.mx/cs/Satellite?c=ConsultaInfo\&childpagename=SatTyR%2FConsultaInfo%2FSAT_LandingConsultaInformacion\&cid=1462228892764\&packedargs=d%3DTouch\&pagename=TySWrapper).

<CardGroup cols={2}>
  <Card title="Draft, preview, and issue" icon="file-invoice" href="/recipes/invoice">
    Follow one consulting sale from customer to CFDI.
  </Card>

  <Card title="Record a bank transfer" icon="money-bill-transfer" href="/recipes/payment">
    Record a payment without creating another invoice.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.