Recharge

Top up your wallet balance via Stripe payment integration.

Get recharge config

GET /api/v1/recharge/config

Returns available recharge tiers, exchange rate, and Stripe publishable key.

const config = await client.getRechargeConfig()
// { tiers: [...], customAmountMin, customAmountMax, exchangeRate, stripePublishableKey }
config = client.get_recharge_config()

Create recharge intent

POST /api/v1/recharge/create-intent

Creates a Stripe PaymentIntent for wallet top-up.

FieldTypeRequiredDescription
tierstringYes1000, 3000, 5000, or custom
idempotencyKeystringYesUnique key to prevent duplicates
customAmountnumberNoCustom amount (for custom tier)
currencystringNoCurrency code
const intent = await client.createRechargeIntent({
  tier: '1000',
  idempotencyKey: 'unique-key',
})
// { clientSecret, paymentIntentId, orderNo, amount }
intent = client.create_recharge_intent(
    tier="1000",
    idempotencyKey="unique-key",
)

Confirm payment

POST /api/v1/recharge/confirm

Confirm a completed Stripe payment and credit the wallet.

FieldTypeDescription
paymentIntentIdstringStripe PaymentIntent ID
const order = await client.confirmRechargePayment('pi_xxx')
order = client.confirm_recharge_payment("pi_xxx")

Recharge history

GET /api/v1/recharge/history
ParamTypeDescription
limitnumberMax results
offsetnumberPagination offset
const history = await client.getRechargeHistory({ limit: 20 })
// { items: [...], total, limit, offset }
history = client.get_recharge_history(limit=20)