GET
/
v1
/
benefits
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.List(ctx, nil, nil, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.ListResourceBenefit != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "items": [
    {
      "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": {
        "image_height": 400,
        "image_width": 400
      }
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

organization_id

Filter by organization ID.

type

Filter by benefit type.

Available options:
custom,
ads,
discord,
github_repository,
downloadables,
license_keys
page
integer
default:
1

Page number, defaults to 1.

Required range: x > 0
limit
integer
default:
10

Size of a page, defaults to 10. Maximum is 100.

Required range: x > 0

Response

200
application/json
Successful Response
items
object[]
required
pagination
object
required