Skip to content
Developers
Get started
Early access: these pages are being written and reviewed. Facts in the header boxes come straight from the product.

Set up wallet auto top-up

POST
/api/v1/billing/wallet/auto-topup
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.

Media typeapplication/json
object
pack_id
required
string
Allowed values: usd_10 usd_25 usd_50 inr_500 inr_2000 inr_5000
threshold_id
required
string
Allowed values: below_5 below_10 below_25
phone_e164
string
/^\+[1-9]\d{7,14}$/

OK

Validation failed

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}

Authentication required or token invalid

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
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

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}

Rate limit exceeded

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}