Skip to main content
The following instructions apply to v2 of the Sendcloud API.
Find out how an order, synced via a webshop integration to Sendcloud, can be fulfilled using a custom integration. Find more information about the endpoints in the API v2 documentation. Before starting, it’s good to be familiar with the following entities used in the Sendcloud ecosystem: And the following fields used in the Sendcloud API:

Overview

This setup is useful if you want to have Sendcloud in the checkout of your webshop, while fulfilling orders from a different system, such as an ERP or WMS. It allows using Sendcloud’s plug-and-play webshop integrations, which already have many features implemented. In this setup, shipments are sent to Sendcloud via a webshop integration and must be fulfilled via the Sendcloud API. You can create labels for shipments already in Sendcloud, and you don’t even have to log into Sendcloud to fulfill orders and print labels. This could be done through a system of your choice, such as an ERP or WMS. This setup also allows you to ship parcels to a service point that the customer has selected in the webshop.

Basic flow

The webshop sends over shipments to Sendcloud. The fulfillment system also has the shipment data and can request labels directly from Sendcloud for a specific order via the custom integration setup. You can request a label when you have a parcel for the order. When you link a parcel to the shipment and request a label, Sendcloud will automatically update the webshop with information on the parcel.
Note that sending the parcel information back to the webshop depends on the webshop’s system. Some webshops might not have a field for track-and-trace links or carrier statuses as specific as Sendcloud does, for example — a webshop might only have Open and Shipped statuses, while Sendcloud offers more.
Diagram showing the basic flow for sending data between a webshop, Sendcloud and a fulfillment system

Technical flow

The following sequence diagram breaks down the detailed flow of the setup. The custom integration should cover the steps in the purple box in the middle of the diagram: Sequence diagram showing the detailed flow for sending data between a webshop, Sendcloud and a fulfillment system

Fetch a shipment

To acquire the shipment details of orders sent in by an official integration, make a GET request to the Retrieve a list of shipments endpoint. In the GET request, specify a query parameter that matches the order_number, and external_order_id (if applicable) or external_shipment_id (if applicable) parameters. These fields are originally inserted by the shop system integration. In the request URL, specify the integration ID. To retrieve the integration ID, use the Retrieve a list of integrations endpoint. Note that If you have multiple webshop integrations connected to your Sendcloud account, it should be clear which order number is attached to which integration ID.

Fetch a parcel

In some cases, the webshop integration might be directly creating parcels in Sendcloud rather than shipments, e.g. a custom webshop integration. In this case, make a GET request to the Retrieve parcels endpoint. In the GET request, specify a query parameter that matches the order_number field.

Create a parcel and request a label

When the order details have been acquired, you can create the parcel and request the label. To do this, use the Create a parcel or parcels endpoint. Note that when creating the parcel, you can redefine most of the fields. The parcel fields do not need to be equal to the original shipment. However, some fields do need to be the same for the described setup to work as intended:

Fetch the label

The Create a parcel or parcels endpoint response includes various ways to fetch the label:
  1. The label field in the response:
    • normal_printer provides an A4 document with the label on it. The default format is PDF. Note that the start_from parameter in each URL determines where the label will be printed on the page: top left, top right, bottom left and bottom right. See the Retrieve a PDF label endpoint.
    • label_printer provides an A6 label document for label printers. See the Retrieve a PDF label for a specific label printer endpoint.
  2. The documents field contains a label URL, plus (if applicable) additional documents for international shipments outside of the EU. See the Retrieve parcel documents endpoint.
    • Note that it is possible to get the label in different formats including ZPL using the API v3 Retrieve a parcel document endpoint.
To download the label, redirect to that link and provide the same API credentials used to request the label. The link cannot be opened if these credentials are not provided.