stars.spend
Asks the person to confirm a Star gift or spend in your app.
The payment hook for the Stars economy. The page only asks with empty params; Aksa owns the confirmation sheet, the preset amounts, and the ledger transfer.
| Property | Value |
|---|---|
| Scope | None (open method) |
| Who can use it | Any developer |
| Status | Available |
Parameters
None. Send no params, or an empty object.
Result
| Field | Type | Description |
|---|---|---|
ok | boolean | true only when the person confirmed in the Aksa wallet sheet and the server accepted, false when cancelled or not eligible. |
Errors
| Code | When |
|---|---|
-32602 | Any parameter was sent. This method takes none. |
4200 | The phone could not do it right now. |
4290 | More than 30 requests in 10 seconds. |
See Error Codes for every code and how they reach your page.
Example
try {
const { ok } = await window.aksa.request({ method: "stars.spend" });
if (ok) showThankYou();
} catch (e) {
if (e.code === 4200) hideStarsOffer();
}Notes
- It takes no parameters. A page can never set an amount, an item or a recipient, so any parameter is refused with
-32602. - For signed-out visitors, minor accounts, or builds where Stars spending is switched off, the host returns
ok: falseor4200. Keep the app useful without it. - See Stars In Your App.
Used By
No starter app calls this method yet.
Ready To Build Or Ship?
Check your files, preview on an iPhone frame, and submit in the Developer Studio.