Skip to main content
PATCH
/
v1
/
customer-portal
/
customers
/
me
Go (SDK)
package main

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

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

    s := polargo.New()

    res, err := s.CustomerPortal.Customers.Update(ctx, components.CustomerPortalCustomerUpdate{
        BillingAddress: &components.AddressInput{
            Country: components.AddressInputCountryAlpha2InputUs,
        },
    }, operations.CustomerPortalCustomersUpdateSecurity{
        CustomerSession: polargo.Pointer(os.Getenv("POLAR_CUSTOMER_SESSION")),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.CustomerPortalCustomer != nil {
        // handle response
    }
}
{
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "email": "<string>",
  "email_verified": true,
  "name": "<string>",
  "billing_name": "<string>",
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "state": "<string>"
  },
  "tax_id": {
    "[0]": "<string>"
  },
  "oauth_accounts": {},
  "default_payment_method_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://polar.sh/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.

Body

application/json
billing_name
string | null
billing_address
AddressInput · object
tax_id
string | null

Response

Customer updated.

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

id
string<uuid4>
required

The ID of the object.

email
string | null
required
email_verified
boolean
required
name
string | null
required
billing_name
string | null
required
billing_address
Address · object
required
tax_id
Tax Id · object
required
oauth_accounts
Oauth Accounts · object
required
default_payment_method_id
string<uuid4> | null
type
enum<string> | null
Available options:
individual,
team