# Payment Service

**Android Pos Payment Service Request Model**

<table><thead><tr><th width="108.33333333333331">Method</th><th width="520">API URL</th><th>Parameter</th></tr></thead><tbody><tr><td>POST</td><td>https://posservice.esnekpos.com/api/pay/PhysicalPayment</td><td>JSON File</td></tr></tbody></table>

## Android Pos Payment Service Transaction Flo&#x77;**;**

In order to perform a successful collection with the Android Pos payment service model, you need to complete your integration by following the procedures described below.

The parameters to be sent to the service are as follows;

### Android Pos Payment Service Request Message Parameters<br>

**Config**

<table><thead><tr><th width="234">Parameters</th><th width="102">Type</th><th width="80">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>MERCHANT</td><td>string</td><td>Yes</td><td>It is a unique credential created specifically for the member business.</td></tr><tr><td>MERCHANT_KEY</td><td>string</td><td>Yes</td><td>It is the key information created specifically for the member business.</td></tr><tr><td>BACK_URL</td><td>string</td><td>Yes</td><td>It is the address information to which the operation result response will be returned by the system. Transaction response will be read from this address by the member business. The result of the transaction is sent as a json post.</td></tr><tr><td>PRICES_CURRENCY</td><td>string</td><td>Yes</td><td>It is the currency information in which the payment transaction will be made. Currently, only “TRY, USD, EUR, GBP” can be sent.</td></tr><tr><td>ORDER_REF_NUMBER</td><td>string</td><td>Yes</td><td>It is the reference number information to be given by the member workplace. Payment transactions can be tracked with this reference number. A maximum of 24 characters can be used.</td></tr><tr><td>ORDER_AMOUNT</td><td>string</td><td>Yes</td><td>It is the transaction amount information of the payment transaction.</td></tr><tr><td>POS_ID</td><td>int</td><td>Yes</td><td>Android pos id information.</td></tr></tbody></table>

<br>

**Customer**

<table><thead><tr><th width="147">Parameters</th><th width="100">Type</th><th width="99">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>FIRST_NAME</td><td>string</td><td>Yes</td><td>It is the name of the user (customer) performing the transaction.</td></tr><tr><td>LAST_NAME</td><td>string</td><td>Yes</td><td>It is the surname of the user (customer) who performed the transaction.</td></tr><tr><td>MAIL</td><td>string</td><td>Yes</td><td>It is the e-mail information of the user (customer) performing the transaction.</td></tr><tr><td>PHONE</td><td>string</td><td>Yes</td><td>It is the phone information of the user (customer) performing the transaction.</td></tr><tr><td>CITY</td><td>string</td><td>Yes</td><td>It is the city information of the user (customer) performing the transaction.</td></tr><tr><td>STATE</td><td>string</td><td>Yes</td><td>It is the district information of the user (customer) performing the transaction.</td></tr><tr><td>ADDRESS</td><td>string</td><td>Yes</td><td>It is the address information of the user (customer) performing the transaction.</td></tr></tbody></table>

<br>

**Product**

<table><thead><tr><th width="246">Parameters</th><th width="92">Type</th><th width="84">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>PRODUCT_ID</td><td>string</td><td>Yes</td><td>It is the ID information given to the product by the member merchant.</td></tr><tr><td>PRODUCT_NAME</td><td>string</td><td>Yes</td><td>The name of the product.</td></tr><tr><td>PRODUCT_CATEGORY</td><td>string</td><td>Yes</td><td>It is the category information of the product.</td></tr><tr><td>PRODUCT_DESCRIPTION</td><td>string</td><td>Yes</td><td>It is the description information of the product.</td></tr><tr><td>PRODUCT_AMOUNT</td><td>string</td><td>Yes</td><td>It is the amount information of the product.</td></tr></tbody></table>

#### Here is a sample JSON file to send to the service;

```json
                                            
                                        
    {
        "Config":{
            "MERCHANT": " TEST1234",
            "MERCHANT_KEY": " 4oK26hK8MOXrIV1bzTRVPA==",
            "BACK_URL": "The url address where the result of the transaction will be returned to the merchant",
            "PRICES_CURRENCY": "TRY",
            "ORDER_REF_NUMBER": "RFN0001",
            "ORDER_AMOUNT": "150.00",
            "POS_ID": 3
            },
       "Customer":{
           "FIRST_NAME": "firstname",
           "LAST_NAME": "lastname",
           "MAIL": "test@esnekpos.com",
           "PHONE": "1122356600",
           "CITY": "İstanbul",
           "STATE": "Kağıthane",
           "ADDRESS": " Merkez Mahallesi, Ayazma Cd. No:37/91 Papirus Plaza Kat:5, 34406 Kağıthane / İSTANBUL "
           },
        "Product" : [
            {
               "PRODUCT_ID": "1",
               "PRODUCT_NAME": "Product Name 1",
               "PRODUCT_CATEGORY": "Electronic",
               "PRODUCT_DESCRIPTION": "Product Description",
               "PRODUCT_AMOUNT": 80
               },
            {
               "PRODUCT_ID": "2",
               "PRODUCT_NAME": "Product Name 2",
               "PRODUCT_CATEGORY": "Home Textils",
               "PRODUCT_DESCRIPTION": "Product Description",
               "PRODUCT_AMOUNT": 70
               }
        ]
    }

                                            
                                        
```

