Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 5.23 KB

QualificationsApi.md

File metadata and controls

84 lines (63 loc) · 5.23 KB

QualificationsApi

All URIs are relative to https://api.voucherify.io

Method HTTP request Description
checkEligibility POST /v1/qualifications Check Eligibility

checkEligibility

QualificationsCheckEligibilityResponseBody checkEligibility(qualificationsCheckEligibilityRequestBody)

Check Eligibility

<!-- theme: warning --> > 🚧 The Qualifications endpoint ignores the rules checking: > > - Limit of total redeemed discount amount per campaign > - Limit of total redemptions count per campaign > - Redemptions per customer > - Redemptions per customer in a campaign 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 the dedicated guide to learn about some use cases this endpoint can cover. ## 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 parameter's 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.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.QualificationsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    QualificationsApi apiInstance = new QualificationsApi(defaultClient);
    QualificationsCheckEligibilityRequestBody qualificationsCheckEligibilityRequestBody = new QualificationsCheckEligibilityRequestBody(); // QualificationsCheckEligibilityRequestBody | Define order and customer context.
    try {
      QualificationsCheckEligibilityResponseBody result = apiInstance.checkEligibility(qualificationsCheckEligibilityRequestBody);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QualificationsApi#checkEligibility");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
qualificationsCheckEligibilityRequestBody QualificationsCheckEligibilityRequestBody Define order and customer context. [optional]

Return type

QualificationsCheckEligibilityResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a qualifications object. -