Paymentsstars.spend

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.

PropertyValue
ScopeNone (open method)
Who can use itAny developer
StatusAvailable

Parameters

None. Send no params, or an empty object.

Result

FieldTypeDescription
okbooleantrue only when the person confirmed in the Aksa wallet sheet and the server accepted, false when cancelled or not eligible.

Errors

CodeWhen
-32602Any parameter was sent. This method takes none.
4200The phone could not do it right now.
4290More than 30 requests in 10 seconds.

See Error Codes for every code and how they reach your page.

Example

js
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: false or 4200. 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.