Developers Guides Receipts

Receipts

Generate, email, print, and customise receipts for in-store transactions using the Surfboard Receipts API.

In-Store API Receipts Printing ESC/POS

Overview

After a payment is completed, Surfboard gives you several ways to deliver receipts to customers. You can attach cash register details for regulatory compliance, email a digital copy, retrieve a shareable link, print directly on a Surfboard terminal, or send fully custom ESC/POS commands for branded receipt output.

All receipt endpoints accept a Transaction ID, Payment ID, or Order ID as the identifier, so you can work with whichever reference suits your integration.

Prerequisites

Before working with receipts, make sure you have:

  • A Surfboard developer account with valid API credentials (API-KEY and API-SECRET)
  • At least one completed transaction, payment, or order
  • For printing: a registered Surfboard terminal with printing capability (SurfTouch with dock or SurfPrint)

Adding Receipt Information

Use this endpoint to store cash register-specific details against an order. This data is used when generating receipt output and is often required for fiscal compliance in Nordic markets.

PUT /receipts/{orderId}

Request body:

{
  "sequenceNumber": "1234567",
  "cashRegisterName": "Kassa 1",
  "controlUnitSerialNumber": "9876543",
  "cashierName": "Amanda",
  "customerName": "Tom"
}

Request parameters:

ParameterTypeRequiredDescription
sequenceNumberstringYesReceipt sequence number from your cash register.
cashRegisterNamestringYesCash register designation or name.
controlUnitSerialNumberstringYesControl unit or control system manufacturing number.
cashierNamestringNoName of the cashier handling the transaction.
customerNamestringNoName of the customer.

Response:

{
  "status": "SUCCESS",
  "message": "Receipt information added successfully"
}
ParameterTypeDescription
statusstringSUCCESS or ERROR.
messagestringHuman-readable status message.

Emailing Receipts

Send a digital receipt directly to a customer’s email address. This is the simplest way to deliver post-payment confirmation without any printing hardware.

PUT /receipts/{id}/email

The {id} path parameter accepts a Transaction ID, Payment ID, or Order ID.

Request body:

{
  "email": "customer@example.com"
}
ParameterTypeRequiredDescription
emailstringYesEmail address to deliver the receipt to.

Response:

{
  "status": "SUCCESS",
  "message": "Receipt email sent successfully"
}
ParameterTypeDescription
statusstringStatus of the request.
messagestringDescription of the result.

Tip: You can call this endpoint multiple times with different email addresses if the customer or merchant both need a copy.

Retrieve a URL that points to a hosted digital receipt. This is useful when you want to display a QR code on the terminal screen, include a link in an SMS, or embed it in your own notification flow.

GET /receipts/{id}/link

The {id} path parameter accepts a Transaction ID, Payment ID, or Order ID.

Request body: None (empty GET request).

Response:

{
  "status": "SUCCESS",
  "data": {
    "receiptURL": "https://receipts.surfboardpayments.com/r/abc123xyz"
  },
  "message": "Receipt link fetched successfully"
}
ParameterTypeDescription
statusstringSUCCESS or ERROR.
data.receiptURLstringURL to access the hosted digital receipt.
messagestringDescription of the result.

Printing Receipts on a Terminal

Print a receipt directly from a Surfboard terminal that has printing capability. Surfboard supports printing through SurfTouch (which features a dock with a printer for checkout) and SurfPrint (which has a built-in printer for on-floor payments).

PUT /receipts/{id}/print

The {id} path parameter accepts a Transaction ID, Payment ID, or Order ID.

Request body:

{
  "templateId": "default",
  "terminalId": "trm_abc123",
  "language": "sv"
}
ParameterTypeRequiredDescription
templateIdstringNoSelect from Surfboard’s default set of receipt templates.
terminalIdstringNoTarget a specific printing-enabled terminal. If omitted, prints on the terminal that handled the transaction.
languagestringNoReceipt language. Available: sv, da, fi, en. Defaults to the merchant’s configured language.

Response:

{
  "status": "SUCCESS",
  "message": "Receipt print command sent successfully"
}
ParameterTypeDescription
statusstringStatus of the request.
messagestringDescription of the result.

Note: A SUCCESS response means the print command was dispatched to the terminal. The terminal must be online and not processing another command for the receipt to print.

Custom ESC/POS Printing

For full control over receipt layout and branding, send raw ESC/POS commands to a terminal’s built-in printer. This lets you design completely custom receipts — including logos, formatted tables, barcodes, and styled text — using the industry-standard ESC/POS command set.

PUT /receipts/{terminalId}/escpos

Note that this endpoint uses the terminalId directly in the path, not a transaction or order ID.

Request body:

{
  "escposCommands": "G0AbYQEbRQFTdXBlciBNYXJ0CjEyMyBNYWluIFN0ChtFABthAERhdGU6IDIwMjQvMTAvMDgKVGltZTogMTI6MDAgUE0KG0UBLS0tLS0tLS0tLQobRQAbYQBJdGVtIEE6IFdhdGVyClByaWNlOiAkMS4wMApJdGVtIEI6IEJyZWFkClByaWNlOiAkMi4wMAobRQEtLS0tLS0tLS0tClRvdGFsOiAkMy4wMAobRQAbYQFUaGFuayB5b3UhCgoKHVYA"
}
ParameterTypeRequiredDescription
escposCommandsstringYesA stream of ESC/POS commands encoded as a Base64 string.

Response:

{
  "status": "SUCCESS",
  "message": "ESC/POS receipt sent to terminal"
}
ParameterTypeDescription
statusstringStatus of the request.
messagestringDescription of the result.

Building ESC/POS Commands

ESC/POS is a command protocol originally developed by Epson and now supported by most thermal receipt printers. Common commands include:

CommandHexDescription
Initialize printer1B 40Reset printer to default settings.
Bold on1B 45 01Enable bold text.
Bold off1B 45 00Disable bold text.
Center align1B 61 01Center-align subsequent text.
Left align1B 61 00Left-align subsequent text.
Cut paper1D 56 00Full cut of the receipt paper.

Workflow:

  1. Compose your ESC/POS byte stream (text interspersed with control commands).
  2. Encode the entire byte stream as a Base64 string.
  3. Send the Base64 string in the escposCommands field.

Tip: Most ESC/POS libraries (e.g., escpos for Python, node-escpos for Node.js) can generate the byte stream for you. Encode the output buffer to Base64 before sending it to Surfboard.

API Quick Reference

OperationMethodEndpoint
Add receipt informationPUT/receipts/{orderId}
Email a receiptPUT/receipts/{id}/email
Fetch receipt linkGET/receipts/{id}/link
Print receipt on terminalPUT/receipts/{id}/print
Print custom ESC/POS receiptPUT/receipts/{terminalId}/escpos

For full endpoint details, see the Receipts API reference documentation.

Ready to get started?

Create a sandbox account and start building your integration today.