# Invoice

### Occurrence

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a data-mention href="/pages/rvILA8OGze9H9IMhTIaS">/pages/rvILA8OGze9H9IMhTIaS</a></td></tr><tr><td><a data-mention href="/pages/4ZxIahprt0ss4dB5Gn3S">/pages/4ZxIahprt0ss4dB5Gn3S</a></td></tr></tbody></table>

### Content

<table><thead><tr><th width="231.6796875">Key</th><th width="154.80078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>number</td><td>string</td><td>Comma-separated product names</td></tr><tr><td>products</td><td>array of Invoice Products</td><td><a data-mention href="/pages/cAppYOYUoFqP5CLRMyKR">/pages/cAppYOYUoFqP5CLRMyKR</a></td></tr><tr><td>shippingAmount</td><td>int|null</td><td>The cost the shopper is charged for shipping the order</td></tr><tr><td>currency</td><td>string</td><td><a href="https://en.wikipedia.org/wiki/ISO_4217">ISO 4217</a> of the used currency</td></tr><tr><td>test</td><td>int</td><td><ul><li>Was the payment simulated?</li><li>Possible values: <code>0</code>  for no or <code>1</code> for yes</li></ul></td></tr><tr><td>referenceId</td><td>string</td><td>An internal reference ID used by your system</td></tr><tr><td>purpose</td><td>string</td><td>The purpose of the payment</td></tr><tr><td>paymentRequestId</td><td>int|null</td><td>ID of the Invoice or Payrexx Gateway created through the API</td></tr><tr><td>paymentLink</td><td>Payment Link|null</td><td><ul><li><a data-mention href="/pages/u4F7debOZ9ZvgkBwfmVf">/pages/u4F7debOZ9ZvgkBwfmVf</a></li><li>Invoice/Gateway data</li></ul></td></tr><tr><td>googleAnalyticProducts</td><td>array of Google Analytic Products</td><td><a data-mention href="/pages/bgLhob0yVNBmoFPYEa2w">/pages/bgLhob0yVNBmoFPYEa2w</a></td></tr><tr><td>originalAmount</td><td>int</td><td>The amount paid by the shopper</td></tr><tr><td>refundedAmount</td><td>int</td><td>The amount refunded to the shopper</td></tr><tr><td>custom_fields</td><td>array of Custom Fields</td><td><ul><li><a data-mention href="/pages/P6ITfbEnvJyxBX5UH7IR">/pages/P6ITfbEnvJyxBX5UH7IR</a></li><li>Only added when the array is not empty</li></ul></td></tr></tbody></table>

### Example

```json
{
  "test": 1,
  "number": "IV_123",
  "currency": "CHF",
  "discount": {
    "code": null,
    "amount": 0,
    "percentage": null
  },
  "products": [
    {
      "sku": null,
      "name": "Product 1",
      "price": 1000,
      "vatRate": "8.1",
      "quantity": 1,
      "description": "sample-email@mail.com"
    }
  ],
  "paymentLink": null,
  "referenceId": "Custom API Reference",
  "custom_fields": [
    {
      "name": "E-Mail",
      "type": "email",
      "value": "sample-email@mail.com"
    }
  ],
  "originalAmount": 1000,
  "refundedAmount": 0,
  "shippingAmount": null,
  "paymentRequestId": null,
  "googleAnalyticProducts": [
    {
      "price": 10,
      "item_id": 112233,
      "quantity": 1,
      "item_name": "Product 1"
    }
  ]
}
```

### Changelog

<details>

<summary>2024-12-10</summary>

An update to the [Invoice Product](/developer/general-info/objects/invoice/invoice-product.md) object.

</details>

<details>

<summary>2021-10-12</summary>

The field `amount` is removed and replaced with two fields providing more details: `originalAmount` which stores the amount that was paid and `refundedAmount` which stores the amount refunded to the shopper.

</details>

<details>

<summary>2019-10-15</summary>

The type of `amount` changes from `float` to `int`. The price is now displayed in the currency's smallest unit.

An update to the [Discount](/developer/general-info/objects/invoice/discount.md) object.

An update to the [Invoice Product](/developer/general-info/objects/invoice/invoice-product.md) object.

</details>

<details>

<summary>2019-02-13</summary>

An update to the [Invoice Product](/developer/general-info/objects/invoice/invoice-product.md) object.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payrexx.com/developer/general-info/objects/invoice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
