# Transaction Inquiry Service

<table><thead><tr><th>Method</th><th width="515.3333333333333">API URL</th><th>Parameter</th></tr></thead><tbody><tr><td>POST</td><td>https://posservice.esnekpos.com/api/services/ProcessQuery</td><td>JSON File</td></tr></tbody></table>

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

<table><thead><tr><th width="214">Parameters</th><th width="94">Type</th><th width="76">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>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. The transaction is carried out by matching the payment transaction to be made to the reference number of the relevant merchant.</td></tr></tbody></table>

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

```json
                                            
{
      "MERCHANT": "TEST1234" , 
      "MERCHANT_KEY": "4oK26hK8MOXrIV1bzTRVPA==" ,
      "ORDER_REF_NUMBER" : "0.54251300 1595848596|93" ,
}
                                        
```

### Transaction Status Inquiry Service Reply Messag&#x65;**;**

While some of the parameters of the reply message sent from the service after the transaction are used for all merchants, some parameters are filled only for merchants defined to the system as a marketplace. These parameters and their explanations are as follows;

#### Transaction Status Inquiry Service Response Message Parameters

<table><thead><tr><th width="270">Parameters</th><th width="78">Type</th><th width="86">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 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 message is the result of the payment process.</td></tr><tr><td>DATE</td><td>string</td><td>Yes</td><td>It is the transaction date information for the query operation.</td></tr><tr><td>PAYMENT_DATE</td><td>string</td><td>Yes</td><td>It is the transaction date information for the payment transaction.</td></tr><tr><td>REFNO</td><td>string</td><td>Yes</td><td>It is the reference number information given by the Esnekpso system for the payment transaction.</td></tr><tr><td>AMOUNT</td><td>string</td><td>Yes</td><td>It is the transaction amount information of the payment transaction.</td></tr><tr><td>ORDER_REF_NUMBER</td><td>string</td><td>Yes</td><td>It is the reference number information of the request given by the merchant in the payment request.</td></tr><tr><td>INSTALLMENT</td><td>string</td><td>Yes</td><td>It is the information of the number of installments requested for the payment process. “1” information is returned for single shot operations.</td></tr><tr><td>SUCCESS_TRANSACTION_ID</td><td>int</td><td>Yes</td><td>When the payment transaction is successful, TRANSACTION ID information of this payment transaction is returned.</td></tr><tr><td>TRANSACTIONS</td><td>array</td><td>Yes</td><td>It is a Json object array that contains the transaction details of all transaction transactions of the payment transaction.</td></tr><tr><td>PHYSICAL_POS_ID</td><td>int</td><td>Yes</td><td>The unique number of the pos where the payment is made.</td></tr><tr><td>PHYSICAL_POS_TITLE</td><td>string</td><td>Yes</td><td>The name of the pos where the payment transaction took place.</td></tr><tr><td>PAYMENT_WAY</td><td>string</td><td>Yes</td><td>The method of execution of the payment transaction.</td></tr></tbody></table>

<br>

**TRANSACTION**

<table><thead><tr><th>Parameters</th><th width="78">Type</th><th width="82">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>TRANSACTION_ID</td><td>string</td><td>Yes</td><td>The unique credential of the subprocess transaction.</td></tr><tr><td>STATUS_NAME</td><td>string</td><td>Yes</td><td>It is the status information of the subprocess transaction.</td></tr><tr><td>AMOUNT</td><td>string</td><td>Yes</td><td>It is the amount information of the sub-process transaction.</td></tr><tr><td>DATE</td><td>string</td><td>Yes</td><td>It is the date information of the subprocess transaction.</td></tr><tr><td>MERCHANT_AMOUNT_TRANSFER_DETAIL</td><td>string</td><td>Yes</td><td>In this section, the transfer detail information of the amount in the sub-transaction transaction related to the payment transaction is given.</td></tr><tr><td>SUB_MERCHANT_DETAILS</td><td>array</td><td>Yes</td><td>This section will only be filled for marketplace member businesses. For other merchants, the information in this field is returned as "null". It is the information of how much of the amount realized in the payment transaction is sent or will be sent to which stores of the marketplace.</td></tr></tbody></table>

<br>

**SUB\_MERCHANT\_DETAILS**

