Package io.voucherify.client.api
Class ClientSideApi
java.lang.Object
io.voucherify.client.api.ClientSideApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckEligibilityClientSide(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody) Check Eligibility (client-side) Generate a list of redeemables that are applicable in the context of the customer and order.okhttp3.CallcheckEligibilityClientSideAsync(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody, ApiCallback<ClientQualificationsCheckEligibilityResponseBody> _callback) Check Eligibility (client-side) (asynchronously) Generate a list of redeemables that are applicable in the context of the customer and order.okhttp3.CallcheckEligibilityClientSideCall(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody, ApiCallback _callback) Build call for checkEligibilityClientSidecheckEligibilityClientSideWithHttpInfo(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody) Check Eligibility (client-side) Generate a list of redeemables that are applicable in the context of the customer and order.intlistPromotionTiersClientSide(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order) List Promotion Tiers (client-side) This method enables you to list promotion tiers.okhttp3.CalllistPromotionTiersClientSideAsync(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order, ApiCallback<ClientPromotionsTiersListResponseBody> _callback) List Promotion Tiers (client-side) (asynchronously) This method enables you to list promotion tiers.okhttp3.CalllistPromotionTiersClientSideCall(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order, ApiCallback _callback) Build call for listPromotionTiersClientSidelistPromotionTiersClientSideWithHttpInfo(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order) List Promotion Tiers (client-side) This method enables you to list promotion tiers.redeemStackedDiscountsClientSide(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody) Redeem Stackable Discounts (client-side) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.okhttp3.CallredeemStackedDiscountsClientSideAsync(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody, ApiCallback<ClientRedemptionsRedeemResponseBody> _callback) Redeem Stackable Discounts (client-side) (asynchronously) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.okhttp3.CallredeemStackedDiscountsClientSideCall(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody, ApiCallback _callback) Build call for redeemStackedDiscountsClientSideredeemStackedDiscountsClientSideWithHttpInfo(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody) Redeem Stackable Discounts (client-side) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex) trackCustomEventClientSide(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody) Track Custom Event (client-side) To track a custom event, you create an event object.okhttp3.CalltrackCustomEventClientSideAsync(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody, ApiCallback<ClientEventsCreateResponseBody> _callback) Track Custom Event (client-side) (asynchronously) To track a custom event, you create an event object.okhttp3.CalltrackCustomEventClientSideCall(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody, ApiCallback _callback) Build call for trackCustomEventClientSidetrackCustomEventClientSideWithHttpInfo(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody) Track Custom Event (client-side) To track a custom event, you create an event object.validateStackedDiscountsClientSide(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody) Validate Stackable Discounts (client-side) Verify redeemables provided in the request.okhttp3.CallvalidateStackedDiscountsClientSideAsync(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody, ApiCallback<ClientValidationsValidateResponseBody> _callback) Validate Stackable Discounts (client-side) (asynchronously) Verify redeemables provided in the request.okhttp3.CallvalidateStackedDiscountsClientSideCall(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody, ApiCallback _callback) Build call for validateStackedDiscountsClientSidevalidateStackedDiscountsClientSideWithHttpInfo(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody) Validate Stackable Discounts (client-side) Verify redeemables provided in the request.
-
Constructor Details
-
ClientSideApi
public ClientSideApi() -
ClientSideApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
checkEligibilityClientSideCall
public okhttp3.Call checkEligibilityClientSideCall(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody, ApiCallback _callback) throws ApiException Build call for checkEligibilityClientSide- Parameters:
clientQualificationsCheckEligibilityRequestBody- Define order and customer context. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
checkEligibilityClientSide
public ClientQualificationsCheckEligibilityResponseBody checkEligibilityClientSide(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody) throws ApiException Check Eligibility (client-side) Generate a list of redeemables that are applicable in the context of the customer and order. The new qualifications method is an improved version of Campaign Qualifications, Voucher Qualifications, and Promotions Validation API requests. The new qualification method introduces the following improvements: - Qualification results are returned faster - No limit on the number of returned redeemables - Introduces new qualification scenarios, not available in the previous version 👍 Scenario Guide Read our dedicated guide to learn about some use cases this endpoint can cover here. # Paging The Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the starting_after cursor. To process of paging the redeemables works in the following manner: - You send the first API request for Qualifications without the starting_after parameter. - The response will contain a parameter named has_more. If the parameters value is set to true, then more redeemables are available. - Get the value of the created_at parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables. - Send another API request for Qualification with the starting_after parameter set to the value taken from the created_at parameter from the last returned redeemable. - Voucherify will return the next page of redeemables. - If the has_more parameter is set to true, apply steps 3-5 to get the next page of redeemables.- Parameters:
clientQualificationsCheckEligibilityRequestBody- Define order and customer context. (optional)- Returns:
- ClientQualificationsCheckEligibilityResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
checkEligibilityClientSideWithHttpInfo
public ApiResponse<ClientQualificationsCheckEligibilityResponseBody> checkEligibilityClientSideWithHttpInfo(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody) throws ApiException Check Eligibility (client-side) Generate a list of redeemables that are applicable in the context of the customer and order. The new qualifications method is an improved version of Campaign Qualifications, Voucher Qualifications, and Promotions Validation API requests. The new qualification method introduces the following improvements: - Qualification results are returned faster - No limit on the number of returned redeemables - Introduces new qualification scenarios, not available in the previous version 👍 Scenario Guide Read our dedicated guide to learn about some use cases this endpoint can cover here. # Paging The Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the starting_after cursor. To process of paging the redeemables works in the following manner: - You send the first API request for Qualifications without the starting_after parameter. - The response will contain a parameter named has_more. If the parameters value is set to true, then more redeemables are available. - Get the value of the created_at parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables. - Send another API request for Qualification with the starting_after parameter set to the value taken from the created_at parameter from the last returned redeemable. - Voucherify will return the next page of redeemables. - If the has_more parameter is set to true, apply steps 3-5 to get the next page of redeemables.- Parameters:
clientQualificationsCheckEligibilityRequestBody- Define order and customer context. (optional)- Returns:
- ApiResponse<ClientQualificationsCheckEligibilityResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
checkEligibilityClientSideAsync
public okhttp3.Call checkEligibilityClientSideAsync(ClientQualificationsCheckEligibilityRequestBody clientQualificationsCheckEligibilityRequestBody, ApiCallback<ClientQualificationsCheckEligibilityResponseBody> _callback) throws ApiException Check Eligibility (client-side) (asynchronously) Generate a list of redeemables that are applicable in the context of the customer and order. The new qualifications method is an improved version of Campaign Qualifications, Voucher Qualifications, and Promotions Validation API requests. The new qualification method introduces the following improvements: - Qualification results are returned faster - No limit on the number of returned redeemables - Introduces new qualification scenarios, not available in the previous version 👍 Scenario Guide Read our dedicated guide to learn about some use cases this endpoint can cover here. # Paging The Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the starting_after cursor. To process of paging the redeemables works in the following manner: - You send the first API request for Qualifications without the starting_after parameter. - The response will contain a parameter named has_more. If the parameters value is set to true, then more redeemables are available. - Get the value of the created_at parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables. - Send another API request for Qualification with the starting_after parameter set to the value taken from the created_at parameter from the last returned redeemable. - Voucherify will return the next page of redeemables. - If the has_more parameter is set to true, apply steps 3-5 to get the next page of redeemables.- Parameters:
clientQualificationsCheckEligibilityRequestBody- Define order and customer context. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
listPromotionTiersClientSideCall
public okhttp3.Call listPromotionTiersClientSideCall(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order, ApiCallback _callback) throws ApiException Build call for listPromotionTiersClientSide- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)isAvailable- This parameter allows filtering promotions that are only available at the moment. When set to true, it selects only non-expired and active promotions. (optional)limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
listPromotionTiersClientSide
public ClientPromotionsTiersListResponseBody listPromotionTiersClientSide(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order) throws ApiException List Promotion Tiers (client-side) This method enables you to list promotion tiers.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)isAvailable- This parameter allows filtering promotions that are only available at the moment. When set to true, it selects only non-expired and active promotions. (optional)limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)- Returns:
- ClientPromotionsTiersListResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listPromotionTiersClientSideWithHttpInfo
public ApiResponse<ClientPromotionsTiersListResponseBody> listPromotionTiersClientSideWithHttpInfo(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order) throws ApiException List Promotion Tiers (client-side) This method enables you to list promotion tiers.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)isAvailable- This parameter allows filtering promotions that are only available at the moment. When set to true, it selects only non-expired and active promotions. (optional)limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)- Returns:
- ApiResponse<ClientPromotionsTiersListResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listPromotionTiersClientSideAsync
public okhttp3.Call listPromotionTiersClientSideAsync(String origin, Boolean isAvailable, Integer limit, Integer page, ParameterOrderListPromotionTiersClientSide order, ApiCallback<ClientPromotionsTiersListResponseBody> _callback) throws ApiException List Promotion Tiers (client-side) (asynchronously) This method enables you to list promotion tiers.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)isAvailable- This parameter allows filtering promotions that are only available at the moment. When set to true, it selects only non-expired and active promotions. (optional)limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
redeemStackedDiscountsClientSideCall
public okhttp3.Call redeemStackedDiscountsClientSideCall(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody, ApiCallback _callback) throws ApiException Build call for redeemStackedDiscountsClientSide- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientRedemptionsRedeemRequestBody- (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
redeemStackedDiscountsClientSide
public ClientRedemptionsRedeemResponseBody redeemStackedDiscountsClientSide(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody) throws ApiException Redeem Stackable Discounts (client-side) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications. # How API returns calculated discounts and order amounts in the response In the table below, you can see the logic the API follows to calculate discounts and amounts: 📘 Rollbacks You cant roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your rollback request.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientRedemptionsRedeemRequestBody- (optional)- Returns:
- ClientRedemptionsRedeemResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
redeemStackedDiscountsClientSideWithHttpInfo
public ApiResponse<ClientRedemptionsRedeemResponseBody> redeemStackedDiscountsClientSideWithHttpInfo(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody) throws ApiException Redeem Stackable Discounts (client-side) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications. # How API returns calculated discounts and order amounts in the response In the table below, you can see the logic the API follows to calculate discounts and amounts: 📘 Rollbacks You cant roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your rollback request.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientRedemptionsRedeemRequestBody- (optional)- Returns:
- ApiResponse<ClientRedemptionsRedeemResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
redeemStackedDiscountsClientSideAsync
public okhttp3.Call redeemStackedDiscountsClientSideAsync(String origin, ClientRedemptionsRedeemRequestBody clientRedemptionsRedeemRequestBody, ApiCallback<ClientRedemptionsRedeemResponseBody> _callback) throws ApiException Redeem Stackable Discounts (client-side) (asynchronously) This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications. # How API returns calculated discounts and order amounts in the response In the table below, you can see the logic the API follows to calculate discounts and amounts: 📘 Rollbacks You cant roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your rollback request.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientRedemptionsRedeemRequestBody- (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
trackCustomEventClientSideCall
public okhttp3.Call trackCustomEventClientSideCall(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody, ApiCallback _callback) throws ApiException Build call for trackCustomEventClientSide- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientEventsCreateRequestBody- Specify the details of the custom event. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
trackCustomEventClientSide
public ClientEventsCreateResponseBody trackCustomEventClientSide(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody) throws ApiException Track Custom Event (client-side) To track a custom event, you create an event object. The event object must be linked to the customer who performs the action. If a customer doesnt exist in Voucherify, the customer will be created.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientEventsCreateRequestBody- Specify the details of the custom event. (optional)- Returns:
- ClientEventsCreateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
trackCustomEventClientSideWithHttpInfo
public ApiResponse<ClientEventsCreateResponseBody> trackCustomEventClientSideWithHttpInfo(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody) throws ApiException Track Custom Event (client-side) To track a custom event, you create an event object. The event object must be linked to the customer who performs the action. If a customer doesnt exist in Voucherify, the customer will be created.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientEventsCreateRequestBody- Specify the details of the custom event. (optional)- Returns:
- ApiResponse<ClientEventsCreateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
trackCustomEventClientSideAsync
public okhttp3.Call trackCustomEventClientSideAsync(String origin, ClientEventsCreateRequestBody clientEventsCreateRequestBody, ApiCallback<ClientEventsCreateResponseBody> _callback) throws ApiException Track Custom Event (client-side) (asynchronously) To track a custom event, you create an event object. The event object must be linked to the customer who performs the action. If a customer doesnt exist in Voucherify, the customer will be created.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientEventsCreateRequestBody- Specify the details of the custom event. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
validateStackedDiscountsClientSideCall
public okhttp3.Call validateStackedDiscountsClientSideCall(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody, ApiCallback _callback) throws ApiException Build call for validateStackedDiscountsClientSide- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientValidationsValidateRequestBody- (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
validateStackedDiscountsClientSide
public ClientValidationsValidateResponseBody validateStackedDiscountsClientSide(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody) throws ApiException Validate Stackable Discounts (client-side) Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientValidationsValidateRequestBody- (optional)- Returns:
- ClientValidationsValidateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
validateStackedDiscountsClientSideWithHttpInfo
public ApiResponse<ClientValidationsValidateResponseBody> validateStackedDiscountsClientSideWithHttpInfo(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody) throws ApiException Validate Stackable Discounts (client-side) Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientValidationsValidateRequestBody- (optional)- Returns:
- ApiResponse<ClientValidationsValidateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
validateStackedDiscountsClientSideAsync
public okhttp3.Call validateStackedDiscountsClientSideAsync(String origin, ClientValidationsValidateRequestBody clientValidationsValidateRequestBody, ApiCallback<ClientValidationsValidateResponseBody> _callback) throws ApiException Validate Stackable Discounts (client-side) (asynchronously) Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.- Parameters:
origin- Indicates the origin (scheme, hostname, and port). (required)clientValidationsValidateRequestBody- (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-