# HeroJSON Specification

### Merchant object

```javascript
"merchant": {
    "name": "Global Receipt Delicatesse",
    "companyID": "123456-7",
    "branch": {
      "id": "340",
      "posId": "2",
      "name": "Receipt Restaurant",
      "subName":"FastFood",
      "email": "restaurant@example.com",
      "phone": "040-5086462",
      "websiteURL": "https://www.getreceipthero.com/",
      "address": {
        "streetAddress": "Itsenäisyydenkatu 17 a 15",
        "city": "Tampere",
        "zipCode": "33500",
        "country": "Finland"
      }
    }
```

| Key           | Type   | Description                         | Required |
| ------------- | ------ | ----------------------------------- | :------: |
| **name**      | String | Company name                        |     ✅    |
| **companyID** | String | Company's business id or VAT number |     ✅    |

#### Branch object

| Key                            | Type   | Description                                                                                                                | Required |
| ------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------- | :------: |
| **id**                         | String | Unique identifier for a branch (e.g., cost center number or another identifier used to distinguish branches of a Merchant) |     ✅    |
| **posId**                      | String | Logical cash register id                                                                                                   |     ✅    |
| **name**                       | String | Branch name                                                                                                                |     ✅    |
| subName                        | String | Freetext slogan etc, placed under branch name                                                                              |          |
| email                          | String | Email address to branch / company support                                                                                  |          |
| phone                          | String | Phone number to branch / company support                                                                                   |          |
| websiteURL                     | String | Website URL of branch / company                                                                                            |          |
| **address**                    | Object | Address values                                                                                                             |     ✅    |
| :wavy\_dash: **streetAddress** | String | Branch location street address                                                                                             |     ✅    |
| :wavy\_dash: **city**          | String | Branch location city                                                                                                       |     ✅    |
| :wavy\_dash: **zipCode**       | String | Branch location zip code                                                                                                   |     ✅    |
| :wavy\_dash: **country**       | String | Branch location country                                                                                                    |     ✅    |

### Products array

Products array contains all product on receipt

```javascript
 "products": [
    {
      "name": "Ground Control",
      "EANCode": "42222130165",
      "quantity": "4",
      "productId": "1234",
      "quantityCode": "PCS",
      "freeText": "Product instructions etc",
      "categorization": { "main": "12", "product": "122", "sub": "1224" },
      "unitPriceIncVAT": 5180,
      "unitPriceIncVATDecimal": "51,80",
      "totalAmountExcVAT": 18836,
      "totalAmountIncVAT": 20720,
      "vats": [
        {
          "VATRate": "24",
          "VATAmount": 1884,
          "totalAmountExcVAT": 18836,
          "totalAmountIncVAT": 20720
        }
      ],
      "discounts": [
        {
          "amount": 0,
          "percentage": "0.00",
          "description": ""
        }
      ],
      "customAttributes": [
        { "Warranty": "2 years" },
        { "Valid until": "2020-11-26" }
      ]
    }
  ],
```

