Skip to main content

GStableClient overview

GStableClient is constructed with GStableClientOptions (see Client configuration). It exposes six resource namespaces on the instance

PropertyTypePurpose
productProductResourceProduct CRUD, list, archive, remove.
accountAccountResourceRead-only list & detail.
paymentLinkPaymentLinkResourcePayment Link lifecycle.
capabilityCapabilityResourcePublic capabilities (all()).
checkoutSessionCheckoutSessionResourceCheckout sessions & status lists.
webhookWebhookResourceWebhook endpoint management.

Constructor behavior:

  • Throws if apiKey is missing or whitespace-only (GStableClient: apiKey is required).
  • Internally creates GStableHttp and one resource instance per row above.

Documentation map

TopicPage
AccountsAccounts
ProductsProducts
Payment linksPayment links
Checkout sessionsCheckout sessions
WebhooksWebhooks
CapabilitiesCapabilities
HTTP & envelopeHTTP 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.