Business - Discounts ==================== .. Last update: 12/04/2022 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 :download:`here `. Get available coupons --------------------- Gets the paged list (see :ref:`paged-list-api`) of available coupons for the user .. openapi:: /openapi/srv-business-base/api-src-WebMobile.json :paths: /v1/discounts/available-coupons 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 :ref:`paged-list-api`) of the coupons already used by user .. openapi:: /openapi/srv-business-base/api-src-WebMobile.json :paths: /v1/discounts/used-coupons 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 :ref:`paged-list-api`) of available promotions for the user .. openapi:: /openapi/srv-business-base/api-src-WebMobile.json :paths: /v1/discounts/available-promotions 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) }, { ... } ]