| Key                                | Type    | Description                                                                                                                                  | Required |
| ---------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- | :------: |
| **name**                           | String  | Product name                                                                                                                                 |     ✅    |
| EANCode                            | String  | Product EAN code                                                                                                                             |          |
| **quantity**                       | String  | Quantity of product                                                                                                                          |     ✅    |
| productId                          | String  | Merchants internal productID                                                                                                                 |          |
| **quantityCode**                   | String  | Quantity code for product                                                                                                                    |     ✅    |
| freeText                           | String  | Product related text field                                                                                                                   |          |
| **unitPriceIncVAT**                | Integer | <p>Unit price including VAT in </p><p>fractional unit (Cents in Euros etc.)</p>                                                              |     ✅    |
| unitPriceIncVATDecimal             | String  | <p>Unit price including VAT in <br>main currency unit. Mainly used by petrol receipts</p>                                                    |          |
| **totalAmountExcVAT**              | Integer | Total price for product row without VAT in fractional unit                                                                                   |     ✅    |
| **totalAmountIncVAT**              | Integer | Total price for product row with VAT  in fractional unit                                                                                     |     ✅    |
| **vats**                           | Array   | <p>Product level VAT specifications</p><p>One object represents one VAT rate.</p><p>If product has multiple taxrates -> multiple objects</p> |     ✅    |
| :wavy\_dash: **VATRate**           | String  | VAT rate.  Integer or Decimal                                                                                                                |     ✅    |
| :wavy\_dash: **VATAmount**         | Integer | VAT amount in fractional unit                                                                                                                |     ✅    |
| :wavy\_dash: **totalAmountExcVAT** | Integer | Amount without VAT in fractional unit                                                                                                        |     ✅    |
| :wavy\_dash: **totalAmountIncVAT** | Integer | Amount with VAT in fractional unit                                                                                                           |     ✅    |
| discounts                          | Array   | Product level discount objects.                                                                                                              |          |
| :wavy\_dash: **amount**            | Integer | Amount of discount in fractional unit                                                                                                        |     ✅    |
| :wavy\_dash: percentage            | String  | Discount percentage in decimal                                                                                                               |          |
| :wavy\_dash: **description**       | String  | Discount reason in free text                                                                                                                 |     ✅    |
| customAttributes                   | Array   | <p>Key value pair for custom attributes on product</p><p>These key value pair will be shown on receipt as table under product.</p><p></p>    |          |
| :wavy\_dash: **key**               | String  | Free key name                                                                                                                                |     ✅    |
| :wavy\_dash: **value**             | String  | Free value                                                                                                                                   |     ✅    |

#### Product Categorization

```json
"categorization": 
  { 
    "main": "12",
    "product": "122",
    "sub": "1224",
    "tags": ["stampcard-identifier"]
  }
```

| Key         | Type         | Description                                                                                          | Required |
| ----------- | ------------ | ---------------------------------------------------------------------------------------------------- | :------: |
| main        | String       | Main category identifier                                                                             |          |
| **product** | String       | Product category identifier                                                                          |     ✅    |
| sub         | Integer      | Sub category identifier                                                                              |          |
| tags        | String Array | A list of custom tags, used for purposes such as marking a product's inclusion in a stamp card offer |          |

#### Product Journey

When dealing with travel-related products such as bus, train, taxi, or other transportation services, it is possible to include structured journey details alongside the product line item. The journey object allows specifying relevant metadata such as the type of transport, schedule, distance, emissions, and location data for both origin and destination.

```json
"journey": {
  "type": "TRAIN",
  "id": "IC924",
  "distance": 185000,
  "duration": 120,
  "CO2Emissions": 222,
  "origin": {
    "name": "Pasila",
    "city": "Helsinki",
    "country": "Finland",
    "latitude": "60.1988",
    "longitude": "24.9333",
    "datetime": "2025-04-02T10:00:00+02:00"
  },
  "destination": {
    "name": "Turku (City Centre, Logomo)",
    "city": "Helsinki",
    "country": "Finland",
    "latitude": "60.45694",
    "longitude": "22.25750",
    "datetime": "2025-04-02T12:00:00+02:00"
  }
}
```

#### Journey Object

<table><thead><tr><th width="199.84765625">Key</th><th>Type</th><th width="238.471435546875">Description</th><th align="center">Required</th></tr></thead><tbody><tr><td><strong>type</strong></td><td>String</td><td><p>Type of Journey</p><pre data-title="Allowed values"><code>  TRAIN
  BUS
  TAXI
  FLIGHT
  FERRY
