URL
POST https://api.e-guma.ch/v1/vouchers/{code}/cancel_charge.json?apikey={api-key}
Attribute Description code requiredThe 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
Attribute Description charge_token requiredThe token returned when Charge Voucher was called. cancel_reason optionalAn optional alphanumeric cancellation reason can be transmitted. Maximum 1024 characters.
If you are working with free credit you can't use the legacy way.
Parameter Description amount_in_cents requiredThe same amount, that was provided when calling Charge Voucher . payment_id optionalIf 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.
code The same voucher code as you provided as parameter balance_in_cents The new balance
Request
POST https://api.e-guma.ch/v1/vouchers/JWCPP7QV25S4/cancel_charge.json?apikey=510e32c594d84816a4af9df1
POST Data
{
"charge_token":"671a6539e3365417cc2ffbe6",
"cancel_reason":"This is a reason for cancellation"
}
POST Data (legacy)
{
"amount_in_cents":"15000",
"cancel_reason":"This is a reason for cancellation"
}
Response
{
"code":"JWCPP7QV25S4",
"balance_in_cents":40000
}