Malonlin SDK Docs

Feature clients

Each client shares the configured endpoint, credentials, timeout, error handling, and request events. Use a focused method when it matches your flow; sdk.execute(...) remains available for every named catalog operation when you want the exact GraphQL response.

Client Feature coverage and common methods
sdk.auth Login, registration, token/session verification and refresh, logout, account profile, password reset/change, email verification, two-factor setup and verification, account deactivation/deletion
sdk.cart / sdk Create, load, update, add/remove items, set quantities, clear, apply/remove coupons, self-scoped cart loading, checkout readiness, and wallet checkout
sdk.products Public storefront/product reads; store- and user-owned product create/read/update; variants, variant inventory and published-state operations
sdk.coupons Coupon list, create, update by code and remove by code; cart coupon application is on sdk.cart
sdk.orders Store orders, user-owned sales, paginated store order summaries and user sold-order summaries
sdk.analytics Store/user sales analytics and date/payment-filtered order rows
sdk.account Customer orders/refunds, refund evidence/cancellation, self-scoped customer/address management, legacy ID-scoped addresses, owned/member stores, ownership transfer
sdk.scheduledOrders Create/list/read scheduled orders; store-day/user views; confirm, prepare, mark ready, complete, cancel, update status, and buyer receipt confirmation
sdk.serviceBookings Create/list bookings; availability, user/store/today views; mark paid, confirm, start, complete, cancel, no-show, and buyer receipt confirmation
sdk.wallet Self-scoped or ID-scoped wallet/transactions, transfers, withdrawals, secure payment initiation, payment methods, Ozow deposits/status/modal data, subscription context, currencies, exchange rates, limits, minimums, and fees
sdk.contacts List, create, resolve by identifier, update, remove, and favorite wallet contacts
sdk.ratings Store rating statistics, paginated ratings, fulfillment-backed rating create/update/delete, and helpful votes
sdk.communications Newsletter signup and public contact messages
sdk.settings Backend notification preferences, self-hosted notification configuration/topics, and test notifications
sdk.stores Public/store reads and store create, update, delete
sdk.members Current user's store membership ID, store members, invitations, role permissions, and membership changes
sdk.subscriptions Platform/store subscription context, plans, add-ons, purchases, and extensions
sdk.apiSubscriptions API plans, API keys, and API-key subscription lifecycle
sdk.digitalPurchases Owned digital products, purchase library, and secure download links
sdk.webhooks Signed outbound event subscription management and delivery history
sdk.uploads Multipart product/store/profile file uploads to the server's same-origin upload route

These are API clients, not UI widgets. Prefer self-scoped helpers such as sdk.getMyCart(), sdk.account.myBillingAddresses(), sdk.account.myCustomer(), and sdk.wallet.myWallet() for signed-in user flows. For ID-scoped methods, pass only the identity permitted by the backend; supplying an ID is never proof of ownership. Backend authorization and business-flow checks remain authoritative. Financial flows should keep idempotency keys stable for retries; the SDK generates/reuses keys for checkout, secure payment initiation, transfers, and withdrawals and rejects duplicate in-flight operations.

Call any catalog operation#

The SDK exports the full named GraphQL catalog (sdk.operations) and sdk.execute provides its direct response:

ts
const { getStoreSalesAnalytics } = await sdk.execute('GET_STORE_SALES_ANALYTICS', {
  storeId,
  memberId,
  startDate,
  endDate,
  currencyCode: 'ZAR',
});

const { updateStore } = await sdk.execute('UPDATE_STORE', {
  id: storeId,
  input: { name: 'A brighter name' },
  memberId,
});

The catalog includes the website's named GraphQL operations plus verified self-scoped backend operations for cart, wallet, payment, and profile flows. The website's upload API is multipart rather than GraphQL; use sdk.uploads.upload(...) for it. Field-level required/optional inputs are listed in Input, field, and event reference.

Use the ZAR default for payment flows unless the server and the transaction explicitly support another currency. Analytics calls deliberately do not add an order-status filter: completed sales are based on paid orders (isPaid: true), not only delivered orders.

Website-only React hooks#

The website uses React hooks to connect API operations to React state, navigation, and page lifecycle. They are app-internal helpers, not exports from this framework-independent SDK. In a React app, call the corresponding SDK client from your own hook or component.

Website hook Website responsibility SDK building block
useCartSync Loads/synchronizes the signed-in shopper's cart in React state sdk.cart / sdk cart methods and cart:synced
useWallet Wallet, transaction, limit, fee, and currency view state/helpers sdk.wallet
useAuthPageGuard Redirects or holds auth pages based on the website's auth/router state sdk.auth for API auth; implement routing in your app
useExternalPaymentMethods Loads configured deposit/withdrawal methods sdk.wallet.externalPaymentMethods()
useStoreMemberAccess Resolves the active member's store role/permissions sdk.members; enforce policy on the server too

Preferences that remain app-local#

Language, currency display, and other website-only presentation preferences currently live in the website's client-side state unless an explicit server operation is available. The SDK does not invent persistence APIs for them. Store app-local preferences in the consuming app and treat ZAR as the primary payment currency.

Malonlin SDK documentation