# ShipX (Inpost) Shipment 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.

* **API\_URL**
* **API\_TOKEN**
* **ORGANIZATION\_ID**

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.

```bash
curl --location '{EXTENSION_URL}/addresses' \
--header 'x-akinon-request-id: 50dac251-048c-402f-91c9-e5573b5a6057' \
--header 'x-akinon-api-version: 1.0' \
--header 'Authorization: Basic {EXTENSION_BASIC_AUTH_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "1ac38925-6a04-42a5-b3b1-044eb4095e45", // return_destination_extension_id in Omnitron config,
    "addressName": "Jacobs Group",
    "addressDescription": "totam quisquam qui",
    "phone": "+90 216 555 1234",
    "email": "Marlee42@example.net",
    "type": "PICK_UP_LOCATION",
    "address": {
        "country": {
            "id": 0, // optional
            "code": "TR",
            "name": "Turkey"
        },
        "city": {
            "id": 0, // optional
            "name": "Istanbul"
        },
  "township": {
            "id": 0, // optional
            "name": "Kadıköy"
        },
        "district": {
            "id": 0, // optional
            "name": "ACIBADEM"
        },
        "coordinates": {
            "latitude": -80.2031,
            "longitude": 11.2438
        },
        "zipcode": "1724042906",
        "addressLine": "Caferağa Mahallesi, Dr. Esat Işık Caddesi No:35"
    }
}'
```

### <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) Test: <https://sandbox-api-shipx-pl.easypack24.net> |
| API\_TOKEN         | API TOKEN received during the preliminary works phase                                                                                     |
| ORGANIZATION\_ID   | ORGANIZATION ID received during the preliminary works phase                                                                               |
| STATIC\_EMAIL      | Default email used in shipment operations                                                                                                 |
| 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>

ShipX 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 ShipX, 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\_origin\_strategy": "\<addressId>", "generate\_shipment\_product\_strategy": true, "generate\_shipment\_product\_attributes": \[ "length", "width", "height", "weight", ] }, "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 }, "label\_options": { "file\_extension": "pdf" } } |

### <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, "return\_destination\_extension\_id":"**`{address_id}`**" “product\_attributes”: { "length": "**`{product_length_attribute}`**", "width": "**`{product_width_attribute}`**", "height": "**`{product_height_attribute}`**", "weight": "**`{product_weight_attribute}`**" } } |
| 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;">**Additional Notes**</mark>

For both the `shipment` and `easy-return` modules to function correctly, the customer address provided in the `generate-shipment` or `generate-easy-return` step must include the `target_point` and `addressLine` values concatenated with a space (" ") in the `addressLine` field.

Example format: `"{target_point} {addressLine}"`, e.g., `"KRA012 Czerniakowska 87A"`.

The `target_point` is a required field enforced by the provider for locker-type shipments.


---

# 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://docs.akinon.com/technical-guides/3rd-party-integration/shipment-integrations/shipx-inpost-shipment-extension.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.
