Overview
Wallet endpoints let an authenticated user inspect recharge configuration, create a payment link, redeem a code, review recharge history, and manage automatic recharge.Read recharge configuration
Always read the current configuration before presenting amounts or payment options:
These values are deployment and campaign configuration. Validate the selected amount immediately before creating a payment link.
Create a payment link
The current wallet flow accepts an integer USD amount and one of the payment methods shown below:pay_link in a browser. Receiving a link does not mean the wallet has been credited; credit is applied after the payment provider confirms completion.
Do not embed the system access token in the redirect URL or send it to the payment provider.
Redeem a recharge code
Recharge history
items, page, page_size, and total. After the checkout completes, refresh both recharge history and account balance:
quota_per_unit as described in Authentication and quota.
Read automatic-recharge status
bound: whether a reusable payment method is boundcard_last4: masked card identifierenabled: whether automatic recharge is activethreshold: wallet balance in USD that triggers a rechargeamount: USD amount charged on each triggerstripe_ready: whether automatic recharge can be configured
Bind a payment method
When no payment method is bound, start the setup flow:setup_link. Wait for the provider callback, then call GET /api/user/auto-recharge again and confirm bound: true before enabling the feature.
Configure automatic recharge
After binding, update all three settings together:threshold must be non-negative. The current console requires a recharge amount of at least USD 10, but clients should also honor current server and payment-provider limits.
Disable automatic recharge without removing the bound method by sending the same payload with enabled: false.
Remove the binding
Recommended payment flow
- Read
/api/user/topup/infoand validate the amount and method. - Create the payment or binding link once.
- Redirect the user to the returned link.
- Treat the provider redirect as pending, not final proof of credit.
- Refresh
/api/user/topup/self,/api/user/self, or/api/user/auto-rechargeuntil the expected state appears. - Make retries idempotent in your application and avoid creating multiple checkout links for the same user action.