Meters
Update Meter
Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Events
- Meters
- Benefits
- Customer Meters
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Customer Events
- Billing Events
- Organization Events
OAuth 2.0 API
- Connect
- Clients
Meters
Update Meter
Update a meter.
Scopes: meters:write
PATCH
/
v1
/
meters
/
{id}
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Meters.Update(ctx, "<value>", components.MeterUpdate{})
if err != nil {
log.Fatal(err)
}
if res.Meter != nil {
// handle response
}
}
{
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "<string>",
"operator": "eq",
"value": "<string>"
}
]
},
"aggregation": {
"func": "count"
},
"organization_id": "<string>"
}
Authorizations
You can generate an Organization Access Token from your organization's settings.
Path Parameters
The meter ID.
Body
application/json
Response
200
application/json
Meter updated.
The response is of type object
.
Was this page helpful?
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Meters.Update(ctx, "<value>", components.MeterUpdate{})
if err != nil {
log.Fatal(err)
}
if res.Meter != nil {
// handle response
}
}
{
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "<string>",
"operator": "eq",
"value": "<string>"
}
]
},
"aggregation": {
"func": "count"
},
"organization_id": "<string>"
}