PATCH
/
v1
/
customers
/
{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.Customers.Update(ctx, "<value>", components.CustomerUpdate{})
    if err != nil {
        log.Fatal(err)
    }
    if res.Customer != nil {
        // handle response
    }
}
{
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "metadata": {},
  "email": "<string>",
  "email_verified": true,
  "name": "<string>",
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "state": "<string>",
    "country": "<string>"
  },
  "tax_id": [
    "<any>"
  ],
  "organization_id": "<string>",
  "avatar_url": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The customer ID.

Body

application/json
metadata
object | null

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A boolean

You can store up to 50 key-value pairs.

email
string | null
name
string | null
billing_address
object | null
tax_id
any[] | null

Response

200
application/json
Customer updated.

A customer in an organization.

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 object.

metadata
object
required
email
string
required
email_verified
boolean
required
name
string | null
required
billing_address
object | null
required
tax_id
any[] | null
required
organization_id
string
required
avatar_url
string
required