@agorio/sdkDocs


Class: ShopifyAdapter

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

Implements

Constructors

new ShopifyAdapter()

new ShopifyAdapter(options): ShopifyAdapter

Parameters

options: ShopifyAdapterOptions

Returns

ShopifyAdapter

Defined in

src/adapters/shopify.ts:138

Properties

adapterType

readonly adapterType: "shopify" = 'shopify'

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

Implementation of

MerchantAdapter.adapterType

Defined in

src/adapters/shopify.ts:125

Accessors

domain

Get Signature

get domain(): string

The domain this adapter handles

Returns

string

Defined in

src/adapters/shopify.ts:149

Methods

completeCheckout()

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

Implementation of

MerchantAdapter.completeCheckout

Defined in

src/adapters/shopify.ts:439


createCheckout()

createCheckout(items): Promise<object>

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

Parameters

items: CartItem[]

Returns

Promise<object>

checkoutUrl?

optional checkoutUrl: string

sessionId

sessionId: string

shippingOptions?

optional shippingOptions: object[]

totals

totals: object

totals.subtotal

subtotal: MoneyAmount

totals.total

total: MoneyAmount

Implementation of

MerchantAdapter.createCheckout

Defined in

src/adapters/shopify.ts:370


discover()

discover(_domain): Promise<MerchantAdapterDiscovery>

Discover/connect to a merchant by domain

Parameters

_domain: string

Returns

Promise<MerchantAdapterDiscovery>

Implementation of

MerchantAdapter.discover

Defined in

src/adapters/shopify.ts:163


getProduct()

getProduct(productId): Promise<MockProduct>

Get a single product by ID

Parameters

productId: string

Returns

Promise<MockProduct>

Implementation of

MerchantAdapter.getProduct

Defined in

src/adapters/shopify.ts:330


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

Implementation of

MerchantAdapter.listProducts

Defined in

src/adapters/shopify.ts:241


matchesDomain()

matchesDomain(domain): boolean

Check if a domain matches this adapter

Parameters

domain: string

Returns

boolean

Defined in

src/adapters/shopify.ts:154


searchProducts()

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

Search products by keyword

Parameters

searchQuery: string

limit?: number

Returns

Promise<object>

products

products: MockProduct[]

query

query: string

total

total: number

Implementation of

MerchantAdapter.searchProducts

Defined in

src/adapters/shopify.ts:288


tryUcpDiscovery()

tryUcpDiscovery(): Promise<null | MerchantAdapterDiscovery>

Try UCP discovery at /.well-known/ucp; returns null if unavailable.

Returns

Promise<null | MerchantAdapterDiscovery>

Defined in

src/adapters/shopify.ts:174