Purpose: This is a guide on how you can enable Service points for API Integrations.
What is the Service Point Picker?
Some shipping carriers offer Service Points for your users to send their parcels to so they can pick the parcel up themselves as they wish from a nearby location. Sendcloud offers the Service Point Picker which can be easily integrated into any system in order to provide an excellent interface to chose from available service points.
How does this work?
This article focuses on setting up the Service Point Picker in a custom-built shop. These shops must be integrated directly to Sendcloud's API without a plugin provided by us.
Version History
Version: 1.0.0
Date: 2017-01-11
URL: https://embed.sendcloud.sc/spp/1.0.0/api.min.js
Related Links
SendCloud API Documentation
https://docs.sendcloud.sc/api/v2/index.html
Service Point Picker integration example
https://sendcloud-public.gitlab.io/spp-integration-example/
Service Point Picker integration example repository
https://gitlab.com/sendcloud-public/spp-integration-example
Step 1: Getting an API key
- Once logged in our panel, click on 'Settings' in the left side menu
- Choose for 'Connected Shops' and 'Connect new shop'(orange button right-top)
- Choose for SendCloud API and click 'Connect'
- Tick the box 'Service Points'
- Enable the carriers you with to activate service points through
- Hit 'Save' once again
Step 2: Setting up a Service Point Picker integration
In order to setup a Service Point Picker integration you need to first have a fully usable custom integration to our API. You can see a guide on how to set it up here.
Once you got your API integration working, please follow up into setting up the Service Point Picker as follows:
- Make sure you've enabled Service Points in your Integration settings
- Copy the Embed JavaScript code provided in the Integration settings page
- Paste the JavaScript code into your checkout page.
- At this point, you can check our Service Point Picker example.
Step 3: A quick step by step guide on how to integrate the JavaScript code to your backend code
- You need to call sendcloud.servicePoints.open and provide with a config object, a success callback and a failure callback (example)
- Once a Service Point is picked our library will call your callback function with a Service Point Object. The main pieces of information you're looking for is the Service Point ID and all of the address properties within. You need to keep track of that ID somehow once it'll be used to create a new parcel shipment in our API
- When the parcel shipment is being created in our API you need to make sure to pass all of the correct address information in the address fields and mainly fill the to_service_point parameter with the Service Point ID.
Once you've followed all of the above steps your integration should be properly working.
If you have any feedback, you're most welcome to send us an email at development@sendcloud.com