Skip to main content
PATCH
/
v1
/
benefits
/
{id}
Go (SDK)
package main

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

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

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

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

Authorizations

Authorization
string
header
required

Path Parameters

id
string<uuid4>
required

Body

application/json
  • BenefitCustomUpdate
  • BenefitDiscordUpdate
  • BenefitGitHubRepositoryUpdate
  • BenefitDownloadablesUpdate
  • BenefitLicenseKeysUpdate
  • BenefitMeterCreditUpdate
type
string
required
Allowed value: "custom"
metadata
object
description
string | null
Required string length: 3 - 42
properties
object | null

Response

  • BenefitCustom
  • BenefitDiscord
  • BenefitGitHubRepository
  • BenefitDownloadables
  • BenefitLicenseKeys
  • BenefitMeterCredit
id
string<uuid4>
required
created_at
string<date-time>
required
modified_at
string<date-time> | null
required
type
string
required
Allowed value: "custom"
description
string
required
selectable
boolean
required
deletable
boolean
required
organization_id
string<uuid4>
required
metadata
object
required
properties
object
required