@agorio/sdk • Docs
Interface: MerchantAdapter
Adapter interface for connecting to real e-commerce platforms. Implement this to add support for Shopify, WooCommerce, or any platform.
Properties
adapterType
readonlyadapterType:string
Human-readable adapter name (e.g., ‘shopify’, ‘woocommerce’)
Defined in
src/types/index.ts:872
Methods
completeCheckout()?
optionalcompleteCheckout(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()?
optionalcreateCheckout(items):Promise<object>
Create a checkout session (optional — not all adapters support purchase)
Parameters
• items: CartItem[]
Returns
Promise<object>
sessionId
sessionId:
string
shippingOptions?
optionalshippingOptions: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()?
optionalgetProductReviews(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