CartAdapter
●cart · /core·interface
Contract that every cart provider implementation satisfies. Adapters expose required CRUD operations and declare their optional capabilities so the kernel can gate advanced mutations without probing method presence.
Properties
PROPTYPEDESCRIPTION
Example
class ShopifyAdapter implements CartAdapter {
readonly type = 'shopify';
readonly capabilities: CartCapabilities = {
giftCards: true, multipleDiscountCodes: true,
buyerIdentity: true, notes: true, cartAttributes: true,
lineAttributes: true, customMutations: [],
};
async getCart(ctx, { cartId }) { ... }
async createCart(ctx, args) { ... }
async addLines(ctx, args) { ... }
async updateLines(ctx, args) { ... }
async removeLines(ctx, args) { ... }
}Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartEventBus
MetadataOpen in GitHub ↗
CartActionResult
Discriminated result returned by a server action. On success, ok: true carries the updated cart. On failure, ok: false carries a code, a human message, and opti
CartCapabilities
Feature flags advertised by every . The kernel checks these before calling optional adapter methods, allowing hosts to also branch on capabilities without probi