SUQODocs
User GuideAPI ReferenceSDKs

Browse the catalog

Browsing your product catalog with the SUQO PHP SDK.

Read-only — and the only resource that works before your seller account completes KYC verification, since browsing your own catalog involves no seller action.

Listing products

$page = $suqo->products->list(page: 1, pageSize: 50);

echo $page->count, PHP_EOL;          // total across all pages, not this page

foreach ($page->results as $product) {
    echo $product->productId, ' ', $product->name, PHP_EOL;
    echo '  vat ', $product->vat?->vatPercentage ?? 'n/a',
         ' subscribers ', $product->totalSubscribers, PHP_EOL;
}

page is 1-based and pageSize is sent as page_size — the SDK does that translation, you never write the wire name. Both are omitted from the query string entirely when null.

Finding a billing period to subscribe to

pbpId is the required input to subscriptions->create(), and the catalog is where you get it. It lives three levels down: a product has plans, a plan has billing periods, a billing period has the id and the price.

foreach ($suqo->products->autoPaging() as $product) {
    foreach ($product->plan as $plan) {
        foreach ($plan->billingPeriods as $period) {
            echo $product->name, ' / ', $plan->planName, PHP_EOL;
            echo '  ', $period->pbpId, ' ', $period->price, ' ', $period->currency,
                 ' every ', $period->intervalCount, ' ', $period->intervalType, PHP_EOL;
        }
    }
}

Price is not on the product record. It lives on the billing period, and surfaces again as $subscription->product->price once a subscription exists.

Fields worth knowing about

Suqo\Model\Product — every property is nullable, because reads are tolerant: a field of an unexpected type reads as absent rather than failing the whole response.

PropertyTypeNotes
productId, name, description, type?string
isActive?bool
vat?ProductVatisVatActive, vatType (inclusive or exclusive), vatPercentage. All three null when VAT is off, which is the common case — the object itself is still there.
productImagelist<ProductImage>image, imageOrder.
planlist<ProductPlan>planId, planName, description, billingPeriods.
totalSubscribers?stringA decimal string, like every other number that could carry money.
createdAt, updatedAt?stringOpaque timestamps; the SDK parses no dates.

BillingPeriod: pbpId, intervalType, intervalCount (?int), label, price, currency, isCurrent / isLimited / isArchived (?bool), and offers (list<Offer>id, discountAmount, startsAt, validUntil, isActive).

Anything the server adds beyond this list is still reachable, with the server's own keys:

$raw = $product->toArray();
$raw['some_new_field'] ?? null;

On this page