Skip to content

theUnrelated/shopify_anchanto_integration

Repository files navigation

Shopify Anchanto Integration

Various management processes between shopify and anchanto warehouse management using REST API with Python, request package and flask or AWS.

Functions

  1. Order creation
  2. Inventory Sync
  3. Fulfillment update
  4. Full Sync

Flask

Flask deployment was tested via local host using ngrok and beeceptor.

AWS

AWS Lambda, AWS API Gateway and AWS Cloudwatch (For logging and debugging purposes).
Additional Permissions needed:

  • iam:CreateRole
  • iam:CreatePolicy

Setting up requests library

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.

Order Creation

Shopify webhook will be activated at new order creation sending POST request to Anchanto warehouse management.

Inventory Sync

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.

Fulfillment Update

POST request will be sent to shopify updating order to Fulfilled upon status change = complete via webhook request from Anchanto end.

Full Sync

Full Sync function can be called which pulls inventory and syncs both inventory according to Anchanto's warehouse.

Disclaimer

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.