Skip to main content
Mexico example. This walkthrough uses the Mexican CFDI flow. For another issuing country, start with shared fields and country rules.
Case: you sold a service, but the customer will request their invoice later. Create a receipt and use its self-invoicing URL in your application. A receipt is not yet a stamped CFDI. Its pending status refers to the receipt’s invoicing workflow; it does not tell you whether a bank transfer settled.

Create the receipt

Use CLIENT_ID from the customer recipe.
Expected: HTTP 201, data.status: "pending", livemode: false with a test key, and total 1160. The self-invoicing URL is data.url; inspect it before sharing it. The example disables email delivery.

What happens next?

  • Read the receipt with GET /receipts/{id}.
  • The customer can provide fiscal details through the self-invoicing flow.
  • Stamping the receipt issues a CFDI and has its own recipient and fiscal requirements.
  • Cancelling a pending receipt is separate from cancelling an already issued invoice.
Repeating the same creation key returned 400 with error.code: "resource_conflict" in our test. Retrieve the original receipt rather than creating another key for the same sale.
The tested response returned payment_form: null even though the request supplied 03. Do not interpret that response field as confirmation of the requested payment form. Verify the fiscal document before issuing it. See verification coverage.
For deadlines, global invoicing, and the full lifecycle, read the receipt guide.