# Online Store Receipts

**WP admin:** turn on the **Receipt** button for online orders in `WP Admin → POS → Settings → General`.

This page is for whoever runs the website

With [WCPOS Pro](/es/getting-started/pro-license.md), you can print or email a receipt at the till for any order, including online ones: see [Reprint a receipt](/es/manage-store/orders.md#receipt-reprinting) on the **Orders** page.

If a customer asks for their online receipt

Once the website has it set up, it's the **Receipt** button in **My Account → Orders**, or a receipt link on their order confirmation page, if the shop added one.

Your WCPOS receipt templates also work on your website. A customer who bought online can download their receipt as a PDF from **My Account**, or from a link you put on the order confirmation page.

## Turn on the Receipt button[​](#my-account "Enlace directo a Turn on the Receipt button")

Activate a receipt template first

Turn one on in **POS → Templates** before you start. Without one, customers won't see the **Receipt** button, even with the setting on. See [Customise Your Receipt](/es/settings/receipt-templates/customise-receipt.md#option-1--pick-a-different-template).

The button is off until you turn it on. The PDF is made from your receipt template.

1. In WP Admin, go to **POS → Settings → General**.

![WP Admin with POS, Settings selected in the menu and General open in the settings menu, showing Stores, Register and the start of Products](/img/2.x/receipts/storefront/en/desktop-light-regular--r8-1-general-screen.png)12

1. **POS → Settings** — the WP Admin menu item for the POS settings.
2. **General** — the first settings screen, already open when you arrive.

2) Scroll down to the **Customers** section and switch on **Let customers download receipts**. It saves as soon as you switch it.

![The Customers section of General: Automatically generate username from customer email, Default POS customer set to Guest, and Let customers download receipts, here still switched off](/img/2.x/receipts/storefront/en/desktop-light-regular--r8-2-customers-section.png)12

1. **Customers** — the section that holds the receipt setting.
2. **Let customers download receipts** — off until you switch it on.

