MyazaPOS
The main SDK class. All methods are available after callinginit().
Constructor
init()
Initialize the SDK and fetch the merchant profile. Must be called before any other method.GridlogAPIError if the merchant ID is invalid or the API is unreachable.
checkout(params)
Opens the checkout modal where the customer selects a chain and token, then creates a payment session and polls for confirmation.| Param | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Fiat amount to charge |
currency | string | No | Currency code (default: 'NGN') |
payoutAccountNumber | string | No | Bank account for fiat settlement |
payoutNetworkId | string | No | Bank network ID (from getBanks()) |
PaymentSession if the customer completes selection, null if they close the modal.
createSession(params)
Create a payment session directly, bypassing the checkout modal. Use this when you handle chain/token selection yourself.| Param | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Fiat amount |
chain | string | Yes | Blockchain (e.g. 'polygon') |
token | string | Yes | Token symbol (e.g. 'USDC') |
metadata | Record<string, unknown> | No | Custom data attached to the session |
payoutAccountNumber | string | No | Bank account for settlement |
payoutNetworkId | string | No | Bank network ID |

