Balance
GET https://api.e-guma.ch/v1/vouchers/{code}/balance.json?apikey={api-key}
Parameters
coderequired | There are two possible inputs: - 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 - A voucher2mobile - ShortCode |
api-keyrequired |
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. Some reasons _ it was not found _ it's not paid _ it's already redeemed _ it's a proforma voucher |
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. |
currency | An e-guma account always has the same and only one currency. Currently we support CHF and EUR. |
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. |
extra | Used for special cases. By default it's value is null |
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,
"currency":"CHF",
"product_id":"14d62f1b-6294-4b57-adc9-5c62667bdbf8",
"message":"",
"extra":null
}
Updated 2 months ago