3) **Receipt template for customers** appears under it. Leave it on **Use active receipt template**, or pick one. See [Choose the customer's template](#template-choice).

A logged-in customer now sees a **Receipt** button beside their orders in **My Account → Orders**. It downloads a PDF named after the order, such as `receipt-1234.pdf`.

The button shows only for orders that have been paid for:

| Order status                                                                            | Receipt button |
| --------------------------------------------------------------------------------------- | -------------- |
| **Processing**                                                                          | Yes            |
| **Completed**                                                                           | Yes            |
| **Refunded**                                                                            | Yes            |
| Any other status, such as **Pending payment**, **On hold**, **Cancelled** or **Failed** | No             |

A developer can [change which statuses show the button](#developers).

## Choose the customer's template[​](#template-choice "Enlace directo a Choose the customer's template")

**Receipt template for customers** sets which template the download uses.

* **Use active receipt template** (the default): customers get your active receipt template from **POS → Templates**. Change it there and their downloads follow.
* **A named template**: customers always get that one, whatever the cashier picks at the till. Use this when several receipt templates are active, or to give online orders their own look.

A narrow thermal-style template makes a narrow PDF. For online orders a full page usually reads better: the gallery's **Invoice** template is made for A4 and Letter paper. See [Customise Your Receipt](/es/settings/receipt-templates/customise-receipt.md#option-1--pick-a-different-template) to add it.

The PDF is filled from the same [receipt data](/es/settings/receipt-templates/receipt-data.md) as the till receipt, so your logo, store details and tax settings carry over.

If a template you picked is later deleted or unpublished, the dropdown shows **Unavailable template** and customers get your active receipt template instead. Pick another one.

## Add a receipt link to the order confirmation page[​](#shortcode "Enlace directo a Add a receipt link to the order confirmation page")

Give customers a **Download receipt (PDF)** link on the "thank you" page they see after checkout. Guests who checked out without an account get their receipt this way.

If your WP Admin has **Appearance → Editor → Templates → Order Confirmation**, put the link on the thank-you page yourself:

1. In WP Admin, go to **Appearance → Editor → Templates** and open **Order Confirmation**.
2. Add a **Shortcode** block where you want the link, and type `[wcpos_receipt]` in it.
3. Press **Save**.

If you don't have that template, or you want the link on an order's page in **My Account**, ask a developer to [add the receipt link from code](#developers).

The shortcode works whether or not **Let customers download receipts** is on: that setting only controls the button in **My Account → Orders**.

Shortcode options and examples

`[wcpos_receipt]` works on the order confirmation page and on an order's page in **My Account**. There it finds the order by itself, so you don't type an order number. On any other page it shows nothing unless you give it an `order_id`.

| Option      | Default                          | What it does                                                                            |
| ----------- | -------------------------------- | --------------------------------------------------------------------------------------- |
| `order_id`  | *(found on the page)*            | Link to one order, on any page. Shows only to a logged-in customer who owns that order. |
| `link_text` | `Download receipt (PDF)`         | The words of the link.                                                                  |
| `format`    | `pdf`                            | `pdf` downloads a PDF. `html` opens the receipt in the browser, ready to print.         |
| `template`  | *(your active receipt template)* | Use this template instead.                                                              |
| `class`     | `wcpos-receipt-link`             | CSS class on the link.                                                                  |
| `id`        | *(none)*                         | HTML `id` on the link.                                                                  |

The shortcode's `template` option ignores **Receipt template for customers**: leave it out and the link uses your active receipt template.

A download link with your own words:

```
[wcpos_receipt link_text="Download your invoice"]
```

Open the receipt in the browser instead of downloading a PDF:

```
[wcpos_receipt format="html" link_text="View your receipt"]
```

Use a particular template, for example an A4 invoice instead of your 80mm till receipt:

```
[wcpos_receipt template="123" link_text="Download invoice (PDF)"]
```

The template number is in the address bar when you edit the template in **POS → Templates** (`post=123`). A template that isn't published is ignored, and the link uses your active receipt template.

## Who can open a receipt[​](#security "Enlace directo a Who can open a receipt")

* **Customers with an account** sign in and use the **Receipt** button in **My Account → Orders**.
* **Guests** who checked out without an account use the receipt link on their order confirmation page, once you [put one there](#shortcode).

Share receipt links only with the customer

Anyone who has a receipt link can open that receipt without signing in. Treat it like the order itself.

How receipt links are protected

Every receipt link carries the order's private key, the same one WooCommerce puts on its order confirmation page. Without the right key, the receipt doesn't open. A shortcode with an `order_id` option shows its link only to the signed-in customer who owns that order.

## If something goes wrong[​](#goes-wrong "Enlace directo a If something goes wrong")

Most fixes below are made in WP Admin. If you're a cashier, pass the message the customer sees to whoever runs the website. Meanwhile, with [WCPOS Pro](/es/getting-started/pro-license.md), you can print or email their receipt at the till: see [Reprint a receipt](/es/manage-store/orders.md#receipt-reprinting) on the **Orders** page.

**The customer sees no Receipt button.** Check that **Let customers download receipts** is on, that the order is **Processing**, **Completed** or **Refunded**, and that at least one receipt template is active in **POS → Templates**. The button is only in **My Account → Orders**, for a logged-in customer.

**"No receipt template is configured."** The PDF has no template to use. Turn on a receipt template in **POS → Templates**.

**"You do not have permission to view this receipt."** The link is incomplete or was copied wrong: each link carries a private key for its order. Send the customer the link from their confirmation page or **My Account** again.

**"Could not generate the receipt PDF."** The PDF couldn't be made from the template. Open it in **POS → Templates** and preview it. See [Customise Your Receipt](/es/settings/receipt-templates/customise-receipt.md).

**The link opens a "Page not found" error.** In WP Admin, go to **Settings → Permalinks** and choose any option except **Plain**. Receipt links don't work with **Plain**.

## For developers[​](#developers "Enlace directo a For developers")

Add the receipt link from code

On a classic theme, print the link from the two WooCommerce actions that draw those pages:

```
// The order confirmation ("thank you") page.

add_action( 'woocommerce_thankyou', function () {

	echo do_shortcode( '[wcpos_receipt]' );

} );



// An order's page in My Account.

add_action( 'woocommerce_view_order', function () {

	echo do_shortcode( '[wcpos_receipt]' );

} );
```

The shortcode finds the order on both pages, so it needs no `order_id`.

Filters for the Receipt button and the PDF template

Three filters sit on top of the settings above, for rules the settings can't express, such as per order or per customer:

```
// Force the My Account Receipt button on or off, overriding the setting.

// Its default value is the "Let customers download receipts" setting,

// so you only need it to override that, e.g. show the button for one user role.

add_filter( 'wcpos_storefront_receipt_my_account_button', '__return_true' );



// Change which order statuses show the button (default: processing, completed, refunded).

add_filter( 'wcpos_storefront_receipt_order_statuses', function ( $statuses, $order ) {

	$statuses[] = 'on-hold';

	return $statuses;

}, 10, 2 );



// Use a different template for storefront PDF downloads, overriding the template

// chosen by the setting or the shortcode. Receives and returns the full template array

// (null when none is configured).

add_filter( 'wcpos_storefront_receipt_template', function ( $template, $order ) {

	return \WCPOS\WooCommercePOS\Templates::get_template( 123 );

}, 10, 2 );
```

Before WCPOS 2.0 these filters were named `woocommerce_pos_storefront_receipt_*`. Those names still work but are deprecated since 2.0 and are removed in 2.2 at the earliest. See [Hook naming](/es/manage-store/add-ons.md#hook-naming).

The PDF address is `/wcpos-checkout/wcpos-receipt/{order_id}` with `?key={order_key}&format=pdf`: the same key-gated receipt address the POS uses, with `format=pdf` returning a PDF instead of the page.

## Related Documentation[​](#related-documentation "Enlace directo a Related Documentation")

[Customise Your ReceiptPick, tweak or edit a receipt template](/es/settings/receipt-templates/customise-receipt.md)

[General SettingsWhere the Receipt button is switched on](/es/settings/general.md)

[Orders: Reprint a receiptPrint or email any order's receipt again from the POS (WCPOS Pro)](/es/manage-store/orders.md#receipt-reprinting)
