Set up wallet auto top-up
const url = 'https://api.pitch2sale.com/api/v1/billing/wallet/auto-topup';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"pack_id":"usd_10","threshold_id":"below_5","phone_e164":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pitch2sale.com/api/v1/billing/wallet/auto-topup \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "pack_id": "usd_10", "threshold_id": "below_5", "phone_e164": "example" }'Body { pack_id, threshold_id } (plus optional phone_e164); any other field, including an amount or a free threshold, is 400, and so is a pack at or below the threshold (pack_below_threshold). Creates a Cashfree on-demand mandate (card or UPI AutoPay; the small authorization is refunded, nothing is charged at setup) and returns the subscription_session_id for checkout. Auto top-up turns on only once Cashfree confirms the mandate. When a wallet debit leaves the balance below the threshold, one charge of the pack (plus 18% GST for INR) is raised; the wallet is credited only from a verified Cashfree payment. At most one charge at a time and 3 per UTC day by default. 409 auto_topup_unavailable when switched off, auto_topup_active when already on, charge_in_progress while a charge is pending, fx_unavailable when the INR exchange rate is unavailable; 403 wallet_not_in_plan on trial or Solo; 502 gateway_unavailable when Cashfree is unreachable. Owners and admins only.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”OK
Validation failed
object
object
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Authentication required or token invalid
object
object
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Role permission or token scope missing; OAuth app tokens are not accepted on this route
object
object
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Rate limit exceeded
object
object
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}