Skip to main content
GET
/
v1
/
customers
/
{id}
Retrieve
curl --request GET \
  --url https://{defaultHost}/v1/customers/{id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{defaultHost}/v1/customers/{id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{defaultHost}/v1/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{defaultHost}/v1/customers/{id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{defaultHost}/v1/customers/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "f70f47d6-f28b-4912-ad2e-1b7a061a60df",
  "object": "customer",
  "affiliation_expires_at": null,
  "billing_matches_shipping": true,
  "email": "customer-22@example.com",
  "first_name": null,
  "indexed": true,
  "last_name": null,
  "live_mode": true,
  "name": null,
  "phone": null,
  "unsubscribed": false,
  "tax_enabled": true,
  "portal_url": "http://app.example.com/portal_redirect/customers/f70f47d6-f28b-4912-ad2e-1b7a061a60df",
  "affiliation": null,
  "billing_address": "25e1f4b8-37f3-4d33-8d1d-2062a094b351",
  "default_payment_method": null,
  "shipping_address": null,
  "tax_identifier": null,
  "created_at": 1782485820,
  "updated_at": 1782485820
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

affiliation_expires_at
integer | null

Time at which the affiliation will expire.

billing_matches_shipping
boolean

If set to true the shipping address will be used for the billing address.

email
string

The customer’s email address.

first_name
string | null

The customer’s first name.

live_mode
boolean

Set to true if this customer is in live mode, and set to false if it is in test mode.

last_name
string | null

The customer’s last name.

name
string | null

The customer’s full name or business name. If set, this will take precedence over the separate first_name and last_name attributes.

phone
string | null

The customer’s phone number.

tax_enabled
boolean

Whether or not tax should be calculated for checkouts associated with this customer.

unsubscribed
boolean

Set to true if this customer has unsubscribed from from opt-in emails (i.e. abandoned cart emails).

indexed
boolean

Whether or not this customer is included in the /customers list endpoint. Only customers that have been manually created or have a purchase are indexed.

affiliation

Expandable – The associated affiliation ID.

balances

Expandable – Property not returned unless expanded.

billing_address

Expandable – The associated address ID.

default_payment_method

Expandable – The associated payment method ID.

licenses

Expandable – Property not returned unless expanded.

portal_url
string | null

A URL that will redirect to this customer's correct portal page (hosted or external).

purchases

Expandable – Property not returned unless expanded.

shipping_address

Expandable – The associated address ID.

tax_identifier

Expandable – The associated tax identifier ID.

reviews

Expandable – Property not returned unless expanded.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.