
If you need more control over your service point integration, build it around Service Points API
v3 instead.
Before you start
The picker uses the carriers enabled for service point delivery in your integration settings. Enable service point delivery and the carriers you want to offer before you start:- In the Sendcloud platform, go to your integration settings
- Find your API integration and click Configure
- Enable service point delivery
- Enable the carriers you want to use for service point delivery and save your changes
Add the picker script
Add the picker script to your checkout page:Example: loading the picker script
sendcloud.servicePoints available to your page. The next section explains how to use this object to display the picker and control its behavior.
If your checkout enforces a Content Security Policy, allow
https://embed.sendcloud.sc in both script-src, for the
picker script, and frame-src, for the picker overlay itself, which is an iframe served from that origin.Display the picker
Usesendcloud.servicePoints.open() to display the picker. It takes three arguments:
open() method signature
Configuration options
The
carriers option only filters the carriers enabled for service point delivery in your integration settings.postalCode, city, and address1.
The picker then opens near that address instead of requiring the customer to search for it again.
Handle the selection
When the customer selects a service point, the picker checks that it is still available before completing the selection. If the service point is available, the picker closes and calls your success callback with two arguments:Service point fields
TheservicePoint argument contains the selected service point details:
Example: selected service point
The service point object returned in the callback uses a different structure than Service Points API
v3 response.
id with the order. If the picker returns a post number, store that as well.
You’ll need these values when you create the shipment.
Handle failures
The failure callback receives a single argument,errors, which is an array of strings. Configuration problems can be reported together, so the array may contain more than one value.
The failure callback can return values such as:
Closed is the only value you should handle as a separate case. It represents normal customer behavior rather than an error. Treat other values as errors to log or report without assuming the list above is exhaustive.
Errors handled inside the picker are not passed to your failure callback.
For example, if the selected service point is no longer available, a search fails, or a required post number is missing, the picker handles the problem in its own interface and remains open.
Close the picker
The customer can close the picker with its close button or by pressing Esc. Both call your failure callback with['Closed']. See Handle failures for how to handle this case.
You can also close the picker from your code, for example when the customer returns to an earlier checkout step:
Example: closing the picker from your code
close() from your code does not trigger the success or failure callback.
Example integration
The following example puts the pieces together. Replace the public key with the one from your integration settings.Example: minimal service point picker integration
Next step
Once you have stored the selected service pointid and any post number returned by the picker, continue with creating the shipment.
Create a shipment with service point delivery
Use the selected service point to find a compatible shipping option, then create and announce the shipment.