From 4c7b6f34e195cd30f17e6adf62558eb5f560cafb Mon Sep 17 00:00:00 2001 From: j-low Date: Sat, 18 Jan 2025 13:17:11 -0600 Subject: [PATCH] chore: add usage example to readme --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 971f94e..eeba33d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,29 @@ The package provides bindings for the following Squarespace Commerce APIs: - [Transactions](https://developers.squarespace.com/commerce-apis/transactions-overview) - [Webhook Subscriptions](https://developers.squarespace.com/commerce-apis/webhook-subscriptions-overview) +Usage + +``` +import ( + "context" + "fmt" + "net/http" + + "github.com/j-low/gocommerce/products" +) + +config := common.Config{ + APIKey: "my_api_key-999", + UserAgent: "my_user-agent-999", + Client: http.DefaultClient, +} + +resp, err := products.DeleteProduct(ctx, &config, "some-product-id-999") +if err != nil { + return fmt.Println(err) +} +``` + ## License MIT License