Class VoucherifyClient

java.lang.Object
org.bhn.promotion.voucherify.engine.VoucherifyClient

public class VoucherifyClient extends Object
This class contains all the api calls made to Voucherify service
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.voucherify.client.model.PromotionsTiersCreateResponseBody
    addPromotionTiersToCampaign(String campaignId, io.voucherify.client.model.PromotionsTiersCreateRequestBody promotionsTiersCreateRequestBody)
    Creates promotion tiers and adds them to a specific campaign.
    io.voucherify.client.model.PromotionsTiersCreateResponseBody
    addPromotionTierToCampaign(String campaignId, io.voucherify.client.model.PromotionsTiersCreateRequestBody requestBody)
    This method invokes voucherify api and Adds Promotion Tier to campaign
    io.voucherify.client.model.ManagementProjectsUsersAssignResponseBody
    assignUser(String projectId, io.voucherify.client.model.ManagementProjectsUsersAssignRequestBody assignRequest)
    This method invokes the Voucherify Management API to assign a user to a project.
    This method invokes voucherify api and Checks promotion eligibility with retry mechanism
    io.voucherify.client.model.CampaignsCreateResponseBody
    createCampaign(io.voucherify.client.model.CampaignsCreateRequestBody requestBody)
    This method invokes voucherify api and Creates campaign
    io.voucherify.client.model.ExportsCreateResponseBody
    createExport(io.voucherify.client.model.ExportsCreateRequestBody requestBody)
    Creates a new export using the provided request body.
    io.voucherify.client.model.ProductsCreateResponseBody
    createProduct(io.voucherify.client.model.ProductsCreateRequestBody requestBody)
    This method invokes voucherify api and Creates Product
    io.voucherify.client.model.ProductCollectionsCreateResponseBody
    createProductCollection(io.voucherify.client.model.ProductCollectionsCreateRequestBody productCollectionsCreateRequestBody)
    Creates promotion tiers by invoking the Product Collections API.
    io.voucherify.client.model.ProductsSkusCreateResponseBody
    createSku(String productId, io.voucherify.client.model.ProductsSkusCreateRequestBody requestBody)
    This method invokes voucherify api and Creates Product SKU
    io.voucherify.client.model.ValidationRulesCreateResponseBody
    createValidationRule(io.voucherify.client.model.ValidationRulesCreateRequestBody requestBody)
    Creates a new validation rule by calling the underlying validation rules API.
    io.voucherify.client.model.ValidationRulesAssignmentsCreateResponseBody
    createValidationRuleAssignment(String validationRuleId, Boolean force, io.voucherify.client.model.ValidationRulesAssignmentsCreateRequestBody assignmentsCreateRequestBody)
    Creates a new validation rule assignment by calling the underlying validation rules API.
    io.voucherify.client.model.VouchersCreateResponseBody
    createVoucher(String code, io.voucherify.client.model.VouchersCreateWithSpecificCodeRequestBody requestBody)
    This method invokes voucherify api and Creates campaign
    io.voucherify.client.model.CampaignsDeleteResponseBody
    deleteCampaign(String campaignId, boolean force)
    This method invokes voucherify api and Deletes campaign
    void
    deleteProduct(String productId, Boolean force)
    This method invokes voucherify api and delete Product
    void
    This method invokes voucherify api and Deletes Promotion Tier
    void
    deleteValidationRule(String validationRuleId)
    Deletes a validation rule by its ID.
    void
    deleteValidationRuleAssignment(String validationRuleId, String assignmentId)
    Deletes the assignment of a validation rule.
    void
    deleteVoucher(String voucherId, boolean force)
    This method invokes voucherify api and Deletes voucher
    io.voucherify.client.model.CampaignsGetResponseBody
    getCampaign(String campaignId)
    This method invokes voucherify api and Gets campaign
    io.voucherify.client.model.ExportsGetResponseBody
    getExport(String exportId)
    Retrieves the details of an existing export using the specified export ID.
    io.voucherify.client.model.ManagementProjectsMetadataSchemasListResponseBody
    This method invokes the Voucherify Management API to retrieve the metadata schemas for a project.
    io.voucherify.client.model.ProductsGetResponseBody
    getProduct(String productId)
    This method invokes voucherify api and Gets product
    io.voucherify.client.model.ProductCollectionsGetResponseBody
    getProductCollection(String productCollectionId)
    This method retrieves the product collection for the given product collection ID.
    io.voucherify.client.model.PromotionsTiersGetResponseBody
    getPromotionTier(String promotionId)
    This method invokes voucherify api and Gets promotion tier
    io.voucherify.client.model.ManagementProjectsUsersGetUserResponseBody
    getUser(String projectId, String userId)
    Gets a user's details from Voucherify.
    io.voucherify.client.model.ValidationRulesGetResponseBody
    This method invokes voucherify api and Gets Validation Rules
    io.voucherify.client.model.VouchersGetResponseBody
    getVoucher(String voucherId)
    This method invokes voucherify api and Gets voucher
    io.voucherify.client.model.VouchersListResponseBody
    getVouchers(Integer limit, Integer page, String category, String campaignId, String customer, String campaign, io.voucherify.client.model.ParameterCreatedBeforeAfter createdAt, io.voucherify.client.model.ParameterUpdatedBeforeAfter updatedAt, io.voucherify.client.model.ParameterOrderVouchers order, String code, List<String> ids)
    Fetches a list of vouchers based on the provided filters and parameters.
    void
    inviteUser(io.voucherify.client.model.ManagementProjectsUsersInviteCreateRequestBody requestBody)
    This method invokes the Voucherify Management API to invite a user to a project.
    This method invokes voucherify api and Redeems promotion with retry mechanism
    This method invokes voucherify api and Rollbacks promotion
    void
    unassignUser(String projectId, String userId)
    This method invokes the Voucherify Management API to unassign a user from a project.
    io.voucherify.client.model.CampaignsUpdateResponseBody
    updateCampaign(String campaignId, io.voucherify.client.model.CampaignsUpdateRequestBody requestBody)
    This method invokes voucherify api and Updates campaign
    io.voucherify.client.model.ManagementProjectsMetadataSchemasUpdateResponseBody
    updateMetadataSchema(String projectId, String metadataSchemaId, io.voucherify.client.model.ManagementProjectsMetadataSchemasUpdateRequestBody metadataSchemasUpdateRequestBody)
    This method invokes the Voucherify Management API to update the metadata schema for a project.
    io.voucherify.client.model.ProductsUpdateResponseBody
    updateProduct(String productId, io.voucherify.client.model.ProductsUpdateRequestBody requestBody)
    This method invokes voucherify api and Updates Product
    io.voucherify.client.model.PromotionsTiersUpdateResponseBody
    updatePromotionTier(String promotionId, io.voucherify.client.model.PromotionsTiersUpdateRequestBody requestBody)
    This method invokes voucherify api and Updates Promotion Tier
    io.voucherify.client.model.ManagementProjectsUsersUpdateRoleResponseBody
    updateUser(String projectId, String userId, io.voucherify.client.model.ManagementProjectsUsersUpdateRoleRequestBody requestBody)
    This method invokes the Voucherify Management API to update a user's role in a project.
    io.voucherify.client.model.ValidationRulesUpdateResponseBody
    updateValidationRuleAssignment(String validationRuleId, io.voucherify.client.model.ValidationRulesUpdateRequestBody validationRulesUpdateRequestBody)
    Updates the validation rule assignment in Voucherify using the provided validation rule ID and the update request body.
    io.voucherify.client.model.VouchersUpdateResponseBody
    updateVoucher(String voucherCode, io.voucherify.client.model.VouchersUpdateRequestBody vouchersUpdateRequestBody)
    This method invokes voucherify api and update voucher
    This method invokes voucherify api and Validates promotion with retry mechanism

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VoucherifyClient

      public VoucherifyClient()
  • Method Details

    • validateStackedDiscounts

      public ValidationResponseDto validateStackedDiscounts(ValidationRequestDto requestBody) throws Exception
      This method invokes voucherify api and Validates promotion with retry mechanism
      Parameters:
      requestBody - ValidationRequestDtoValidation Request
      Returns:
      ValidationResponseDto Validations Response
      Throws:
      Exception - throw exception in case of execution issue
    • checkEligibility

      This method invokes voucherify api and Checks promotion eligibility with retry mechanism
      Parameters:
      requestBody - CheckPromotionEligibilityRequestDto Qualification Request
      Returns:
      CheckPromotionEligibilityResponseDto Qualification Response
      Throws:
      Exception - throw exception in case of execution issue
    • redeemStackedDiscounts

      public RedeemPromotionResponseDto redeemStackedDiscounts(RedeemPromotionRequestDto requestBody) throws Exception
      This method invokes voucherify api and Redeems promotion with retry mechanism
      Parameters:
      requestBody - RedeemPromotionRequestDto Redemption Request
      Returns:
      RedeemPromotionResponseDto Redemption Response
      Throws:
      Exception - throw exception in case of execution issue
    • inviteUser

      public void inviteUser(io.voucherify.client.model.ManagementProjectsUsersInviteCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to invite a user to a project.
      Parameters:
      requestBody - ManagementProjectsUsersInviteCreateRequestBody the request containing user invitation details
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call
    • updateUser

      public io.voucherify.client.model.ManagementProjectsUsersUpdateRoleResponseBody updateUser(String projectId, String userId, io.voucherify.client.model.ManagementProjectsUsersUpdateRoleRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to update a user's role in a project.
      Parameters:
      projectId - the project identifier
      userId - the user identifier (can be user ID or email)
      requestBody - ManagementProjectsUsersUpdateRoleRequestBody the request containing the new role
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call
    • getUser

      public io.voucherify.client.model.ManagementProjectsUsersGetUserResponseBody getUser(String projectId, String userId) throws io.voucherify.client.ApiException
      Gets a user's details from Voucherify.
      Parameters:
      projectId - the project ID
      userId - the user ID or email
      Returns:
      ManagementProjectsUsersGetUserResponseBody containing user details
      Throws:
      io.voucherify.client.ApiException - if the API call fails
    • unassignUser

      public void unassignUser(String projectId, String userId) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to unassign a user from a project.
      Parameters:
      projectId - the project identifier
      userId - the user identifier (can be user ID or email)
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call
    • assignUser

      public io.voucherify.client.model.ManagementProjectsUsersAssignResponseBody assignUser(String projectId, io.voucherify.client.model.ManagementProjectsUsersAssignRequestBody assignRequest) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to assign a user to a project.
      Parameters:
      projectId - the project identifier
      assignRequest - the request body containing user login and role
      Returns:
      the response from the API
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call
    • rollbackStackedRedemptions

      public RedemptionRollbackResponseDto rollbackStackedRedemptions(String redemptionId, String reason, RedemptionRollbackRequestDto body) throws Exception
      This method invokes voucherify api and Rollbacks promotion
      Parameters:
      redemptionId - String Redemption ID
      reason - String Rollback Reason
      body - RedemptionRollbackRequestDto Contains metadata for the rollback
      Returns:
      RedemptionRollbackResponseDto Rollback Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
      Exception
    • createCampaign

      public io.voucherify.client.model.CampaignsCreateResponseBody createCampaign(io.voucherify.client.model.CampaignsCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Creates campaign
      Parameters:
      requestBody - CampaignsCreateRequestBody Create Campaign Request
      Returns:
      CampaignsCreateResponseBody Create Campaign Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • deleteCampaign

      public io.voucherify.client.model.CampaignsDeleteResponseBody deleteCampaign(String campaignId, boolean force) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Deletes campaign
      Parameters:
      campaignId - String Campaign Id
      force - boolean Force Delete Flag
      Returns:
      CampaignsDeleteResponseBody Delete Campaign Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getCampaign

      public io.voucherify.client.model.CampaignsGetResponseBody getCampaign(String campaignId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Gets campaign
      Parameters:
      campaignId - String Campaign Id
      Returns:
      CampaignsGetResponseBody Get Campaign Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • updateCampaign

      public io.voucherify.client.model.CampaignsUpdateResponseBody updateCampaign(String campaignId, io.voucherify.client.model.CampaignsUpdateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Updates campaign
      Parameters:
      campaignId - String Campaign Id
      requestBody - CampaignsUpdateRequestBody Update Campaign Request
      Returns:
      CampaignsUpdateResponseBody Update Campaign Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getPromotionTier

      public io.voucherify.client.model.PromotionsTiersGetResponseBody getPromotionTier(String promotionId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Gets promotion tier
      Parameters:
      promotionId - String Promotion ID
      Returns:
      PromotionsTiersGetResponseBody Get Promotion Tier Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • deletePromotionTier

      public void deletePromotionTier(String promotionId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Deletes Promotion Tier
      Parameters:
      promotionId - String Promotion ID
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • addPromotionTierToCampaign

      public io.voucherify.client.model.PromotionsTiersCreateResponseBody addPromotionTierToCampaign(String campaignId, io.voucherify.client.model.PromotionsTiersCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Adds Promotion Tier to campaign
      Parameters:
      campaignId - String Campaign Id
      requestBody - PromotionsTiersCreateRequestBody Add Promotion Tier Request
      Returns:
      PromotionsTiersCreateResponseBody Add Promotion Tier Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • updatePromotionTier

      public io.voucherify.client.model.PromotionsTiersUpdateResponseBody updatePromotionTier(String promotionId, io.voucherify.client.model.PromotionsTiersUpdateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Updates Promotion Tier
      Parameters:
      promotionId - String Promotion ID
      requestBody - PromotionsTiersUpdateRequestBody Update Promotion Tier Request
      Returns:
      PromotionsTiersUpdateResponseBody Update Promotion Tier Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getVoucher

      public io.voucherify.client.model.VouchersGetResponseBody getVoucher(String voucherId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Gets voucher
      Parameters:
      voucherId - String Voucher Id
      Returns:
      VouchersGetResponseBody Get Voucher Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • deleteVoucher

      public void deleteVoucher(String voucherId, boolean force) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Deletes voucher
      Parameters:
      voucherId - String Voucher Id
      force - boolean Force Delete Flag
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getVouchers

      public io.voucherify.client.model.VouchersListResponseBody getVouchers(Integer limit, Integer page, String category, String campaignId, String customer, String campaign, io.voucherify.client.model.ParameterCreatedBeforeAfter createdAt, io.voucherify.client.model.ParameterUpdatedBeforeAfter updatedAt, io.voucherify.client.model.ParameterOrderVouchers order, String code, List<String> ids) throws io.voucherify.client.ApiException
      Fetches a list of vouchers based on the provided filters and parameters.
      Parameters:
      limit - The maximum number of vouchers to return in the response. (Optional)
      page - The page number to retrieve. (Optional)
      category - The category of vouchers to filter by. (Optional)
      campaignId - The ID of the campaign to filter vouchers by. (Optional)
      customer - The customer ID to filter vouchers by. (Optional)
      campaign - The name of the campaign to filter vouchers by. (Optional)
      createdAt - The creation date filter for vouchers. Accepts before or after parameters. (Optional)
      updatedAt - The last updated date filter for vouchers. Accepts before or after parameters. (Optional)
      order - The order in which to return the vouchers (e.g., ascending or descending). (Optional)
      code - A specific voucher code to search for. (Optional)
      ids - A list of voucher IDs to filter by. (Optional)
      Returns:
      A VouchersListResponseBody containing the list of vouchers and associated metadata.
      Throws:
      io.voucherify.client.ApiException - If an error occurs while fetching the vouchers from the API.
    • getValidationRule

      public io.voucherify.client.model.ValidationRulesGetResponseBody getValidationRule(String ruleId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Gets Validation Rules
      Parameters:
      ruleId - String RuleId
      Returns:
      ValidationRulesGetResponseBody Get Validation Rules Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • createProduct

      public io.voucherify.client.model.ProductsCreateResponseBody createProduct(io.voucherify.client.model.ProductsCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Creates Product
      Parameters:
      requestBody - ProductsCreateRequestBody RuleId
      Returns:
      ProductsCreateResponseBody Create Product Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • deleteProduct

      public void deleteProduct(String productId, Boolean force) throws io.voucherify.client.ApiException
      This method invokes voucherify api and delete Product
      Parameters:
      productId -
      force -
      Throws:
      io.voucherify.client.ApiException
    • updateProduct

      public io.voucherify.client.model.ProductsUpdateResponseBody updateProduct(String productId, io.voucherify.client.model.ProductsUpdateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Updates Product
      Parameters:
      productId - String Product ID
      requestBody - ProductsUpdateRequestBody Update Product Request
      Returns:
      ProductsUpdateResponseBody Update Product Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • createSku

      public io.voucherify.client.model.ProductsSkusCreateResponseBody createSku(String productId, io.voucherify.client.model.ProductsSkusCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Creates Product SKU
      Parameters:
      productId - String Product ID
      requestBody - ProductsSkusCreateRequestBody Create Product SKU Request
      Returns:
      ProductsSkusCreateResponseBody Create Product SKU Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getProduct

      public io.voucherify.client.model.ProductsGetResponseBody getProduct(String productId) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Gets product
      Parameters:
      productId - String Product ID
      Returns:
      ProductsGetResponseBody Get Product Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • createExport

      public io.voucherify.client.model.ExportsCreateResponseBody createExport(io.voucherify.client.model.ExportsCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      Creates a new export using the provided request body.
      Parameters:
      requestBody - the request body containing the export details.
      Returns:
      an ExportsCreateResponseBody representing the response from the export creation request.
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call to create the export.
    • getExport

      public io.voucherify.client.model.ExportsGetResponseBody getExport(String exportId) throws io.voucherify.client.ApiException
      Retrieves the details of an existing export using the specified export ID.
      Parameters:
      exportId - the ID of the export to retrieve.
      Returns:
      an ExportsGetResponseBody containing the details of the requested export.
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call to fetch the export details.
    • getProductCollection

      public io.voucherify.client.model.ProductCollectionsGetResponseBody getProductCollection(String productCollectionId) throws io.voucherify.client.ApiException
      This method retrieves the product collection for the given product collection ID.
      Parameters:
      productCollectionId - The unique identifier of the product collection.
      Returns:
      A ProductCollectionsGetResponseBody object containing the details of the product collection.
      Throws:
      io.voucherify.client.ApiException - if there is an error when trying to retrieve the product collection.
    • createVoucher

      public io.voucherify.client.model.VouchersCreateResponseBody createVoucher(String code, io.voucherify.client.model.VouchersCreateWithSpecificCodeRequestBody requestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and Creates campaign
      Parameters:
      requestBody - VouchersCreateWithSpecificCodeRequestBody Create Campaign Request
      Returns:
      VouchersCreateResponseBody Create Campaign Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • createValidationRule

      public io.voucherify.client.model.ValidationRulesCreateResponseBody createValidationRule(io.voucherify.client.model.ValidationRulesCreateRequestBody requestBody) throws io.voucherify.client.ApiException
      Creates a new validation rule by calling the underlying validation rules API.
      Parameters:
      requestBody - the request body containing the details of the validation rule to be created.
      Returns:
      a ValidationRulesCreateResponseBody object containing the response details of the created validation rule.
      Throws:
      io.voucherify.client.ApiException - if an error occurs while creating the validation rule.
    • createValidationRuleAssignment

      public io.voucherify.client.model.ValidationRulesAssignmentsCreateResponseBody createValidationRuleAssignment(String validationRuleId, Boolean force, io.voucherify.client.model.ValidationRulesAssignmentsCreateRequestBody assignmentsCreateRequestBody) throws io.voucherify.client.ApiException
      Creates a new validation rule assignment by calling the underlying validation rules API.
      Parameters:
      validationRuleId - the ID of the validation rule to be assigned.
      force - a boolean indicating whether to force the creation of the assignment, even if conflicts occur.
      assignmentsCreateRequestBody - the request body containing the assignment details.
      Returns:
      a ValidationRulesAssignmentsCreateResponseBody object containing the response details of the created validation rule assignment.
      Throws:
      io.voucherify.client.ApiException - if an error occurs while creating the validation rule assignment.
    • addPromotionTiersToCampaign

      public io.voucherify.client.model.PromotionsTiersCreateResponseBody addPromotionTiersToCampaign(String campaignId, io.voucherify.client.model.PromotionsTiersCreateRequestBody promotionsTiersCreateRequestBody) throws io.voucherify.client.ApiException
      Creates promotion tiers and adds them to a specific campaign.

      This method interacts with the external promotions API to add promotion tiers to the specified campaign. The request body contains the details for the tiers to be added, and the method returns a response containing the result of the operation.

      Parameters:
      campaignId - The ID of the campaign to which the promotion tiers will be added.
      promotionsTiersCreateRequestBody - The request body containing the details of the promotion tiers.
      Returns:
      PromotionsTiersCreateResponseBody The response body containing the details of the created promotion tiers.
      Throws:
      io.voucherify.client.ApiException - If there is an error while interacting with the API or if the API returns an error response.
    • createProductCollection

      public io.voucherify.client.model.ProductCollectionsCreateResponseBody createProductCollection(io.voucherify.client.model.ProductCollectionsCreateRequestBody productCollectionsCreateRequestBody) throws io.voucherify.client.ApiException
      Creates promotion tiers by invoking the Product Collections API.
      Parameters:
      productCollectionsCreateRequestBody - the request body containing details for creating product collections and promotion tiers.
      Returns:
      a ProductCollectionsCreateResponseBody object containing the response details from the Product Collections API.
      Throws:
      io.voucherify.client.ApiException - if an error occurs while invoking the API.
    • deleteValidationRule

      public void deleteValidationRule(String validationRuleId) throws io.voucherify.client.ApiException
      Deletes a validation rule by its ID.

      This method interacts with the validationRulesApi to delete a validation rule specified by the provided validationRuleId. If the operation fails, an ApiException is thrown.

      Parameters:
      validationRuleId - the unique identifier of the validation rule to be deleted
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the deletion process
    • deleteValidationRuleAssignment

      public void deleteValidationRuleAssignment(String validationRuleId, String assignmentId) throws io.voucherify.client.ApiException
      Deletes the assignment of a validation rule.

      This method removes the association between a validation rule and an assignment by invoking the appropriate API. If the deletion fails, an ApiException is thrown to indicate the error.

      Parameters:
      validationRuleId - the unique identifier of the validation rule to be deleted
      assignmentId - the unique identifier of the assignment to be removed
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the deletion process
    • updateValidationRuleAssignment

      public io.voucherify.client.model.ValidationRulesUpdateResponseBody updateValidationRuleAssignment(String validationRuleId, io.voucherify.client.model.ValidationRulesUpdateRequestBody validationRulesUpdateRequestBody) throws io.voucherify.client.ApiException
      Updates the validation rule assignment in Voucherify using the provided validation rule ID and the update request body. It calls the underlying API method to perform the update.
      Parameters:
      validationRuleId - The ID of the validation rule to update.
      validationRulesUpdateRequestBody - The request body containing the updated validation rule data.
      Returns:
      The response from the API containing the updated validation rule data.
      Throws:
      io.voucherify.client.ApiException - If there is an error while making the API call.
    • updateVoucher

      public io.voucherify.client.model.VouchersUpdateResponseBody updateVoucher(String voucherCode, io.voucherify.client.model.VouchersUpdateRequestBody vouchersUpdateRequestBody) throws io.voucherify.client.ApiException
      This method invokes voucherify api and update voucher
      Parameters:
      voucherCode - String Voucher Code
      vouchersUpdateRequestBody - VouchersUpdateRequestBody Update Voucher Request
      Returns:
      VouchersUpdateResponseBody Update Voucher Response
      Throws:
      io.voucherify.client.ApiException - throw exception in case of execution issue
    • getMetadataSchema

      public io.voucherify.client.model.ManagementProjectsMetadataSchemasListResponseBody getMetadataSchema(String projectId) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to retrieve the metadata schemas for a project.
      Parameters:
      projectId - the project identifier
      Returns:
      the response body containing the list of metadata schemas
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call
    • updateMetadataSchema

      public io.voucherify.client.model.ManagementProjectsMetadataSchemasUpdateResponseBody updateMetadataSchema(String projectId, String metadataSchemaId, io.voucherify.client.model.ManagementProjectsMetadataSchemasUpdateRequestBody metadataSchemasUpdateRequestBody) throws io.voucherify.client.ApiException
      This method invokes the Voucherify Management API to update the metadata schema for a project.
      Parameters:
      projectId - the project identifier
      metadataSchemaId - the metadata schema identifier
      metadataSchemasUpdateRequestBody - the request body containing the updated metadata schema details
      Returns:
      the response body containing the updated metadata schema details
      Throws:
      io.voucherify.client.ApiException - if an error occurs during the API call