GonnaOrder provides highly versatile digital vouchers and a loyalty system that you can integrate with your preferred POS provider. This gives you a more convenient way to use GonnaOrder’s digital vouchers and loyalty scheme. All this is possible thanks to GonnaOrder APIs that allow POS systems interact and use digital vouchers and loyalty mechanisms. This documentation provides a guide on how a POS can integrate and use GonnaOrder’s digital voucher and loyalty scheme.
On this Page
- Configure POS Parameters
- Authorize the API
- Get Available Vouchers API for an Existing Member
- Validate Voucher API
- Process External Order API
Configure POS Parameters
To get started, it is highly recommended that you configure several parameters in your POS for each store for calling the GonnaOrder APIs, triggering the loyalty flow. Here are the POS parameters that you should configure in the POS.
GonnaOrder API Base URL: https://api.gonnaorder.com/
. This base URL calls the GonnaOrder backend APIs.
GonnaOrder username. It’s used to get the bearer token for all GonnaOrder APIs.
GonnaOrder password. Used for getting the bearer token for all GonnaOrder APIs.
GonnaOrder Store id. It is an integer number for calling the APIs (e.g., 1234).
GonnaOrder Loyalty Enabled – Yes / No
. If this setting is set to Yes, then the POS follows the voucher flow with validate voucher against the GonnaOrder API and publish the order to GonnaOrder.
Authorize the API
The POS system must authenticate before calling the GonnaOrder API to request a token that is passed in every API header. For API authorization to be successful, use the GonnaOrder username and GonnaOrder password mentioned in the POS parameters section above. See related documentation.
Authorization Request
POST: https://admin.gonnaorder.com/api/v1/auth/login
{ "username":"user", "password":"password" }
Response
„Authorization“: „Bearer {ACCESS_TOKEN}“
Get Available Vouchers API for an Existing Member
The Get available vouchers API allows the finding of available vouchers for a member based on their member code or telephone number. Upon request, it returns all available vouchers associated with the specific member and their properties.
In cases where the voucher code is known and the user wants to redeem the voucher, the POS can skip the Get available vouchers API. Instead, utilize the Validate voucher API directly.
Note that the Get available vouchers API does not return the consequences of a voucher on an order. This is because the input does not include any order details. Therefore, it’s crucial to call the Validate voucher API to get the correct consequences of the order. For instance, a voucher may be of 10 EUR but the order may be of 5 EUR. In this case, the voucher cannot be consumed fully.
What You Need to Send a Get Available Vouchers API Request
The user must provide at least one of the following parameters – member code or phone number. If the user provides both parameters, the system looks for a match with both parameters. However, in cases where there are multiple results due to data pollution, the system returns the first result.
memberCode
: The loyalty code (GonnaOrder loyalty voucher id).phoneNumber
: The customer’s mobile number. Use the international mobile number format with the international code and no spaces (e.g., +301234567890).searchString
: This is the string used to search for the customer’s member code and phone number. First, the system conducts a search based on the member code. If not found, it will check the format of the string. If there is no result found and the string does not start with +, it will add the international phone code of the country of the store and then trim the spaces of the phone number and search by phone number. For example, the search string “6987 482018” converts to “+30698748018”.
Sample Request
GET: https://api.gonnaorder.com/api/v1/stores/{storeId}/loyalty/customer-vouchers?memberCode=XYZ&phoneNumber=+302310589248
- XYZ is the member code and +302310589248 is the phone number.
- Replace
storeId
with your store ID, a numerical value that is available in your store URL. See the image below