> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/3rd-party-integration/shipment-integrations/surat-cargo-easy-return-extension.md).

# Sürat Cargo Easy Return Extension

## <mark style="color:red;">Extension Installation</mark>

### <mark style="color:red;">Preliminary Works</mark>

The following information is requested from the provider for the brand-specific and production (live) environment.<br>

* WSDL URL
* Kullanıcı Adı (Username)
* Şifre (Password)

A secret\_key is generated with a minimum length of 41 characters. The generated key must be kept throughout the installation. An example command line to generate a random key:

```
openssl rand -base64 41
```

An address ID must be set for the default destination information in easy-return shipments. It can be created using the extension's address creation method (example curl is given below). Ensure that the address ID is accurately configured to facilitate the smooth handling of return shipments within the Omnitron configuration.

```
curl --location --request POST 'https://extension.lb.akinoncloud.com/addresses' \
--header 'x-akinon-request-id: ••••••' \
--header 'x-akinon-api-version: ••••••'' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '{
    "id": "1234", // return_destination_extension_id in Omnitron config
    "addressName": "Test Warehouse",
    "addressDescription": "Test Warehouse",
    "phone": "000",
    "email": "test@test.com",
    "address": {
        "country": {
            "id": 1,
            "code": "tr",
            "name": "Türkiye"
        },
        "city": {
            "id": 1,
            "name": "Adana"
        },
"township": {
            "id": 1,
            "name": "Aladağ"
        },   
        "district": {
            "id": 41,
            "name": "Ceritler Mah."
        },  
        "zipcode": "01722",
        "addressLine": "Test Street No: 7/19"
    }
}'

```

Label format should be defined as **ZPL** on the Provider side. If no definition is made the default format will be **EPL** which is currently not supported.

Supported type: **ZPL**

Unsupported types: **EPL, PDF**

### <mark style="color:red;">Environment Variables</mark>

The extension installed to the relevant project in ACC must have the following environment variables. Environment variables can be entered before or after the deployment phase. As changes are made to the environment variables, the deployment process must be performed again.

An example environment variable input during the setup phase:

<table data-header-hidden><thead><tr><th width="339"></th><th></th></tr></thead><tbody><tr><td><strong>Variable</strong></td><td><strong>Description</strong></td></tr><tr><td><strong>Extension-specific</strong></td><td></td></tr><tr><td>API_URL</td><td>WSDL URL received during the preliminary works phase</td></tr><tr><td>API_USERNAME</td><td>Username received during the preliminary works phase</td></tr><tr><td>API_PASSWORD</td><td>Password received during the preliminary works phase</td></tr><tr><td>WEBGONDERI</td><td><p>True for using WebServisGonderisi services</p><p>False for using OrtakBarkodEntegrasyonu services</p><p>Default: False</p></td></tr><tr><td><strong>Generic</strong></td><td></td></tr><tr><td>SECRET_KEY</td><td>The generated secret key during the preliminary works phase</td></tr><tr><td>ADMIN_EMAIL</td><td>The e-mail address of the installer can be entered</td></tr><tr><td>ADMIN_PASSWORD</td><td>A newly created and extension-specific strong password</td></tr><tr><td>ADMIN_USERNAME</td><td>A username can be entered (example: ‘akinon’)</td></tr></tbody></table>

### <mark style="color:red;">Mapping</mark>

If there are differences between the Sürat cargo city/township data and the commerce city/township data, mapping is required. For mapping operations, you can follow the mapping documentation.

[User Guide - Mapper Endpoints in Extensions](https://docs.google.com/document/d/1YSfgfHvQkLKQ8-PxIyQI4f6BAUqWTrghYpcGjzSDiqQ/edit)

**Generate City Mapping Request:**

```
curl -X POST {{extension_url}}/mapper \
     -u username:password \
     -H "Content-Type: application/json" \
     -d '{
           "key": {{commerce_data}},
           "type": "CITY",
           "value": {{provider_data}}
         }'
```

**Generate Township Mapping Request:**

```
curl -X POST {{extension_url}}/mapper \
     -u username:password \
     -H "Content-Type: application/json" \
     -d '{
           "key": {{commerce_data}},
           "type": "TOWNSHIP",
           "value": {{provider_data}}
         }'
```

## <mark style="color:red;">Omnitron Settings</mark>

The installed extension must also be defined to the project via Omnitron. For this, Easy Return Shipping Options page should be consulted.

### <mark style="color:red;">Easy Return Shipping Option</mark>

One easy return shipping option must be defined in Omnitron to be specific for the extension installed. Explanations on how the settings should be made at this stage are in the table below.

| **Field**                  | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Shipping Company           | Extension Cargo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Shipping Company Auth Code | <p>{</p><p>"url": "<code>{extension\_url}</code>",</p><p>"username": "extension\_username",</p><p>"password": "extension\_password",</p><p>"return\_destination\_extension\_id": "<code>{destination\_id}</code>",</p><p>“send\_user\_address”: true/false,</p><p>“use\_prefix”: True/False</p><p>}</p><p>\*If it is required to add the value specified in the prefix field to the beginning of the return codes, the use\_prefix value should be set to True. If this feature is not needed, the use\_prefix can be omitted.</p><p>\*send\_user\_address:</p><p>If set to true, the return requests sent from the extension will use the user's address.</p><p>If not set or set to false, the previously configured fixed warehouse address will be used.</p> |
| Start Date Gap             | This variable is used to delay the start date for using the return code. If this value is set to 0, the customer can request a refund on the same day.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Delivery Time              | The delivery\_time variable indicates the duration for which the return code will be valid and usable. If the product is not shipped by the customer within this period, the code becomes invalid.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Shipping Company Prefix    | If a prefix is to be added to the return code, this field should contain the short name of the brand. This short name can be any value determined by the brand.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Shipping Company Rules     | <p>{</p><p>"product": {</p><p>"field\_key": "attributes\_\_easy\_return\_method",</p><p>"field\_values": \[</p><p>\[</p><p>"",</p><p>null</p><p>]</p><p>]</p><p>}</p><p>}</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Status                     | active                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.akinon.com/technical-guides/3rd-party-integration/shipment-integrations/surat-cargo-easy-return-extension.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
