# POS integrations management

## Get logistic integrations

<mark style="color:blue;">`GET`</mark> `https://integrations.mipos.shop/api/v1/logistic/pos/list`

Provides a list of delivery integrations registered in the platform

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Authorization | string | Bearer {access\_token} |

{% tabs %}
{% tab title="200 " %}

```javascript
[
    {
        "id": 8,
        "name": "logistic company"
    }
]
```

{% endtab %}
{% endtabs %}

## Change status logistic integration

<mark style="color:green;">`POST`</mark> `https://integrations.mipos.shop/api/v1/logistic/pos/change/status`

Enable the selected integration for this store

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Content-Type  | string | application/json       |
| Authorization | string | Bearer {access\_token} |

#### Request Body

| Name                | Type   | Description                            |
| ------------------- | ------ | -------------------------------------- |
| status              | string | "enable" or "disable"                  |
| external\_store\_id | string | ID of the store in the logistic system |
| store\_id           | string | ID of the store in the platform        |
| integration\_id     | string | ID of the integration in the platform  |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "message": "Successful change of status.",
    "data": null
}
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized."
```

{% endtab %}

{% tab title="409 Could not find a cake matching this query." %}

```javascript
{
    "message": [
        "You don't have this store available.",
        "Integration not available.",
        "This store does not have this integration enabled."
    ],
    "data": null
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
    "status": [
        "The status field is required.",
        "The status must be a string.",
        "The selected status is invalid."
    ],
    "store_id": [
        "The store id field is required."
    ],
    "external_store_id": [
        "The external store id field is required."
    ],
    "integration_id": [
        "The integration id field is required.",
        "The integration id must be a string.",
        "The selected integration id is invalid."
    ]
}
```

{% endtab %}
{% endtabs %}

## Manage Status Delivery Webhook

<mark style="color:green;">`POST`</mark> `https://integrations.mipos.shop/api/v1/logistic/pos/webhook/status/manage`

Create or update webhook for changes of delivery status of an order .

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Authorization | string | Bearer {access\_token} |
| Content-type  | string | application/json       |

#### Request Body

| Name            | Type   | Description             |
| --------------- | ------ | ----------------------- |
| integration\_id | string | Your Logistic System Id |
| url             | string | Webhook URL             |

{% tabs %}
{% tab title="201 " %}

```javascript
{
    "message": "Webhook successfully configured.",
    "data": null
}
```

{% endtab %}

{% tab title="409 " %}

```javascript
{
    "message": [
        "Unable to set up the webhook URL."
    ],
    "data": null
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
    "integration_id": [
        "The integration id field is required."
    ],
    "url": [
        "The url field is required."
    ]
}
```

{% endtab %}
{% endtabs %}

The events you will receive in this webhook will have the following structure.

```javascript
{
    "service_identifier": "abc123",
    "status": "....",
    "location": {
        "lat": ....,
        "lng": ....
    }
}
```

## Manage Location Delivery Webhook

<mark style="color:green;">`POST`</mark> `https://integrations.mipos.shop/api/v1/logistic/pos/webhook/location/manage`

Create or update webhook for changes of location of an order .

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Authorization | string | Bearer {access\_token} |
| Content-type  | string | application/json       |

#### Request Body

| Name            | Type   | Description             |
| --------------- | ------ | ----------------------- |
| integration\_id | string | Your Logistic System Id |
| url             | string | Webhook URL             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

The events you will receive in this webhook will have the following structure.

```javascript
{
    "service_identifier": "abc123",
    "location": {
        "lat": ....,
        "lng": ....
    }
}
```
