> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopline

> Connect Alumio to Shopline.

## Extra information

System documentation: [Shopline API Reference](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/JeIKq5Oi?version=v20230901)

## Connector package documentation

### Table of Contents

**1.** Setting up HTTP Client Shopline
 **1.1** Steps
**2.** Subscribing to entities from Shopline
 **2.1** Steps
 **2.2** General concept
**3.** Publishing entity to Shopline
 **3.1** Steps
 **3.2** General concept

### 1. Setting up HTTP Client Shopline

**1.1 Steps**

1. In the Alumio Dashboard, go to Clients -> HTTP Clients. Create a new HTTP Client.
2. Select Shopline HTTP Client as PlatForm and click the next step.
3. Fill in the Base URI. Replace \{handle} with your custom application URL
   (For more information, see [Shopline Application Management](https://developer.myshopline.com/docsv2/ec20/3cv5d7wpfgr6a8z5/cm8x8nyfgwvd4svf?version=v20231201)).
4. Fill in the Token that is generated by your custom application.
5. You can optionally enable logging of requests to get the authentication log.
6. Click the next step, fill in the name of the HTTP Client and finally you can save the HTTP Client for use.

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-01.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=a3fcbfd3a24110ad366ea2a61d9c04c7" alt="Shopline connector screenshot 1" width="618" height="500" data-path="images/connectors/shopline-01.png" />

### 2. Subscribing to Entities from Shopline

**2.1 Steps**

1. Go to Connections -> Incoming -> create a new incoming configuration and select "Shopline Admin Subscriber" as the subscriber.
2. Select the entity you want to subscribe to from Shopline.
3. Add any request parameters needed to subscribe to the entity.
4. Select the Shopline HTTP Client to use.
5. You can optionally add a transformer to transform the request parameters into something you will request from Shopline.
6. You can also optionally enable pagination to allow Alumio to fetch paginated entities.

**2.2 General Concept**

We follow Shopline documentation on building this connector, so you can easily use the connector based on [Shopline API Reference](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/JeIKq5Oi?version=v20230901).

**Entity**

The entity you want to subscribe to Shopline. Please refer to the entities from the [Shopline API Reference](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/JeIKq5Oi?version=v20230901) page.

**Request Parameters**

These are the parameters you can provide to get the needed entity based on the [Shopline API Reference](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/JeIKq5Oi?version=v20230901).

Please look at the example below on how to fill the path field when subscribing to [Product - Bulk Query Products](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/P0FAlOwy?version=v20230901) entity.

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-02.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=836509e63f270ac2f2489f3f963ca5ba" alt="Shopline connector screenshot 2" width="690" height="275" data-path="images/connectors/shopline-02.png" />

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-03.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=bed877b4940f1f7d498e7d0555c64ae3" alt="Shopline connector screenshot 3" width="458" height="500" data-path="images/connectors/shopline-03.png" />

Based on the documentation, we can query a single product by setting the "product\_id" inside the path key in the Request Parameters.
[Product - Query Single Product](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/GiOQ66py?version=v20230901)

Alumio will then make a request to Shopline with the URL `/admin/openapi/v20230901/products/{product_id}.json`

* Path is the path parameter of the URL. For example the \{product\_id}.
* Query is a defined set of parameters attached to the end of a URL.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)
* Payload is the data contained within a request.

**HTTP Client**

The HTTP Client configuration you will use to access Shopline.

### 3. Publishing Entity to Shopline

**3.1 Steps**

1. Go to Connections -> Outgoing, create a new outgoing configuration and select "Shopline Admin Publisher" as the publisher.
2. Select the Method that you want the publisher to perform with the data.
3. Select the Shopline entity you want the data to be published.
4. You can optionally add any query data to the request on the key query.
5. You can optionally add any payload data to the request on the key payload.
6. Select the HTTP Client to use.

**3.2 General Concept**

Like the subscriber, the publisher has similar methods on how to use it. The difference is the payload that will be submitted by the publisher originating from the data (from routes, from transformers in outgoing configuration), though you can also add or modify payload using the Request Transformer.

**Method**

Currently, we support the HTTP Post method, HTTP Put method and HTTP Delete method on submitting data to Shopline.

**Entity**

We support publishing to most Shopline endpoints.
Please refer to [Shopline API Reference](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/JeIKq5Oi?version=v20230901) page.

For example, we want to add a new product. Please select “Post” as the Method and [Product - Create Product](https://developer.myshopline.com/docsv2/ec20/cdb180dc069f7d8d6877c0cdffe96f73/7EBTln5x?version=v20230901) as the entity of the publisher.

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-04.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=4d2b842d97454c553c280cb1ff094ef7" alt="Shopline connector screenshot 4" width="690" height="243" data-path="images/connectors/shopline-04.png" />

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-05.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=cea6898fb4a5aecb522a29ebf9cd16fb" alt="Shopline connector screenshot 5" width="450" height="500" data-path="images/connectors/shopline-05.png" />

Based on the documentation, it requires a payload with a root product element. Set that root element inside the payload key.
For example:

```
{
  "path": [],
  "query": [],
  "payload": {
    "product": {
      "foo": "bar"
    }
  }
}
```

<img src="https://mintcdn.com/alumio/2XcHi1eVMdbU3dfQ/images/connectors/shopline-06.png?fit=max&auto=format&n=2XcHi1eVMdbU3dfQ&q=85&s=6e2ee3dcc772d9c848c418ab9433c8da" alt="Shopline connector screenshot 6" width="628" height="500" data-path="images/connectors/shopline-06.png" />

Alumio will send an API request to Shopline with the URL `/admin/openapi/v20230901/products/products.json`

* Path is the path parameter of the URL. For example the \{product\_id}.
* Query is a defined set of parameters attached to the end of a URL.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)
* Payload is the data contained within a request.

**HTTP Client**

The HTTP Client configuration you will use to access Shopline.
