Skip to content

FriendsOfShopware/go-shopware-admin-api-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDK for the Shopware 6 Admin API

See example folder

Create a client

Password

ctx := context.Background()

// Create a using password grant
creds := sdk.NewPasswordCredentials("<username>", "<password>", []string{"write"})
client, err := sdk.NewApiClient(ctx, "<url>", creds, nil)

Integration

ctx := context.Background()

// Create a using password grant
creds := sdk.NewIntegrationCredentials("<client-id>", "<client-secret>", []string{"write"})
client, err := sdk.NewApiClient(ctx, "<url>", creds, nil)

Usage of a repository

Search

apiContext := sdk.NewApiContext(ctx)
criteria := sdk.Criteria{}

collection, _, _ := client.Repository.Tax.Search(apiContext, criteria)

for _, tax := range collection.Data {
    fmt.Println(tax.Name)
}

Create/Update

apiContext := sdk.NewApiContext(ctx)
client.Repository.Tax.Upsert(apiContext, []sdk.Tax{
    {TaxRate: 15, Name: "15%"},
})

Delete

apiContext := sdk.NewApiContext(ctx)
client.Repository.Tax.Delete(apiContext, []string{"someid"})

About

Go SDK for the Shopware 6 Admin API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published