</code></pre></td><td align="center">✅</td></tr><tr><td>id</td><td>String</td><td>Journey identifier, such as train connection or flight number</td><td align="center"></td></tr><tr><td>distance</td><td>Number</td><td>Journey distance in meters</td><td align="center"></td></tr><tr><td>duration</td><td>Number</td><td>Journey duration in minutes</td><td align="center"></td></tr><tr><td>CO2Emissions</td><td>Integer</td><td>CO2 Emissions in grams</td><td align="center"></td></tr><tr><td><strong>origin</strong></td><td><a data-mention href="#journey-location-object">#journey-location-object</a></td><td>Journey origin</td><td align="center">✅</td></tr><tr><td><strong>destination</strong></td><td><a data-mention href="#journey-location-object">#journey-location-object</a></td><td>Journey destination</td><td align="center">✅</td></tr><tr><td>vehicle</td><td><a data-mention href="#journey-vehicle-object">#journey-vehicle-object</a></td><td>Journey vehicle, applicable for <code>type=TAXI</code></td><td align="center"></td></tr><tr><td>driver</td><td><a data-mention href="#journey-driver-object">#journey-driver-object</a></td><td>Driver details, applicable for <code>type=TAXI</code></td><td align="center"></td></tr><tr><td>pickupArrivedAt</td><td>String</td><td>Departure or Arrival time as ISO 8601 datetime with offset</td><td align="center"></td></tr></tbody></table>

#### Journey Location Object

<table><thead><tr><th width="199.84765625">Key</th><th>Type</th><th>Description</th><th align="center">Required</th></tr></thead><tbody><tr><td><strong>name</strong></td><td>String</td><td>Journey location name</td><td align="center">✅</td></tr><tr><td>city</td><td>String</td><td>Journey location city</td><td align="center"></td></tr><tr><td>country</td><td>String</td><td>Journey location country</td><td align="center"></td></tr><tr><td>latitude</td><td>String</td><td>Journey location latitude</td><td align="center"></td></tr><tr><td>longitude</td><td>String</td><td>Journey location longitude</td><td align="center"></td></tr><tr><td>datetime</td><td>String</td><td>Departure or Arrival time as ISO 8601 datetime with offset</td><td align="center"></td></tr></tbody></table>

#### Journey Vehicle Object

Optional vehicle details for the journey. Currently applicable only to `TAXI` journeys.

<table><thead><tr><th width="199.84765625">Key</th><th>Type</th><th>Description</th><th align="center">Required</th></tr></thead><tbody><tr><td><strong>id</strong></td><td>String</td><td>Vehicle identifier</td><td align="center">✅</td></tr><tr><td><strong>licensePlate</strong></td><td>String</td><td>Vehicle license plate number</td><td align="center">✅</td></tr><tr><td>make</td><td>String</td><td>Vehicle make</td><td align="center"></td></tr><tr><td>model</td><td>String</td><td>Vehicle model</td><td align="center"></td></tr><tr><td>category</td><td>String</td><td><p>Vehicle category</p><pre data-title="Allowed values"><code>  SEDAN
  HATCHBACK
  WAGON
  VAN
  MINIBUS
  SUV
  LUXURY
</code></pre></td><td align="center"></td></tr><tr><td>powertrain</td><td>String</td><td><p>Vehicle power train</p><pre data-title="Allowed values"><code>  PETROL
  DIESEL
  HYBRID
  PLUG_IN_HYBRID
  ELECTRIC
  HYDROGEN
</code></pre></td><td align="center"></td></tr><tr><td>phoneNumber</td><td>String</td><td>Vehicle phone number</td><td align="center"></td></tr></tbody></table>

#### Journey Driver Object

Optional vehicle details for the journey. Currently applicable only to `TAXI` journeys.

<table><thead><tr><th width="199.84765625">Key</th><th>Type</th><th>Description</th><th align="center">Required</th></tr></thead><tbody><tr><td><strong>id</strong></td><td>String</td><td>Driver identifier</td><td align="center">✅</td></tr></tbody></table>

### Receipt VAT specification

```javascript

 "vats": [
    {
      "VATRate": "24",
      "totalVATAmount": 1884,
      "totalAmountExcVAT": 18836,
      "totalAmountIncVAT": 20720,
      "VATCode": "A"
    }
  ],
```

