Class RewardApi

java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.RewardApi

public class RewardApi extends BaseApi
  • Constructor Details

    • RewardApi

      public RewardApi()
    • RewardApi

      public RewardApi(ApiClient apiClient)
  • Method Details

    • completeRedeemTransaction

      public MainRedeem completeRedeemTransaction(@Nonnull UUID pid, @Nonnull String tid) throws ApiException
      Complete redeem voucher request Completes voucher redeem request.
      Parameters:
      pid - Loyalty Program ID (required)
      tid - Redeem transaction ID (required)
      Returns:
      MainRedeem
      Throws:
      ApiException - if fails to make API call
    • completeRedeemTransaction

      public MainRedeem completeRedeemTransaction(@Nonnull UUID pid, @Nonnull String tid, Map<String,String> additionalHeaders) throws ApiException
      Complete redeem voucher request Completes voucher redeem request.
      Parameters:
      pid - Loyalty Program ID (required)
      tid - Redeem transaction ID (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainRedeem
      Throws:
      ApiException - if fails to make API call
    • createReward

      public MainCreateRewardResponse createReward(@Nonnull UUID pid, @Nonnull MainCreateRewardPayload mainCreateRewardPayload) throws ApiException
      Create a reward Creates a new reward in the loyalty program.
      Parameters:
      pid - Loyalty Program ID (required)
      mainCreateRewardPayload - (required)
      Returns:
      MainCreateRewardResponse
      Throws:
      ApiException - if fails to make API call
    • createReward

      public MainCreateRewardResponse createReward(@Nonnull UUID pid, @Nonnull MainCreateRewardPayload mainCreateRewardPayload, Map<String,String> additionalHeaders) throws ApiException
      Create a reward Creates a new reward in the loyalty program.
      Parameters:
      pid - Loyalty Program ID (required)
      mainCreateRewardPayload - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainCreateRewardResponse
      Throws:
      ApiException - if fails to make API call
    • createVoucher

      public MainRewardAttribution createVoucher(@Nonnull UUID pid, @Nonnull MainAttributeRewardPayload mainAttributeRewardPayload) throws ApiException
      Create a voucher Create a voucher and attribute it to a specific membership.
      Parameters:
      pid - Loyalty Program ID (required)
      mainAttributeRewardPayload - (required)
      Returns:
      MainRewardAttribution
      Throws:
      ApiException - if fails to make API call
    • createVoucher

      public MainRewardAttribution createVoucher(@Nonnull UUID pid, @Nonnull MainAttributeRewardPayload mainAttributeRewardPayload, Map<String,String> additionalHeaders) throws ApiException
      Create a voucher Create a voucher and attribute it to a specific membership.
      Parameters:
      pid - Loyalty Program ID (required)
      mainAttributeRewardPayload - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainRewardAttribution
      Throws:
      ApiException - if fails to make API call
    • getCodeCount

      public MainCodeCountHttpResponse getCodeCount(@Nonnull UUID pid, @Nonnull UUID cpid) throws ApiException
      Get code count Get code count
      Parameters:
      pid - Loyalty Program ID (required)
      cpid - Code Pool ID (required)
      Returns:
      MainCodeCountHttpResponse
      Throws:
      ApiException - if fails to make API call
    • getCodeCount

      public MainCodeCountHttpResponse getCodeCount(@Nonnull UUID pid, @Nonnull UUID cpid, Map<String,String> additionalHeaders) throws ApiException
      Get code count Get code count
      Parameters:
      pid - Loyalty Program ID (required)
      cpid - Code Pool ID (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainCodeCountHttpResponse
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidOffersGet

      public MainRewardPage loyaltyOfferProgramsPidOffersGet(@Nonnull UUID pid, @Nullable Integer limit, @Nullable Integer offset, @Nullable String state, @Nullable String version) throws ApiException
      Get Reward Page API Returns a reward page
      Parameters:
      pid - Loyalty Program ID (required)
      limit - Page size (optional, default to 25)
      offset - Pagination offset (optional, default to 0)
      state - State of the reward (optional, default to all)
      version - Version (optional, default to draft)
      Returns:
      MainRewardPage
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidOffersGet

      public MainRewardPage loyaltyOfferProgramsPidOffersGet(@Nonnull UUID pid, @Nullable Integer limit, @Nullable Integer offset, @Nullable String state, @Nullable String version, Map<String,String> additionalHeaders) throws ApiException
      Get Reward Page API Returns a reward page
      Parameters:
      pid - Loyalty Program ID (required)
      limit - Page size (optional, default to 25)
      offset - Pagination offset (optional, default to 0)
      state - State of the reward (optional, default to all)
      version - Version (optional, default to draft)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainRewardPage
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidRewardsRidGet

      public MainReward loyaltyOfferProgramsPidRewardsRidGet(@Nonnull UUID pid, @Nonnull UUID rid, @Nullable String version) throws ApiException
      Get reward information Returns reward information.
      Parameters:
      pid - Loyalty Program ID (required)
      rid - Reward ID (required)
      version - Version (optional, default to draft)
      Returns:
      MainReward
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidRewardsRidGet

      public MainReward loyaltyOfferProgramsPidRewardsRidGet(@Nonnull UUID pid, @Nonnull UUID rid, @Nullable String version, Map<String,String> additionalHeaders) throws ApiException
      Get reward information Returns reward information.
      Parameters:
      pid - Loyalty Program ID (required)
      rid - Reward ID (required)
      version - Version (optional, default to draft)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainReward
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidVouchersGet

      public MainModelContactRewardsResp loyaltyOfferProgramsPidVouchersGet(@Nonnull UUID pid, @Nonnull Integer contactId, @Nullable Integer limit, @Nullable Integer offset, @Nullable String sort, @Nullable String sortField, @Nullable String metadataKeyValue, @Nullable String rewardId) throws ApiException
      Get voucher for a contact Get voucher for a contact
      Parameters:
      pid - Loyalty Program ID (required)
      contactId - Contact ID (required)
      limit - Page size (optional, default to 25)
      offset - Pagination offset (optional, default to 0)
      sort - Sort order (optional, default to desc)
      sortField - Sort field (optional, default to updatedAt)
      metadataKeyValue - Metadata value for a Key filter (optional)
      rewardId - Reward ID (optional)
      Returns:
      MainModelContactRewardsResp
      Throws:
      ApiException - if fails to make API call
    • loyaltyOfferProgramsPidVouchersGet

      public MainModelContactRewardsResp loyaltyOfferProgramsPidVouchersGet(@Nonnull UUID pid, @Nonnull Integer contactId, @Nullable Integer limit, @Nullable Integer offset, @Nullable String sort, @Nullable String sortField, @Nullable String metadataKeyValue, @Nullable String rewardId, Map<String,String> additionalHeaders) throws ApiException
      Get voucher for a contact Get voucher for a contact
      Parameters:
      pid - Loyalty Program ID (required)
      contactId - Contact ID (required)
      limit - Page size (optional, default to 25)
      offset - Pagination offset (optional, default to 0)
      sort - Sort order (optional, default to desc)
      sortField - Sort field (optional, default to updatedAt)
      metadataKeyValue - Metadata value for a Key filter (optional)
      rewardId - Reward ID (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainModelContactRewardsResp
      Throws:
      ApiException - if fails to make API call
    • redeemVoucher

      public MainRedeem redeemVoucher(@Nonnull UUID pid, @Nonnull MainCreateRedeemPayload mainCreateRedeemPayload) throws ApiException
      Create redeem voucher request Creates a request to redeem a voucher.
      Parameters:
      pid - Loyalty Program ID (required)
      mainCreateRedeemPayload - (required)
      Returns:
      MainRedeem
      Throws:
      ApiException - if fails to make API call
    • redeemVoucher

      public MainRedeem redeemVoucher(@Nonnull UUID pid, @Nonnull MainCreateRedeemPayload mainCreateRedeemPayload, Map<String,String> additionalHeaders) throws ApiException
      Create redeem voucher request Creates a request to redeem a voucher.
      Parameters:
      pid - Loyalty Program ID (required)
      mainCreateRedeemPayload - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainRedeem
      Throws:
      ApiException - if fails to make API call
    • revokeVouchers

      public void revokeVouchers(@Nonnull UUID pid, @Nullable String attributedRewardIds) throws ApiException
      Revoke vouchers Revoke attributed vouchers.
      Parameters:
      pid - Loyalty Program ID (required)
      attributedRewardIds - Reward Attribution IDs (comma seperated) (optional)
      Throws:
      ApiException - if fails to make API call
    • revokeVouchers

      public void revokeVouchers(@Nonnull UUID pid, @Nullable String attributedRewardIds, Map<String,String> additionalHeaders) throws ApiException
      Revoke vouchers Revoke attributed vouchers.
      Parameters:
      pid - Loyalty Program ID (required)
      attributedRewardIds - Reward Attribution IDs (comma seperated) (optional)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • validateReward

      public MainRewardValidate validateReward(@Nonnull UUID pid, @Nonnull MainValidateRewardPayload mainValidateRewardPayload) throws ApiException
      Validate a reward Validates a reward.
      Parameters:
      pid - Loyalty Program ID (required)
      mainValidateRewardPayload - (required)
      Returns:
      MainRewardValidate
      Throws:
      ApiException - if fails to make API call
    • validateReward

      public MainRewardValidate validateReward(@Nonnull UUID pid, @Nonnull MainValidateRewardPayload mainValidateRewardPayload, Map<String,String> additionalHeaders) throws ApiException
      Validate a reward Validates a reward.
      Parameters:
      pid - Loyalty Program ID (required)
      mainValidateRewardPayload - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MainRewardValidate
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.