Business - Discounts
The Mobile interface handles web service calls from the mobile app. The base url for this is at:
/api/business-mobile
A JSON file with OpenAPI data about all business-related mobile APIs can be downloaded here
.
Get available coupons
Gets the paged list (see Paged List APIs) of available coupons for the user
- GET /v1/discounts/available-coupons
Lists all available coupons for this user
- Query Parameters
date (string) – Nullable filter for effect date
- Status Codes
200 OK – Success
The API accepts the following optional parameter in the query path:
date (DateTime)
The API returns the list of coupons that the user can use. The list is comprised of all the coupons that are in effect at the time specified in the query pat, or at the time of the request if not specified, and that are either visible to all the users of that community and have not already been used by the user, or that are activated and not used on the user.
The response format is as follows:
[
{
Guid: "53155c4a-b2a0-412f-ab41-552d9ccdf784", // Guid
CommunityID: 1, // Int
Name: "TCP Active Future User", // String
Code: "TCPAFU", // String
CreatedDate: "2001-01-01T01:01:01Z", // DateTime
AvailabilityStart: "2001-01-01T01:01:01Z", // DateTime
EffectStart: "2001-01-01T01:01:01Z", // DateTime
EffectEnd: "2001-01-01T01:01:01Z", // DateTime
AvailabilityEnd: "2001-01-01T01:01:01Z", // DateTime
IsCumulative: false, // Boolean
IsValidForAllUsers: false, // Boolean
Amount: 10, // Int
MaxDiscount: 10, // Decimal (nullable)
MinDiscount: 10 // Decimal (nullable)
},
{ ... }
]
Possible errors are:
err_UserNotFound
The Guid of the current user does not map to any known user
Get used coupons
Gets the paged list (see Paged List APIs) of the coupons already used by user
The response format is as follows:
[
{
Guid: "53155c4a-b2a0-412f-ab41-552d9ccdf784", // Guid
CommunityID: 1, // Int
Name: "TCP Active Future User", // String
Code: "TCPAFU", // String
CreatedDate: "2001-01-01T01:01:01Z", // DateTime
AvailabilityStart: "2001-01-01T01:01:01Z", // DateTime
EffectStart: "2001-01-01T01:01:01Z", // DateTime
EffectEnd: "2001-01-01T01:01:01Z", // DateTime
AvailabilityEnd: "2001-01-01T01:01:01Z", // DateTime
IsCumulative: false, // Boolean
IsValidForAllUsers: false, // Boolean
Amount: 10, // Int
MaxDiscount: 10, // Decimal (nullable)
MinDiscount: 10 // Decimal (nullable)
},
{ ... }
]
Possible errors are:
err_UserNotFound
The Guid of the current user does not map to any known user
Get available promotions
Gets the paged list (see Paged List APIs) of available promotions for the user
- GET /v1/discounts/available-promotions
Lists all available promotions for this user
- Status Codes
200 OK – Success
The API returns the list of promotions that can be applied to the user’s payments. The list is comprised of all the promotions that are in effect in the time of the request and whose community and user groups filters matches with the communities and groups of the user.
The response format is as follows:
[
{
ID: 3, // Int
Name: "Test Promotion", // String
EffectStart: "2001-01-01T01:01:01Z", // DateTime
EffectEnd: "2001-01-01T01:01:01Z", // DateTime
Amount: 12, // Int
MaxDiscount: 12.3, // Decimal (nullable)
MinDiscount: 12.3, // Decimal (nullable)
Description: "Description", // String (nullable)
CommunitiesNames: "{\"Community1\",...}", // String (nullable)
CategoriesNames: [ "{\"en\":\"City Car\",...}",... ], // String Array (nullable)
ResourceGroupsNames: "Milan", // String (nullable)
UserGroupsNames: [ "{\"en\":\"Default Group\"}",... ] // String Array (nullable)
},
{ ... }
]