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.

Other Guides

in-store

Tap to Pay on iPhone SDK

Accept contactless payments directly on iPhone. Complete integration guide for Surfboard's iOS SoftPOS SDK -- from setup to production.

in-store

Android SoftPOS SDK

Turn Android devices into payment terminals with the Surfboard Android SoftPOS SDK. Complete integration guide from setup to production.

in-store

EMV Terminal Integration

Integrate traditional card-present terminals through Surfboard's unified API. From account setup to live payments in one guide.

online

Payment Page

Redirect customers to a Surfboard-hosted checkout page. The fastest way to accept online payments with minimal integration effort.

in-store

Inter-App Integration

Integrate your POS app with CheckoutX using native app switch. Register terminals, process payments, and scan NFC tags through a bi-directional deep link flow.

online

Self-Hosted Checkout

Embed a payment form directly in your web app with the Surfboard Online SDK. Full UI control with Surfboard handling PCI compliance.

online

Server-to-Server API

Process online payments entirely from your backend with Merchant Initiated Transactions. Full control over recurring payments, subscriptions, and tokenized card flows.

online

Create an Order

Learn how to create orders with line items, tax, customer details, and control functions. The starting point for accepting payments with the Surfboard API.

online

Merchant Onboarding

Set up merchants and stores on the Surfboard platform. Walk through the full onboarding flow from merchant creation to KYB completion and store setup.

online

Payment Lifecycle

Manage the full payment lifecycle from order creation through capture, void, cancel, and refund operations using the Surfboard Payments API.

online

Capture a Payment

Finalize a previously authorized payment by capturing funds. Covers delay capture and pre-authorization flows with step-by-step API examples.

in-store

Terminal & Device Management

Manage payment terminals and devices via the Surfboard API. Register in-store and online terminals, configure settings, and handle device operations.

online

Cancel a Payment

Stop an in-progress payment before it completes. Use cancellation when a customer abandons checkout or a payment needs to be halted mid-process.

online

Webhooks & Notifications

Receive real-time event notifications via webhooks, email, Slack, and SFTP. Subscribe to payment events and settlement reports for merchants and partners.

online

Recurring Payments

Implement subscription billing and recurring charges using tokenization, recurring payment configuration, and Merchant Initiated Transactions.

online

Void a Payment

Reverse a completed payment before settlement. Voiding stops funds from transferring to the merchant's account, avoiding incorrect transactions.

online

Refund an Order

Process a full refund by creating a return order with negative quantities. Covers the complete refund flow with API examples and payment method requirements.

online

Partial Refund

Refund specific items or a reduced amount from a completed order. Process partial returns by creating a return order with only the items to be refunded.

in-store

Tips Configuration

Configure tipping on Surfboard payment terminals at the merchant, store, or terminal level using a hierarchical override model.

in-store

NFC Tag Reading

Use the NFC Reading API to create tag-reading sessions on payment terminals, scan NFC/RFID-tagged products, and retrieve scanned tag data.

online

Partial Payments

Split an order across multiple payment methods or transactions. Accept card, cash, and Swish in any combination to settle a single order.

in-store

Multi-Merchant Terminals

Set up shared payment terminals for multiple merchants using the Multi-Merchant Group API. Ideal for food courts, events, and co-located businesses.

online

Store Management

Create, update, verify, and manage in-store and online stores using the Surfboard Payments Store APIs.

online

Gift Cards & Promotions

Issue and manage gift cards, track transactions, and create marketing promotions using the Surfboard Payments APIs.

online

Product Catalog

Create and manage product catalogs, products, variants, inventory levels, and analytics through the Catalog API.

online

Settlements & Reporting

Retrieve settlement reports, view adjustments, manage merchant charges, and register customer profiles for reconciliation and billing.

online

Account & Service Provider Management

Create merchant and partner accounts, manage user roles, register service providers, and configure external notifications via the Surfboard API.

online

Payment Methods

Activate, deactivate, and list payment methods for a merchant. Manage card, Swish, Klarna, AMEX, Vipps, MobilePay, and more via the API or Partner Portal.

online

Client Auth Tokens

Generate client-side authentication tokens for secure API access from browsers and mobile apps without exposing your API key or secret.

online

Partner Branding

Configure white-label branding for terminals and payment pages. Set colors, fonts, logos, and cover images at the partner level via API or Partner Portal.

Ready to get started?

Create a sandbox account and start building your integration today.