SUQODocs
User GuideAPI ReferenceSDKs
PHP SDK v1.0.0. This version is frozen and no longer updated. Read the latest (1.1.0).

Look up customers

Listing and retrieving customers with the SUQO PHP SDK.

Read-only — list(), autoPaging() and read(). There is no create, update or delete: a customer record is created implicitly the first time someone subscribes, through subscriptions->create()'s customer field.

Listing

$page = $suqo->customers->list(pageSize: 50);

echo $page->count, PHP_EOL;

foreach ($page->results as $customer) {
    echo $customer->id, ' ', $customer->buyerPhone, PHP_EOL;
    echo '  ', $customer->fullName ?? '(no name)', PHP_EOL;
}

Or walk every page without page math:

foreach ($suqo->customers->autoPaging() as $customer) {
    handle($customer);
}

Retrieving one

$customer = $suqo->customers->read('cus_0390b1820');

echo $customer->buyerEmail ?? '-', PHP_EOL;

The method is read(), not retrieve() — the name comes from the operation the API declares. A 404 also covers an id belonging to the other environment; the two look identical.

Shape

Suqo\Model\Customer — id, buyerPhone, buyerEmail, fullName, address, createdAt, all ?string, plus toArray().

id is a prefixed public id (cus_0390b1820) — not an integer, and not a UUID like the subscription ids elsewhere in the API.

Every field except id, buyerPhone and createdAt can be null in practice: a record with only a phone number on file is normal. createdAt carries microseconds and a +05:45 offset rather than Z, and is kept as an opaque string like every other timestamp.

Not the same shape as a subscription's customer

buyerPhone and buyerEmail keep their wire stems here. The customer embedded on a subscription is a different type — SubscriptionCustomer, with phone / fullName / email and no prefix, plus nested billing and shipping. Both describe a buyer; they are not the same record, and the SDK never conflates them.

On this page