> For the complete documentation index, see [llms.txt](https://developer-eng.esnekpos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer-eng.esnekpos.com/esnekpos-developer-environment/return-cancellation-service.md).

# Return/Cancellation Service

### Return/Cancellation Service Request Model&#x61;**;**

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

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

<table><thead><tr><th width="217">Parameters</th><th width="117">Type</th><th width="98">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 payment transaction to be canceled is matched with the reference number of the relevant merchant, and the transaction is carried out.</td></tr><tr><td>AMOUNT</td><td>int</td><td>Yes</td><td>It is the Cancellation/Refund amount information of the reference number to be processed.</td></tr><tr><td>SYNC_WITH_POS</td><td>bool</td><td>No</td><td>It is the parameter that will enable you to perform the refund/cancellation of the payment synchronously with the bank. If you send a false message, your return/cancellation request, which is not instantly approved by the bank, is recorded in our system and then your transaction is completed by our operation unit.</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" ,
      "AMOUNT": 29.99,
      "SYNC_WITH_POS": false,
}
                                        
```

### Return/Cancellation Service Reply Messag&#x65;**;**

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

<table><thead><tr><th width="203">Parameters</th><th width="114">Type</th><th width="110">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>RETURN_CODE</td><td>string</td><td>Yes</td><td>The status of the return 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 return process.</td></tr><tr><td>STATUS</td><td>string</td><td>Yes</td><td>The result of the return process is the status information.</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>REFNO</td><td>string</td><td>Yes</td><td>It is the reference number information given by the Esnekpos system for the return transaction.</td></tr><tr><td>TRANSACTION_ID</td><td>int</td><td>Yes</td><td>If the refund is instantly approved by the card bank, it is the reference number information of the record added to the sub-transactions of the payment by the Esnekpsos system.</td></tr></tbody></table>

```json
                                            
{
    "RETURN_CODE": "0",
    "RETURN_MESSAGE": "29,99 ₺ Your return request has been successfully registered.",
    "STATUS": "SUCCESS",
    "ORDER_REF_NUMBER": null,
    "REFNO": null
}
                                        
```

Returning the value of STATUS parameter to SUCCESS and RETURN\_CODE parameter to 0 in the return/cancellation response message indicates that the Return/Cancellation Transaction was successful.
