This endpoint allows users to enable or disable auto-recharge for their wallet.Request Body#
Name | Type | Description |
---|
enable | boolean | Set to true to enable auto-recharge or false to disable it. |
threshold | number | Optional. The wallet balance threshold to trigger auto-recharge. Defaults to 20 . |
minimumRechargeAmount | number | Optional. The minimum amount to recharge when auto-recharge triggers. Defaults to 50 . |
Behaviour#
Set enable: false
to disable auto-recharge immediately
Whenenable
is true
and a payment method exists: Auto-recharge is enabled immediately.
When enable
is true
but no payment method exists:A Stripe Checkout session is created to add a payment method.
The paymentLink
in the response allows the user to complete the setup.
Request
Body Params application/json
{
"enable": true,
"threshold": 25,
"minimumRechargeAmount": 100
}
Request Code Samples
curl --location --request POST 'https://api.zapmail.ai/api/v2/wallet/enable-auto-recharge' \
--header 'x-auth-zapmail;' \
--header 'x-workspace-key;' \
--header 'x-service-provider;' \
--header 'Content-Type: application/json' \
--data-raw '{
"enable": true,
"threshold": 25,
"minimumRechargeAmount": 100
}'
Responses
application/json {
"message": "Add your payment method to enable auto-recharge",
"paymentLink": "https://example.com/payment-link/12345"
}
Modified at 2025-10-14 09:22:34