Usage
Parameters
The mutation accepts an object with:params(CreateSkuPurchaseParams):wallet(WalletData): The user’s wallet (publicKey+encryptedPrivateKey)skuId(string): The unique identifier of the SKU to purchasemxnAmount(number): The amount to be charged in Mexican Pesos (MXN)reference(string): A unique reference for the transaction (e.g. phone number, account number)encryptKey(string): The user’s PIN to decrypt the walletexternalUserId(string): Your application’s user identifier
bearerToken(string): Bearer token for authentication
Return Value
| Property | Type | Description |
|---|---|---|
purchaseSku | (input) => void | Fire-and-forget purchase |
purchaseSkuAsync | (input) => Promise<Transaction> | Promise-based purchase |
data | Transaction | undefined | The purchase transaction record |
isLoading | boolean | True while processing |
isError | boolean | True if purchase failed |
isSuccess | boolean | True if purchase succeeded |
error | Error | null | Error details |
reset | () => void | Reset mutation state |
Example Implementation
Related Hooks
- useGetSkuList — Browse available SKUs before purchasing
- useGetSku — Fetch details of a specific SKU
- useGetSkuPurchase — Check the status of a completed purchase
