Skip to content

Frontview

Get the frontview configured for your Point of Sale. Frontview is a UI hierarchy that groups categories, products, and navigation items for display in your application.

Use pos.frontview_id from /point_info as frontview_id in this request. For product elements, content_id is the service ID from /services and should be used as product in transaction requests.

Endpoint: POST /frontview

Request

bash
curl -X POST https://API-ENDPOINT/frontview \
  -H "Content-Type: application/json" \
  -d '{
    "frontview_id": "69f393a3ebd85",
    "auth": {
      "id": "21001",
      "key": "177757256348500",
      "hash": "2effa39516fc86f3eb1fd894152429c1"
    }
  }'
php
<?php
$url = 'https://API-ENDPOINT/frontview';
$key = (string) (time() * 1000);
$data = [
    'frontview_id' => '69f393a3ebd85',
    'auth' => [
        'id' => '21001',
        'key' => $key,
        'hash' => md5('21001' . $token . $key)
    ]
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
javascript
const key = Date.now().toString();
const response = await fetch('https://API-ENDPOINT/frontview', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    frontview_id: '69f393a3ebd85',
    auth: {
      id: '21001',
      key,
      hash: md5(`21001${token}${key}`)
    }
  })
});

const data = await response.json();
console.log(data);
python
import hashlib
import time

import requests

url = 'https://API-ENDPOINT/frontview'
key = str(int(time.time() * 1000))
hash_value = hashlib.md5(f"21001{token}{key}".encode()).hexdigest()

response = requests.post(url, json={
    'frontview_id': '69f393a3ebd85',
    'auth': {
        'id': '21001',
        'key': key,
        'hash': hash_value
    }
})

print(response.json())

Request Fields

FieldTypeRequiredDescription
frontview_idstringYesFrontview ID from /point_info response field pos.frontview_id
authobjectYesStandard authentication object

Response

json
{
  "elements": [
    {
      "id": 24079,
      "parent_id": null,
      "type": "category",
      "alias": "",
      "name": "Games & Gifts",
      "active": 1,
      "image_large": "https://url-to-file/24079_large.png",
      "image_small": null,
      "action": "",
      "params": [],
      "content_id": ""
    },
    {
      "id": 24080,
      "parent_id": 24079,
      "type": "category",
      "alias": "game-pubg",
      "name": "PUBG Mobile",
      "active": 1,
      "image_large": "https://url-to-file/24080_large.jpg",
      "image_small": "https://url-to-file/24080_small.jpg",
      "action": "",
      "params": [],
      "content_id": ""
    },
    {
      "id": 24081,
      "parent_id": 24080,
      "type": "product",
      "alias": "",
      "name": "PUBG Mobile<br>325 UC<br>Redeem Code",
      "active": 1,
      "image_large": null,
      "image_small": null,
      "action": "",
      "params": [],
      "content_id": "pubg_mobile_20_aed"
    },
    {
      "id": 24435,
      "parent_id": 24398,
      "type": "other",
      "alias": "",
      "name": "Etisalat",
      "active": 1,
      "image_large": "https://url-to-file/24435_large.png",
      "image_small": "https://url-to-file/24435_small.png",
      "action": "gotoCategory",
      "params": { "target_alias": "mobile_etisalat" },
      "content_id": ""
    },
    {
      "id": 24439,
      "parent_id": 24438,
      "type": "other",
      "alias": "international",
      "name": "international",
      "active": 1,
      "image_large": "https://url-to-file/24439_large.gif",
      "image_small": "https://url-to-file/24439_small.png",
      "action": "international",
      "params": { "product_slug": "intl2" },
      "content_id": ""
    }
  ]
}

Response Fields

FieldTypeDescription
elementsarrayFlat list of frontview elements. Build the UI hierarchy using id and parent_id.

Element Fields

FieldTypeDescription
idintegerUnique frontview element ID
parent_idinteger/nullParent element ID. null means a root-level element.
typestringElement type: category, product, or other
aliasstringOptional alias for navigation inside the same frontview
namestringDisplay name. May contain <br> line breaks.
activeinteger1 means active. Hide or disable inactive elements.
image_largestring/nullLarge image path for detail views, category banners, or large tiles
image_smallstring/nullSmall image path for icons, thumbnails, or compact tiles
actionstringAction to execute when the element is selected
paramsobject/arrayParameters for action, or an empty array when there are no parameters
content_idstringService ID from /services for product elements. Empty for non-product elements.

Rendering Hierarchy

Frontview returns a flat elements array. Build the tree on the client side:

  1. Index elements by id.
  2. Treat elements with parent_id: null as root nodes.
  3. Attach each element with a non-null parent_id to the matching parent.
  4. Preserve the API order for siblings unless your UI has its own ordering rule.
  5. Render image_small for compact lists and image_large for large tiles or detail screens when present.

For type: "category", open or display its child elements. For type: "product", use content_id as the service ID from /services and continue with the relevant transaction flow.

Actions

ActionWhen to useParameters
Empty string ("")Default behavior. Categories open their children; products start the transaction flow using content_id.No action-specific parameters. params.warning may be displayed to the customer when present.
gotoCategoryNavigate to another category or element inside the same frontview.target_alias - alias of the destination element.
gotoPageOpen an application page handled by your integration.page - page identifier. params - page-specific payload, often a JSON string with encoded request parameters.
internationalStart the International Bridge wizard. The wizard should use the /international-bridge discovery and transaction endpoints.product_slug - product slug returned by the API. country - optional ISO 3-letter country code. group - optional country group key.

TIP

When params.target_alias is returned, resolve it against element aliases in the same frontview and navigate to that element.

Paynet API Documentation