Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gowizzard committed May 5, 2021
1 parent 64d55e2 commit 59ca534
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To access the API you need a current Bearer Token. You will receive this token w

```go
// Get bearer token
data, err := tillhub.AuthKey("accudId", "apiKey")
data, err := tillhub.AuthKey("accountId", "apiKey")
if err != nil {
fmt.Println(err)
}
Expand All @@ -50,7 +50,7 @@ To find out the tax ids and get more information about the tax you can use the f

```go
// Get tax information
tax, err := Tax("accoundId", "token")
tax, err := Tax("accountId", "token")
if err != nil {
fmt.Println(err)
}
Expand Down Expand Up @@ -252,7 +252,7 @@ To remove a product you need the ID of the product and you can remove it with th

```go
// Delete an product whith his dependencies
delete, err := DeleteProduct("productId", "userId", "token")
delete, err := tillhub.DeleteProduct("productId", "userId", "token")
if err != nil {
fmt.Println(err)
}
Expand All @@ -267,11 +267,43 @@ If you want to read out all product groups, you can do it with this function. Bo

```go
// Get all product groups
groups, err := ProductGroups("accoundId", "token")
groups, err := tillhub.ProductGroups("accountId", "token")
if err != nil {
fmt.Println(err)
}

// Print all product groups
fmt.Println(groups)
```

### Create new product group

To define a new product group the following function can be used. You can find the documentation [here](https://api.tillhub.com/api/docs#tag/product_groups/paths/~1api~1v0~1product_groups~1{clientAccountID}/post).

```go
// Create product body data
body := tillhub.CreateProductGroupBody{
true,
"#87cef9",
"newGroup",
"00001",
"f85910a6-94c4-40bd-a0ac-386ef880c857",
"673ba8d1-f544-48be-b432-122633e92715",
tillhub.CreateProductGroupBodyImages{
"https://storage.googleapis.com/tillhub-api-images/dd5a5b03-69fd-4747-bd6c-2ecf22ec78c1/productGroups/1a743bf7-10af-4897-891e-13c9924441de_1x.png",
"https://storage.googleapis.com/tillhub-api-images/dd5a5b03-69fd-4747-bd6c-2ecf22ec78c1/productGroups/1a743bf7-10af-4897-891e-13c9924441de_1x.png",
"https://storage.googleapis.com/tillhub-api-images/dd5a5b03-69fd-4747-bd6c-2ecf22ec78c1/productGroups/1a743bf7-10af-4897-891e-13c9924441de_1x.png",
"https://storage.googleapis.com/tillhub-api-images/dd5a5b03-69fd-4747-bd6c-2ecf22ec78c1/productGroups/1a743bf7-10af-4897-891e-13c9924441de_1x.png",
"https://storage.googleapis.com/tillhub-api-images/dd5a5b03-69fd-4747-bd6c-2ecf22ec78c1/productGroups/1a743bf7-10af-4897-891e-13c9924441de_1x.png",
},
}

// Save new product group
group, err := tillhub.CreateProductGroup(body, "accountId", "token")
if err != nil {
fmt.Println(err)
}

// Print return
fmt.Println(group)
```

0 comments on commit 59ca534

Please sign in to comment.