| Key                                | Type    | Description                                         | Required |
| ---------------------------------- | ------- | --------------------------------------------------- | :------: |
| **vats**                           | Array   | Receipt total VATs as array of objects per VAT rate |     ✅    |
| :wavy\_dash: **VATRate**           | String  | VAT rate.  Integer or Decimal                       |     ✅    |
| :wavy\_dash: **totalVATAmount**    | Integer | VAT amount in fractional unit                       |     ✅    |
| :wavy\_dash: **totalAmountExcVAT** | Integer | Amount without VAT in fractional unit               |     ✅    |
| :wavy\_dash: t**otalAmountIncVAT** | Integer | Amount with VAT in fractional unit                  |     ✅    |
| VATCode                            | String  | VAT identifier                                      |          |

### Payments&#x20;

HeroJSON supports a variety of payment types including card, cash, gift card, and online payments — see the full list of [payment-types](https://docs.receipthero.io/filetypes/receipthero-json/herojson-specification/payment-types "mention") for details. Payments are mapped as an array of Payment Objects as shown in the example below.

#### Payments Example

```json
  "payments": [
    {
      "type": "CARD",
      "amount": 20720,
      "attributes": {
        "transactionType": "PURCHASE",
        "currencyISOCode": "EUR",
        "MID": "12346543",
        "timeStamp": "2022-09-01T12:35:34.678+02:00",
        "terminalId": "BS-4545F9",
        "referenceNumber": "220901015555",
        "authorizationCode": "HIU456",
        "transactionId": "05555",
        "receiptNumber": "12923",
        "maskedPAN": "525400******9876",
        "APP": "MASTERCARD DEBIT",
        "cardType": "DEBIT",
        "cardProgram": "Nordic Tech Bank — MC Debit",
        "transactionRawText": "CARD TRANSACTION\n\nCard: Debit Mastercard\n **** **** **** 9876 LN\nApplication: A0000000041010\nTr.Nr/Auth: 05555/HIU456\nPayee/business: 0029432413000/0001\n\nReference: 220901015555\n\nCredit/Charge 207,20 EUR\nPayPass Contactless \n\n",
        "preAuthorizedAmount": 30000,
        "ENTRY": "Contactless ICC (07)",
        "ARC": "APPROVED (00)",
        "TVR": "8000008000",
        "TSI": "E800",
        "AID": "A0000000031010",
        "AC": "9F270180",
        "CID": "0x80",
        "cryptogramType": "ARQC",
        "CVM": "Online PIN"
      }
    },
    {
      "type": "CASH",
      "amount": 34920,
      "attributes": {
        "handedAmount": 40000
      }
    }
  ]
```

### General Receipt Data

```javascript
 "type": "PURCHASE",
 "customAttributes": [
    { "key": "value" },
    { "key2": "value2" },
    { "key3": "value3" }
  ],
  "freeText": "Custom greetings etc",
  "receiptNumber": "89942344234",
  "receiptTimeStamp": "2018-11-26T12:35:34.678+02:00",
  "currencyISOCode": "EUR",
  "totalVATAmount": 1884,
  "totalPriceExcVAT": 18836,
  "totalPriceIncVAT": 20720,
}
```

<table><thead><tr><th>Key</th><th>Type</th><th>Description</th><th align="center">Required</th></tr></thead><tbody><tr><td>type</td><td>String</td><td><p></p><p>Type of Receipt</p><pre data-title="Allowed values"><code>PURCHASE
RETURN
PURCHASE_AND_RETURN
</code></pre></td><td align="center"></td></tr><tr><td>freeText</td><td>String</td><td>Freetext field to be displayed on receipt</td><td align="center"></td></tr><tr><td><strong>receiptNumber</strong></td><td>String</td><td>Merchant's internal receiptnumber</td><td align="center">✅</td></tr><tr><td><strong>receiptTimeStamp</strong></td><td>String</td><td>ISO 8601 datetime with offset</td><td align="center">✅</td></tr><tr><td><strong>currencyISOCode</strong></td><td>String</td><td>Currency code</td><td align="center">✅</td></tr><tr><td><strong>totalVATAmount</strong></td><td>Integer</td><td>Total VAT amount in fractional unit</td><td align="center">✅</td></tr><tr><td><strong>totalPriceExcVAT</strong></td><td>Integer</td><td>Total price excluding VAT</td><td align="center">✅</td></tr><tr><td><strong>totalPriceIncVAT</strong></td><td>Integer</td><td>Total price including VAT</td><td align="center">✅</td></tr><tr><td>customAttributes</td><td>Array</td><td>Key value pair list, to be show on receipt</td><td align="center"></td></tr><tr><td><span data-gb-custom-inline data-tag="emoji" data-code="3030">〰️</span> <strong>Key</strong></td><td>String</td><td>Free text key</td><td align="center">✅</td></tr><tr><td><span data-gb-custom-inline data-tag="emoji" data-code="3030">〰️</span> <strong>Value</strong></td><td>String</td><td>Free text value</td><td align="center">✅</td></tr></tbody></table>

### Verifications array

```json
"verifications": [
  {
    "type": "OCMF",
    "version": "1.0",
    "publicKey": "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEqHEykfqZhspgok6zCQh/329B38xine8ujzT8p5Nh7lek47cYeZj507aN6E4/QirF1b7Q57ln4VGfK6h0d0GOQA==",
    "transactionId": "848182519",
    "currentType": "AC",
    "transactionBegin": {
      "signedData": "OCMF|{\"FV\" : \"1.0\",\"GI\" : \"Nano CH-10311C\",\"GS\" : \"060643\",\"GV\" : \"v017\",\"PG\" : \"T198\",\"MV\" : \"DZG\",\"MM\" : \"DVH4013\",\"MS\" : \"1DZG0033016824\",\"IS\" : true,\"IL\" : \"VERIFIED\",\"IF\" : [\"RFID_NONE\",\"OCPP_NONE\",\"ISO15118_NONE\",\"PLMN_NONE\"],\"IT\" : \"EMAID\",\"ID\" : \"04ab076a345b85\",\"CT\" : \"CBIDC\",\"CI\" : \"CI\",\"RD\" : [{\"TM\" : \"2021-10-26T10:20:52,000+0200 I\",\"TX\" : \"B\",\"RV\" : \"       9.038\",\"RI\" : \"01-00:01.08.00.FF\",\"RU\" : \"kWh\",\"RT\" : \"AC\",\"EF\" : \"\",\"ST\" : \"G\"}]}|{\"SA\" : \"ECDSA-secp256k1-SHA256\",\"SD\" : \"3046022100A4C188533ECA1793336520F7F99E010E62DEC32ABD344A562B00D396F65DFFE9022100CB0FB3782E406525641D689F4326D2118365A722EE75AAAB976C14B090BE49DA\"}"
    },
    "transactionEnd": {
      "signedData": "OCMF|{\"FV\" : \"1.0\",\"GI\" : \"Nano CH-10311C\",\"GS\" : \"060643\",\"GV\" : \"v017\",\"PG\" : \"T199\",\"MV\" : \"DZG\",\"MM\" : \"DVH4013\",\"MS\" : \"1DZG0033016824\",\"IS\" : true,\"IL\" : \"VERIFIED\",\"IF\" : [\"RFID_NONE\",\"OCPP_NONE\",\"ISO15118_NONE\",\"PLMN_NONE\"],\"IT\" : \"EMAID\",\"ID\" : \"04ab076a345b85\",\"CT\" : \"CBIDC\",\"CI\" : \"CI\",\"RD\" : [{\"TM\" : \"2021-10-26T10:21:22,000+0200 I\",\"TX\" : \"E\",\"RV\" : \"       9.038\",\"RI\" : \"01-00:01.08.00.FF\",\"RU\" : \"kWh\",\"RT\" : \"AC\",\"EF\" : \"\",\"ST\" : \"G\"},{\"TM\" : \"2021-10-26T10:21:22,000+0200 I\",\"TX\" : \"E\",\"RV\" : \"      30\",\"RI\" : \"01-00:00.08.06.FF\",\"RU\" : \"sec\",\"RT\" : \"AC\",\"EF\" : \"\",\"ST\" : \"G\"}]}|{\"SA\" : \"ECDSA-secp256k1-SHA256\",\"SD\" : \"3045022016FD6DF51EE338CC56F6035670172653C93A77F263B7B24DD5DC84EF7C4A98AB022100ADE8D7D9EC4EFFE2B3C0781C108B9DF2688776F81AE94D9230C92ED570C9693C\"}"
    }
  }
]
```

#### Verification Object

<table><thead><tr><th width="203">Key</th><th width="250">Type</th><th width="187.867919921875">Description</th><th>Required</th></tr></thead><tbody><tr><td>type</td><td>String</td><td>Type of verification</td><td>✅</td></tr><tr><td>version</td><td>String</td><td>Standard version</td><td>✅</td></tr><tr><td>publicKey</td><td>String</td><td>Public key for verifying data</td><td>✅</td></tr><tr><td>transactionId</td><td>String</td><td>Transaction identifier</td><td>✅</td></tr><tr><td>currentType</td><td>String</td><td><p>Current type</p><pre data-title="Allowed values"><code>  AC
  DC
</code></pre></td><td>✅</td></tr><tr><td>transactionBegin</td><td>Transaction Event Object</td><td>Transaction Begin event data</td><td>✅ <strong>*</strong></td></tr><tr><td>transactionEnd</td><td>Transaction Event Object</td><td>Transaction End event data</td><td>✅</td></tr></tbody></table>

{% hint style="info" %}
&#x20;**\*** `transactionBegin` is mandatory when `type=AC`
{% endhint %}

#### Transaction Event Object

<table><thead><tr><th width="235">Key</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>signedData</td><td>String</td><td>Signed transaction event data for verification</td><td>✅</td></tr></tbody></table>

### Attachments

Attachments such as entrance tickets and gift cards can be included.&#x20;

{% hint style="warning" %}
This is a premium feature. To enable this option, please reach out to the ReceiptHero sales team.
{% endhint %}

```json
"attachments": [
    {
        "type": "QRCODE",
        "kind": "TICKET",
        "title": "Here is your ticket!",
        "description": "Present this code at the entrance to maintain your access.",
        "data": "89942344234",
        "validUntil": "2024-09-10T00:00:00.000+02:00"
    }
]
```

<table><thead><tr><th width="203">Key</th><th width="250">Type</th><th width="196.396728515625">Description</th><th>Required</th></tr></thead><tbody><tr><td>type</td><td>String</td><td><p>Type of attachment</p><pre data-title="Allowed values"><code>BARCODE
QRCODE
</code></pre></td><td>✅</td></tr><tr><td>kind</td><td>String</td><td><p>Kind represents the purpose of the attachment</p><pre data-title="Allowed values"><code>TICKET
RETURN
VOUCHER
</code></pre></td><td>✅</td></tr><tr><td>title</td><td>String</td><td>Title shown on top of the attachment</td><td>✅</td></tr><tr><td>data</td><td>String</td><td>Data encoded to the attachment according to the provided type</td><td>✅</td></tr><tr><td>description</td><td>String</td><td>Description providing more details on how this attachment is used</td><td></td></tr><tr><td>validUntil</td><td>String</td><td>ISO 8601 string with offset, representing the last moment the attachment is valid for use</td><td></td></tr></tbody></table>

<br>


---

# 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.receipthero.io/filetypes/receipthero-json/herojson-specification.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.
