v2 is generally available. See what changed
Skip to content
Acme Commerce API Menu

Retrieve a customer

GET /api/v2/customers/{customer} Requires authentication v2

Send a bearer token in the Authorization header.

Full URL: https://api.acme.example/api/v2/customers/{customer}

Path parameters

Name Type Required Description
customer integer yes The customer id.

Query parameters

Name Type Required Description
include string, one of orders, addresses no Embed a related collection in the response.

Responses

200 The customer.

Field Type Description
id integer
email string<email>
name string
status string, one of active, invited, archived
created_at string<date-time>

404 No customer with that id.

Example request

cURL
curl -X GET 'https://api.acme.example/api/v2/customers/1' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
JavaScript
const response = await fetch('https://api.acme.example/api/v2/customers/1', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Accept': 'application/json'
  }
});

const data = await response.json();
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Authorization' => 'Bearer YOUR_TOKEN',
    'Accept' => 'application/json',
])->get('https://api.acme.example/api/v2/customers/1');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('GET', 'https://api.acme.example/api/v2/customers/1', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_TOKEN',
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);

Free while you are building.

Get an API key

This page as Markdown, or the whole API as OpenAPI. Ask ChatGPT Ask Claude