# Invoice

### Occurrence

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a data-mention href="../../guides/webhook/transaction">transaction</a></td></tr><tr><td><a data-mention href="../../guides/webhook/subscription">subscription</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="invoice/invoice-product">invoice-product</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="invoice/payment-link">payment-link</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="invoice/google-analytic-product">google-analytic-product</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="invoice/custom-field">custom-field</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](https://docs.payrexx.com/developer/general-info/objects/invoice/invoice-product) 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](https://docs.payrexx.com/developer/general-info/objects/invoice/discount) object.

An update to the [Invoice Product](https://docs.payrexx.com/developer/general-info/objects/invoice/invoice-product) object.

</details>

<details>

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

An update to the [Invoice Product](https://docs.payrexx.com/developer/general-info/objects/invoice/invoice-product) object.

</details>
