Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gowizzard committed Oct 6, 2021
1 parent ab20033 commit 944093f
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 944093f

Please sign in to comment.