Code QR -Integration

Comment créer un code QR sur un reçu (uniquement avec intégration de code QR)

 

 

Cette solution est disponible uniquement dans le package Whitelable

 

Le point de vente (POS) doit générer un code QR sur le reçu au format d'encodage JSON.

Voici les attributs nécessaires :
{
  "Business id": 1234,
  "currency": "CAD",
  "amount": 3000,
  "timestamp": "2022-01-19T14:05:52",
  "locationId": 1,
  "invoiceId": "100010"
}
}

Les attributs n'ont pas besoin d'être dans le même ordre. Des paramètres optionnels peuvent être ajoutés si nécessaire, etc.

Pour obtenir plus d'aide :
Voici un exemple fonctionnel en PHP avec le code QR, la clé de chiffrement et le vecteur d'initialisation fournis :
https://laravelplayground.com/#/snippets/63bc45b1-36f9-4848-84db-50b07f02fe23
Veuillez le modifier ou en créer un autre qui déchiffrera une chaîne chiffrée de la même manière que pour un vrai code QR.

 

Veuillez contacter l'équipe de support pour activer l'intégration du code QR ainsi que la clé de chiffrement, le vecteur d'initialisation et l'ID de la succursale.

 

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

        }

      }

    ]

  }