Skip to content

Top up an account with a voucher

rechargeVoucher redeems a top-up voucher for an account: the voucher’s value is converted to the account’s currency and added to its balance as a voucher payment. Use it to let accounts top up from your own website or app, as Make Payment with Top-up Voucher does in the portal.

The method supports trusted mode with i_customer, the ID of the customer that owns the account. In trusted mode you can also pass i_voucher instead of voucher_id and secret_pin.

Name Type Required Description
i_account int one of ID of the account to top up
username string one of User name of the account, used when i_account is not given
voucher_id string yes Voucher ID printed on the voucher
secret_pin string no Secret PIN of the voucher. Needed when the vouchers are issued with a PIN
i_voucher int no Internal ID of the voucher, trusted mode only. Replaces voucher_id and secret_pin
Name Type Description
result string OK when the voucher was redeemed. Any other value means it was not accepted: check the voucher ID and PIN
value double Value of the voucher, in voucher_currency
voucher_currency string ISO 4217 code of the voucher’s currency
payer_amount double Amount added to the balance, in the account’s currency
request
call("rechargeVoucher", {
"username": "1001",
"voucher_id": "7420019935",
"secret_pin": "4815",
})
response
{
"result": "OK",
"value": 10.0,
"voucher_currency": "EUR",
"payer_amount": 10.85,
}
faultCode Cause
410 The voucher payment cannot be processed now. The panel asks the payer to try again later