# Horoz Lojistik Satıcı Öder Shipment Extension

{% hint style="info" %}
This integration is one of the “Satıcı Öder” integrations. It is designed to help Seller Center to specify the seller account in the cargo company so as to disable the agreement between the marketplace and cargo company. Some data related to the seller account for the cargo company must be sent to the extension inside product attributes.
{% endhint %}

## <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.

* **API\_URL**
* **PROCESS\_KEY**

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
```

For easy-return and forward shipments, an address ID must be set for the default destination and origin information. This ID can be created using the extension's address creation method (an example cURL command is provided below). Ensure that the address ID is accurately configured to facilitate the smooth handling of return and forward shipments within the Omnitron configuration.

```bash
curl --location --request GET 'https://{{extension_url}}/addresses' \
--header 'x-akinon-request-id: {{guid}}' \
--header 'x-akinon-api-version: 1.0' \
--header 'Authorization: Basic {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "<id>",
    "addressName": "ADDRESS NAME",
    "addressDescription": "...",
    "phone": "639-228-8456",
    "email": "akinon@akinon2.com",
    "address": {
        "country": {
            "id": 1,
            "code": "TC",
            "name": "TÜRKİYE"
        },
        "city": {
            "id": 1,
            "name": "İSTANBUL"
        },
        "district": {
            "id": 1,
            "name": "ESENLER"
        },
        "township": {
            "id": 1,
            "name": "PENDİK"
        },
        "zipcode": "1724588042",
        "addressLine": "771 Kyleigh Via"
    },
    "type": "DISTRIBUTION_POINT"}'
```

### <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.

| Variable           | Description                                                                           |
| ------------------ | ------------------------------------------------------------------------------------- |
| Extension-specific |                                                                                       |
| API\_URL           | URL received during the preliminary works phase (without a trailing slash at the end) |
| PROCESS\_KEY       | PROCESS KEY received during the preliminary works phase                               |
| Generic            |                                                                                       |
| SECRET\_KEY        | The generated secret key during the preliminary works phase                           |
| ADMIN\_EMAIL       | The e-mail address of the installer can be entered                                    |
| ADMIN\_PASSWORD    | A newly created and extension-specific strong password                                |
| ADMIN\_USERNAME    | A username can be entered (example: ‘akinon’)                                         |

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

Horoz Lojistik Satıcı Öder can be selected as the Shipment Provider in Omnitron to integrate with the extension installed. Additionally, an easy return option can be defined to enable easy return methods. Explanations on how these settings can be configured are detailed in the sections below. Please note that these two operations are independent and optional.

### <mark style="color:red;">**Shipping Provider**</mark>

To add Horoz Lojistik Satıcı Öder, a new shipping provider is added to SHIPPING\_PROVIDERS in Dynamic Settings through Omnitron.

#### **Example Omnitron Configuration:**

| Field               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Klass               | ExtensionShippingProvider Class                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Urls Code           | { "urls": { "base\_url": "**`{SHIPMENT_EXTENSION_URL}`**" } }                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Serializers         | Order Serializer: ExtensionShippingOrderSerializer Class Response Serializer: ExtensionShippingResponseSerializer Class                                                                                                                                                                                                                                                                                                                                                                                      |
| Configurations Code | { "strategies": { "query\_type": "SHIPMENT\_ID", "generate\_shipment\_product\_strategy": true, "generate\_shipment\_product\_attributes": \[ "deci", “warehouse\_id”, “seller\_id” ] }, "pay\_on\_delivery\_option": false, "delivery\_type": "CUSTOMER", "auth": { "username": "{SHIPMENT\_EXTENSION\_ADMIN\_USERNAME}", "password": "{SHIPMENT\_EXTENSION\_ADMIN\_PASSWORD}" }, "is\_active": { "query": true, "send\_shipping\_info": true, "delete\_shipping\_info": true, "query\_by\_order": true } } |
|                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### <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 section below.

#### **Example Omnitron Configuration:**

| Field                      | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Shipping Company           | Extension Cargo                                                                                                                                                                                                                                                                                                                                                                                            |
| Shipping Company Auth Code | { "url": "**`{SHIPMENT_EXTENSION_URL}`**", "username": "**`{SHIPMENT_EXTENSION_ADMIN_USERNAME}`**", "password": "**`{SHIPMENT_EXTENSION_ADMIN_PASSWORD}`**", “send\_user\_address”: True, “easy\_return\_product\_strategy”: True, “product\_attributes”: { "deci": "**`{product_attribute_code}`**, "warehouse\_id": "**`{product_attribute_code}`**", "seller\_id": "**`{product_attribute_code}`**" } } |
| 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     | { "product": { "field\_key": "attributes\_\_easy\_return\_method", "field\_values": \[ \[ "", null ] ] } }                                                                                                                                                                                                                                                                                                 |
| Status                     | active                                                                                                                                                                                                                                                                                                                                                                                                     |

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

| Field         | Description                                 |
| ------------- | ------------------------------------------- |
| Extension URL | The URL of the shipment extension           |
| Username      | Extension user's name for authorization     |
| Password      | Extension user's password for authorization |
| Type          | Mapping type (“CITY”, “TOWNSHIP”)           |
| Key           | CITY or TOWNSHIP KEY                        |
| Value         | CITY or TOWNSHIP VALUE                      |

#### **Generate Mapping Request:**

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

```

**Example:**

* **Type: CITY**
* **Key: ISTANBUL**
* **Value: İSTANBUL**

#### **Update Mapping Request:**

**\*** The values for key, type, and value should be updated.

```bash
curl -X PATCH "{{extension_url}}/mapper/<id>" \
     -u username:password \
     -H "Content-Type: application/json" \
     -d '{
           "type": "",
           "key": "",
           "value": ""
         }'

```

#### **Get Mapping Request:**

**\*** When making a query request, it can be filtered by the fields type, key, value, created\_date and modified\_date.

```bash
curl -X GET "{{extension_url}}/mapper?key=<key>" \
     -u username:password \
     -H "Content-Type: application/json"
```

#### **Delete Mapping Request:**

```bash
curl -X DELETE "{{extension_url}}/mapper/<id>" \
     -u username:password \
     -H "Content-Type: application/json"
```
