GStableClient overview
GStableClient is constructed with GStableClientOptions (see Client configuration). It exposes six resource namespaces on the instance
| Property | Type | Purpose |
|---|---|---|
product | ProductResource | Product CRUD, list, archive, remove. |
account | AccountResource | Read-only list & detail. |
paymentLink | PaymentLinkResource | Payment Link lifecycle. |
capability | CapabilityResource | Public capabilities (all()). |
checkoutSession | CheckoutSessionResource | Checkout sessions & status lists. |
webhook | WebhookResource | Webhook endpoint management. |
Constructor behavior:
- Throws if
apiKeyis missing or whitespace-only (GStableClient: apiKey is required). - Internally creates
GStableHttpand one resource instance per row above.
Documentation map
| Topic | Page |
|---|---|
| Accounts | Accounts |
| Products | Products |
| Payment links | Payment links |
| Checkout sessions | Checkout sessions |
| Webhooks | Webhooks |
| Capabilities | Capabilities |
| HTTP & envelope | HTTP transport & envelope |
HTTP field names and bodies match the REST docs: API introduction.
Package exports (src/index.ts)
Besides GStableClient, the root entry re-exports errors (GStableError, GStableProductError, createTypedApiError, …), HTTP primitives, resource classes (including AiPaymentResource), and TypeScript types for every domain (Product, PaymentLink, Webhook, AI Payment messages, etc.). Each resource page above documents methods with parameters, return types, and examples aligned with those exports.