PATCH
/
v1
/
customers
/
external
/
{external_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.UpdateExternal(ctx, "<id>", 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": {},
  "external_id": "<string>",
  "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

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

Path Parameters

external_id
string
required

The customer external 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.

external_id
string | null

The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.

email
string | null

The email address of the customer. This must be unique within the organization.

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
external_id
string | null
required

The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.

email
string
required

The email address of the customer. This must be unique within the organization.

email_verified
boolean
required

Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.

name
string | null
required
billing_address
object | null
required
tax_id
any[] | null
required
organization_id
string
required
avatar_url
string
required