# Send receipts by email or text message Provide customers with paperless receipts by sending them via email or short message service (SMS). The InStore POS supports sending a receipt at checkout using email or SMS. To enable paperless receipts, send a receipt template (for example, your existing [Sales receipt](/instore/implement-instore/receipts/sales-receipt.md)) and cart data to the Receipt Print Server API. Use the `Allow_Defaulted_Customer_Email_Override` and `Allow_Defaulted_Customer_Phone_Override` [administration parameters](/instore/customization/administration-parameters.md#print-parameters) to control whether a customer can use an email address or phone number on an ad-hoc basis. Listen for the user's selected delivery method (print, email, or SMS) via the `inStoreCore-receiptChoice` event. For details, see [Events](/instore/implement-instore/integrate-with-instore/events.md#instorecore-receiptchoice). ## Overview The paperless receipt feature consists of the following components: - A receipt template written with Handlebars syntax. - A data object that contains receipt fields (for example, line items, total, and location data). - A request to the Receipt Print Server API that compiles the template and returns both markdown and Scalable Vector Graphics (SVG) output. You can use the returned markdown to populate your outbound email or SMS system. You can display the returned SVG during checkout or when reprinting a receipt. ## Generate an SVG receipt The `svg` endpoint generates an SVG representation of a receipt without printing it. The builder utility processes the template and data, and converts currency values to Dinero format for consistent currency rendering. ### Request Send a POST request with the following fields to the Receipt Print Server API: ```bash title="Request" POST /api/svg { "template": "Handlebars receipt template string", "data": "JSON receipt data object", "currency": "USD", "locale": "en-US", "currencyFormat": "$0,0.00" } ``` ```json title="Example request body" { "template": "^{{location.location_name}}^\n{{location.address_line_1}}\n-----------------\n{{#each line_items}}\n{{description}} {{quantity}} @ {{price}}\n{{/each}}\n-----------------\nTotal: {{total}}", "data": { "location": { "location_name": "COFFEE SHOP", "address_line_1": "123 Main Street" }, "line_items": [ { "description": "Cappuccino", "quantity": 1, "price": "$4.50" }, { "description": "Croissant", "quantity": 2, "price": "$3.75" } ], "total": "$12.00" }, "currency": "USD", "locale": "en-US", "currencyFormat": "$0,0.00" } ``` ### Response The server returns the status and receipt markdown that you can use to populate your own HTML template, which is suitable for sending from your outbound email or SMS system. ```json title="Response structure" { "markdown": "Compiled receipt markdown", "svg": "SVG representation of the receipt", "success": true } ``` Example response: ```json title="Example response" { "markdown": "^COFFEE SHOP^\n123 Main Street\n-----------------\nCappuccino 1 @ $4.50\nCroissant 2 @ $3.75\n-----------------\nTotal: $12.00", "svg": "COFFEE SHOP123 Main Street", "success": true } ``` The `^` characters in the template apply styling (typically emphasis or larger text) within the rendering engine. The template uses Handlebars syntax for dynamic content. For more information about available data fields, see [Receipt data fields](/instore/implement-instore/receipts/receipt-data-fields.md). ## Related pages - [Area overview page with navigation](/instore.md) - [Previous page: Manage and display receipt data](/instore/implement-instore/receipts/manage-display-receipt-data.md) - [Next page: Data fields for receipt templates](/instore/implement-instore/receipts/receipt-data-fields.md) - [Search documentation and API specs](/search.md)