# POS Integration service

## Architecture&#x20;

<figure><img src="/files/MlRSZaZuHUmeVhySbrvh" alt=""><figcaption></figcaption></figure>

## How the system works

Token operators, by using the Token X admin panel, register customers. Then, operators organize the store branches, pump OKC terminals, and market terminals in the branches. So, the system pairs the terminals.

As the oil is released to the customer, the Token Pump OKC moves to the payment acceptance mode. Users can make the payment either in Pump OKC or from market POS. Therefore, Pump OKC adds the sale order to the Token X cloud. Market POS gets the order from the Token x cloud when the Market operator presses the menu of Market POS. Market pos must lock the order with the Token X cloud as it moves into the payment state.

As the Market POS finalizes the sale and takes the payment, it must return the sale info to the Token X cloud for Pump OKC to register to the fiscal memory and inform the GIB systems.

## The Integration Checklist

<details>

<summary>Setup</summary>

**API Environments**\
\- Test environment base URL: [https://test-api.devtokeninc.com](https://test-api.devtokeninc.com/)\
\
**Authentication & Authorization**\
\- Token will share the Client Credentials for Authentication and the virtual terminalId.&#x20;

</details>

<details>

<summary>Sale Flow</summary>

Please follow Energy->Instore POS Integration

1. 1000TR adds order after filling fuel is done.
2. Instore POS lists orders by consuming Get Order Summary List API
3. The POS gets order details by consuming Get Order API, when cashier selects related plate number from order list.
4. The POS locks the order, when cashier proceeds to payment. If lock is successful, then the POS allows to payment, otherwise, not allowed.
5. According to payment status,
   1. If payment unsuccessful, then POS must send unlock request.
   2. If payment successful, then POS sends payment request with customer slip data.
6. 1000TR completes order with receipt info.

</details>

## Access to API's

{% embed url="<https://sandbox.tokeninc.com/#0a625727-2acb-4cc4-9e0b-674e040ac8db>" %}

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.tokeninc.com/token-developer-portal-1/x-platform/token-x-energy/pos-integration-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
