UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

60 lines 3.06 kB
import { BaseServiceClient } from '../../core/base-client'; import type { HTTPClient } from '../../core/client'; import { type HealthCheckResource, type HealthCheckDataResource, type CartHdrResource, type CartHdrDataResource, type CartLineResource, type CartLineDataResource, type CheckoutResource, type CheckoutDataResource } from './resources'; /** * Commerce Service Client * @description Client for interacting with Commerce API endpoints for e-commerce cart and checkout operations * @fullPath api.commerce * @service commerce * @domain e-commerce * @discoverable true * @searchTerms ["commerce", "e-commerce", "shopping cart", "checkout", "cart management", "online store"] * @relatedEndpoints ["api.commerce.cartHdr.list.get", "api.commerce.cartLine.get", "api.commerce.checkout.create", "api.avalara.rates.create"] * @commonPatterns ["Shopping cart management", "E-commerce checkout", "Cart operations", "Payment processing"] * @workflow ["shopping-cart", "checkout-process", "e-commerce-operations", "payment-processing"] * @functionalArea "e-commerce-and-cart-management" * @businessRules ["Requires valid bearer authentication", "Shopping cart session management", "Checkout processing", "ERP integration"] * @performance "Optimized for e-commerce workflows and cart operations" * @example * ```typescript * import { HTTPClient } from '@augur/api-client/core'; * import { CommerceClient } from '@augur/api-client/services/commerce'; * * const http = new HTTPClient('commerce', { siteId: 'your-site-id', bearerToken: 'your-token' }); * const commerce = new CommerceClient(http); * * // Check service health * const health = await commerce.healthCheck.get(); * const healthData = await commerce.healthCheckData.get(); * * // Create or lookup cart * const cart = await commerce.cartHdr.lookup.get({ userId: 12345, customerId: 456, contactId: 123 }); * * // Add items to cart * await commerce.cartLine.add.create(cart.data.cartHdrUid, [{ invMastUid: 12345, quantity: 2, unitOfMeasure: 'EA' }]); * * // Create checkout * const checkout = await commerce.checkout.create({ customer: {...}, payment: {...}, lineItems: [...] }); * ``` */ export declare class CommerceClient extends BaseServiceClient { /** Health check resource */ readonly healthCheck: HealthCheckResource; /** Health check data resource (data-only) */ readonly healthCheckData: HealthCheckDataResource; /** Cart header resource */ readonly cartHdr: CartHdrResource; /** Cart header data resource (data-only) */ readonly cartHdrData: CartHdrDataResource; /** Cart line resource */ readonly cartLine: CartLineResource; /** Cart line data resource (data-only) */ readonly cartLineData: CartLineDataResource; /** Checkout resource */ readonly checkout: CheckoutResource; /** Checkout data resource (data-only) */ readonly checkoutData: CheckoutDataResource; constructor(http: HTTPClient, baseUrl?: string); protected getServiceDescription(): string; } //# sourceMappingURL=client.d.ts.map