> ## 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.

# Let a customer invoice later

> Create a receipt when fiscal details will be supplied after the sale.

<Note>**Mexico example.** This walkthrough uses the Mexican CFDI flow. For another
issuing country, start with [shared fields and country rules](/concepts/shared-fields).</Note>

**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](/recipes/customer).

```bash theme={null}
set -euo pipefail
curl --fail-with-body "$GIGSTACK_BASE_URL/receipts" \
  -H "Authorization: Bearer $GIGSTACK_API_KEY" \
  -H 'Content-Type: application/json' \
  --data "$(jq -n --arg client "$CLIENT_ID" '{
    client: {id: $client},
    currency: "MXN",
    payment_form: "03",
    idempotency_key: "receipt-order-1042",
    send_email: false,
    ignore_emails: true,
    items: [{
      description: "One hour of consulting",
      product_key: "80101500", unit_key: "E48",
      unit_price: 1000, quantity: 1,
      taxes: [{type: "IVA", rate: 0.16, inclusive: false, withholding: false, factor: "Tasa"}]
    }]
  }')" > receipt.json

RECEIPT_ID=$(jq -er '.data.id' receipt.json)
export RECEIPT_ID
```

**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](/reference/createReceiptsByIdStamp) issues a CFDI and has its own
  recipient and fiscal requirements.
* [Cancelling a pending receipt](/reference/deleteReceiptsById) 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.

<Note>
  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](/verification).
</Note>

For deadlines, global invoicing, and the full lifecycle, read the [receipt guide](/guides/receipts).


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