GET
/
v1
/
benefits
/
{id}
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Benefits.Get(ctx, "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Benefit != nil {
        // handle response
    }
}
{
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "type": "<string>",
  "description": "<string>",
  "selectable": true,
  "deletable": true,
  "organization_id": "<string>",
  "properties": {
    "note": "<string>"
  },
  "is_tax_applicable": true
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Path Parameters

id
string
required

The benefit ID.

Response

200
application/json
Successful Response

A benefit of type custom.

Use it to grant any kind of benefit that doesn't fit in the other types.

created_at
string
required

Creation timestamp of the object.

modified_at
string | null
required

Last modification timestamp of the object.

id
string
required

The ID of the benefit.

type
string
required
Allowed value: "custom"
description
string
required

The description of the benefit.

selectable
boolean
required

Whether the benefit is selectable when creating a product.

deletable
boolean
required

Whether the benefit is deletable.

organization_id
string
required

The ID of the organization owning the benefit.

properties
object
required

Properties for a benefit of type custom.

is_tax_applicable
boolean
required
deprecated

Was this page helpful?