---
updatedAt: 2025-05-20T21:53:54.000Z
agentTools:
  projectIndex: https://shop-and-pay.readme.io/llms.txt
---

# Invoice

The invoice contains all order/invoice information.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th style={{ textAlign: "left" }}>
        Key
      </th>

      <th style={{ textAlign: "left" }}>
        Type
      </th>

      <th style={{ textAlign: "left" }}>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{ textAlign: "left" }}>
        number
      </td>

      <td style={{ textAlign: "left" }}>
        string
      </td>

      <td style={{ textAlign: "left" }}>
        Comma separated product names
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        products
      </td>

      <td style={{ textAlign: "left" }}>
        array
      </td>

      <td style={{ textAlign: "left" }}>
        Products as array with\
        -name: string\
        -price: float\
        -quantity: integer\
        -sku: string (see [changelog](https://shop-and-pay.readme.io/docs/webhooks))\
        -vatRate: float (see [changelog](https://shop-and-pay.readme.io/docs/webhooks))
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        amount
      </td>

      <td style={{ textAlign: "left" }}>
        float
      </td>

      <td style={{ textAlign: "left" }}>
        The total amount paid
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        discount
      </td>

      <td style={{ textAlign: "left" }}>
        array
      </td>

      <td style={{ textAlign: "left" }}>
        (optional) Information about discount\
        -code: string\
        -amount: float\
        -percentage: integer (optional)
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        currency
      </td>

      <td style={{ textAlign: "left" }}>
        string
      </td>

      <td style={{ textAlign: "left" }}>
        [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) of currency
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        test
      </td>

      <td style={{ textAlign: "left" }}>
        boolean
      </td>

      <td style={{ textAlign: "left" }}>
        Payment has been processed in sandbox
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        referenceId
      </td>

      <td style={{ textAlign: "left" }}>
        string
      </td>

      <td style={{ textAlign: "left" }}>
        reference code passed through API or GET parameter to the payment page
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        paymentRequestId
      </td>

      <td style={{ textAlign: "left" }}>
        id
      </td>

      <td style={{ textAlign: "left" }}>
        ID of the [Invoice](https://shop-and-pay.readme.io/docs/invoice) or [Shop & Pay Gateway](https://shop-and-pay.readme.io/docs/shopandpay-gateway) created through API
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        paymentLink
      </td>

      <td style={{ textAlign: "left" }}>
        array
      </td>

      <td style={{ textAlign: "left" }}>
        Invoice / Gateway data as array\
        -hash\
        -referenceId\
        -email
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        custom\_fields
      </td>

      <td style={{ textAlign: "left" }}>
        array
      </td>

      <td style={{ textAlign: "left" }}>
        All fields passed in the form in the shopper's language as array\
        -name\
        -value
      </td>
    </tr>
  </tbody>
</Table>

## Example

```php HTTP $_POST
<?php
array(
  'number' => 'Product 1, Product 2',
  'products' => array(
    0 => array(
      'name' => 'Product 1',
      'price' => 2.9,
      'quantity' => 1,
      'sku' => '01120001',
      'vatRate' => 8,
    ),
    1 => array(
      'name' => 'Product 2',
      'price' => 1.9,
      'quantity' => 1,
      'sku' => '01120000',
      'vatRate' => 7.7,
    ),
  ),
  'amount' => 4.8,
  'discount' => array(
    'code' => NULL,
    'amount' => 0,
    'percentage' => NULL,
  ),
  'currency' => 'CHF',
  'test' => 0,
  'referenceId' => '',
  'paymentRequestId' => NULL,
  'paymentLink' => NULL,
  'custom_fields' => array(
    1 => array(
      'name' => 'Field 1 name',
      'value' => 'Field 1 value',
    ),
    2 => array(
      'name' => 'Field 2 name',
      'value' => 'Field 2 value',
    ),
    3 => array(
      'name' => 'Field 3 name',
      'value' => 'Field 3 value',
    ),
  ),
);
```