Display a QR Code

Applies to: Terminal API

Learn how to display a QR code for a buyer to scan on the Square Terminal.

Link to section

Overview

As part of creating custom workflows with the Terminal API, you can create a screen workflow that allows a buyer to scan a QR code. You send a Terminal action request of the QR_CODE type and configure options for the QR code in qr_code_options.

In the request body for qr_code_options, you provide the title text, body text, and barcode content that display on the screen.

For more information about encoding information to barcode content, see the open-source reference for barcode image processing standards.

Link to section

Example use case for the QR code

You can build a screen workflow that prompts the buyer to scan the QR code and download the seller's application.

An animation of the QR code screen displayed on the Square Terminal.

Link to section

Make a QR code scan input request

  1. Send a Terminal action POST request using the CreateTerminalAction endpoint and specify the QR_CODE action type. In the qr_code_options body, provide screen text for title and body.

    Create terminal action

    The Terminal action response includes an action_id and a PENDING status.

    The Square Terminal displays the QR code screen for the buyer.

A Square Terminal showing a screen asking the buyer how they want to receive reminders from the seller.

The Terminal action is put in a COMPLETED state and the Square Terminal displays the idle screen.

  1. Send a GET request to see the Terminal action that includes the decision.

    Get terminal action

    The following response example shows the response with the status of COMPLETED for the QR code request: