voucherify 8.0.3 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/ENDPOINTS-COVERAGE.md +123 -111
- data/Gemfile.lock +19 -17
- data/README.md +218 -75
- data/VoucherifySdk.gemspec +1 -1
- data/__tests__/README.md +18 -0
- data/__tests__/lib/campaigns.rb +53 -1
- data/__tests__/lib/config.rb +21 -0
- data/__tests__/lib/loyalties.rb +2 -2
- data/__tests__/lib/utils.rb +27 -1
- data/__tests__/spec/02_campaigns_spec.rb +33 -2
- data/__tests__/spec/04_publications_spec.rb +16 -3
- data/__tests__/spec/07_vouchers_spec.rb +22 -3
- data/__tests__/spec/13_management_spec.rb +110 -0
- data/__tests__/spec/14_additional_properties_spec.rb +28 -0
- data/__tests__/spec/support/get_snapshot_without_uniq_keys.rb +1 -1
- data/docs/ApplicableTo.md +18 -2
- data/docs/ApplicableToOrderItemUnitsItem.md +2 -1
- data/docs/AsyncActionsApi.md +2 -2
- data/docs/AsyncActionsListResponseBody.md +1 -0
- data/docs/Bundle.md +11 -0
- data/docs/BundleIdentifiedItem.md +11 -0
- data/docs/BundleMissingItem.md +10 -0
- data/docs/Campaign.md +4 -4
- data/docs/CampaignBase.md +4 -4
- data/docs/CampaignLoyaltyCardExpirationRules.md +6 -4
- data/docs/CampaignsApi.md +209 -12
- data/docs/CampaignsCreateRequestBody.md +2 -2
- data/docs/CampaignsCreateResponseBody.md +4 -4
- data/docs/CampaignsGetResponseBody.md +4 -4
- data/docs/CampaignsImportVoucherItem.md +1 -1
- data/docs/CampaignsSummaryGetResponseBody.md +48 -0
- data/docs/CampaignsTransactionsExportCreateRequestBody.md +8 -0
- data/docs/CampaignsTransactionsExportCreateRequestBodyParameters.md +10 -0
- data/docs/CampaignsTransactionsExportCreateResponseBody.md +16 -0
- data/docs/CampaignsTransactionsExportCreateResponseBodyParameters.md +10 -0
- data/docs/CampaignsTransactionsExportCreateResponseBodyParametersFilters.md +11 -0
- data/docs/CampaignsTransactionsExportCreateResponseBodyParametersFiltersCampaignId.md +8 -0
- data/docs/CampaignsTransactionsExportCreateResponseBodyParametersFiltersCampaignIdConditions.md +8 -0
- data/docs/CampaignsTransactionsExportCreateResponseBodyResult.md +8 -0
- data/docs/CampaignsTransactionsListResponseBody.md +12 -0
- data/docs/CampaignsUpdateRequestBody.md +1 -1
- data/docs/CampaignsUpdateResponseBody.md +4 -4
- data/docs/CampaignsVouchersCreateCombinedResponseBodyGift.md +3 -2
- data/docs/CampaignsVouchersCreateCombinedResponseBodyLoyaltyCard.md +5 -3
- data/docs/CampaignsVouchersCreateResponseBodyGift.md +3 -2
- data/docs/CampaignsVouchersCreateResponseBodyLoyaltyCard.md +5 -3
- data/docs/CategoriesApi.md +1 -1
- data/docs/ClientQualificationsCheckEligibilityRequestBody.md +2 -1
- data/docs/ClientQualificationsCheckEligibilityRequestBodySession.md +8 -0
- data/docs/ClientRedemptionsRedeemRequestBodyOptions.md +1 -1
- data/docs/ClientRedemptionsRedeemRequestBodyRedeemablesItemGift.md +1 -1
- data/docs/ClientSideApi.md +2 -2
- data/docs/ClientValidationsValidateRequestBodyOptions.md +1 -1
- data/docs/ClientValidationsValidateRequestBodyRedeemablesItemGift.md +1 -1
- data/docs/ClientValidationsValidateResponseBody.md +1 -0
- data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResult.md +1 -0
- data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +4 -4
- data/docs/ClientValidationsValidateResponseBodyRedeemablesItemResultGift.md +2 -1
- data/docs/CustomerSummaryOrders.md +3 -3
- data/docs/CustomerSummaryRedemptionsGift.md +2 -2
- data/docs/CustomerWithSummaryLoyaltyReferralsAssets.md +2 -1
- data/docs/CustomersApi.md +10 -10
- data/docs/CustomersCreateResponseBodyAssets.md +2 -1
- data/docs/CustomersGetResponseBodyAssets.md +2 -1
- data/docs/CustomersUpdateResponseBodyAssets.md +2 -1
- data/docs/Discount.md +4 -4
- data/docs/DiscountUnitMultipleOneUnit.md +1 -1
- data/docs/EarningRule.md +1 -0
- data/docs/EarningRuleExpirationRules.md +13 -0
- data/docs/EarningRuleLoyalty.md +1 -0
- data/docs/EarningRuleLoyaltyCustomEventMetadata.md +1 -0
- data/docs/EarningRuleLoyaltyCustomerMetadata.md +1 -0
- data/docs/EarningRuleLoyaltyOrderAmount.md +1 -0
- data/docs/EarningRuleLoyaltyOrderItemsAmount.md +4 -2
- data/docs/EarningRuleLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/EarningRuleLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/EarningRuleLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/EarningRuleLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/EarningRuleLoyaltyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/EarningRuleLoyaltyOrderMetadata.md +1 -0
- data/docs/EarningRuleLoyaltyOrderTotalAmount.md +1 -0
- data/docs/ExportCampaignTransactionsFilters.md +10 -0
- data/docs/ExportParameters.md +1 -0
- data/docs/ExportsApi.md +3 -3
- data/docs/ExportsCreateRequestBodyParameters.md +1 -0
- data/docs/ExportsCreateResponseBodyParameters.md +1 -0
- data/docs/ExportsGetResponseBodyParameters.md +1 -0
- data/docs/Gift.md +3 -2
- data/docs/InapplicableTo.md +18 -2
- data/docs/InapplicableToOrderItemUnitsItem.md +2 -1
- data/docs/LoyaltiesApi.md +264 -67
- data/docs/LoyaltiesCreateCampaignRequestBody.md +2 -2
- data/docs/LoyaltiesCreateCampaignResponseBody.md +1 -1
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItem.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateRequestBodyItemPendingPoints.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBody.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesCreateResponseBodyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBody.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesDisableResponseBodyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBody.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesEnableResponseBodyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesGetResponseBody.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesGetResponseBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBody.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateRequestBodyPendingPoints.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBody.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyalty.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomEventMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyCustomerMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItemsAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItemsAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItemsQuantity.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItemsQuantityApplicableToItem.md +9 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderItemsSubtotalAmount.md +4 -2
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderMetadata.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyLoyaltyOrderTotalAmount.md +1 -0
- data/docs/LoyaltiesEarningRulesUpdateResponseBodyOrderItemsSubtotalAmountApplicableToItem.md +9 -0
- data/docs/LoyaltiesGetCampaignResponseBody.md +1 -1
- data/docs/LoyaltiesMembersCreateResponseBodyLoyaltyCard.md +5 -3
- data/docs/LoyaltiesMembersGetResponseBodyLoyaltyCard.md +5 -3
- data/docs/LoyaltiesMembersPendingPointsActivateResponseBody.md +1 -1
- data/docs/LoyaltiesMembersPendingPointsBalanceRequestBody.md +8 -0
- data/docs/LoyaltiesMembersPendingPointsBalanceResponseBody.md +12 -0
- data/docs/LoyaltiesMembersPendingPointsBalanceResponseBodyRelatedObject.md +9 -0
- data/docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItem.md +1 -1
- data/docs/LoyaltiesMembersRedemptionRedeemRequestBody.md +1 -1
- data/docs/LoyaltiesMembersRedemptionRedeemResponseBody.md +1 -0
- data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyRelatedRedemptionsRollbacksItem.md +1 -0
- data/docs/LoyaltiesMembersRedemptionRedeemResponseBodySession.md +8 -0
- data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherGift.md +3 -2
- data/docs/LoyaltiesMembersRedemptionRedeemResponseBodyVoucherLoyaltyCard.md +5 -3
- data/docs/LoyaltiesMembersTransfersCreateResponseBodyLoyaltyCard.md +5 -3
- data/docs/LoyaltiesPointsExpirationExportCreateRequestBodyParameters.md +1 -1
- data/docs/LoyaltiesRewardAssignmentsRewardGetResponseBody.md +1 -1
- data/docs/LoyaltiesTransactionsExportCreateRequestBody.md +8 -0
- data/docs/LoyaltiesTransactionsExportCreateRequestBodyParameters.md +10 -0
- data/docs/LoyaltiesTransactionsListResponseBody.md +12 -0
- data/docs/LoyaltiesUpdateCampaignRequestBody.md +1 -1
- data/docs/LoyaltiesUpdateCampaignResponseBody.md +1 -1
- data/docs/LoyaltyCampaign.md +1 -1
- data/docs/LoyaltyCardTransaction.md +1 -1
- data/docs/LoyaltyCardTransactionDetailsBalance.md +1 -0
- data/docs/LoyaltyMemberLoyaltyCard.md +5 -3
- data/docs/LoyaltyPointsBucket.md +1 -1
- data/docs/LoyaltyTiersExpirationAll.md +1 -1
- data/docs/ManagementApi.md +22 -22
- data/docs/ManagementProjectsStackingRules.md +14 -8
- data/docs/ManagementProjectsStackingRulesCreateRequestBody.md +14 -8
- data/docs/ManagementProjectsStackingRulesCreateResponseBody.md +14 -8
- data/docs/ManagementProjectsStackingRulesGetResponseBody.md +14 -8
- data/docs/ManagementProjectsStackingRulesUpdateRequestBody.md +14 -8
- data/docs/ManagementProjectsStackingRulesUpdateResponseBody.md +14 -8
- data/docs/ManagementProjectsUsersInviteCreateRequestBody.md +1 -1
- data/docs/ManagementProjectsUsersUpdateRoleRequestBody.md +1 -1
- data/docs/MetadataSchemasApi.md +5 -5
- data/docs/Order.md +1 -1
- data/docs/OrderCalculatedItem.md +1 -1
- data/docs/OrderItem.md +1 -1
- data/docs/OrdersApi.md +3 -3
- data/docs/OrdersCreateRequestBody.md +1 -1
- data/docs/OrdersImportCreateRequestBodyItem.md +2 -2
- data/docs/OrdersUpdateRequestBody.md +1 -1
- data/docs/ParametersFiltersListCampaignTransactions.md +10 -0
- data/docs/ProductCollectionsCreateRequestBody.md +1 -1
- data/docs/ProductsApi.md +22 -22
- data/docs/ProductsSkusCreateRequestBody.md +1 -1
- data/docs/ProductsSkusUpdateRequestBody.md +1 -1
- data/docs/PromotionTierCampaign.md +1 -1
- data/docs/PromotionsTiersCreateResponseBodyCampaign.md +1 -1
- data/docs/PromotionsTiersDisableResponseBodyCampaign.md +1 -1
- data/docs/PromotionsTiersEnableResponseBodyCampaign.md +1 -1
- data/docs/PromotionsTiersGetResponseBodyCampaign.md +1 -1
- data/docs/PromotionsTiersUpdateResponseBodyCampaign.md +1 -1
- data/docs/PublicationsApi.md +7 -7
- data/docs/QualificationsApi.md +1 -1
- data/docs/QualificationsCheckEligibilityRequestBody.md +2 -1
- data/docs/QualificationsCheckEligibilityRequestBodySession.md +8 -0
- data/docs/QualificationsOption.md +1 -1
- data/docs/QualificationsRedeemable.md +1 -1
- data/docs/QualificationsRedeemableBase.md +1 -1
- data/docs/RedeemableGift.md +3 -2
- data/docs/RedeemableLoyaltyCard.md +2 -2
- data/docs/RedeemableResult.md +1 -0
- data/docs/RedeemableVoucherGift.md +3 -2
- data/docs/RedeemableVoucherLoyaltyCard.md +5 -3
- data/docs/Redemption.md +1 -0
- data/docs/RedemptionEntry.md +1 -0
- data/docs/RedemptionEntryPromotionTierCampaign.md +1 -1
- data/docs/RedemptionEntryRelatedRedemptionsRollbacksItem.md +1 -0
- data/docs/RedemptionEntrySession.md +8 -0
- data/docs/RedemptionEntryVoucherGift.md +3 -2
- data/docs/RedemptionEntryVoucherLoyaltyCard.md +5 -3
- data/docs/RedemptionRelatedRedemptionsRollbacksItem.md +1 -0
- data/docs/RedemptionRewardResultParametersCampaign.md +1 -1
- data/docs/RedemptionRollback.md +1 -1
- data/docs/RedemptionSession.md +8 -0
- data/docs/RedemptionVoucherGift.md +3 -2
- data/docs/RedemptionVoucherLoyaltyCard.md +5 -3
- data/docs/RedemptionsApi.md +3 -3
- data/docs/RedemptionsGetResponseBody.md +1 -0
- data/docs/RedemptionsGetResponseBodyPromotionTierCampaign.md +1 -1
- data/docs/RedemptionsGetResponseBodyRelatedRedemptionsRollbacksItem.md +1 -0
- data/docs/RedemptionsGetResponseBodySession.md +8 -0
- data/docs/RedemptionsGetResponseBodyVoucherGift.md +3 -2
- data/docs/RedemptionsGetResponseBodyVoucherLoyaltyCard.md +5 -3
- data/docs/RedemptionsListResponseBodyRedemptionsItem.md +1 -0
- data/docs/RedemptionsListResponseBodyRedemptionsItemPromotionTierCampaign.md +1 -1
- data/docs/RedemptionsListResponseBodyRedemptionsItemRelatedRedemptionsRollbacksItem.md +1 -0
- data/docs/RedemptionsListResponseBodyRedemptionsItemSession.md +8 -0
- data/docs/RedemptionsListResponseBodyRedemptionsItemVoucherGift.md +3 -2
- data/docs/RedemptionsListResponseBodyRedemptionsItemVoucherLoyaltyCard.md +5 -3
- data/docs/RedemptionsRedeemRequestBodyOptions.md +1 -1
- data/docs/RedemptionsRedeemRequestBodyRedeemablesItemGift.md +1 -1
- data/docs/RedemptionsRollbackCreateResponseBody.md +1 -1
- data/docs/ReferralsApi.md +13 -13
- data/docs/Reward.md +1 -1
- data/docs/RewardsCreateRequestBody.md +1 -1
- data/docs/RewardsCreateRequestBodyParametersCampaign.md +1 -1
- data/docs/RewardsCreateResponseBody.md +1 -1
- data/docs/RewardsUpdateRequestBody.md +1 -1
- data/docs/RewardsUpdateRequestBodyParametersCampaign.md +1 -1
- data/docs/RewardsUpdateResponseBody.md +1 -1
- data/docs/SegmentsApi.md +2 -2
- data/docs/SegmentsCreateRequestBody.md +1 -1
- data/docs/SegmentsCreateResponseBody.md +4 -3
- data/docs/SegmentsGetResponseBody.md +4 -3
- data/docs/SimpleLoyaltyCard.md +5 -3
- data/docs/SimpleVoucherRedemption.md +1 -0
- data/docs/StackingRules.md +15 -11
- data/docs/TemplatesApi.md +7 -7
- data/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +2 -2
- data/docs/TrashBinItem.md +1 -1
- data/docs/ValidationRule.md +1 -0
- data/docs/ValidationRulesApi.md +3 -3
- data/docs/ValidationRulesCreateRequestBody.md +1 -0
- data/docs/ValidationRulesCreateResponseBody.md +1 -0
- data/docs/ValidationRulesGetResponseBody.md +1 -0
- data/docs/ValidationRulesUpdateRequestBody.md +1 -0
- data/docs/ValidationRulesUpdateResponseBody.md +1 -0
- data/docs/ValidationsApi.md +1 -1
- data/docs/ValidationsRedeemableInapplicableResult.md +1 -0
- data/docs/ValidationsValidateRequestBodyOptions.md +1 -1
- data/docs/ValidationsValidateRequestBodyRedeemablesItemGift.md +1 -1
- data/docs/ValidationsValidateResponseBody.md +1 -0
- data/docs/ValidationsValidateResponseBodyRedeemablesItemResult.md +1 -0
- data/docs/ValidationsValidateResponseBodyRedeemablesItemResultDiscount.md +4 -4
- data/docs/ValidationsValidateResponseBodyRedeemablesItemResultGift.md +2 -1
- data/docs/ValidityHours.md +1 -1
- data/docs/VoucherBalance.md +1 -0
- data/docs/VoucherGift.md +3 -2
- data/docs/VoucherLoyaltyCard.md +5 -3
- data/docs/VoucherTransaction.md +1 -1
- data/docs/VoucherTransactionDetailsBalance.md +1 -0
- data/docs/VoucherTransactionsExportParameters.md +1 -1
- data/docs/VoucherTransactionsFilters.md +1 -1
- data/docs/VoucherWithCategoriesGift.md +3 -2
- data/docs/VoucherWithCategoriesLoyaltyCard.md +5 -3
- data/docs/VouchersApi.md +16 -14
- data/docs/VouchersBalanceUpdateRequestBody.md +1 -1
- data/docs/VouchersBalanceUpdateResponseBody.md +2 -2
- data/docs/VouchersCreateRequestBody.md +2 -2
- data/docs/VouchersCreateResponseBodyGift.md +3 -2
- data/docs/VouchersCreateResponseBodyLoyaltyCard.md +5 -3
- data/docs/VouchersCreateWithSpecificCodeRequestBody.md +2 -2
- data/docs/VouchersDisableResponseBodyGift.md +3 -2
- data/docs/VouchersDisableResponseBodyLoyaltyCard.md +5 -3
- data/docs/VouchersEnableResponseBodyGift.md +3 -2
- data/docs/VouchersEnableResponseBodyLoyaltyCard.md +5 -3
- data/docs/VouchersGetResponseBodyGift.md +3 -2
- data/docs/VouchersGetResponseBodyLoyaltyCard.md +5 -3
- data/docs/VouchersImportCreateItemRequestBody.md +1 -1
- data/docs/VouchersTransactionsExportCreateResponseBodyResult.md +1 -1
- data/docs/VouchersUpdateRequestBody.md +2 -2
- data/docs/VouchersUpdateResponseBodyGift.md +3 -2
- data/docs/VouchersUpdateResponseBodyLoyaltyCard.md +5 -3
- data/lib/VoucherifySdk/api/async_actions_api.rb +4 -4
- data/lib/VoucherifySdk/api/campaigns_api.rb +220 -18
- data/lib/VoucherifySdk/api/categories_api.rb +2 -2
- data/lib/VoucherifySdk/api/client_side_api.rb +4 -4
- data/lib/VoucherifySdk/api/customers_api.rb +14 -14
- data/lib/VoucherifySdk/api/exports_api.rb +6 -6
- data/lib/VoucherifySdk/api/loyalties_api.rb +277 -72
- data/lib/VoucherifySdk/api/management_api.rb +44 -44
- data/lib/VoucherifySdk/api/metadata_schemas_api.rb +6 -6
- data/lib/VoucherifySdk/api/orders_api.rb +6 -6
- data/lib/VoucherifySdk/api/products_api.rb +30 -30
- data/lib/VoucherifySdk/api/publications_api.rb +8 -8
- data/lib/VoucherifySdk/api/qualifications_api.rb +2 -2
- data/lib/VoucherifySdk/api/redemptions_api.rb +6 -6
- data/lib/VoucherifySdk/api/referrals_api.rb +14 -14
- data/lib/VoucherifySdk/api/segments_api.rb +4 -4
- data/lib/VoucherifySdk/api/templates_api.rb +14 -14
- data/lib/VoucherifySdk/api/validation_rules_api.rb +6 -6
- data/lib/VoucherifySdk/api/validations_api.rb +2 -2
- data/lib/VoucherifySdk/api/vouchers_api.rb +25 -22
- data/lib/VoucherifySdk/models/access_settings_campaign_assignments_list.rb +1 -1
- data/lib/VoucherifySdk/models/applicable_to.rb +192 -16
- data/lib/VoucherifySdk/models/applicable_to_order_item_units_item.rb +20 -5
- data/lib/VoucherifySdk/models/async_actions_list_response_body.rb +16 -5
- data/lib/VoucherifySdk/models/bundle.rb +267 -0
- data/lib/VoucherifySdk/models/bundle_identified_item.rb +296 -0
- data/lib/VoucherifySdk/models/bundle_missing_item.rb +274 -0
- data/lib/VoucherifySdk/models/campaign.rb +4 -4
- data/lib/VoucherifySdk/models/campaign_base.rb +4 -4
- data/lib/VoucherifySdk/models/campaign_loyalty_card_expiration_rules.rb +53 -10
- data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +3 -3
- data/lib/VoucherifySdk/models/campaigns_create_response_body.rb +4 -4
- data/lib/VoucherifySdk/models/campaigns_get_response_body.rb +4 -4
- data/lib/VoucherifySdk/models/campaigns_import_voucher_item.rb +1 -1
- data/lib/VoucherifySdk/models/campaigns_summary_get_response_body.rb +673 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_request_body.rb +209 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_request_body_parameters.rb +256 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body.rb +334 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body_parameters.rb +256 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body_parameters_filters.rb +257 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body_parameters_filters_campaign_id.rb +209 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body_parameters_filters_campaign_id_conditions.rb +221 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_export_create_response_body_result.rb +210 -0
- data/lib/VoucherifySdk/models/campaigns_transactions_list_response_body.rb +286 -0
- data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/campaigns_update_response_body.rb +4 -4
- data/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/campaigns_vouchers_create_combined_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/campaigns_vouchers_create_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/client_qualifications_check_eligibility_request_body.rb +12 -2
- data/lib/VoucherifySdk/models/client_qualifications_check_eligibility_request_body_session.rb +236 -0
- data/lib/VoucherifySdk/models/client_redemptions_redeem_request_body_options.rb +1 -1
- data/lib/VoucherifySdk/models/client_redemptions_redeem_request_body_redeemables_item_gift.rb +1 -1
- data/lib/VoucherifySdk/models/client_validations_validate_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/client_validations_validate_request_body_options.rb +1 -1
- data/lib/VoucherifySdk/models/client_validations_validate_request_body_redeemables_item_gift.rb +1 -1
- data/lib/VoucherifySdk/models/client_validations_validate_response_body.rb +12 -1
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result.rb +11 -1
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_discount.rb +5 -2
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_gift.rb +14 -3
- data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item_result_loyalty_card.rb +1 -0
- data/lib/VoucherifySdk/models/create_publication_campaign.rb +3 -3
- data/lib/VoucherifySdk/models/customer_summary_orders.rb +4 -3
- data/lib/VoucherifySdk/models/customer_summary_redemptions_gift.rb +2 -2
- data/lib/VoucherifySdk/models/customer_with_summary_loyalty_referrals_assets.rb +18 -7
- data/lib/VoucherifySdk/models/customers_create_response_body_assets.rb +18 -7
- data/lib/VoucherifySdk/models/customers_get_response_body_assets.rb +18 -7
- data/lib/VoucherifySdk/models/customers_update_response_body_assets.rb +18 -7
- data/lib/VoucherifySdk/models/discount.rb +5 -2
- data/lib/VoucherifySdk/models/discount_unit_multiple_one_unit.rb +1 -1
- data/lib/VoucherifySdk/models/earning_rule.rb +10 -1
- data/lib/VoucherifySdk/models/earning_rule_expiration_rules.rb +313 -0
- data/lib/VoucherifySdk/models/earning_rule_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/earning_rule_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/earning_rule_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/earning_rule_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/export_campaign_transactions_filters.rb +248 -0
- data/lib/VoucherifySdk/models/export_parameters.rb +16 -5
- data/lib/VoucherifySdk/models/exports_create_request_body_parameters.rb +16 -5
- data/lib/VoucherifySdk/models/exports_create_response_body_parameters.rb +16 -5
- data/lib/VoucherifySdk/models/exports_get_response_body.rb +0 -1
- data/lib/VoucherifySdk/models/exports_get_response_body_parameters.rb +16 -5
- data/lib/VoucherifySdk/models/filter_conditions_date_time.rb +2 -2
- data/lib/VoucherifySdk/models/gift.rb +14 -3
- data/lib/VoucherifySdk/models/inapplicable_to.rb +192 -16
- data/lib/VoucherifySdk/models/inapplicable_to_order_item_units_item.rb +20 -5
- data/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +3 -3
- data/lib/VoucherifySdk/models/loyalties_create_campaign_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item.rb +22 -3
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_request_body_item_pending_points.rb +257 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body.rb +10 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_create_response_body_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body.rb +10 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_disable_response_body_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body.rb +10 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_enable_response_body_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body.rb +10 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_get_response_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body.rb +22 -3
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_request_body_pending_points.rb +257 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body.rb +10 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_custom_event_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_customer_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_items_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_items_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_items_quantity.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_items_quantity_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_items_subtotal_amount.rb +31 -7
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_metadata.rb +12 -1
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_loyalty_order_total_amount.rb +16 -5
- data/lib/VoucherifySdk/models/loyalties_earning_rules_update_response_body_order_items_subtotal_amount_applicable_to_item.rb +242 -0
- data/lib/VoucherifySdk/models/loyalties_get_campaign_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_create_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/loyalties_members_create_response_body_publish.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_get_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/loyalties_members_get_response_body_publish.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_pending_points_activate_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_pending_points_balance_request_body.rb +210 -0
- data/lib/VoucherifySdk/models/loyalties_members_pending_points_balance_response_body.rb +283 -0
- data/lib/VoucherifySdk/models/loyalties_members_pending_points_balance_response_body_related_object.rb +247 -0
- data/lib/VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body.rb +11 -1
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_related_redemptions_rollbacks_item.rb +38 -4
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_session.rb +210 -0
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/loyalties_members_redemption_redeem_response_body_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/loyalties_members_transfers_create_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/loyalties_points_expiration_export_create_request_body_parameters.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_reward_assignments_reward_get_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_transactions_export_create_request_body.rb +209 -0
- data/lib/VoucherifySdk/models/loyalties_transactions_export_create_request_body_parameters.rb +256 -0
- data/lib/VoucherifySdk/models/loyalties_transactions_list_response_body.rb +286 -0
- data/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalties_update_campaign_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/loyalty_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/loyalty_card_transaction.rb +1 -1
- data/lib/VoucherifySdk/models/loyalty_card_transaction_details_balance.rb +12 -1
- data/lib/VoucherifySdk/models/loyalty_member_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/loyalty_member_publish.rb +1 -1
- data/lib/VoucherifySdk/models/loyalty_points_bucket.rb +1 -1
- data/lib/VoucherifySdk/models/loyalty_tiers_expiration_all.rb +1 -1
- data/lib/VoucherifySdk/models/management_projects_stacking_rules.rb +112 -9
- data/lib/VoucherifySdk/models/management_projects_stacking_rules_create_request_body.rb +116 -13
- data/lib/VoucherifySdk/models/management_projects_stacking_rules_create_response_body.rb +112 -9
- data/lib/VoucherifySdk/models/management_projects_stacking_rules_get_response_body.rb +112 -9
- data/lib/VoucherifySdk/models/management_projects_stacking_rules_update_request_body.rb +116 -13
- data/lib/VoucherifySdk/models/management_projects_stacking_rules_update_response_body.rb +112 -9
- data/lib/VoucherifySdk/models/management_projects_users_invite_create_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/management_projects_users_update_role_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/order.rb +1 -1
- data/lib/VoucherifySdk/models/order_calculated_item.rb +1 -1
- data/lib/VoucherifySdk/models/order_item.rb +1 -1
- data/lib/VoucherifySdk/models/orders_create_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb +15 -15
- data/lib/VoucherifySdk/models/orders_update_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/parameter_filters_list_campaigns_campaign_status.rb +2 -1
- data/lib/VoucherifySdk/models/parameter_filters_list_campaigns_campaign_status_conditions.rb +1 -0
- data/lib/VoucherifySdk/models/parameter_filters_list_campaigns_category_ids.rb +1 -1
- data/lib/VoucherifySdk/models/parameter_filters_list_campaigns_is_referral_code.rb +1 -1
- data/lib/VoucherifySdk/models/parameters_filters_list_campaign_transactions.rb +247 -0
- data/lib/VoucherifySdk/models/product_collections_create_request_body.rb +2 -4
- data/lib/VoucherifySdk/models/products_skus_create_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/products_skus_create_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/products_skus_list_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/products_skus_update_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/promotion_tier_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/promotions_tiers_create_response_body_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/promotions_tiers_disable_response_body_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/promotions_tiers_enable_response_body_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/promotions_tiers_get_response_body_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/promotions_tiers_update_response_body_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/qualifications_check_eligibility_request_body.rb +12 -2
- data/lib/VoucherifySdk/models/qualifications_check_eligibility_request_body_session.rb +236 -0
- data/lib/VoucherifySdk/models/qualifications_option.rb +1 -1
- data/lib/VoucherifySdk/models/qualifications_option_filters_resource_type_conditions.rb +1 -1
- data/lib/VoucherifySdk/models/qualifications_redeemable.rb +1 -1
- data/lib/VoucherifySdk/models/qualifications_redeemable_base.rb +1 -1
- data/lib/VoucherifySdk/models/redeemable_gift.rb +18 -7
- data/lib/VoucherifySdk/models/redeemable_loyalty_card.rb +2 -2
- data/lib/VoucherifySdk/models/redeemable_result.rb +10 -1
- data/lib/VoucherifySdk/models/redeemable_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/redeemable_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/redeemable_voucher_publish.rb +1 -1
- data/lib/VoucherifySdk/models/redemption.rb +11 -1
- data/lib/VoucherifySdk/models/redemption_entry.rb +11 -1
- data/lib/VoucherifySdk/models/redemption_entry_promotion_tier_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/redemption_entry_related_redemptions_rollbacks_item.rb +38 -4
- data/lib/VoucherifySdk/models/redemption_entry_session.rb +210 -0
- data/lib/VoucherifySdk/models/redemption_entry_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/redemption_entry_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/redemption_related_redemptions_rollbacks_item.rb +38 -4
- data/lib/VoucherifySdk/models/redemption_reward_result_parameters_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/redemption_rollback.rb +15 -15
- data/lib/VoucherifySdk/models/redemption_session.rb +210 -0
- data/lib/VoucherifySdk/models/redemption_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/redemption_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/redemptions_get_response_body.rb +11 -1
- data/lib/VoucherifySdk/models/redemptions_get_response_body_promotion_tier_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/redemptions_get_response_body_related_redemptions_rollbacks_item.rb +38 -4
- data/lib/VoucherifySdk/models/redemptions_get_response_body_session.rb +210 -0
- data/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/redemptions_get_response_body_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item.rb +11 -1
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_promotion_tier_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_related_redemptions.rb +0 -1
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_related_redemptions_rollbacks_item.rb +38 -4
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_session.rb +210 -0
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/redemptions_redeem_request_body_options.rb +1 -1
- data/lib/VoucherifySdk/models/redemptions_redeem_request_body_redeemables_item_gift.rb +1 -1
- data/lib/VoucherifySdk/models/redemptions_rollback_create_response_body.rb +15 -15
- data/lib/VoucherifySdk/models/reward.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_create_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_create_request_body_parameters_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_create_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_update_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_update_request_body_parameters_campaign.rb +1 -1
- data/lib/VoucherifySdk/models/rewards_update_response_body.rb +1 -1
- data/lib/VoucherifySdk/models/segments_create_request_body.rb +2 -2
- data/lib/VoucherifySdk/models/segments_create_response_body.rb +31 -20
- data/lib/VoucherifySdk/models/segments_get_response_body.rb +32 -21
- data/lib/VoucherifySdk/models/simple_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/simple_voucher_redemption.rb +16 -5
- data/lib/VoucherifySdk/models/stacking_rules.rb +72 -20
- data/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +3 -3
- data/lib/VoucherifySdk/models/trash_bin_item.rb +1 -1
- data/lib/VoucherifySdk/models/validation_rule.rb +11 -1
- data/lib/VoucherifySdk/models/validation_rules_create_request_body.rb +11 -1
- data/lib/VoucherifySdk/models/validation_rules_create_response_body.rb +11 -1
- data/lib/VoucherifySdk/models/validation_rules_get_response_body.rb +11 -1
- data/lib/VoucherifySdk/models/validation_rules_update_request_body.rb +11 -1
- data/lib/VoucherifySdk/models/validation_rules_update_response_body.rb +11 -1
- data/lib/VoucherifySdk/models/validations_redeemable_inapplicable_result.rb +14 -5
- data/lib/VoucherifySdk/models/validations_validate_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/validations_validate_request_body_options.rb +1 -1
- data/lib/VoucherifySdk/models/validations_validate_request_body_redeemables_item_gift.rb +1 -1
- data/lib/VoucherifySdk/models/validations_validate_response_body.rb +12 -1
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result.rb +11 -1
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_discount.rb +5 -2
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_gift.rb +14 -3
- data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item_result_loyalty_card.rb +1 -0
- data/lib/VoucherifySdk/models/validity_hours.rb +1 -1
- data/lib/VoucherifySdk/models/validity_hours_daily_item.rb +1 -1
- data/lib/VoucherifySdk/models/voucher_balance.rb +12 -1
- data/lib/VoucherifySdk/models/voucher_gift.rb +14 -3
- data/lib/VoucherifySdk/models/voucher_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/voucher_transaction.rb +1 -1
- data/lib/VoucherifySdk/models/voucher_transaction_details_balance.rb +12 -1
- data/lib/VoucherifySdk/models/voucher_transactions_export_parameters.rb +1 -1
- data/lib/VoucherifySdk/models/voucher_transactions_filters.rb +1 -1
- data/lib/VoucherifySdk/models/voucher_with_categories_gift.rb +14 -3
- data/lib/VoucherifySdk/models/voucher_with_categories_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/vouchers_balance_update_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/vouchers_balance_update_response_body.rb +2 -2
- data/lib/VoucherifySdk/models/vouchers_create_request_body.rb +2 -2
- data/lib/VoucherifySdk/models/vouchers_create_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/vouchers_create_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/vouchers_create_with_specific_code_request_body.rb +2 -2
- data/lib/VoucherifySdk/models/vouchers_disable_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/vouchers_disable_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/vouchers_enable_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/vouchers_enable_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/vouchers_get_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/vouchers_get_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/models/vouchers_import_create_item_request_body.rb +1 -1
- data/lib/VoucherifySdk/models/vouchers_transactions_export_create_response_body_result.rb +1 -1
- data/lib/VoucherifySdk/models/vouchers_update_request_body.rb +2 -2
- data/lib/VoucherifySdk/models/vouchers_update_response_body_gift.rb +14 -3
- data/lib/VoucherifySdk/models/vouchers_update_response_body_loyalty_card.rb +30 -8
- data/lib/VoucherifySdk/version.rb +1 -1
- data/lib/VoucherifySdk.rb +55 -0
- metadata +147 -33
data/VoucherifySdk.gemspec
CHANGED
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
|
23
23
|
s.email = ['pawel.rychlik@rspective.pl']
|
|
24
24
|
|
|
25
25
|
s.summary = %q{Ruby SDK for Voucherify. More info on http://www.voucherify.io}
|
|
26
|
-
s.homepage = 'https://github.com/voucherifyio/
|
|
26
|
+
s.homepage = 'https://github.com/voucherifyio/voucherify-ruby-sdk'
|
|
27
27
|
s.license = 'MIT'
|
|
28
28
|
s.required_ruby_version = ">= 2.7"
|
|
29
29
|
|
data/__tests__/README.md
CHANGED
|
@@ -9,6 +9,16 @@ The primary reason for this approach is to ensure that the most critical aspects
|
|
|
9
9
|
We strongly recommend running the tests using the Dockerfile provided in the root directory.
|
|
10
10
|
If you prefer to run tests locally, here are the steps you need to follow.
|
|
11
11
|
|
|
12
|
+
### Environment variables
|
|
13
|
+
|
|
14
|
+
Create `sdks/ruby/.env` (you can copy `sdks/ruby/.env.example`) and set:
|
|
15
|
+
|
|
16
|
+
- `VOUCHERIFY_HOST`
|
|
17
|
+
- `X_APP_ID`
|
|
18
|
+
- `X_APP_TOKEN`
|
|
19
|
+
- `X_MANAGEMENT_ID`
|
|
20
|
+
- `X_MANAGEMENT_TOKEN`
|
|
21
|
+
|
|
12
22
|
### Requirements
|
|
13
23
|
|
|
14
24
|
- all elements described in [main README.md](../README.md) like Ruby and Gem manager
|
|
@@ -23,6 +33,14 @@ If you prefer to run tests locally, here are the steps you need to follow.
|
|
|
23
33
|
4. Go into `__tests__` directory
|
|
24
34
|
5. Run `rspec ./spec` command
|
|
25
35
|
|
|
36
|
+
### Running with Docker (recommended)
|
|
37
|
+
|
|
38
|
+
1. Go into `sdks/ruby` directory
|
|
39
|
+
2. Build image: `docker build -t ruby .`
|
|
40
|
+
3. Run tests: `docker run --rm ruby`
|
|
41
|
+
|
|
42
|
+
From repo root, you can also run: `npm run test-ruby-sdk`.
|
|
43
|
+
|
|
26
44
|
**Note that running tests will affect your Voucherify project data. Run tests only on development projects.**
|
|
27
45
|
|
|
28
46
|
## Contributing
|
data/__tests__/lib/campaigns.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require_relative 'utils.rb'
|
|
2
2
|
require 'VoucherifySdk'
|
|
3
3
|
require 'json'
|
|
4
|
+
require 'tempfile'
|
|
4
5
|
|
|
5
6
|
def create_validation_rule_applicable_to(validation_rules_api_instance, product_id)
|
|
6
7
|
begin
|
|
@@ -144,5 +145,56 @@ def add_vouchers_to_campaign(campaigns_api_instance, campaign_id, voucher_count)
|
|
|
144
145
|
rescue VoucherifySdk::ApiError => e
|
|
145
146
|
return nil
|
|
146
147
|
end
|
|
147
|
-
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def create_discount_campaign_with_expiration(campaigns_api_instance, expiration_date)
|
|
151
|
+
expiration_value = expiration_date.respond_to?(:utc) ? expiration_date.utc.iso8601 : expiration_date
|
|
152
|
+
|
|
153
|
+
campaigns_api_instance.create_campaign({
|
|
154
|
+
campaigns_create_request_body: VoucherifySdk::CampaignsCreateRequestBody.new({
|
|
155
|
+
campaign_type: "DISCOUNT_COUPONS",
|
|
156
|
+
name: generate_random_string(),
|
|
157
|
+
type: "AUTO_UPDATE",
|
|
158
|
+
expiration_date: expiration_value,
|
|
159
|
+
voucher: VoucherifySdk::CampaignsCreateRequestBodyVoucher.new({
|
|
160
|
+
type: 'DISCOUNT_VOUCHER',
|
|
161
|
+
discount: VoucherifySdk::Discount.new({
|
|
162
|
+
type: 'AMOUNT',
|
|
163
|
+
amount_off: 1000
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def update_campaign_expiration_to_null(campaigns_api_instance, campaign_id)
|
|
171
|
+
campaigns_api_instance.update_campaign(campaign_id, {
|
|
172
|
+
campaigns_update_request_body: {
|
|
173
|
+
expiration_date: nil
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
true
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def import_vouchers_to_campaign_using_csv(campaigns_api_instance, campaign_id, voucher_codes)
|
|
180
|
+
file = Tempfile.new(['vouchers_import', '.csv'])
|
|
181
|
+
|
|
182
|
+
begin
|
|
183
|
+
file.write("code\n")
|
|
184
|
+
voucher_codes.each do |code|
|
|
185
|
+
file.write("#{code}\n")
|
|
186
|
+
end
|
|
187
|
+
file.rewind
|
|
188
|
+
|
|
189
|
+
csv_file = File.new(file.path)
|
|
190
|
+
result = campaigns_api_instance.import_vouchers_to_campaign_using_csv(campaign_id, {
|
|
191
|
+
file: csv_file
|
|
192
|
+
})
|
|
193
|
+
csv_file.close
|
|
194
|
+
result
|
|
195
|
+
ensure
|
|
196
|
+
file.close
|
|
197
|
+
file.unlink
|
|
198
|
+
end
|
|
199
|
+
end
|
|
148
200
|
|
data/__tests__/lib/config.rb
CHANGED
|
@@ -60,6 +60,10 @@ module Config
|
|
|
60
60
|
return VoucherifySdk::EventsApi.new()
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
def self.async_actions_api_instance
|
|
64
|
+
return VoucherifySdk::AsyncActionsApi.new()
|
|
65
|
+
end
|
|
66
|
+
|
|
63
67
|
def self.order_api_instance
|
|
64
68
|
return VoucherifySdk::OrdersApi.new()
|
|
65
69
|
end
|
|
@@ -71,5 +75,22 @@ module Config
|
|
|
71
75
|
def self.vouchers_api_instance
|
|
72
76
|
return VoucherifySdk::VouchersApi.new()
|
|
73
77
|
end
|
|
78
|
+
|
|
79
|
+
def self.management_api_instance
|
|
80
|
+
management_config = VoucherifySdk::Configuration.new
|
|
81
|
+
management_config.api_key['X-Management-Id'] = ENV['X_MANAGEMENT_ID']
|
|
82
|
+
management_config.api_key['X-Management-Token'] = ENV['X_MANAGEMENT_TOKEN']
|
|
83
|
+
management_config.host = ENV['VOUCHERIFY_HOST'] || 'https://api.voucherify.io'
|
|
84
|
+
|
|
85
|
+
return VoucherifySdk::ManagementApi.new(VoucherifySdk::ApiClient.new(management_config))
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def self.management_credentials_configured?
|
|
89
|
+
return !ENV['X_MANAGEMENT_ID'].to_s.empty? && !ENV['X_MANAGEMENT_TOKEN'].to_s.empty?
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def self.management_project_id
|
|
93
|
+
return ENV['PROJECT_ID']
|
|
94
|
+
end
|
|
74
95
|
end
|
|
75
96
|
|
data/__tests__/lib/loyalties.rb
CHANGED
|
@@ -12,7 +12,7 @@ def update_loyalty_card_balance(loyalties_api_instance, memberId)
|
|
|
12
12
|
return updated_loyalty_member_card
|
|
13
13
|
|
|
14
14
|
rescue VoucherifySdk::ApiError => e
|
|
15
|
-
|
|
15
|
+
return nil
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -28,5 +28,5 @@ def list_loyalty_card_transactions(loyalties_api_instance, memberId)
|
|
|
28
28
|
|
|
29
29
|
rescue VoucherifySdk::ApiError => e
|
|
30
30
|
return nil
|
|
31
|
-
end
|
|
31
|
+
end
|
|
32
32
|
end
|
data/__tests__/lib/utils.rb
CHANGED
|
@@ -6,4 +6,30 @@ end
|
|
|
6
6
|
|
|
7
7
|
def generate_random_voucher_codes(base_code, count, length=6)
|
|
8
8
|
(1..count).map { "#{base_code}-#{generate_random_string(length)}" }
|
|
9
|
-
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Polls the async actions endpoint until the action reaches a terminal state.
|
|
12
|
+
# Returns the final AsyncActionGetResponseBody when it succeeds, raises otherwise.
|
|
13
|
+
def wait_for_async_action(async_actions_api_instance, async_action_id, max_attempts: 10, delay_seconds: 2)
|
|
14
|
+
attempt = 0
|
|
15
|
+
|
|
16
|
+
loop do
|
|
17
|
+
attempt += 1
|
|
18
|
+
sleep(delay_seconds)
|
|
19
|
+
|
|
20
|
+
action = async_actions_api_instance.get_async_action(async_action_id)
|
|
21
|
+
|
|
22
|
+
operation_status = action.operation_status.to_s.upcase
|
|
23
|
+
status = action.status.to_s.upcase
|
|
24
|
+
|
|
25
|
+
return action if operation_status == 'SUCCESS' || status == 'DONE'
|
|
26
|
+
|
|
27
|
+
if operation_status == 'FAILED' || status == 'FAILED'
|
|
28
|
+
raise "Async action #{async_action_id} failed (status=#{status}, operation_status=#{operation_status})"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
if attempt >= max_attempts
|
|
32
|
+
raise "Async action #{async_action_id} did not finish after #{max_attempts} attempts (status=#{status}, operation_status=#{operation_status})"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -9,6 +9,7 @@ RSpec.describe 'Campaigns API', :order => :defined do
|
|
|
9
9
|
before(:each) do
|
|
10
10
|
@campaigns_api_instance = Config.campaigns_api_instance()
|
|
11
11
|
@validation_rules_api_instance = Config.validation_rules_api_instance()
|
|
12
|
+
@async_actions_api_instance = Config.async_actions_api_instance()
|
|
12
13
|
@voucherify_data = VoucherifyData.instance()
|
|
13
14
|
end
|
|
14
15
|
|
|
@@ -44,7 +45,7 @@ RSpec.describe 'Campaigns API', :order => :defined do
|
|
|
44
45
|
@voucherify_data.set_discount_campaign(created_discount_campaign)
|
|
45
46
|
end
|
|
46
47
|
|
|
47
|
-
it 'create a promotion campaign', :order => :
|
|
48
|
+
it 'create a promotion campaign', :order => :third do
|
|
48
49
|
created_promotion_campaign = create_promotion_campaign(@campaigns_api_instance)
|
|
49
50
|
|
|
50
51
|
snapshot_name = 'campaigns/created_promotion_campaign'
|
|
@@ -125,9 +126,39 @@ RSpec.describe 'Campaigns API', :order => :defined do
|
|
|
125
126
|
expect(validate_deep_match(filtered_validation_rule_snapshot, validation_rule)).to be true
|
|
126
127
|
|
|
127
128
|
voucher = @campaigns_api_instance.add_vouchers_to_campaign(campaign.id, {
|
|
128
|
-
|
|
129
|
+
vouchers_count: 1,
|
|
129
130
|
})
|
|
130
131
|
|
|
131
132
|
@voucherify_data.set_voucher_with_more_than_validation_rule(voucher)
|
|
132
133
|
end
|
|
134
|
+
|
|
135
|
+
it 'import vouchers to campaign using csv', :order => :tenth do
|
|
136
|
+
voucher_codes = Array.new(3) { generate_random_string(8) }
|
|
137
|
+
imported_vouchers = import_vouchers_to_campaign_using_csv(@campaigns_api_instance, $created_discount_campaign.id, voucher_codes)
|
|
138
|
+
|
|
139
|
+
expect(imported_vouchers).not_to be_nil
|
|
140
|
+
expect(imported_vouchers.async_action_id).not_to be_nil
|
|
141
|
+
|
|
142
|
+
finished_action = wait_for_async_action(@async_actions_api_instance, imported_vouchers.async_action_id)
|
|
143
|
+
|
|
144
|
+
expect(finished_action).not_to be_nil
|
|
145
|
+
expect(finished_action.id).to eq(imported_vouchers.async_action_id)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
it 'update campaign expiration_date to null', :order => :eleventh do
|
|
149
|
+
expiration_date = Time.now.utc + 86400
|
|
150
|
+
created_campaign = create_discount_campaign_with_expiration(@campaigns_api_instance, expiration_date)
|
|
151
|
+
|
|
152
|
+
expect(created_campaign).not_to be_nil
|
|
153
|
+
expect(created_campaign.expiration_date).not_to be_nil
|
|
154
|
+
|
|
155
|
+
updated_to_null = update_campaign_expiration_to_null(@campaigns_api_instance, created_campaign.id)
|
|
156
|
+
|
|
157
|
+
expect(updated_to_null).to be true
|
|
158
|
+
|
|
159
|
+
campaign_after_update = @campaigns_api_instance.get_campaign(created_campaign.id)
|
|
160
|
+
|
|
161
|
+
expect(campaign_after_update).not_to be_nil
|
|
162
|
+
expect(campaign_after_update.expiration_date).to be_nil
|
|
163
|
+
end
|
|
133
164
|
end
|
|
@@ -16,9 +16,7 @@ RSpec.describe 'Publications API', :order => :defined do
|
|
|
16
16
|
customer: VoucherifySdk::Customer.new({
|
|
17
17
|
id: @voucherify_data.get_customer().id
|
|
18
18
|
}),
|
|
19
|
-
|
|
20
|
-
name: @voucherify_data.get_discount_campaign().name
|
|
21
|
-
})
|
|
19
|
+
voucher: @voucherify_data.get_voucher().code
|
|
22
20
|
})
|
|
23
21
|
})
|
|
24
22
|
|
|
@@ -28,4 +26,19 @@ RSpec.describe 'Publications API', :order => :defined do
|
|
|
28
26
|
expect(publication).not_to be_nil
|
|
29
27
|
expect(validate_deep_match(filtered_snapshot, publication)).to be true
|
|
30
28
|
end
|
|
29
|
+
|
|
30
|
+
it 'publish loyalty card to customer', :order => :second do
|
|
31
|
+
publication = @publications_api_instance.create_publication({
|
|
32
|
+
join_once: true,
|
|
33
|
+
publications_create_request_body: VoucherifySdk::PublicationsCreateRequestBody.new({
|
|
34
|
+
customer: VoucherifySdk::Customer.new({
|
|
35
|
+
id: @voucherify_data.get_customer().id
|
|
36
|
+
}),
|
|
37
|
+
voucher: @voucherify_data.get_loyalty_card().code
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
expect(publication).not_to be_nil
|
|
42
|
+
expect(publication.voucher.code).to eq(@voucherify_data.get_loyalty_card().code)
|
|
43
|
+
end
|
|
31
44
|
end
|
|
@@ -8,6 +8,7 @@ require_relative 'support/validate_deep_match'
|
|
|
8
8
|
RSpec.describe 'Vouchers API', :order => :defined do
|
|
9
9
|
before(:each) do
|
|
10
10
|
@vouchers_api_instance = Config.vouchers_api_instance()
|
|
11
|
+
@publications_api_instance = Config.publications_api_instance()
|
|
11
12
|
@voucherify_data = VoucherifyData.instance()
|
|
12
13
|
end
|
|
13
14
|
|
|
@@ -31,7 +32,7 @@ RSpec.describe 'Vouchers API', :order => :defined do
|
|
|
31
32
|
expect(validate_deep_match(filtered_snapshot, voucher)).to be true
|
|
32
33
|
end
|
|
33
34
|
|
|
34
|
-
it 'enable voucher previously created', :order => :
|
|
35
|
+
it 'enable voucher previously created', :order => :third do
|
|
35
36
|
voucher = @vouchers_api_instance.enable_voucher(@voucherify_data.get_voucher().code)
|
|
36
37
|
|
|
37
38
|
snapshot_name = 'vouchers/enabled_previously_created_voucher'
|
|
@@ -41,14 +42,32 @@ RSpec.describe 'Vouchers API', :order => :defined do
|
|
|
41
42
|
expect(validate_deep_match(filtered_snapshot, voucher)).to be true
|
|
42
43
|
end
|
|
43
44
|
|
|
44
|
-
it '
|
|
45
|
+
it 'publish loyalty card', :order => :fourth do
|
|
46
|
+
loyalty_card = @voucherify_data.get_loyalty_card()
|
|
47
|
+
customer = @voucherify_data.get_customer()
|
|
48
|
+
|
|
49
|
+
publication = @publications_api_instance.create_publication({
|
|
50
|
+
publications_create_request_body: VoucherifySdk::PublicationsCreateRequestBody.new({
|
|
51
|
+
voucher: loyalty_card.code,
|
|
52
|
+
customer: VoucherifySdk::Customer.new({
|
|
53
|
+
id: customer.id
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
expect(publication).not_to be_nil
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it 'update loyalty card balance', :order => :fifth do
|
|
62
|
+
loyalty_card = @voucherify_data.get_loyalty_card()
|
|
63
|
+
|
|
45
64
|
vouchers_balance_update_request_body = VoucherifySdk::VouchersBalanceUpdateRequestBody.new({
|
|
46
65
|
source_id: generate_random_string(),
|
|
47
66
|
amount: 10000,
|
|
48
67
|
reason: "Regular customer"
|
|
49
68
|
})
|
|
50
69
|
|
|
51
|
-
response = @vouchers_api_instance.update_voucher_balance(
|
|
70
|
+
response = @vouchers_api_instance.update_voucher_balance(loyalty_card.code, vouchers_balance_update_request_body)
|
|
52
71
|
|
|
53
72
|
snapshot_name = 'vouchers/updated_loyalty_card_balance'
|
|
54
73
|
filtered_snapshot = get_snapshot_without_uniq_keys(snapshot_name)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
require_relative '../lib/config.rb'
|
|
2
|
+
require 'VoucherifySdk'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'Management API', :order => :defined do
|
|
5
|
+
before(:each) do
|
|
6
|
+
skip 'Set X_MANAGEMENT_ID and X_MANAGEMENT_TOKEN to run management tests' unless Config.management_credentials_configured?
|
|
7
|
+
@management_api_instance = Config.management_api_instance()
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
TEST_SCHEMA_RELATED_OBJECT = 'test-ruby-sdk'.freeze
|
|
11
|
+
|
|
12
|
+
$management_project_id = nil
|
|
13
|
+
$metadata_schema_to_update = nil
|
|
14
|
+
|
|
15
|
+
it 'list projects', :order => :first do
|
|
16
|
+
projects_response = @management_api_instance.list_projects()
|
|
17
|
+
project_from_response = projects_response.data&.first
|
|
18
|
+
|
|
19
|
+
$management_project_id = project_from_response&.id
|
|
20
|
+
|
|
21
|
+
expect(projects_response).not_to be_nil
|
|
22
|
+
expect(projects_response.object).to eq('list')
|
|
23
|
+
expect(projects_response.data).to be_a(Array)
|
|
24
|
+
expect($management_project_id).not_to be_nil
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it 'list metadata schemas for selected project', :order => :second do
|
|
28
|
+
metadata_schemas_response = @management_api_instance.list_metadata_schemas1($management_project_id)
|
|
29
|
+
|
|
30
|
+
expect(metadata_schemas_response).not_to be_nil
|
|
31
|
+
expect(metadata_schemas_response.object).to eq('list')
|
|
32
|
+
expect(metadata_schemas_response.data).to be_a(Array)
|
|
33
|
+
|
|
34
|
+
test_metadata_schema = metadata_schemas_response.data&.find do |schema|
|
|
35
|
+
schema.related_object == TEST_SCHEMA_RELATED_OBJECT
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
if test_metadata_schema.nil? ||
|
|
39
|
+
!test_metadata_schema.properties.is_a?(Hash) ||
|
|
40
|
+
test_metadata_schema.properties.empty?
|
|
41
|
+
test_metadata_schema = ensure_test_metadata_schema(@management_api_instance, $management_project_id)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
$metadata_schema_to_update = test_metadata_schema
|
|
45
|
+
|
|
46
|
+
expect($metadata_schema_to_update).not_to be_nil
|
|
47
|
+
expect($metadata_schema_to_update.related_object).to eq(TEST_SCHEMA_RELATED_OBJECT)
|
|
48
|
+
expect($metadata_schema_to_update.properties).to be_a(Hash)
|
|
49
|
+
expect($metadata_schema_to_update.properties).not_to be_empty
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'update metadata schema', :order => :third do
|
|
53
|
+
property_name, property_definition = $metadata_schema_to_update.properties&.first
|
|
54
|
+
expect(property_name).not_to be_nil
|
|
55
|
+
expect(property_definition).not_to be_nil
|
|
56
|
+
|
|
57
|
+
update_request_body = VoucherifySdk::ManagementProjectsMetadataSchemasUpdateRequestBody.new({
|
|
58
|
+
allow_defined_only: $metadata_schema_to_update.allow_defined_only,
|
|
59
|
+
properties: {
|
|
60
|
+
property_name => VoucherifySdk::ManagementProjectsMetadataSchemaDefinition.new(
|
|
61
|
+
property_definition.to_hash.transform_keys(&:to_sym)
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
updated_metadata_schema = @management_api_instance.update_metadata_schema(
|
|
67
|
+
$management_project_id,
|
|
68
|
+
$metadata_schema_to_update.id,
|
|
69
|
+
{
|
|
70
|
+
management_projects_metadata_schemas_update_request_body: update_request_body
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
expect(updated_metadata_schema).not_to be_nil
|
|
75
|
+
expect(updated_metadata_schema.id).to eq($metadata_schema_to_update.id)
|
|
76
|
+
expect(updated_metadata_schema.related_object).to eq($metadata_schema_to_update.related_object)
|
|
77
|
+
expect(updated_metadata_schema.properties.keys).to include(property_name)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def ensure_test_metadata_schema(management_api_instance, project_id)
|
|
81
|
+
create_request_body = VoucherifySdk::ManagementProjectsMetadataSchemasCreateRequestBody.new({
|
|
82
|
+
related_object: TEST_SCHEMA_RELATED_OBJECT,
|
|
83
|
+
allow_defined_only: false,
|
|
84
|
+
properties: {
|
|
85
|
+
'Test' => VoucherifySdk::ManagementProjectsMetadataSchemaDefinition.new({
|
|
86
|
+
type: 'string',
|
|
87
|
+
array: false,
|
|
88
|
+
optional: true,
|
|
89
|
+
object_type: nil
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
management_api_instance.create_metadata_schema(
|
|
95
|
+
project_id,
|
|
96
|
+
{
|
|
97
|
+
management_projects_metadata_schemas_create_request_body: create_request_body
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
sleep(2)
|
|
102
|
+
|
|
103
|
+
metadata_schemas_response = management_api_instance.list_metadata_schemas1(project_id)
|
|
104
|
+
metadata_schemas_response.data&.find do |schema|
|
|
105
|
+
schema.related_object == TEST_SCHEMA_RELATED_OBJECT &&
|
|
106
|
+
schema.properties.is_a?(Hash) &&
|
|
107
|
+
!schema.properties.empty?
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'VoucherifySdk'
|
|
2
|
+
|
|
3
|
+
RSpec.describe 'Models with additional properties', :order => :defined do
|
|
4
|
+
it 'build metadata schema with regular fields and dynamic properties', :order => :first do
|
|
5
|
+
schema_payload = {
|
|
6
|
+
'id' => 'meta_test_schema',
|
|
7
|
+
'related_object' => 'customer',
|
|
8
|
+
'allow_defined_only' => false,
|
|
9
|
+
'object' => 'metadata_schema',
|
|
10
|
+
'properties' => {
|
|
11
|
+
'dynamic_field' => {
|
|
12
|
+
'type' => 'string',
|
|
13
|
+
'optional' => true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
metadata_schema = VoucherifySdk::ManagementProjectsMetadataSchema.build_from_hash(schema_payload)
|
|
19
|
+
serialized_metadata_schema = metadata_schema.to_hash
|
|
20
|
+
|
|
21
|
+
expect(metadata_schema.id).to eq('meta_test_schema')
|
|
22
|
+
expect(metadata_schema.related_object).to eq('customer')
|
|
23
|
+
expect(metadata_schema.properties).to be_a(Hash)
|
|
24
|
+
expect(metadata_schema.properties['dynamic_field']).to be_a(VoucherifySdk::ManagementProjectsMetadataSchemaDefinition)
|
|
25
|
+
expect(metadata_schema.properties['dynamic_field'].type).to eq('string')
|
|
26
|
+
expect(serialized_metadata_schema[:properties].keys).to include('dynamic_field')
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
require_relative 'snapshot_helper'
|
|
3
3
|
|
|
4
4
|
def get_snapshot_without_uniq_keys(snapshot_name, keys_to_remove = nil)
|
|
5
|
-
keys_to_remove ||= ['id', 'created_at', 'updated_at', 'name', 'rule_id', 'customer_id', 'related_object_id', 'source_id', 'product_id', 'promotion_id', 'campaign_id', 'banner', 'code', 'date', 'voucher_id', 'rule_id', 'related_object_id', 'url', 'tracking_id', 'vouchers_id', 'holder_id']
|
|
5
|
+
keys_to_remove ||= ['id', 'created_at', 'updated_at', 'name', 'rule_id', 'customer_id', 'related_object_id', 'source_id', 'product_id', 'promotion_id', 'campaign_id', 'banner', 'code', 'date', 'voucher_id', 'rule_id', 'related_object_id', 'url', 'tracking_id', 'vouchers_id', 'holder_id', 'join_once', 'orders', 'segments', 'daily_events']
|
|
6
6
|
|
|
7
7
|
# Load snapshot
|
|
8
8
|
snapshot = load_snapshot(snapshot_name)
|
data/docs/ApplicableTo.md
CHANGED
|
@@ -9,17 +9,33 @@
|
|
|
9
9
|
| **source_id** | **String** | The source identifier from your inventory system. | [optional] |
|
|
10
10
|
| **product_id** | **String** | Parent product's unique ID assigned by Voucherify. | [optional] |
|
|
11
11
|
| **product_source_id** | **String** | Parent product's source ID from your inventory system. | [optional] |
|
|
12
|
-
| **strict** | **Boolean** | | [optional] |
|
|
13
12
|
| **price** | **Float** | New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price. | [optional] |
|
|
14
|
-
| **price_formula** | **Float** | Formula used to calculate the discounted price of an item. | [optional] |
|
|
13
|
+
| **price_formula** | **Float** | Formula used to dynamically calculate the discounted price of an item. | [optional] |
|
|
15
14
|
| **effect** | [**ApplicableToEffect**](ApplicableToEffect.md) | | |
|
|
16
15
|
| **quantity_limit** | **Integer** | The maximum number of units allowed to be discounted per order line item. | [optional] |
|
|
17
16
|
| **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] |
|
|
18
17
|
| **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] |
|
|
19
18
|
| **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - `APPLY_TO_ITEMS` (each item subtotal is discounted equally) - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value) | [optional] |
|
|
19
|
+
| **product_campaign_quantity_limit** | **Integer** | Limits the number of discounted item units (product, SKU, collection) that all customers can receive in a given campaign. If a product is selected, the limit covers all discounts across all SKUs belonging to that product. If a product collection is selected, the limit covers all products/SKUs within the collection. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
20
|
+
| **product_campaign_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per campaign. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
21
|
+
| **product_customer_campaign_quantity_limit** | **Integer** | Limits the number of discounted item units (product, SKU, collection) that one customer can receive in a given campaign. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
22
|
+
| **product_customer_campaign_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per customer in a campaign. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
23
|
+
| **product_in_collection_campaign_quantity_limit** | **Integer** | Limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
24
|
+
| **product_in_collection_campaign_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per campaign for a product in a collection. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
25
|
+
| **product_in_collection_customer_campaign_quantity_limit** | **Integer** | Limits the number of discounted item units of a given product in a collection that one customer can receive in a campaign. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
26
|
+
| **product_in_collection_customer_campaign_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per customer for a product in a collection. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
27
|
+
| **product_promotion_tier_quantity_limit** | **Integer** | Limits the number of discounted item units that all customers can receive in a promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
28
|
+
| **product_promotion_tier_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
29
|
+
| **product_customer_promotion_tier_quantity_limit** | **Integer** | Limits the number of discounted item units that one customer can receive in a given promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
30
|
+
| **product_customer_promotion_tier_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per customer in a promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
31
|
+
| **product_in_collection_promotion_tier_quantity_limit** | **Integer** | Limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
32
|
+
| **product_in_collection_promotion_tier_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per promotion tier for a product in a collection. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
33
|
+
| **product_in_collection_customer_promotion_tier_quantity_limit** | **Integer** | Limits the number of discounted item units of a given product in a collection that one customer can receive in a promotion tier. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
34
|
+
| **product_in_collection_customer_promotion_tier_quantity_limit_formula** | **String** | Formula used to dynamically calculate the maximum units per customer in a promotion tier for a product in a collection. This limit is available on demand as part of campaign budget limits. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to learn more. | [optional] |
|
|
20
35
|
| **order_item_indices** | **Array<Integer>** | Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the `order` object in the request. The first order line is assigned `0`, the second order line is assigned `1`, and so on. | [optional] |
|
|
21
36
|
| **order_item_units** | [**Array<ApplicableToOrderItemUnitsItem>**](ApplicableToOrderItemUnitsItem.md) | Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the `index` corresponds to the order line sent in the `order` object in the request. | [optional] |
|
|
22
37
|
| **repeat** | **Integer** | Determines the recurrence of the discount, e.g. `\"repeat\": 3` means that the discount is applied to every third item. | [optional] |
|
|
23
38
|
| **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] |
|
|
24
39
|
| **target** | **String** | Determines to which kinds of objects the discount is applicable. `ITEM` includes products and SKUs. `UNIT` means particular units within an order line. | [optional] |
|
|
40
|
+
| **strict** | **Boolean** | | [optional] |
|
|
25
41
|
|
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **index** | **Integer** | Number assigned to the order line item in accordance with the order sent in the request. | [optional] |
|
|
8
|
-
| **units** | **Array<Integer>** | Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. | [optional] |
|
|
8
|
+
| **units** | **Array<Integer>** | Numbers of units in the order line covered by the discount; e.g. `2, 5, 8` for 10 units with the setting `\"skip_initially\": 1`, `\"repeat\": 3`. The counting of units starts from `1`. The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but `units_limit_exceeded: true`. However, the discount is calculated properly for all relevant units. | [optional] |
|
|
9
|
+
| **units_limit_exceeded** | **Boolean** | Returned as `true` only when the sum total of `quantity` of all order items exceeds 1000. | [optional] |
|
|
9
10
|
|
data/docs/AsyncActionsApi.md
CHANGED
|
@@ -14,7 +14,7 @@ All URIs are relative to *https://api.voucherify.io*
|
|
|
14
14
|
|
|
15
15
|
Get Async Action
|
|
16
16
|
|
|
17
|
-
Check the result of a scheduled asynchronous operation. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
|
|
17
|
+
Check the result of a scheduled asynchronous operation. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
|
|
18
18
|
|
|
19
19
|
### Examples
|
|
20
20
|
|
|
@@ -72,7 +72,7 @@ end
|
|
|
72
72
|
|
|
73
73
|
List Async Actions
|
|
74
74
|
|
|
75
|
-
Track asynchronous operations scheduled in your project. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
|
|
75
|
+
Track asynchronous operations scheduled in your project. The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
|
|
76
76
|
|
|
77
77
|
### Examples
|
|
78
78
|
|
|
@@ -7,4 +7,5 @@
|
|
|
7
7
|
| **object** | **String** | The type of the object represented by JSON. This object stores information about asynchronous actions. | [optional][default to 'list'] |
|
|
8
8
|
| **data_ref** | **String** | Identifies the name of the JSON property that contains the array of asynchronous actions. | [optional][default to 'async_actions'] |
|
|
9
9
|
| **async_actions** | [**Array<AsyncActionBase>**](AsyncActionBase.md) | | [optional] |
|
|
10
|
+
| **has_more** | **Boolean** | As query results are always limited by parameters, the `has_more` flag indicates if there are more records available. This lets you know if you can run another request to get more records returned in the results. | [optional] |
|
|
10
11
|
|
data/docs/Bundle.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# VoucherifySdk::Bundle
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **quantity** | **Integer** | Determines how many bundles are qualified. If there are missing bundle products, the value is `0`. If the bundle is qualified, the value is `1`. The maximum number of identified bundles can equal the number set in `limit`. Also defines the multiplier of the discount for `AMOUNT`, `PERCENT`, and `UNIT` discount types. To inform end-customers that more products can be added to meet additional bundles, compare this parameter with `limit`. | [optional] |
|
|
8
|
+
| **limit** | **Integer** | Determines the maximum number of identified bundles. This also defines the maximum multiplier of the bundle discount. | [optional] |
|
|
9
|
+
| **identified** | [**Array<BundleIdentifiedItem>**](BundleIdentifiedItem.md) | Determines products from the customer's order items that meet bundle conditions. SKUs meet the conditions for their product that is used in the bundle. Returns only the products and their quantity that meet the bundle. | [optional] |
|
|
10
|
+
| **missing** | [**Array<BundleMissingItem>**](BundleMissingItem.md) | Determines products, SKUs, or collections from the bundle that are missing in the customer's order items. Determines also the missing quantity. For collections, this means that order items do not include a sufficient number of items that belong to the collection. Not returned when all required bundle items are in the order. | [optional] |
|
|
11
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# VoucherifySdk::BundleIdentifiedItem
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Unique identifier of the product or SKU that meets the bundle condition. This is an ID assigned by Voucherify. | |
|
|
8
|
+
| **object** | **String** | Determines the type of the object that meets the bundle condition. | |
|
|
9
|
+
| **item_index** | **Integer** | Number assigned to the order line item in accordance with the order sent in the request. It starts with `0` for the first order line item in the request. | |
|
|
10
|
+
| **item_quantity** | **Integer** | Quantity of items that meet the bundle conditions. If the quantity in the order is higher than the quantity required by the bundle, this returns only the number that meets the bundle. For example, if the bundle requires `5` coffees, but the order includes `10` coffees, `item_quantity` returns `5`. | |
|
|
11
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# VoucherifySdk::BundleMissingItem
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Unique identifier of the collection, product, or SKU that is missing in the customer's order items. This is an ID assigned by Voucherify. | |
|
|
8
|
+
| **object** | **String** | Determines the type of the object that is missing in the customer's order items. | |
|
|
9
|
+
| **item_quantity** | **Integer** | Quantity of items that are missing in the order items to meet the bundle conditions. | |
|
|
10
|
+
|
data/docs/Campaign.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
| **name** | **String** | Campaign name. | [optional] |
|
|
9
9
|
| **description** | **String** | An optional field to keep any extra textual information about the campaign such as a campaign description and details. | [optional] |
|
|
10
10
|
| **campaign_type** | **String** | Type of campaign. | [optional] |
|
|
11
|
-
| **type** | **String** | Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of standalone vouchers. - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria - `STATIC`: vouchers need to be manually published - `STANDALONE`: campaign for single vouchers | [optional] |
|
|
11
|
+
| **type** | **String** | Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers. - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria - `STATIC`: vouchers need to be manually published - `STANDALONE`: campaign for single vouchers | [optional] |
|
|
12
12
|
| **voucher** | [**CampaignVoucher**](CampaignVoucher.md) | | [optional] |
|
|
13
13
|
| **auto_join** | **Boolean** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | [optional] |
|
|
14
|
-
| **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for standalone
|
|
14
|
+
| **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always `true` for loyalty campaigns and it cannot be changed in them. | [optional] |
|
|
15
15
|
| **use_voucher_metadata_schema** | **Boolean** | Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema. | [optional] |
|
|
16
16
|
| **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] |
|
|
17
17
|
| **validity_day_of_week** | **Array<Integer>** | Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday | [optional] |
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
| **category** | **String** | Unique category name. | [optional] |
|
|
28
28
|
| **creation_status** | **String** | Indicates the status of the campaign creation. | [optional] |
|
|
29
29
|
| **vouchers_generation_status** | **String** | Indicates the status of the campaign's voucher generation. | [optional] |
|
|
30
|
-
| **readonly** | **Boolean** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] |
|
|
30
|
+
| **readonly** | **Boolean** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. It is also not returned for restricted users who use the [GET Campaign summary](/api-reference/campaigns/get-campaign-summary) endpoint. | [optional] |
|
|
31
31
|
| **protected** | **Boolean** | Indicates whether the resource can be deleted. | [optional] |
|
|
32
32
|
| **category_id** | **String** | Unique category ID that this campaign belongs to. | [optional] |
|
|
33
|
-
| **categories** | [**Array<Category>**](Category.md) | Contains details about the category. | [optional] |
|
|
33
|
+
| **categories** | [**Array<Category>**](Category.md) | Contains details about the campaign category. For the GET [List campaigns](/api-reference/campaigns/list-campaigns) endpoint, this is returned only if the `expand=category` query parameter is passed in the request. Otherwise, it is returned as an empty array. For GET [Campaign summary](/api-reference/campaigns/get-campaign-summary) endpoint, it is always returned as an empty array. | [optional] |
|
|
34
34
|
| **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] |
|
|
35
35
|
| **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] |
|
|
36
36
|
| **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] |
|