-
- get store date(in case if neede) for example to display the owner, address ...etc of the store.
-
- fetch all products(or products of specific collection).
- push product images(will remove the old images).
- update product cost per item.
- update product quantity.
-
- fetch all locations.
-
- fetch all customers.
-
- fetch data of specific collection(like count of products).
-
- install the package in your project
- init your store like:
myStore := fkshopify.New("store user"), "store password", "store name", "api version", "web hook token")
- then U can call resources functions like for example if U want to fetch all customers on store:
myStore.GetAllShopifyCustomers()
-
- the WebHookHandleActionEntity method handles create, update and delete webhooks for all resources just need to pass the right data like the examples bellow:
type Product struct { ID int `json:"id"` Title string `json:"title"` BodyHTML string `json:"body_html,omitempty"` } type DeleteDate struct { ID int `json:"id"` } // handle the create or update webhook func yourHandler() { var payload Product body := ... //the request body hmacHeader := .... // ge the X-Shopify-Hmac-SHA256 header data, err := fkshopify.WebHookHandleActionEntity(myStore, payload, hmacHeader, body) // handle the error // U have the data sended via webhook fmt.Printf("%#v\n", payload.Titlt) } // handle delete webhook func anotherHandler() { var payload DeleteDate // the rest code is the same .... }
-
Notifications
You must be signed in to change notification settings - Fork 0
fareskato/fkshopify
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Golang shopify utility package to fetch products(update images, qty and cost per item), customers, locations and handle webhooks