It charges a voucher with a specified amount. If free credit is set for a particular voucher, the free credit amount is automatically applied.
POST https://api.e-guma.ch/v1/vouchers/{code}/charge.json?apikey={api-key}
Parameters
Attribute
Description
coderequired
The code of the voucher. Vouchers issued by e-guma have 12 characters. You can pass the code with (e.g. ABCD-ABCD-ABCD) or without (e.g. ABCDABCDABCD) dashes. Imported vouchers from a previous system can have another length and format, for example a 16-digit card number. Pass the code as it is printed or scanned. Dashes and spaces are ignored. Please use url_encode for the code as it might contain special characters.
api-keyrequired
POST Data
Attribute
Description
amount_in_centsrequired
The amount to recharge the voucher.
payment_idoptional
If no payment_id is provided, the default payment will be used.
free_credit_in_percentageoptional
This percentage of the amount_in_cents is credited as free credit. General settings for free credit are overruled with this value. This value cannot be used if the client is using the legacy recharging procedure.
referenceoptional
An optional alphanumeric reference can be transmitted. 256 characters max.
Return
charge_token
Use this token to cancel a recharge. This token will only be returned if the client is using the new charging procedure.
code
The same voucher code as you provided as parameter
balance_in_cents
The new balance
free_credit_amount_in_cents
The credited amount of free credit. Will only be returned if the new charging procedure is in use.