Balance
GET https://api.e-guma.ch/v1/vouchers/{code}/balance.json?apikey={api-key}
Parameters
code | There are two possible inputs:
|
api-key |
Return
code | The voucher code. If you sent a voucher2mobile - ShortCode it will return the voucher code of this ShortCode. Use this code for further operations (e.g. for the redeem request, print on the receipt, store in the database). Don't use the code which was entered by the user. |
is_redeemable | Indicates if the requested voucher can be redeemed. If the voucher can't be redeemed, you find the reason in the message.
|
balance_in_cents | Amount in cents. Maison (PR) vouchers can have 0 as value. |
total_amount_in_cents | Total-amount in cents. Maison (PR) vouchers can have 0 as value. |
product_id | The ID of the voucher product. |
message | If the voucher is not redeemable (is_redeemable=false) the message contains the reason why the requested voucher can't be redeemed. The message is returned in the client's default language. This field can also contain a note that has been saved with the voucher in the back office. |
Example
GET https://api.e-guma.ch/v1/vouchers/JWCPP7QV25S4/balance.json?apikey=510e32c594d84816a4af9df1
{
"code":"JWCPP7QV25S4",
"is_redeemable":true,
"balance_in_cents":40000,
"total_amount_in_cents":40000,
"product_id":"14d62f1b-6294-4b57-adc9-5c62667bdbf8",
"message":""
}
Updated 4 months ago