This package provides a go API client for the lemonsqueezy API
lemonsqueezy-go
is compatible with modern Go releases in module mode, with Go installed:
go get github.com/NdoleStudio/lemonsqueezy-go
Alternatively the same can be achieved if you use import
in a package:
import "github.com/NdoleStudio/lemonsqueezy-go"
- Users
GET /v1/users/me
: Retrieves the currently authenticated user.
- Stores
GET /v1/stores/:id
: Retrieve a storeGET /v1/stores
: List all stores
- Customers
GET /v1/customers/:id
: Retrieve a customerGET /v1/customers
: List all customers
- Products
GET /v1/products/:id
: Retrieve a productGET /v1/products
: List all products
- Variants
GET /v1/variants/:id
: Retrieve a variantGET /v1/variants
: List all variants
- Files
GET /v1/files/:id
: Retrieve a fileGET /v1/files
: List all files
- Orders
GET /v1/orders/:id
: Retrieve an orderGET /v1/orders
: List all orders
- Order Items
GET /v1/order-items/:id
: Retrieve an order itemGET /v1/order-items
: List all order items
- Subscriptions
PATCH /v1/subscriptions/:id
: Update a subscriptionGET /v1/subscriptions/:id
: Retrieve a subscriptionGET /v1/subscriptions
: List all subscriptionsDELETE /v1/subscriptions/{id}
: Cancel an active subscription
- Subscription Invoices
GET /v1/subscription-invoices/:id
: Retrieve a subscription invoiceGET /v1/subscription-invoices
: List all subscription invoices
- Discounts
POST /v1/discounts
: Create a discountGET /v1/discounts/:id
: Retrieve a discountDELETE /v1/discounts/:id
: Delete a discountGET /v1/discounts
: List all discounts
- Discount Redemptions
GET /v1/discount-redemptions/:id
: Retrieve a discount redemptionGET /v1/discount-redemptions
: List all discount redemptions
- License Keys
GET /v1/license-keys/:id
: Retrieve a license keyGET /v1/license-keys
: List all license keys
- License Key Instances
GET /v1/license-key-instances/:id
: Retrieve a license key instanceGET /v1/license-key-instances
: List all license keys instance
- Checkouts
POST /v1/checkouts
: Create a checkoutGET /v1/checkouts/:id
: Retrieve a checkoutGET /v1/checkouts
: List all checkouts
- Webhooks
Verify
: Verify that webhook requests are coming from Lemon Squeezy
An instance of the client can be created using New()
.
package main
import (
"github.com/NdoleStudio/lemonsqueezy-go"
)
func main() {
client := lemonsqueezy.New(lemonsqueezy.WithAPIKey(""))
}
All API calls return an error
as the last return object. All successful calls will return a nil
error.
subscription, response, err := client.Sucbscriptions.Get(context.Background(), "1")
if err != nil {
//handle error
}
You can run the unit tests for this client from the root directory using the command below:
go test -v
This project is licensed under the MIT License - see the LICENSE file for details
- In the payload of https://docs.lemonsqueezy.com/api/order-items#list-all-order-items, remove extra
,
in thelinks
property. - In the payload of https://docs.lemonsqueezy.com/api/subscription-invoices#list-all-subscription-invoices, remove extra
,
in thelinks
property. - In the payload of https://docs.lemonsqueezy.com/api/discount-redemptions#list-all-discount-redemptions, remove extra
,
in thelinks
property. - In the payload of https://docs.lemonsqueezy.com/api/license-key-instances#list-all-license-key-instances, remove extra
,
in thelinks
property. - In the payload of https://docs.lemonsqueezy.com/api/license-keys#list-all-license-keys, remove extra
,
in thelinks
property.