Various management processes between shopify and anchanto warehouse management using REST API with Python, request package and flask or AWS.
- Order creation
- Inventory Sync
- Fulfillment update
- Full Sync
Flask deployment was tested via local host using ngrok and beeceptor.
AWS Lambda,
AWS API Gateway and
AWS Cloudwatch (For logging and debugging purposes).
Additional Permissions needed:
- iam:CreateRole
- iam:CreatePolicy
requests package requried as an additional layer in AWS Lambda
mkdir python
cd python
pip install requests -t .
to download in python directory
*Note: folder must be named python and the . in pip install is required.
Zip and upload to AWS Lambda Layers
You can use AWS lambda boto3 and skip the above step
from botocore.vendored import requests
but I believe it is going to be deprecated in 2021.
Alternatively, you can use ZAPPA or SAM for the dependencies but personally, that would be much more complicated to the solution above.
Shopify webhook will be activated at new order creation sending POST request to Anchanto warehouse management.
Anchanto Webhook will be activated upon change in any inventory quantity, sending POST request to Shopify to update stock count. Anchanto uses SKU while Shopify uses ID. Shopify graphQL is used to obtain inventory ID from SKU number.
POST request will be sent to shopify updating order to Fulfilled upon status change = complete via webhook request from Anchanto end.
Full Sync function can be called which pulls inventory and syncs both inventory according to Anchanto's warehouse.
This is still in dev stage but they do work. Current challenges:
- Confirmation and more vigorous testing required with Anchanto Test Environment (Down atm)
- Key information required for POST requests e.g order ID is different in Anchanto and in Shopify.