@agorio/sdkDocs


Interface: MerchantAdapter

Adapter interface for connecting to real e-commerce platforms. Implement this to add support for Shopify, WooCommerce, or any platform.

Properties

adapterType

readonly adapterType: string

Human-readable adapter name (e.g., ‘shopify’, ‘woocommerce’)

Defined in

src/types/index.ts:872

Methods

completeCheckout()?

optional completeCheckout(sessionId, payment, shippingAddress): Promise<object>

Complete a checkout (optional)

Parameters

sessionId: string

payment

payment.method: string

payment.token?: string

shippingAddress: ShippingAddress

Returns

Promise<object>

orderId

orderId: string

status

status: string

Defined in

src/types/index.ts:912


createCheckout()?

optional createCheckout(items): Promise<object>

Create a checkout session (optional — not all adapters support purchase)

Parameters

items: CartItem[]

Returns

Promise<object>

sessionId

sessionId: string

shippingOptions?

optional shippingOptions: object[]

totals

totals: object

totals.subtotal

subtotal: MoneyAmount

totals.total

total: MoneyAmount

Defined in

src/types/index.ts:900


discover()

discover(domain): Promise<MerchantAdapterDiscovery>

Discover/connect to a merchant by domain

Parameters

domain: string

Returns

Promise<MerchantAdapterDiscovery>

Defined in

src/types/index.ts:875


getProduct()

getProduct(productId): Promise<MockProduct>

Get a single product by ID

Parameters

productId: string

Returns

Promise<MockProduct>

Defined in

src/types/index.ts:891


getProductReviews()?

optional getProductReviews(productId, limit?): Promise<ProductReviewResult>

Get product reviews (optional)

Parameters

productId: string

limit?: number

Returns

Promise<ProductReviewResult>

Defined in

src/types/index.ts:894


listProducts()

listProducts(options?): Promise<object>

List products from the catalog

Parameters

options?

options.category?: string

options.limit?: number

options.page?: number

Returns

Promise<object>

products

products: MockProduct[]

total

total: number

Defined in

src/types/index.ts:878


searchProducts()

searchProducts(query, limit?): Promise<object>

Search products by keyword

Parameters

query: string

limit?: number

Returns

Promise<object>

products

products: MockProduct[]

query

query: string

total

total: number

Defined in

src/types/index.ts:885