# SDK reference

Generated from the SDK source. Prose and examples live on the module pages\: [server](/sdk/typescript/server), [browser](/sdk/typescript/browser), [payments](/sdk/typescript/payments), [commerce](/sdk/typescript/commerce), [webhooks](/sdk/typescript/webhooks).

## Server configuration

| Property | Type | Description |
| --- | --- | --- |
| `secretKey` | `string` | Secret key minted on the dashboard (`/api-keys`). Server-side only. |
| `actingFor?` | `string` | A merchant this client acts for. Set it through `forMerchant`; a key that is not a platform's for that merchant gets a 403 or a 404 on the first call. |
| `baseUrl` | `string` |  |
| `preset?` | `"merchant"` |  |
| `fetch?` | `typeof fetch` |  |
| `generateIdempotencyKey?` | `() => string` |  |

## Server client

| Property | Type | Description |
| --- | --- | --- |
| `commerce` | `CommerceModule` |  |
| `analytics` | `AnalyticsModule` | Revenue, orders, settlements and payment performance for a date range. |
| `payment` | `PaymentModule` |  |
| `platform` | `PlatformModule` | Create merchants of your own and manage them. Needs `merchants:provision`. |
| `forMerchant` | `(merchantId: string) => MayarinClient` | A client that acts for one of the merchants you created\: every call is made as that merchant, with your key's other permissions and without the power to create more. |
| `feed` | `FeedModule` | The live feed of finished payments, for an overlay or a live view. |
| `disputes` | `DisputesModule` | Escrow disputes\: read the thread, answer. Pair with the dispute webhooks (#313). |
| `x402` | `{ readonly resources: X402ResourcesModule; }` | Agent-endpoint management (#269). Registration only — the request-time surface is keyless. |
| `transport` | `Transport` | Raw typed transport. The escape hatch until a module covers a route. |
| `preset` | `Preset` |  |

## Shared client configuration

Both entry points extend this\: the base URL, the preset, and the two injectable effects.

| Property | Type | Description |
| --- | --- | --- |
| `baseUrl` | `string` |  |
| `preset?` | `"merchant"` |  |
| `fetch?` | `typeof fetch` |  |
| `generateIdempotencyKey?` | `() => string` |  |

## Browser configuration

The browser entry point creates a client configured with an optional publishable key. There is no field for a secret.

| Property | Type | Description |
| --- | --- | --- |
| `publishableKey?` | `string` | Publishable key minted on the dashboard. Safe in a browser bundle\: it identifies the merchant and reaches only catalog read and cart checkout. Without one, only the keyless buyer routes answer. |
| `alertKey?` | `string` | Alert key minted on the dashboard (`ak_...`). Read-only\: it opens the live feed of the merchant's finished payments and nothing else, so it is safe in an overlay page and in a URL, and revoking it ends the feed. |
| `baseUrl` | `string` |  |
| `preset?` | `"merchant"` |  |
| `fetch?` | `typeof fetch` |  |
| `generateIdempotencyKey?` | `() => string` |  |

## Browser client

| Property | Type | Description |
| --- | --- | --- |
| `commerce` | `PublishableCommerceModule` |  |
| `feed` | `FeedModule` | Finished payments as they finish. Needs an `alertKey`. |
| `transport` | `Transport` | Raw typed transport. The escape hatch until a module covers a route. |
| `preset` | `Preset` |  |

## Request options

| Property | Type | Description |
| --- | --- | --- |
| `query?` | `Readonly<Record<string, string \| number \| boolean \| undefined>>` |  |
| `idempotencyKey?` | `string` | Caller-supplied key for a write. The transport generates one when absent. |
| `signal?` | `AbortSignal` |  |

## Transport

The escape hatch until a module covers a route. Keeps the `/v1` prefix, version header, auth, idempotency, and error mapping.

| Property | Type | Description |
| --- | --- | --- |
| `get` | `<T>(path: string, options?: RequestOptions \| undefined) => Promise<T>` |  |
| `post` | `<T>(path: string, body?: unknown, options?: RequestOptions \| undefined) => Promise<T>` |  |
| `patch` | `<T>(path: string, body: unknown, options?: RequestOptions \| undefined) => Promise<T>` |  |
| `delete` | `<T>(path: string, options?: RequestOptions \| undefined) => Promise<T>` | A write\: gets an `Idempotency-Key` like every non-GET. A 204 resolves to `undefined`. |
| `stream` | `(path: string, options?: RequestOptions \| undefined) => Promise<Response>` | Opens a Server-Sent Events response and hands back the live `Response`, its body unread. A failure answers like any other call, as a `MayarinApiError`. |

## Error contract

| Property | Type | Description |
| --- | --- | --- |
| `code` | `string` |  |
| `status` | `number` | HTTP status of the response, or 0 when no response arrived. |
| `retryable` | `boolean` | Whether retrying the same request unchanged can succeed later. |
| `details` | `Record<string, unknown>` |  |
| `name` | `string` |  |
| `message` | `string` |  |
| `stack?` | `string` |  |
| `cause?` | `unknown` | The cause of the error. |

## Payment module

| Property | Type | Description |
| --- | --- | --- |
| `createIntent` | `(body: CreatePaymentIntentBody, options?: RequestOptions \| undefined) => Promise<CreatedPaymentIntent>` |  |
| `validateIntent` | `(body: CreatePaymentIntentBody, options?: RequestOptions \| undefined) => Promise<void>` | Checks a body the way `createIntent` would and creates nothing. Resolves when it would be accepted; throws the error `createIntent` would throw (a refused rail names what is offered). For a form or a deploy check that must not leave an intent behind in the dashboard. |
| `getIntent` | `(id: string, options?: RequestOptions \| undefined) => Promise<PaymentIntentDto>` |  |
| `list` | `(filter?: ListPaymentsOptions \| undefined, options?: RequestOptions \| undefined) => Promise<PaymentIntentListDto>` | One page of this merchant's payments, newest first, each with what clearing recorded for it. Needs a secret key that can read payments. The history behind a dashboard of your own\: pair it with [webhooks](https\://docs.mayarin.xyz/sdk/typescript/webhooks) for what happens next. |
| `listAll` | `(filter?: Omit<ListPaymentsOptions, "cursor"> \| undefined, options?: RequestOptions \| undefined) => AsyncGenerator<PaymentIntentListItemDto, any, any>` | Every payment that matches, page after page, as one async sequence. Stops when the pages run out. |
| `confirmIntent` | `(id: string, options?: RequestOptions \| undefined) => Promise<PaymentDto>` |  |
| `get` | `(id: string, options?: RequestOptions \| undefined) => Promise<PaymentDto>` |  |
| `getContractCall` | `(id: string, options?: RequestOptions \| undefined) => Promise<ContractCallDto>` |  |
| `getEscrow` | `(id: string, options?: RequestOptions \| undefined) => Promise<EscrowDto>` | Where an escrowed payment's funds are, and the calldata to release, refund or dispute them (#304). Send `calls[action]` to `factory` from the wallet the terms allow. |
| `waitFor` | `(id: string, options?: WaitForOptions \| undefined) => Promise<PaymentDto>` | Reads the payment until it is settled, backing off between reads, and resolves with the last read. For a server that is not listening to [webhooks](https\://docs.mayarin.xyz/sdk/typescript/webhooks), or that wants to confirm one. Throws `WAIT_TIMEOUT` if `timeoutMs` passes first; a payer who has not paid is not an error until then. |
| `retry` | `(id: string, options?: RequestOptions \| undefined) => Promise<ClearingDto>` | Reopen a failed payment whose payer funds were already received. |

## Commerce module

| Property | Type | Description |
| --- | --- | --- |
| `products` | `{ readonly create: (body: { merchantId: string; sku: string; name: string; prices: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }[]; description?: string \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<ProductDto>; readonly list: (merchantId?: string \| undefined, options?: RequestOptions \| undefined) => Promise<readonly ProductDto[]>; readonly get: (id: string, options?: RequestOptions \| undefined) => Promise<ProductDto>; readonly update: (id: string, body: { name?: string \| undefined; description?: string \| null \| undefined; prices?: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }[] \| undefined; active?: boolean \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<ProductDto>; }` |  |
| `rails` | `(options?: RequestOptions \| undefined) => Promise<PaymentRailsDto>` | `GET /rails` — every `(chain, asset)` pair this merchant can be paid on, with no payment link needed. The list `payment.createIntent` checks a rail against, so a pair read here is a pair accepted there. Publishable keys may read it. |
| `carts` | `{ readonly checkout: (body: { currency: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; lines: ({ productId: string; quantity: number; } \| { name: string; unitPrice: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }; quantity: number; imageUrl?: string \| undefined; })[]; settlementAsset?: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC" \| undefined; provider?: string \| undefined; payment?: { asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; chain: "ethereum" \| "ethereum-sepolia" \| "base" \| "base-sepolia" \| "arbitrum" \| "arbitrum-sepolia" \| "arc-testnet" \| "polygon-amoy" \| "bsc-testnet" \| "polygon" \| "bsc" \| "solana-devnet" \| "solana-localnet"; payerAddress?: string \| undefined; returnAddress?: string \| undefined; } \| undefined; executionPath?: "deposit-match" \| "on-chain-contract" \| "x402" \| undefined; metadata?: Record<string, string> \| undefined; merchantReference?: string \| undefined; ttlSeconds?: number \| undefined; merchant?: { id?: string \| undefined; name?: string \| undefined; city?: string \| undefined; countryCode?: string \| undefined; categoryCode?: string \| undefined; } \| undefined; }, options?: RequestOptions \| undefined) => Promise<PaymentIntentDto & { url: string; }>; }` |  |
| `paymentLinks` | `{ readonly create: (body: { kind: "fixed" \| "open" \| "catalog"; merchant: { id: string; name: string; city: string; countryCode: string; categoryCode?: string \| undefined; }; amount?: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; } \| undefined; currency?: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC" \| undefined; lines?: { productId: string; quantity: number; }[] \| undefined; title?: string \| undefined; merchantReference?: string \| undefined; metadata?: Record<string, string> \| undefined; expiresAt?: string \| undefined; listed?: boolean \| undefined; rails?: { chain: "ethereum" \| "ethereum-sepolia" \| "base" \| "base-sepolia" \| "arbitrum" \| "arbitrum-sepolia" \| "arc-testnet" \| "polygon-amoy" \| "bsc-testnet" \| "polygon" \| "bsc" \| "solana-devnet" \| "solana-localnet"; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }[] \| undefined; }, options?: RequestOptions \| undefined) => Promise<PaymentLinkDto>; readonly list: (merchantId?: string \| undefined, options?: RequestOptions \| undefined) => Promise<readonly PaymentLinkDto[]>; readonly get: (id: string, options?: RequestOptions \| undefined) => Promise<PaymentLinkDto>; readonly rails: (id: string, options?: RequestOptions \| undefined) => Promise<PaymentRailsDto>; readonly disable: (id: string, options?: RequestOptions \| undefined) => Promise<PaymentLinkDto>; readonly listInIndex: (id: string, options?: RequestOptions \| undefined) => Promise<PaymentLinkDto>; readonly unlistFromIndex: (id: string, options?: RequestOptions \| undefined) => Promise<PaymentLinkDto>; readonly checkout: (id: string, body?: { settlementAsset?: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC" \| undefined; provider?: string \| undefined; payment?: { asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; chain: "ethereum" \| "ethereum-sepolia" \| "base" \| "base-sepolia" \| "arbitrum" \| "arbitrum-sepolia" \| "arc-testnet" \| "polygon-amoy" \| "bsc-testnet" \| "polygon" \| "bsc" \| "solana-devnet" \| "solana-localnet"; payerAddress?: string \| undefined; returnAddress?: string \| undefined; } \| undefined; executionPath?: "deposit-match" \| "on-chain-contract" \| "x402" \| undefined; metadata?: Record<string, string> \| undefined; merchantReference?: string \| undefined; ttlSeconds?: number \| undefined; amount?: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; } \| undefined; } \| undefined, options?: RequestOptions \| undefined) => Promise<PaymentIntentDto>; }` |  |
| `invoices` | `{ readonly create: (body: { merchantId: string; merchant: { id: string; name: string; city: string; countryCode: string; categoryCode?: string \| undefined; }; buyer: { name: string; email?: string \| undefined; taxId?: string \| undefined; address?: string \| undefined; }; currency: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; lines: { name: string; unitPrice: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }; quantity: number; productId?: string \| undefined; }[]; notes?: string \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly list: (merchantId?: string \| undefined, options?: RequestOptions \| undefined) => Promise<readonly InvoiceDto[]>; readonly get: (id: string, options?: RequestOptions \| undefined) => Promise<InvoiceViewDto>; readonly update: (id: string, body: { buyer?: { name: string; email?: string \| undefined; taxId?: string \| undefined; address?: string \| undefined; } \| undefined; lines?: { name: string; unitPrice: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }; quantity: number; productId?: string \| undefined; }[] \| undefined; notes?: string \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly issue: (id: string, body: { dueAt: string; prefix?: string \| undefined; includeYear?: boolean \| undefined; }, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly void: (id: string, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly listInIndex: (id: string, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly unlistFromIndex: (id: string, options?: RequestOptions \| undefined) => Promise<InvoiceDto>; readonly checkout: (id: string, body?: { payment?: { asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; chain: "ethereum" \| "ethereum-sepolia" \| "base" \| "base-sepolia" \| "arbitrum" \| "arbitrum-sepolia" \| "arc-testnet" \| "polygon-amoy" \| "bsc-testnet" \| "polygon" \| "bsc" \| "solana-devnet" \| "solana-localnet"; payerAddress?: string \| undefined; returnAddress?: string \| undefined; } \| undefined; executionPath?: "deposit-match" \| "on-chain-contract" \| "x402" \| undefined; amount?: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; } \| undefined; } \| undefined, options?: RequestOptions \| undefined) => Promise<PaymentIntentDto>; }` |  |
| `subscriptions` | `{ readonly create: (body: { customer: { name: string; email: string; }; description: string; amount: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }; interval: "week" \| "month" \| "year"; startAt?: string \| undefined; daysUntilDue?: number \| undefined; }, options?: RequestOptions \| undefined) => Promise<SubscriptionDto>; readonly list: (options?: RequestOptions \| undefined) => Promise<readonly SubscriptionDto[]>; readonly get: (id: string, options?: RequestOptions \| undefined) => Promise<{ subscription: SubscriptionDto; cycles: readonly InvoiceViewDto[]; }>; readonly pause: (id: string, options?: RequestOptions \| undefined) => Promise<SubscriptionDto>; readonly resume: (id: string, options?: RequestOptions \| undefined) => Promise<SubscriptionDto>; readonly cancel: (id: string, options?: RequestOptions \| undefined) => Promise<SubscriptionDto>; }` | Recurring plans (#296), send-to-pay\: every cycle Mayarin issues the subscriber an invoice and emails its pay link. Payments on a cycle carry `metadata.subscriptionId` into the `payment.*` webhooks. |

## Publishable commerce module

The subset a publishable key reaches\: catalog read and cart checkout.

| Property | Type | Description |
| --- | --- | --- |
| `products` | `Pick<{ readonly create: (body: { merchantId: string; sku: string; name: string; prices: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }[]; description?: string \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<ProductDto>; readonly list: (merchantId?: string \| undefined, options?: RequestOptions \| undefined) => Promise<readonly ProductDto[]>; readonly get: (id: string, options?: RequestOptions \| undefined) => Promise<ProductDto>; readonly update: (id: string, body: { name?: string \| undefined; description?: string \| null \| undefined; prices?: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }[] \| undefined; active?: boolean \| undefined; metadata?: Record<string, string> \| undefined; }, options?: RequestOptions \| undefined) => Promise<ProductDto>; }, "list" \| "get">` |  |
| `carts` | `{ readonly checkout: (body: { currency: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; lines: ({ productId: string; quantity: number; } \| { name: string; unitPrice: { amount: string; asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; }; quantity: number; imageUrl?: string \| undefined; })[]; settlementAsset?: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC" \| undefined; provider?: string \| undefined; payment?: { asset: "IDR" \| "SGD" \| "MYR" \| "THB" \| "PHP" \| "VND" \| "BND" \| "MMK" \| "KHR" \| "LAK" \| "USD" \| "JPY" \| "CNY" \| "HKD" \| "EUR" \| "GBP" \| "AUD" \| "CAD" \| "AED" \| "SAR" \| "BRL" \| "MXN" \| "USDC" \| "USDT" \| "EURC" \| "PYUSD" \| "USDG" \| "DAI" \| "FDUSD" \| "ETH" \| "POL" \| "BNB" \| "WETH" \| "WBTC" \| "CBBTC" \| "WBNB" \| "BTCB" \| "LINK" \| "UNI" \| "AAVE" \| "ARB" \| "CAKE" \| "SOL" \| "BTC"; chain: "ethereum" \| "ethereum-sepolia" \| "base" \| "base-sepolia" \| "arbitrum" \| "arbitrum-sepolia" \| "arc-testnet" \| "polygon-amoy" \| "bsc-testnet" \| "polygon" \| "bsc" \| "solana-devnet" \| "solana-localnet"; payerAddress?: string \| undefined; returnAddress?: string \| undefined; } \| undefined; executionPath?: "deposit-match" \| "on-chain-contract" \| "x402" \| undefined; metadata?: Record<string, string> \| undefined; merchantReference?: string \| undefined; ttlSeconds?: number \| undefined; merchant?: { id?: string \| undefined; name?: string \| undefined; city?: string \| undefined; countryCode?: string \| undefined; categoryCode?: string \| undefined; } \| undefined; }, options?: RequestOptions \| undefined) => Promise<PaymentIntentDto & { url: string; }>; }` |  |
| `rails` | `(options?: RequestOptions \| undefined) => Promise<PaymentRailsDto>` |  |

## Webhook verification

| Property | Type | Description |
| --- | --- | --- |
| `payload` | `string` |  |
| `signature` | `string` |  |
| `secret` | `string` |  |
| `now?` | `Date` |  |
| `toleranceSeconds?` | `number` |  |

## Presets

| Property | Type | Description |
| --- | --- | --- |
| `name` | `"merchant"` |  |
| `openAmountLinks` | `false` | Payment links created with no amount let the payer type one. |
| `checkout` | `"catalog"` | The commerce surface the integration leans on. |
