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

# Create invoice for transaction

> Creates an invoice for a transaction sending the products for the invoice.

<RequestExample>
  ```bash Request theme={null}
  curl 
  --location 
  --request POST 'https://staging-api.propaga.io/v1/transaction/{transactionId}/invoice' \
  --header 'Authorization: <your_awesome_token>'
  --header 'Content-Type: application/json'
  --data '{
    "invoice": {
      "discount": 0,
      "products": [
         {
          "product": {
            "description": "Sopa",
            "price": 200.77,
            "productKey": "50191507",
            "sku": "00041789901980",
            "taxes": [{ "rate": 0, "type": "IVA" }],
            "unitKey": "XUN"
          },
          "quantity": 1
        },
      ]
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "success": true
  }
  ```
</ResponseExample>

## Path parameters

<ParamField path="transactionId" type="string" required>
  Propaga's transaction id
</ParamField>

## Body

<ParamField body="invoice" type="object" required>
  <Expandable title="properties">
    <ParamField body="discount" type="number" required />

    <ParamField body="products" type="array" required>
      <Expandable title="Product object">
        <ParamField body="description" type="string" required>
          Product description
        </ParamField>

        <ParamField body="price" type="number" required>
          Total price for the product
        </ParamField>

        <ParamField body="productKey" type="string" required>
          The product key in the SAT system is an identifier in the Product and
          Services Catalog (Catálogo de productos y servicios). For more
          information, see the [SAT's
          catalog](https://www.sat.gob.mx/consultas/53693/catalogo-de-productos-y-servicios)
        </ParamField>

        <ParamField body="sku" type="string" required>
          Internal product identifier
        </ParamField>

        <ParamField body="taxes" type="array" required>
          <Expandable title="Tax properties">
            <ParamField body="rate" type="number" required>
              Tax rate
            </ParamField>

            <ParamField body="type" type="string" required>
              Tax type
            </ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="unitKey" type="string" required>
          Product unit key in the SAT system. For more information, see the
          [SAT's
          catalog](https://infocfdi.com.mx/catalogo-de-unidades-de-medida-sat/)
        </ParamField>

        <ParamField body="quantity" type="number" required>
          Product quantity
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="success" type="boolean" />
