The invoice contains all order/invoice information.

KeyTypeDescription
numberstringComma separated product names
productsarrayProducts as array with
-name: string
-price: float
-quantity: integer
-sku: string (see changelog)
-vatRate: float (see changelog)
amountfloat (version < 2019-10-15)
integer (version >= 2019-10-15)
The total amount paid.
(removed in 2021-10-12, see changelog)
originalAmountintegerThe amount of the initial payment in the smallest currency unit. (added in 2021-10-12, see changelog)
refundedAmountintegerThe total amount refunded at the time of the webhook. (added in 2021-10-12, see changelog)
discountarray(optional) Information about discount
-code: string
-amount: float
-percentage: integer (optional)
currencystringISO 4217 of currency
testbooleanPayment has been processed in sandbox
referenceIdstringreference code passed through API or GET parameter to the payment page
paymentRequestIdidID of the Paylink or Gateway created through API
paymentLinkarrayInvoice / Gateway data as array
-hash
-referenceId
-email
custom_fieldsarrayAll fields passed in the form in the shopper's language as array
-name
-value

Example

<?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',
    ),
  ),
);