The e-guma Developer Hub

Welcome to the e-guma developer hub. You'll find comprehensive guides and documentation to help you start working with e-guma as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Balance

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

Parameters

code
required

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.

  • A voucher2mobile - ShortCode

api-key
required

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.

product_id

The ID of the voucher product.

message

If the voucher is not redeemable the message contains the reason why the requested voucher can't be redeemed. The message is returned in the client's default language.

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 about a year ago

Balance


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.