How do I integrate Peppyduck Back in Stock APIs?
Who can benefit from Peppyduck Back in Stock API integration?
By default, the Peppyduck Back in Stock app provides a complete package and integrates seamlessly with all Shopify stores -
A customizable button and sign up form to collect user signups for out of stock products
A robust backend system which automatically sends messages to signed up users when the products come back in stock.
However, you might have the need or desire to have complete control over the design, layout and style of your storefront pages. For such cases, we provide the capability of integrating our extremely simple and minimal APIs. This enables you to benefit from our solid backend systems while you completely own the UI and UX on your store.
What do I need to do for the API integration?
List of API endpoints
We provide you the following 3 API endpoints -
API | Mandatory? | Description | Data Needed |
---|---|---|---|
Create Subscription | Yes | Capture a user signup | Product/Variant ID, Customer contact details |
Track Click | No | Track when a user clicks a back in stock notification and lands on your store | Product/Variant ID, Subscription ID* |
Track Order | No | Track when a user places an order after landing on your store from a back in stock notification | Order/Checkout Details, Subscription ID* |
*Subscription ID will be available to you as a query parameter in the URL that the user will have in their browser
The overall flow
Signup flow
A user lands on an out of stock product page on your store
You collect their contact information
You call our Create Subscription API with the contact details of the customer and the IDs product/variant they signed up for
The signup flow is completed here.
Restock flow
You restock a product
Messages are automatically sent to all users who had signed up for restock notifications for that product
Such a user clicks on the notification and lands on the product page for their chosen product. In the URL, the relevant UTM parameters and the Subscription ID are present.
Using this subscription ID, you make a call to our Track Click endpoint so that you can get accurate CTR reporting in our app dashboard
In case the user makes a purchase, you make a call to our Track Order endpoint with the same Subscription ID so that you can get correct order attribution information in our app reports
The restock flow is completed here.
Important notes
The Track Click and Track Order APIs are optional but recommended to be integrated - they help you in getting accurate CTR and attribution information from within the application. Otherwise you will have to rely on Google/Shopify UTM based analytics to track order attribution to back in stock notifications from our app.
You'll need to keep track of the Subscription ID for the entire user journey - that is, starting from when the user lands on the product page, till the moment they make a purchase. We recommend that you use a cookie for this purpose (first-party cookie)
Updated on: 19/08/2024
Thank you!