<?php
require __DIR__.'/vendor/autoload.php';
use ContextDev\Client;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));
// The generated Brand helper requires fields from multiple lookup types, so send the request directly.
$raw = $client->request(
method: 'post',
path: 'brand/retrieve',
body: [
'type' => 'by_domain',
'domain' => 'stripe.com',
],
);
$response = json_decode((string) $raw->getBody(), true, flags: JSON_THROW_ON_ERROR);
echo $response['brand']['title'] ?? 'No brand found', PHP_EOL;