From 944093f53f3f1fc82a67f04a2f076e9ab679ae96 Mon Sep 17 00:00:00 2001 From: Jonas Kwiedor Date: Wed, 6 Oct 2021 18:28:48 +0200 Subject: [PATCH] Update readme --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0fd1fc..df8a6d2 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ if err != nil { ## Get all inventory locations -If you want to read out all inventory locations, you can do this with the following function. You can find the description from Shopify [here](https://shopify.dev/api/admin-rest/2021-07/resources/inventorylevel#[post]/admin/api/2021-07/inventory_levels/adjust.json). +If you want to read out all inventory locations, you can do this with the following function. You can find the description from Shopify [here](https://shopify.dev/api/admin-rest/2021-07/resources/location#[get]/admin/api/2021-07/locations.json). ```go // Define request @@ -248,6 +248,34 @@ if err != nil { } ``` +## Set an inventory level + +If you want to customize a pass, you can do so as follows. For this you need the Inventory Id and the Location Id of the product. You can find the description from Shopify [here](https://shopify.dev/api/admin-rest/2021-07/resources/inventorylevel#[post]/admin/api/2021-07/inventory_levels/set.json). + +```go +// Define request +r := goshopify.Request{ + ApiKey: "", + ApiPassword: "", + StoreName: "", +} + +// Define body +body := goshopify.InventoryLevelBody{ + LocationId: 62413209784, + InventoryItemId: 42744167694520, + Available: 24, +} + +// Get all inventory locations +inventory, err := goshopify.InventoryLevels(body, r) +if err != nil { + fmt.Println(err) +} else { + fmt.Println(inventory) +} +``` + ## Get list of orders since id To get a list of orders, you can call the following function. The list shows all orders by a certain ID, if you leave this ID at 0, then the orders are displayed from the beginning. 200 orders are always read out at once.