Skip to main content
GET
/
v1
/
customers
/
external
/
{external_id}
PHP (SDK)
declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->customers->getExternal(
    externalId: '<id>'
);

if ($response->customer !== null) {
    // handle response
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "metadata": {},
  "email": "<string>",
  "email_verified": true,
  "type": "<string>",
  "name": "John Doe",
  "billing_address": {
    "line1": "<string>",
    "line2": "<string>",
    "postal_code": "<string>",
    "city": "<string>",
    "state": "<string>"
  },
  "tax_id": {
    "[0]": "<string>"
  },
  "organization_id": "<string>",
  "deleted_at": "2023-11-07T05:31:56Z",
  "avatar_url": "<string>",
  "external_id": "usr_1337",
  "locale": "<string>",
  "default_payment_method_id": "<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.

Response

Successful Response

A customer in an organization.

id
string<uuid4>
required

The ID of the customer.

Example:

"992fae2a-2a17-4b7a-8d9e-e287cf90131b"

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

metadata
object
required
email
string
required

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

Example:

"customer@example.com"

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.

Example:

true

type
string
required

The type of customer.

Allowed value: "individual"
Example:

"individual"

name
string | null
required

The name of the customer.

Example:

"John Doe"

billing_address
Address · object
required
tax_id
Tax Id · object
required
organization_id
string<uuid4>
required

The ID of the organization owning the customer.

Example:

"1dbfc517-0bbf-4301-9ba8-555ca42b9737"

deleted_at
string<date-time> | null
required

Timestamp for when the customer was soft deleted.

avatar_url
string
required
Example:

"https://www.gravatar.com/avatar/xxx?d=404"

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.

Example:

"usr_1337"

locale
string | null
default_payment_method_id
string<uuid4> | null

The ID of the customer's default payment method, if any. Use the payment methods endpoint to retrieve its details.