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

# How to include service points in your data flow

In this guide, you will find an explanation of how to incorporate Sendcloud service points in the data flow between your CMS (webshop), ERP/WMS systems, and Sendcloud. Please note that this guide includes most standard scenarios that you might encounter.

## Requesting a label based on service point selection

<Card title="Creating a parcel with service point delivery" href="/docs/service-points/creating-a-parcel-with-service-point-delivery" icon="map-location-dot" horizontal>
  Read our step-by-step guide on how to create a parcel that is delivered to a service point.
</Card>

## How to determine which flow of data to use for the integration

Refer to the following decision tree:

<img src="https://mintcdn.com/sendcloud/bH_7gFwWAF2dSsyu/images/docs/service-points/servicepoints_erp_wms.jpeg?fit=max&auto=format&n=bH_7gFwWAF2dSsyu&q=85&s=525c53dff411b00ae79b3af309258716" alt="Decision tree for service point integration" width="707" height="589" data-path="images/docs/service-points/servicepoints_erp_wms.jpeg" />

## Most common integrations

| Integration          | Service point id                | To post number                       |
| -------------------- | ------------------------------- | ------------------------------------ |
| **Lightspeed** (new) | `order.shipmentData.location`   | Not saved                            |
| **Lightspeed** (old) | Not saved                       | Not saved                            |
| **Magento v2**       | `sendcloud_service_point_id`    | `sendcloud_service_point_postnumber` |
| **Prestashop**       | Not saved                       | Not saved                            |
| **Shopify**          | Not saved                       | Not saved                            |
| **Shopware 6**       | `order.sendcloud_service_point` | Not saved                            |
| **Woocommerce**      | Not saved                       | Not saved                            |

## Custom-built plugins using Sendcloud service points

In cases where we do not offer a plug-and-play integration with your CMS platform, or the integration does not save the service point ID to the webshop, there are two possible options:

1. Embed the [Sendcloud service points widget JavaScript code](https://support.sendcloud.com/hc/en-us/articles/360024967612-Service-points-for-API-Integrations) in your checkout
   <Frame>
     <img src="https://mintcdn.com/sendcloud/DdDKRJriEqG9cvye/images/docs/marketplaces/sendcloud-service-point-picker.webp?fit=max&auto=format&n=DdDKRJriEqG9cvye&q=85&s=49ff8b4bbb9dc2df779ceeb241434c10" alt="Service point picker widget" height={607} width={800} noZoom data-path="images/docs/marketplaces/sendcloud-service-point-picker.webp" />
   </Frame>
2. Create your own service point picker plugin using our [Service Points API](/api/v2/service-points/retrieve-a-list-of-service-points).

For both options, based on the end customer's selection, save the `service_point_id`, `to_post_number`, and `carrier` (as they are returned in the service point object) to the order in your webshop.

This information can then be sent to the ERP/WMS when the order is synced. It's a good idea to save the carrier since this field can be used for setting more flexible shipping rules in Sendcloud; refer to the Standard flow section below.

### Standard flow

As depicted in the diagram, the `service_point_id` (and potentially the `to_post_number`) are saved in the webshop and, most commonly, to the order. This information can then be sent to the ERP/WMS, where it is saved, and later can be sent to Sendcloud at the time of parcel creation. It's important to note that the `shipment` `id` has to be defined when creating a parcel to ship to a service point. This can be done via three methods:

1. Using [Sendcloud shipping rules](/docs/shipping/shipping-rules/). For example, when you have the following shipping rule: **if** the checkout delivery method is PostNL service point, **then** ship with "PostNL service point 0-23 kg", you would use the `shipment` `id` of `8` and set `"apply_shipping_rules": true` when creating a parcel with `"request_label": true`. The checkout delivery method name is defined in the webshop, and should also be sent to the ERP/WMS, and then to Sendcloud.
2. Use the [Retrieve a list of shipping methods](/api/v2/shipping-methods/retrieve-a-list-of-shipping-methods) endpoint to find shipping methods that ship to the service point. In the query parameters, use the `service_point_id`.
3. If the carrier is known in the ERP/WMS, the [Retrieve a list of shipping products](api/v2/shipping-products/retrieve-a-list-of-shipping-products) endpoint can be used to find an appropriate shipping method. Make sure to pass the `last_mile=service_point` query parameter.
   ```http Example request method and URL wrap theme={null}
   GET https://panel.sendcloud.sc/api/v2/shipping-products?from_country=NL&to_country=NL&carrier=postnl&weight=5&weight_unit=kilogram&last_mile=service_point
   ```

## Fulfilling webshop orders via API flow

Read a full explanation of this flow on [Fulfill orders](/docs/shipping/fulfill-orders).

Note that when the integration fetches the shipment created by the webshop integration, the `to_service_point`, `to_post_number` and the `shipping_method` are also retrieved.