<table><thead><tr><th>Parameters</th><th width="78">Type</th><th width="73">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>EXTERNAL_ID</td><td>string</td><td>Yes</td><td>It is the ID information of the store (submerchant) in the marketplace (merchant) system. This information is assigned by the marketplace.</td></tr><tr><td>AMOUNT</td><td>string</td><td>Yes</td><td>It is the portion of the amount in the payment transaction that will be sent or sent to the store.</td></tr><tr><td>DATE</td><td>string</td><td>Yes</td><td>It is the date of the transaction.</td></tr><tr><td>SUB_MERCHANT_AMOUNT_TRANSFER_DETAIL</td><td>string</td><td>Yes</td><td>In this section, the transfer detail information of the amount in the transaction movement of the store is given.</td></tr></tbody></table>

<br>

**MERCHANT\_AMOUNT\_TRANSFER\_DETAIL, SUB\_MERCHANT\_AMOUNT\_TRANSFER\_DETAIL**

<table><thead><tr><th width="218">Parameters</th><th width="90">Type</th><th width="98">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>EXTRACT_ID</td><td>string</td><td>Yes</td><td>It is the subprocess transfer number.</td></tr><tr><td>SENDED_AMOUNT</td><td>string</td><td>Yes</td><td>Transferred amount information.</td></tr><tr><td>SENDED_DATE</td><td>string</td><td>Yes</td><td>The transferred date information.</td></tr></tbody></table>

```json
                                            
{
    "STATUS": "SUCCESS",
    "RETURN_CODE": "0",
    "RETURN_MESSAGE": "SUCCESS",
    "DATE": "24.09.2020 17:08:10",
    "PAYMENT_DATE": "19.04.2020 18:34:35",
    "REFNO": null,
    "AMOUNT": "1250,00",
    "ORDER_REF_NO": "9.54251311 1595848596|999",
    "INSTALLMENT": "1",
    "COMMISSION": "1,490",
    "TRANSACTIONS": [
        {
            "TRANSACTION_ID": 343666,
            "STATUS_NAME": "Payment - Successful",
            "STATUS_ID": 3,
            "AMOUNT": "1250,00",
            "DATE": "19.04.2020 18:35:09",
            "MERCHANT_AMOUNT_TRANSFER_DETAIL": {
                "EXTRACT_ID": 5715,
                "SENDED_AMOUNT": "148,88",
                "SENDED_DATE": "4.05.2020 11:58:11"
            },
            "SUB_MERCHANT_DETAILS": [
                {
                    "EXTERNAL_ID": "999999",
                    "AMOUNT": "1073,00",
                    "DATE": "19.04.2020 18:35:09",
                    "SUB_MERCHANT_AMOUNT_TRANSFER_DETAIL": {
                        "EXTRACT_ID": 5779,
                        "SENDED_AMOUNT": "1073,00",
                        "SENDED_DATE": "4.05.2020 11:57:28"
                    }
                }
            ]
        }
    ]
}
                                        
```

In the transaction status inquiry response message, if the transaction type is **"Payment - Successful"** (Ödeme-Başarılı) or **"Return - Successful"** (İade - Başarılı), the value of the **STATUS** parameter is **SUCCESS** and the value of the **RETURN\_CODE** parameter is **"0"**, indicating that the transaction status inquiry has been completed successfully.&#x20;

If the transaction type is **"Cancel - Successful"** (İptal- Başarılı), the value of the **STATUS** parameter is **"ORDER\_CANCEL"** and the value of the **RETURN\_CODE** parameter is **"300"**, indicating that the transaction status inquiry was successful.

### Payment and Payment Sub-Transaction Status Codes and Explanation&#x73;**;**

The details of the STATUS\_NAME and STATUS\_ID statements returned in the details of Payment and Payment Sub-Transactions are as follows;

<table><thead><tr><th width="137">STATUS_ID</th><th width="172.33333333333331">STATUS_NAME</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>3</td><td>Payment - Successful</td><td>It is the status information returned as a result of successful payments and sub-transactions.</td></tr><tr><td>4</td><td>Payment - Unsuccessful</td><td>It is the status information returned as a result of unsuccessful payments and sub-transactions.</td></tr><tr><td>5</td><td>Cancel - Successful</td><td>It is the status information returned as a result of successful cancellation payments and sub-transactions.</td></tr><tr><td>6</td><td>Cancel - Unsuccessful</td><td>It is the status information returned as a result of unsuccessful cancellation payments and sub-transactions.</td></tr><tr><td>7</td><td>Return - Successful</td><td>It is the status information returned as a result of successful refund payments and sub-transactions.</td></tr><tr><td>8</td><td>Return - Unsuccessful</td><td>It is the status information returned as a result of unsuccessful refund payments and sub-transactions.</td></tr></tbody></table>
