Cancel Charge
POST https://api.e-guma.ch/v1/vouchers/{code}/cancel_charge.json?apikey={api-key}
Parameters
Attribute | Description |
---|---|
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
Attribute | Description |
---|---|
charge_token
| The token returned when Charge Voucher was called. |
cancel_reason | An 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.
Parameter | Description |
---|---|
amount_in_cents | The same amount, that was provided when calling Charge Voucher. |
payment_id
| If you set a payment_id for Charge Voucher, provide the same payment_id to cancel the charging. |
cancel_reason | An optional alphanumeric cancellation reason can be transmitted. Maximum 1024 characters. |
Return
code | The same voucher code as you provided as parameter |
balance_in_cents | The 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
}
Updated 22 days ago