Cancel Charge



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

Parameters

AttributeDescription
code requiredThe 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-key required

POST Data

AttributeDescription
charge_token
required
The token returned when Charge Voucher was called.
cancel_reason optionalAn optional alphanumeric cancellation reason can be transmitted. Maximum 1024 characters.

POST Data (legacy)

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

ParameterDescription
amount_in_cents requiredThe 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.
cancel_reason optionalAn optional alphanumeric cancellation reason can be transmitted. Maximum 1024 characters.

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",
  "cancel_reason":"This is a reason for cancellation"
}
{
  "amount_in_cents":"15000",
  "cancel_reason":"This is a reason for cancellation"
}
{
  "code":"JWCPP7QV25S4",
  "balance_in_cents":40000
}