Rest API
Getting Started with Swym Back In Stock Alerts API: Setting up on Your REST Implementation
Introduction
This guide provides basic instructions to help you get started with setting up Swym Back In Stock Alerts API on your REST implementation.
With Swym Back in Stock Alerts, you can automatically send notifications to customers when products are back in stock or available for pre-order or coming soon on your headless builds.
Preconditions
- Swym apps installed on your store's, Shopify's, or BigCommerce's backend.
- Inventory, product updates, and other related functions are managed by the e-commerce platform, such as Shopify or Bigcommerce. These functions are integral to the proper functioning of your online store, and are typically handled by the platform rather than your backend.
The REST Lists API is available only on our Premium plans or above. Check out our Pricing & Plans page for more information.
Setup pre-requisites
Key | Comments |
---|---|
{{Swym API endpoint}} | {{Swym API Endpoint}}/storeadmin/v3/user/generate-regid |
PID | unique token for the merchant or your username for making the API calls. |
Swym API Key | API key to access Swym storefront APIs available dashboard or your password for making the API calls. |
You can navigate to Swym Admin Settings page and check with your API credentials such as API {{Swym API endpoint}} and PID.
You need to contact support by reaching out to us at [email protected] to generate your unique API key per store.
Tools Required to Setup and Test.
- Understanding of GET and POST requests.
- Curl or Postman to test the APIs.
- knowledge of Headless development.
Authentication
Store Admin Authentication
The Swym Back in Stock Alerts API is a backend-only (API) that requires store admin authentication to work properly. To ensure security, middleware is needed to facilitate the use of API keys and PIDs (passwords and usernames) and prevent access by unauthorized users. This approach helps keep sensitive information away from bad actors and ensures the API can function safely and securely.
curl '{{Swym API Endpoint}}/storeadmin/me' \
--basic \
--user {{pid}}:{{APIKey}} \
--compressed
curl '{{Swym API Endpoint}}/storeadmin/me' \
-H 'Authorization: Basic {{BASE64-ENCODING-OF-"pid:apikey"}}' \
--compressed
Response
{
"pid": "yourstorepid",
"appId": "StoreadminApi"
}
Updated over 1 year ago