---
title: POS Integration Guide
slug: pos-integration-guide
icon: {"faIcon":"fa-solid fa-shop"}
docTags: 
createdAt: 2022-04-23T08:41:40.000Z
---

**POS Integration using QRCode**

# Introduction

Are you a merchant partner looking to integrate octifi in your Application/POS terminal?

:::BlockQuote
Looking for something else?
If you are looking for a checkout experience on the web instead, then you should look at the [Web Integration Guide](https://docs.sg.latitudepay.com/web-integration-guide)
:::


**Welcome**

Integrate OctiFi by integrating a dynamic qrcode within your App.

**Step 1:&#x20;**&#x43;reate a dynamic qrcode by passing a bill \{} to LatitudePay api (details below). Show the qrcode on your terminal.

**Step 2:&#x20;**&#x43;ustomer scans the qrcode pay using octifi App

::Image[]{src="https://api.archbee.com/api/presign/uMLzTav_HIzdTyGRmLuEG/36OW-RA5ohNl6Qq0Ie6uJ_image.png" size="64" caption="Customer Scans the QRCode" position="center" showCaption="true"}



**Step 3:&#x20;**&#x49;f you need updates on the order use the status api (details below)

# Staging vs Live Environment

- This document only covers the staging environment api's.
- Please refer to [sandbox-and-live-environment](https://docs.sg.latitudepay.com/sandbox-and-live-environment) for production env urls.

# Authorization

1. The api to create the dynamic qrcode requires an authorization key.
2. Create authorization key from merchant console following[ these instructions](https://docs.sg.latitudepay.com/integration-prerequisite#f9-get-your-merchant-keys):
3. Include the following header:

`HTTP_AUTHORIZATION: Api-Key <your public key>`

# Apis

## How to generate dynamic QRCode

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://latitudepay.me/api/v2/partner/qrcode/",
  "name": "Create QRCode",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "optional",
        "name": "ParHTTP_AUTHORIZATIONameter name",
        "type": "string",
        "description": "<the public key>"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "ZFeFIh0RCmhpsEc0-6usf",
        "code": "{\n    \"status_code\": 200,\n    \"message\": \"Success\",\n    \"data\": {\n        \"qrcode\": \"https://lpaymys.page.link/bepv\",\n        \"qrcode_id\": \"e55014c5-9072-4035-a45d-9a1fa92a188b\",\n        \"app_payment_link\": \"https://lpaymys.page.link/bepv\"\n    },\n    \"errors\": null,\n    \"errors_code\": \"\"\n}",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "L78t3tKZ-69Aiv-CGpABD",
        "code": "{\n  \"status_code\": 400,\n   \"message\": \"QR code not encoded !\",\n   \"data\": {},\n   \"errors\": {\n       \"bill\": \"total_amount\"\n   },\n   \"errors_code\": \"GENERIC_ERROR_CODE\"\n}",
        "language": "404",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "ZFeFIh0RCmhpsEc0-6usf"
  },
  "examples": {
    "languages": [
      {
        "id": "giyaSLAgX9WAlMWwsP5Sg",
        "code": "{\n \"metadata\": {\n     \"key1\":\"value1\",\n     \"key2\":\"value2\"\n },\n \"merchant\": {\n   \"merchant_id\": \"\",\n   \"store_id\": \"6\",\n   \"terminal_id\": \"7\",\n   \"public_key\": \"demo_hardcoded_public_key_btL7eqg9_fixed_my\"\n },\n \"bill\": {\n   \"merchant_order_id\":\"f0f73318-73d8-4df6-b801-0d0096da082b\",\n   \"display_name\": \"string\",\n   \"tax_amount\": 0.0,\n   \"total_amount\": 100,\n   \"currency\": \"MYR\",\n   \"reference_id\": \"string\",\n   \"pre_checkout_token\": \"string\",\n   \"type\": \"OFFLINE\",\n   \"version\": \"v2\"\n },\n \"customer\": {\n   \"phone_number\": \"+65599017300\",\n   \"email\": \"cx-552952@t.com\"\n }\n}",
        "language": "json",
        "customLabel": "Body"
      }
    ],
    "selectedLanguageId": "giyaSLAgX9WAlMWwsP5Sg"
  },
  "description": "Create a QRCODe via this api",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

# Example Curl command

```shell
curl --location --request POST 'https://latitudepay.me/api/v2/partner/qrcode/' \
--header 'Authorization: Api-Key demo_hardcoded_public_key_btL7eqg9_fixed_my' \
--header 'Content-Type: application/json' \
--data-raw '{
  "metadata": {
      "key1":"value1",
      "key2":"value2"
  },
  "merchant": {
    "merchant_id": "",
    "store_id": "string",
    "terminal_id": "string",
    "public_key": "demo_hardcoded_public_key_btL7eqg9_fixed_my"
  },
  "bill": {
    "merchant_order_id": "67baeb37-904f-4bc8-9b31-61cf25f12c7e",
    "display_name": "Macbook Pro 2020",
    "tax_amount": 0.0,
    "total_amount": 2400.99,
    "currency": "MYR",
    "reference_id": "string",
    "pre_checkout_token": "string",
    "type": "OFFLINE",
    "version": "v2"
  },
  "customer": {
    "phone_number": "+60599625033",
    "email": "joedoe@123fakestreet.com"
  }
}'
```

**Response:&#x20;**

1. Note down the **qrcode** text (which is a deep link) to be shown as a Qrcode Text

:::BlockQuote
"**qrcode**": "https\://octifi.page.link/HZjx",
:::

&#x20;   2\. Note down the **qrcode\_id** which can be used next in the status api.       &#x20;

:::BlockQuote
&#x20;"**qrcode\_id**": "64ea6c20-f27e-487e-b11f-e0a7293ae0d1",
:::

# Status Api

We provide the status API as well to check the status of the QRCode above.

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": " https://latitudepay.me/api/v1/partner/qrcode/status/<qrcode_id>/",
  "name": "Status Api",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "ParameHTTP_AUTHORIZATIONter name",
        "type": "string",
        "description": "<your public api end point>"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "WddH5XvAP36zq3DY2qt9s",
        "code": "{\n    \"status_code\": 200,\n    \"message\": \"Success\",\n    \"data\": {\n        \"steps\": {\n            \"download\": true,\n            \"signup\": true,\n            \"profile\": true,\n            \"order\": true,\n            \"payment\": true\n        },\n        \"qr_details\": {\n            \"bill\": {\n                \"type\": \"OFFLINE\",\n                \"version\": \"v2\",\n                \"currency\": \"MYR\",\n                \"tax_amount\": 0.0,\n                \"display_name\": \"Macbook Pro 2020\",\n                \"reference_id\": null,\n                \"total_amount\": 2400.99,\n                \"merchant_order_id\": \"1f25097d-75af-4ec7-bb57-cffc4d7e305d\",\n                \"pre_checkout_token\": \"99206615-0495-4a94-937f-575f7e265e47\"\n            },\n            \"customer\": {\n                \"email\": \"joedoe@123fakestreet.com\",\n                \"phone_number\": \"\"\n            },\n            \"merchant\": {\n                \"store_id\": null,\n                \"public_key\": \"demo_hardcoded_public_key_btL7eqg9_fixed_my\",\n                \"merchant_id\": 912,\n                \"terminal_id\": null,\n                \"merchant_user\": \"USER-bpy-lzs-316\",\n                \"merchant_user_id\": 3083\n            },\n            \"metadata\": {}\n        },\n        \"result\": {\n            \"merchant_order_id\": \"1f25097d-75af-4ec7-bb57-cffc4d7e305d\",\n            \"checkout_token\": \"b61c6a1b-f7c2-42ea-b6d1-03c268798f1b\",\n            \"statuscode\": 200\n        },\n        \"status\": \"SUCCESS\"\n    },\n    \"errors\": null,\n    \"errors_code\": \"\"\n}",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "2FWxw1u0KU9wkN6f8KB2o",
        "code": "{\n  \n}",
        "language": "404",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "WddH5XvAP36zq3DY2qt9s"
  },
  "examples": {
    "languages": [
      {
        "id": "a3_S2a8v7xSnMH3FHPmup",
        "code": "",
        "language": "none",
        "customLabel": ""
      },
      {
        "id": "AkEBXd4ocVh_2_lFC9GlD",
        "code": "",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "AkEBXd4ocVh_2_lFC9GlD"
  },
  "description": "Get status of the QRCode <qrcode_id> generated above",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  }
}
```
:::

Result:

:::BlockQuote
"status": "PENDING"
:::

Keep calling the /status api until status changes to "SUCCESS".

These are valid values for status:

- PENDING  : meaning order is still pending customer payment
- SUCCESS : customer payment is complete
- FAILED : customer payment is failed.&#x20;

# Timeout in status

- We recommend that you keep calling the status api with 5second delay for upto 10mins to 15mins (until customer has made the final payment).



# WebHooks

****

