Cancel Charge

POST https://api.e-guma.ch/v1/vouchers/{code}/cancel_charge.json?apikey={api-key}

Parameters

code
required
The alphanumeric code of the voucher. The code has 12 characters. You can pass the code with (e.g. ABCD-ABCD-ABCD) or without (e.g. ABCDABCDABCD) dashes.

Please use url_encode for the code as it might contain special characters.
api-key
required

POST Data

charge_token
required
The token returned when Charge Voucher was called.

POST Data (legacy)

If you are working with free credit you can't use the legacy way.

amount_in_cents
required
The same amount, that was provided when calling Charge Voucher .
payment_id
optional
If you set a payment_id for Charge Voucher, provide the same payment_id to cancel the charging.

Return

codeThe same voucher code as you provided as parameter
balance_in_centsThe new balance

Example

POST https://api.e-guma.ch/v1/vouchers/JWCPP7QV25S4/cancel_charge.json?apikey=510e32c594d84816a4af9df1
{
  "charge_token": "671a6539e3365417cc2ffbe6"
}
{
  "code":"JWCPP7QV25S4",
  "balance_in_cents":40000
}