QR code Integration

How to create a QR code on a receipt (QR code integration only)

Set up a QR code per receipt so that your customers can start earning points when scanning it from your Whitelabel Loyalty app

Note: This solution is only available for the Whitelabel package.

 

The POS needs to generate a QR code on the receipt in JSON encryption format 

Here are the attributes needed
{
  "Business id": 1234,
  "currency": "CAD",
  "amount": 3000,
  "timestamp": "2022-01-19T14:05:52",
  "locationId": 1,
  "invoiceId": "100010"
}

The attributes do not have to be in that same order. Optional parameters can be added if needed etc.

For more help:

Here is a working example in PHP and one with the provided QR code, key, and iv
https://laravelplayground.com/#/snippets/63bc45b1-36f9-4848-84db-50b07f02fe23
Please modify it or create another one that will decrypt an encrypted string the same way it will be done for a real QR Code.

 

Please reach out to the support team to enable the QR code integration as well as the Encryption Key, IV and Branch ID 

 

Additional Attributes 

You can find a list of potential attributes that can be transmitted to Kangaroo after decrypting the JSON code. Each parameter is accompanied by its respective type and a brief description. Additionally, you can find a sample sale structure presented in JSON format for reference.

 

Attributes

 

Name

Type

Description

sale

array

Required for products scan Array of sale details

sale.branch_link_id

integer

Required

ID of the branch link associated with the sale.

sale.sale_external_id

string

Required

External ID associated with the sale.

sale.sale_number

string

Optional

String representing the sale number.

sale.customer_external_id

string

Required

External ID associated with the customer.

sale.sale_status

string

Required

Status of the sale. 

Possible values: new

sale.payment_status

string

Optional

Payment status of the sale. Possible values: paid

sale.sale_created_at

Date (Y-m-d format; ex: 2023-11-20)

Required

Date when the sale was created.

sale.sale_total

Numeric (min:0 | max:99999999.99)

Required

Total amount of the sale.

sale.sale_subtotal

Numeric (min:0 | max:99999999.99)

Required

Subtotal amount of the sale.

sale.sale_total_tax

Numeric (min:0 | max:99999999.99)

Required

Total tax amount associated with the sale.

sale.sale_shipping

Numeric (min:0 | max:99999999.99)

Optional

Numeric value representing the shipping amount.

sale.sale_shipping_tax

Numeric (min:0 | max:99999999.99)

Optional

Numeric value representing the tax associated with shipping.

sale.sale_discounts

Numeric (min:0 | max:99999999.99)

Required

Discounts applied to the sale.

sale.sale_discounts_tax numeric

Numeric (min:0 | max:99999999.99)

Required

Tax associated with the discounts applied to the sale.

sale.sale_currency

String (iso_code; ex: USD)

Required

Currency code associated with the sale.

sale.customer

array

Sometimes required

sale.customer.first_name

string

Optional

String representing the customer's first name.

sale.customer.last_name

string

Optional

String representing the customer's last name.

sale.customer.birth_date

Date  (Y-m-d format; ex: 2023-11-20)

Optional

Date representing the customer's birth date.

sale.customer.email

email

Required without phone

Email address of the customer.

sale.customer.phone

regex:/^\+?[1-9]\d{1,14}$/

Required without email

Phone number of the customer (E.164 format)

sale.customer.language

string

Optional

Language code representing the customer's language. Possible values: en, fr, es, pt, nl, ar, ku.

sale.sale_lines

array

Required

Sale lines associated with the sale.

sale.sale_lines.*.line_external_id

string

min:1|max:36

Required

Unique identifier string representing the ID of the sale line.

sale.sale_lines.*.quantity

integer

Required

Quantity number

sale.sale_lines.*.line_total

numeric (min:0 | max:99999999.99)

Required

Total amount of the sale line

sale.sale_lines.*.line_subtotal

numeric (min:0 | max:99999999.99)

Required

Subtotal amount of the sale line

sale.sale_lines.*.line_total_tax

numeric (min:0 | max:99999999.99)

Required

Total tax amount of the sale line

sale.sale_lines.*.line_discounts

numeric (min:0 | max:99999999.99)

Required

Total discount amount of the sale line

sale.sale_lines.*.line_discounts_tax

numeric (min:0 | max:99999999.99)

Required

Total tax discount amount of the sale line

sale.sale_lines.*.line_item

array

Required

Sale line item details.

sale.sale_lines.*.line_item.item_external_id

string (min:1 | max:36)

Required

Unique identifier string representing the ID of the product line item.

sale.sale_lines.*.line_item.variant_external_id

string (min:1 | max:36)

Optional

Unique identifier string representing the variant ID of product line item.

sale.sale_lines.*.line_item.description

string (min:1 | max:10000)

Optional

String representing the description of the product line item.

sale.sale_lines.*.line_item.name

string (min:1 | max:255)

Required

String representing the name of the product line item.

sale.sale_lines.*.line_item.sku

string (min:1 | max:255)

Optional

String representing the SKU of the product line item.

sale.sale_lines.*.line_item.price

numeric (min:0 | max:99999999.99)

Required

String representing the price of the product line item.



JSON format

{

  "businessId": 100,

  "locationId": "Loc001",

  "timestamp": "2023-11-20 12:51:48",

  "sale": {

    "branch_link_id": 1001,

    "sale_external_id": "SLEXT-001",

    "customer_external_id": "CSTM-001",

    "sale_created_at": "2023-11-20 12:51:48",

    "sale_status": "new",

    "payment_status": "paid",

    "sale_total": 53,

    "sale_subtotal": 53,

    "sale_total_tax": 0,

    "sale_discounts": 0,

    "sale_discounts_tax": 0,

    "sale_currency": "USD",

    "customer": {

      "first": "John",

      "last": "Doe",

      "email": "abcdefg@yopmail.com"

    },

    "sale_lines": [

      {

        "line_external_id": "LNEXT001",

        "quantity": 1,

        "line_total": 33,

        "line_subtotal": 33,

        "line_total_tax": 0,

        "line_discounts": 0,

        "line_discounts_tax": 0,

        "line_item": {

          "item_external_id": "ITM001",

          "name": "Item #1",

          "price": 33,

          "sku": "sku#001"

        }

      },

      {

        "line_external_id": "LNEXT002",

        "quantity": 2,

        "line_total": 20,

        "line_subtotal": 20,

        "line_total_tax": 0,

        "line_discounts": 0,

        "line_discounts_tax": 0,

        "line_item": {

          "item_external_id": "ITM002",

          "name": "Item #2",

          "price": 10

        }

      }

    ]

  }

}