---
title: "Receipts"
canonical: "https://red-ant-documentation.refined.site/space/RET/1410105387/Receipts"
format: markdown
---
> Macro (toc)

## Overview

RetailOS provides a versatile solution for issuing both printed and electronic receipts (e-Receipts), tailored to meet diverse retailer needs. This guide outlines the core capabilities and structure of the receipt functionality.

### Accessing the Receipt Options

Sales associates can issue receipts directly from the **Order Details** screen by selecting the **Receipt** button. A pop-up menu prompts the associate to choose between:

- **Gift Receipt **- Generates a printed gift receipt.
- **Print** **Receipt **– Generates a printed receipt.
- **e-Receipt** – Sends the receipt to the customer via email as a PDF attachment.

This allows associates to accommodate customer preferences for physical or electronic receipts.

![Screenshot 2025-02-06 at 15.26.12.png](media://006a2bae-58e6-44de-8187-e83218542a27)

> ℹ️ The option to print a gift receipt is disabled for refund/exchange orders.
> ℹ️ 
> ℹ️ The option to trigger an e-Receipt is disabled in the following scenarios:
> ℹ️ 
> ℹ️ 1. The order is associated with a customer profile that does not have an email address on file.
> ℹ️ 2. The order is anonymous (i.e., not linked to a customer profile).

### Receipt Types

#### **Sales Receipts**

Sales receipts can be generated for any order with at least one recorded payment. They are available for orders in the following statuses:

- `Partially Paid`
- `Deposit Paid`
- `Complete`

#### **Refund Receipts**

Refund receipts can be generated for orders where a refund has been processed. They are available for orders in the following statuses:

- `Partially Refunded`
- `Fully Refunded`

#### **Gift Receipts**

Gift receipts can only be generated for sales orders (not refunds or exchanges). When selecting the Gift Receipt option, the sales associate is prompted to specify which products (and their respective quantities) should be included in the gift receipt. This allows for split gift receipts, meaning multiple gift receipts can be generated for a single order.

This feature is particularly useful when a customer has purchased gifts for multiple recipients and wants to provide each person with a gift receipt referencing only their portion of the order. 

Each gift receipt will list only the selected items, excluding pricing and payment information, ensuring that the recipient can return or exchange the items without seeing the original purchase price.

Gift Receipts are available for orders in the following statuses:

- `Partially Paid`
- `Deposit Paid`
- `Complete`

> 📝 The gift receipt functionality is feature-flagged to align with retailer needs. It is controlled by the `generateReceiptsEnabled` config, and to enable split gift receipts, `generateSplitGiftReceiptsEnabled` must also be set to `true`. Without this, only a single gift receipt containing all products in the order can be generated, without the option to select specific products or quantities.

### How Receipts Are Generated

- **Printed Receipts**
  - **Web Browsers**: Receipts are generated using the native browser print functionality, producing an A4 printout to a connected printer on the same network.
  - **Apple Devices**: Receipts are printed using AirPrint, offering seamless integration with compatible printers.
  - **Consistent Formatting**: The receipt is converted from an HTML template into a PDF format before being sent to the printer, ensuring consistent and professional formatting across all devices.
- **e-Receipts**
  - When sending an e-Receipt, the system emails the customer with the receipt attached as a PDF.
  - The same receipt template is used for both printed and e-Receipts, maintaining consistency in design and layout.

> ℹ️ When an e-Receipt is sent, the attached receipt file follows a standard naming convention to ensure clarity and consistency. The format used is: `{orderNumber}_receipt`

### Receipt Template Information

The receipt template combines **dynamic** and **non-dynamic** content to provide all necessary transaction details while ensuring branding consistency.

> 📝 If a timezone has been set against the store (this can be configured via [Store Management](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/34734081)), this timezone will be used when recording the date and time of the transaction on the receipt. This ensures that all printed documents reflect the correct local time rather than the server time.

![Screenshot 2024-12-18 at 15.35.29.png](media://b3da47bf-665b-4a73-bdec-fd1d426b2a91)

#### **Dynamic Content**

Dynamic elements are automatically populated based on the customer, order, and payment details:

**Customer Information:**

- Customer Name
- Customer Address (if the order is a home delivery)

**Order Information:**

- Order Date
- Order Number
- Salesperson
- Store Name/Address
- Subtotal
- Discount
- Delivery Charges (where applicable)
- Total

**Products:**

- Product Name
- Product SKU
- Quantity (QTY)
- Price
- Discount
- Total

**Payments/Refunds:**

- Payment/Refund Date
- Payment/Refund Type (e.g., Card, Cash)
- Payment/Refund Amount
- Change (cash payments only)
- Total Payments/Refunds
- Balance Due (if the order is partially paid/refunded)

#### **Non-Dynamic Content**

Examples of static elements that can be included in all receipts:

- Brand logo (typically displayed in the header)
- VAT Number
- Customer support contact details (e.g. phone and email)
- Retailer website URL

### Receipt Archiving

All generated receipts are archived under the directory: `{{bucket_name}}/orders/receipts/pdf/`

This dedicated folder structure allows lifecycle methods to be applied specifically to receipts, enabling the configuration of retention policies for effective archive management.

#### Folder Structure

Receipts are stored in subfolders organised by order number. This structure ensures a complete history of all receipts generated for each order is easily accessible.

#### Naming Convention

Receipt files are named using the order status and a timestamp based on the `updatedAt` date at the time of generation. For example `complete_1734528560.pdf`

#### Receipt Retrieval Logic

When a receipt is requested, the archive is searched for a file matching the order status and timestamp.

- **If a matching file exists**: It is retrieved and returned, avoiding unnecessary regeneration.
- **If no matching file exists**: A new receipt is generated and added to the archive.

This approach ensures efficient storage and retrieval while maintaining an accurate history of receipts for auditing and reference purposes.

> 📝 When a gift receipt is generated, a copy of the original sales receipt is created and archived in the same directory as the other receipts. The file follows the same naming convention, with ‘_gift’ appended to the filename. The file follows the same naming convention, with ‘_gift’ appended to the filename. Additionally, a unique hash is generated based on the order ID, the list of product IDs included in the gift receipt, and their quantities. This ensures that each gift receipt has a distinct identifier. 
> 📝 
> 📝 For example: `complete_1734528560_gift_069d38e9a0f4b15c0feb822b3202970d.pdf`

### FAQ

<details>
<summary>Can we customise receipt templates for individual stores?</summary>

Yes, we recently introduced support for store-specific receipts by allowing each store to define its own custom receipt template. This is achieved by setting a `receiptTemplatePath` value in the store’s configuration, which points to the location of the store's specific receipt template hosted on S3. At the time of generating a receipt, the platform retrieves the correct template based on the logged-in user's store, enabling tailored branding and layout per store.

This is particularly useful for retail groups that operate multiple brands or store formats, as it allows each store to reflect its own visual identity and receipt format without requiring changes to the core platform.
</details>