#### Esnekpos evaluates the information and sends the reply message to the member business.

The parameters of the reply message sent from the service after the transaction are as follows;

Android Pos Payment Service Reply Message Parameters

<table><thead><tr><th width="214">Parameters</th><th width="93">Type</th><th width="74">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>STATUS</td><td>string</td><td>Yes</td><td>The result of the payment transaction is the status information.</td></tr><tr><td>RETURN_CODE</td><td>string</td><td>Yes</td><td>The result of the payment transaction is the status information.</td></tr><tr><td>RETURN_MESSAGE</td><td>string</td><td>Yes</td><td>The status message is the result of the payment process.</td></tr><tr><td>ORDER_REF_NUMBER</td><td>string</td><td>Yes</td><td>Reference number information given by the Android Pos system for the payment transaction.</td></tr></tbody></table>

```json
                                            
                                        
    {
        "STATUS": "SUCCESS",
        "RETURN_CODE": "0",
        "RETURN_MESSAGE": null,
        "ORDER_REF_NUMBER": "ORDER_REF_NUMBER"
    }

                                            
                                        
```

If the value of STATUS parameter is SUCCESS and RETURN\_CODE parameter is 0 in the Android Pos Payment Service transaction response message, it means that the Android Pos Payment transaction has been accepted.

**Step 1:**

If the payment is accepted by evaluating the answer received, the merchant directs the customer to the URL\_3DS address given by Esnekpos.

**Step 2:**

Android Pos finalizes the payment transaction, and reports the result of the payment to the BACK\_URL address that the merchant reported in step 1, with the JSON POST method.

After the payment transaction is completed, the parameters of the payment result message are as follows;

#### Android Pos Payment Service Reply Message Parameters

<table><thead><tr><th width="214">Parameters</th><th width="101">Tip</th><th width="74">Compulsory</th><th>Açıklama</th></tr></thead><tbody><tr><td>STATUS</td><td>string</td><td>Yes</td><td>The result of the payment transaction is the status information.</td></tr><tr><td>RETURN_CODE</td><td>string</td><td>Yes</td><td>The status of the payment process is the code information.</td></tr><tr><td>RETURN_MESSAGE</td><td>string</td><td>Yes</td><td>The status of the payment process is the code information.</td></tr><tr><td>ORDER_REF_NUMBER</td><td>string</td><td>Yes</td><td>It is the reference number information given by the merchant when sending the payment transaction request.</td></tr></tbody></table>

```json
                                            
                                        
    {
        "STATUS": "SUCCESS",
        "RETURN_CODE": "0",
        "RETURN_MESSAGE": null,
        "ORDER_REF_NUMBER": "ORDER_REF_NUMBER"
    }

                                            
                                        
```

In the JSON POST message sent to the merchant, the value of the STATUS parameter is SUCCESS and the RETURN\_CODE parameter is 0, indicating that the Android Pos Payment process has been completed without any problems.

{% hint style="danger" %}

* <mark style="color:red;">In order to be sure of the payment status, you need to query with the PROCCESS\_QUERY method and take into account the answer of the PROCCESS\_QUERY method. You need to configure this query as server to server, not client-side.</mark>&#x20;
* <mark style="color:red;">This PROCCESS\_QUERY method you have made in the client browser should not be visible and cannot be followed.</mark>
  {% endhint %}

## Reply Message Statuses and Explanations

The details of the RETURN\_CODE explanations returned in the Android Pos Reply message details are as follows;

<table><thead><tr><th width="114">RETURN_CODE</th><th width="249.33333333333331">STATUS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>0</td><td>SUCCESS</td><td>It's  successful transaction.</td></tr><tr><td>100</td><td>ERROR</td><td>It's unsuccessful transaction.</td></tr><tr><td>101</td><td>FIELD_ERROR</td><td>If there is an error in the request messages, this message is returned.</td></tr><tr><td>102</td><td>AUTHENTICATION_ERROR</td><td>Authentication error.</td></tr><tr><td>103</td><td>LIMIT_ERROR</td><td>This error message is returned when the limit is insufficient for payment requests.</td></tr><tr><td>104</td><td>COMMISSION_ERROR</td><td>This message is returned because the commission information is not defined or is incompletely defined.</td></tr><tr><td>105</td><td>INSERT_ERROR</td><td>This message is returned in case of errors encountered in database registration processes.</td></tr><tr><td>999</td><td>UNKNOWN_ERROR</td><td>An unexpected error has occurred.</td></tr></tbody></table>


---

# 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-eng.esnekpos.com/esnekpos-developer-environment/android-pos-web-api/payment-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.
