From 886d3b8e112a1667868de29f878bf73cb04e1011 Mon Sep 17 00:00:00 2001 From: "rebilly-ci-push-to-other-repos[bot]" Date: Wed, 14 Oct 2026 15:49:54 +0000 Subject: [PATCH] update SDK from api-definitions --- .changeset/big-rivers-yawn.md | 33 + .changeset/bright-coins-retire.md | 39 + .changeset/clean-seahorses-invent.md | 26 + .changeset/forty-insects-fail.md | 14 + .changeset/nervous-falcons-stare.md | 26 + .changeset/perfect-numbers-battle.md | 27 + .changeset/quick-zebras-sell.md | 34 + .changeset/rotten-tools-protect.md | 34 + .changeset/sharp-bottles-repair.md | 26 + .changeset/slimy-ducks-melt.md | 9 + .changeset/slow-adults-drive.md | 29 + .changeset/spec-diff.md | 335 + .changeset/stupid-trainers-develop.md | 26 + .changeset/two-days-tap.md | 41 + .openapi-snapshot.yaml | 12372 ++++++++++------ src/Api/AccountRegistrationSettingsApi.php | 141 - src/Api/CustomersApi.php | 19 + src/Api/DigitalWalletsApi.php | 27 + src/Api/MembershipsApi.php | 103 +- ...ropertySetsApi.php => OrderChangesApi.php} | 40 +- src/Api/OrdersApi.php | 6 +- .../PayoutRequestAllocationOperationsApi.php | 42 + src/Api/PayoutRequestAllocationsApi.php | 27 +- src/Api/PayoutRequestAutoAllocationsApi.php | 45 + src/Api/PayoutRequestBatchOperationsApi.php | 42 + src/Api/PayoutRequestBatchPreviewsApi.php | 42 + src/Api/PayoutRequestBatchesApi.php | 83 +- src/Api/PayoutRequestSplitsApi.php | 45 + src/Api/PayoutRequestsApi.php | 43 - src/Api/PlansApi.php | 9 +- src/Api/ProfileApi.php | 35 - src/Api/QuotesApi.php | 20 + src/Api/ReleaseFlagsApi.php | 40 + src/Api/ReportsApi.php | 49 + src/Api/ServiceCredentialsApi.php | 5 +- src/Api/TrackingApi.php | 4 - src/Api/UsersApi.php | 19 - src/Api/WebhookEventsApi.php | 85 + src/Model/AccountRegistrationSettings.php | 280 - .../AccountRegistrationSettingsLocations.php | 78 - src/Model/AddPayoutRequestBatchOperation.php | 36 + ...PayoutRequestBatchOperationExplicitIDs.php | 121 + ...PayoutRequestBatchOperationFilterBased.php | 121 + src/Model/AdjustReadyToPayGeneric.php | 6 + src/Model/AdjustReadyToPayoutGeneric.php | 6 + src/Model/AdyenSettings.php | 36 + src/Model/AlternativeInstrument.php | 6 + src/Model/AlternativePaymentInstrument.php | 6 +- src/Model/AlternativePaymentToken.php | 6 + src/Model/AmlChecksDataExport.php | 26 + .../ApprovePayoutRequestBatchOperation.php | 66 + src/Model/Attachment.php | 6 + ...utoAllocatePayoutRequestBatchOperation.php | 66 + src/Model/AwepaySettings.php | 18 - ...p => BlockPayoutRequestBatchOperation.php} | 30 +- src/Model/CashInstrument.php | 2 +- src/Model/Cashier.php | 78 +- src/Model/ChangeQuoteOrder.php | 36 +- src/Model/ChangeQuoteOrderShipping.php | 35 + src/Model/CheckInstrument.php | 2 +- src/Model/CheckoutForm.php | 4 + src/Model/CoinPricing.php | 22 + src/Model/CoinPricingFactory.php | 29 + src/Model/CoinPricingFlatRate.php | 66 + src/Model/CoinPricingVolume.php | 80 + src/Model/CoinPricingVolumeBracket.php | 82 + src/Model/CompositeTokenFactory.php | 2 +- src/Model/Customer.php | 20 +- .../CustomerDefaultPaymentInstrument.php | 449 +- ...ustomerDefaultPaymentInstrumentFactory.php | 226 - src/Model/CustomerTimeline.php | 16 + src/Model/CustomersDataExport.php | 26 + src/Model/DashboardTab.php | 24 + src/Model/DashboardTile.php | 82 + src/Model/DataExport.php | 6 +- src/Model/DataExportFactory.php | 1 + src/Model/DepositRequest.php | 54 +- src/Model/DepositStrategy.php | 22 + ...igitalWalletOnboardingApplePayDomains.php} | 41 +- src/Model/DisputesDataExport.php | 26 + src/Model/EmailNotification.php | 26 + src/Model/File.php | 2 + src/Model/FlexiblePlan.php | 12 + src/Model/FlexiblePlanOneTimeSalePlan.php | 78 + src/Model/FlexiblePlanSubscriptionPlan.php | 52 +- ...iblePlanSubscriptionPlanMeteredBilling.php | 18 + src/Model/FlexiblePlanTrialOnlyPlan.php | 68 +- src/Model/FlexiblePlanTrialOnlyPlanTrial.php | 86 + .../FlexiblePlanTrialOnlyPlanTrialPeriod.php | 86 + src/Model/GatewayAccount.php | 42 + src/Model/GatewayAccountDowntimeSchedule.php | 2 + src/Model/GatewayAccountPayoutLimits.php | 144 + ...GatewayAccountPayoutLimitsMaxPerPeriod.php | 102 + ...yAccountPayoutLimitsMaxPerTransaction.php} | 38 +- ...ayAccountPayoutLimitsMinPerTransaction.php | 82 + src/Model/GatewayAccountTimeline.php | 2 + ...outRequestAllocationCollectionResponse.php | 856 -- .../GetPayoutRequestBatchPreviewResponse.php | 112 - ...ayoutRequestPaymentInstrumentsResponse.php | 6 + src/Model/GetReleaseFlagsResponse.php | 66 + src/Model/GlobalWebhook.php | 140 - src/Model/IMerchant.php | 89 + src/Model/IMerchantCredentials.php | 60 + src/Model/IntegrationConfigurations.php | 26 + src/Model/InvoiceItem.php | 22 - src/Model/InvoiceItemsDataExport.php | 26 + src/Model/InvoiceTimeline.php | 4 + src/Model/InvoicesDataExport.php | 26 + src/Model/JournalRecordsDataExport.php | 26 + src/Model/KhelocardCard.php | 436 - src/Model/KhelocardCardToken.php | 296 - .../KhelocardCardTokenPaymentInstrument.php | 132 - src/Model/KycAddressMatches.php | 6 +- src/Model/KycAddressMatchesOverwrite.php | 324 + src/Model/KycDocument.php | 4 + src/Model/KycDocumentCheck.php | 6 + src/Model/KycDocumentRejection.php | 6 + src/Model/KycFundsMatchesOverwrite.php | 156 + src/Model/KycIdentityMatches.php | 25 +- src/Model/KycIdentityMatchesOverwrite.php | 562 + src/Model/KycPurchaseMatchesOverwrite.php | 174 + src/Model/KycSettingsIdentity.php | 22 + ... KycSettingsIdentityFaceProofSettings.php} | 22 +- src/Model/KycSettingsIdentityWeights.php | 54 + src/Model/Membership.php | 284 - src/Model/MembershipEmbedded.php | 76 - src/Model/MembershipOrganization.php | 124 - src/Model/MembershipUser.php | 96 - src/Model/OneTimeSaleItem.php | 18 - src/Model/OneTimeSalePlan.php | 449 + ...alePlan.php => OneTimeSalePlanDetails.php} | 75 +- src/Model/OrderChange.php | 292 +- src/Model/OrderChangeItems.php | 18 + src/Model/OrderItemsChange.php | 200 + src/Model/OrderItemsChangeItems.php | 104 + src/Model/OrderPreview.php | 2 +- src/Model/OrderPreviewItems.php | 59 +- ...DepositForm.php => OrderPreviewItems0.php} | 23 +- src/Model/OrderPreviewItems0PlanId.php | 40 + src/Model/OrderPreviewItems1.php | 63 + src/Model/OrderPreviewItems1Plan.php | 40 + src/Model/OrderPreviewItems2.php | 99 + src/Model/OrderPreviewItemsFactory.php | 23 + src/Model/OrderTimeline.php | 6 + src/Model/Organization.php | 18 + src/Model/OrganizationSettings.php | 22 + ...ationSettingsAnnualComplianceScreening.php | 78 + src/Model/PatchOrganizationRequest.php | 18 + src/Model/PatchPlaidCredential.php | 9 +- src/Model/PatchServiceCredential.php | 36 + src/Model/PatchServiceCredentialRequest.php | 2 + .../PatchServiceCredentialRequestFactory.php | 38 + src/Model/PatchTaxJarCredential.php | 9 +- src/Model/PayGlocal.php | 67 + src/Model/PayGlocalCredentials.php | 132 + src/Model/PaybiltCredentials.php | 18 + src/Model/PaymentCard.php | 18 + src/Model/PaymentInstructionMethods.php | 4 + src/Model/PaymentInstrument.php | 2 +- src/Model/PaymentInstrumentFactory.php | 3 +- src/Model/PayoutRequest.php | 18 + src/Model/PayoutRequestAllocation.php | 26 + .../PayoutRequestAllocationOperation.php | 106 + ...ayoutRequestAllocationOperationRequest.php | 32 + ...questAllocationOperationRequestFactory.php | 28 + .../PayoutRequestAllocationsDataExport.php | 26 + src/Model/PayoutRequestBatch.php | 36 - src/Model/PayoutRequestBatchOperation.php | 112 + .../PayoutRequestBatchOperationRequest.php | 26 + ...outRequestBatchOperationRequestFactory.php | 34 + src/Model/PayoutRequestTimelineMessage.php | 4 + src/Model/PayoutRequestsDataExport.php | 26 + ...tionGatewayAcquirerWeightsWeightedList.php | 10 + src/Model/Plan.php | 14 +- src/Model/PlanRequest.php | 90 + src/Model/PostAvalaraCredential.php | 202 + src/Model/PostAwsSesCredential.php | 238 + src/Model/PostCashier.php | 66 - src/Model/PostDepositRequest.php | 18 - src/Model/PostExperianCredential.php | 238 + src/Model/PostKycDocumentMatchesRequest.php | 6 +- .../PostKycDocumentMatchesRequestFactory.php | 31 + src/Model/PostMailgunCredential.php | 220 + src/Model/PostOAuth2Credential.php | 288 + src/Model/PostOrganizationRequest.php | 18 + .../PostPaymentInstrumentRequestFactory.php | 3 + ...stPayoutRequestAutoAllocationsRequest.php} | 2 +- .../PostPayoutRequestBatchPreviewRequest.php | 78 + .../PostPayoutRequestBatchPreviewResponse.php | 128 + ...chPreviewResponseTotalAmountByCurrency.php | 82 + src/Model/PostPayoutRequestSplitRequest.php | 139 + src/Model/PostPlaidCredential.php | 238 + src/Model/PostPostmarkCredential.php | 184 + ...ertySet.php => PostSendGridCredential.php} | 100 +- src/Model/PostServiceCredentialRequest.php | 31 + .../PostServiceCredentialRequestFactory.php | 38 + src/Model/PostSmtpCredential.php | 248 + src/Model/PostTaxJarCredential.php | 202 + src/Model/PostWebhookCredential.php | 172 + ...ocessPayoutRequestAllocationOperation.php} | 12 +- .../ProcessPayoutRequestBatchOperation.php | 66 + src/Model/Profile.php | 76 + src/Model/ProfileMfa.php | 146 - src/Model/ProfilePastDueInvoice.php | 96 + ...oofOfAddressKycDocumentDocumentMatches.php | 18 + .../ProofOfAddressKycDocumentParsedData.php | 18 + src/Model/ProofOfCreditFileKycDocument.php | 22 + ...OfCreditFileKycDocumentDocumentMatches.php | 58 +- ...ProofOfCreditFileKycDocumentParsedData.php | 134 + ...ProofOfFundsKycDocumentDocumentMatches.php | 70 + .../ProofOfFundsKycDocumentParsedData.php | 70 + ...ofOfIdentityKycDocumentDocumentMatches.php | 18 + .../ProofOfIdentityKycDocumentParsedData.php | 18 + ...ofOfPurchaseKycDocumentDocumentMatches.php | 70 + .../ProofOfPurchaseKycDocumentParsedData.php | 70 + src/Model/QuickpayCredentials.php | 18 + src/Model/QuoteReissue.php | 66 + src/Model/QuoteSubscriptionItem.php | 22 + src/Model/QuoteTimeline.php | 20 +- src/Model/ReactivationQuoteOrder.php | 26 +- src/Model/ReactivationQuoteOrderShipping.php | 35 + src/Model/ReadyToPayGenericMethod.php | 6 + src/Model/ReadyToPayMethodsFactory.php | 1 + src/Model/RecurringOrderItems.php | 4 - src/Model/RegistrationField.php | 372 - .../RemovePayoutRequestBatchOperation.php | 90 + src/Model/ReportAmlAuditReport.php | 266 + ...> ReportAmlAuditReportLinkedCustomers.php} | 18 +- .../ReportAmlAuditReportScreeningHistory.php | 208 + src/Model/ReportAmlAuditReportSummary.php | 102 + .../ReportAmlAuditReportTransactions.php | 272 + ...eportKycRejectionsDataRejectionReasons.php | 6 + src/Model/RiskScoreBracketBrackets.php | 11 - src/Model/RiskScoreBracketBrackets0.php | 46 +- src/Model/RiskScoreBracketBrackets0End.php | 40 + src/Model/RiskScoreBracketBrackets1.php | 46 +- src/Model/RiskScoreBracketBrackets1Start.php | 40 + src/Model/RiskScoreBracketBrackets2.php | 95 + src/Model/SendThroughAttribution.php | 26 + src/Model/Subscription.php | 22 - src/Model/SubscriptionChange.php | 8 + src/Model/SubscriptionItem.php | 18 - src/Model/SubscriptionPlan.php | 501 + ...onPlan.php => SubscriptionPlanDetails.php} | 59 +- .../SubscriptionPlanDetailsMeteredBilling.php | 126 + ...bscriptionPlanDetailsRecurringInterval.php | 148 + ...php => SubscriptionPlanMeteredBilling.php} | 20 +- ... => SubscriptionPlanRecurringInterval.php} | 2 +- src/Model/SubscriptionRecurringInterval.php | 64 - src/Model/SubscriptionSummaryMetrics.php | 24 +- src/Model/SubscriptionsDataExport.php | 26 + src/Model/SystemEvent.php | 26 + src/Model/TagUntagRule.php | 8 + src/Model/Thunes.php | 89 + src/Model/ThunesCredentials.php | 114 + src/Model/ThunesSettings.php | 64 + src/Model/TimeSeriesTransactionData.php | 24 +- src/Model/TimelineExtraDataLinks.php | 2 + src/Model/Transaction.php | 42 + .../TransactionPaymentInstrumentFactory.php | 2 + src/Model/TransactionTimeline.php | 2 + src/Model/TransactionsDataExport.php | 26 + src/Model/TrialOnlyPlan.php | 453 + ...lOnlyPlan.php => TrialOnlyPlanDetails.php} | 65 +- src/Model/TrialOnlyPlanDetailsTrial.php | 86 + src/Model/TrialOnlyPlanDetailsTrialPeriod.php | 86 + src/Model/TrialOnlyPlanTrial.php | 86 + src/Model/TrialOnlyPlanTrialPeriod.php | 86 + .../UnblockPayoutRequestBatchOperation.php | 66 + src/Model/Unlimit.php | 22 + src/Model/UsersDataExport.php | 450 + src/Model/UsersDataExportDateRange.php | 96 + src/Model/UsersDataExportEmbedded.php | 86 + src/Model/VaultedInstrument.php | 2 +- src/Model/VivaCredentials.php | 18 + src/Model/WebhookEvent.php | 82 + src/Model/WebhookTracking.php | 234 - src/Model/Website.php | 18 + src/Model/WebsiteSettings.php | 22 - src/Model/WebsiteSettingsDepositFormTheme.php | 96 - src/Model/WebsiteSettingsPayoutRequest.php | 42 + .../WorldlineAtosFrankfurtCredentials.php | 12 +- src/Model/WorldlineAtosFrankfurtSettings.php | 18 - src/Service.php | 80 +- 284 files changed, 23520 insertions(+), 9935 deletions(-) create mode 100644 .changeset/big-rivers-yawn.md create mode 100644 .changeset/bright-coins-retire.md create mode 100644 .changeset/clean-seahorses-invent.md create mode 100644 .changeset/forty-insects-fail.md create mode 100644 .changeset/nervous-falcons-stare.md create mode 100644 .changeset/perfect-numbers-battle.md create mode 100644 .changeset/quick-zebras-sell.md create mode 100644 .changeset/rotten-tools-protect.md create mode 100644 .changeset/sharp-bottles-repair.md create mode 100644 .changeset/slimy-ducks-melt.md create mode 100644 .changeset/slow-adults-drive.md create mode 100644 .changeset/spec-diff.md create mode 100644 .changeset/stupid-trainers-develop.md create mode 100644 .changeset/two-days-tap.md delete mode 100644 src/Api/AccountRegistrationSettingsApi.php rename src/Api/{DepositCustomPropertySetsApi.php => OrderChangesApi.php} (72%) create mode 100644 src/Api/PayoutRequestAllocationOperationsApi.php create mode 100644 src/Api/PayoutRequestAutoAllocationsApi.php create mode 100644 src/Api/PayoutRequestBatchOperationsApi.php create mode 100644 src/Api/PayoutRequestBatchPreviewsApi.php create mode 100644 src/Api/PayoutRequestSplitsApi.php create mode 100644 src/Api/ReleaseFlagsApi.php create mode 100644 src/Api/WebhookEventsApi.php delete mode 100644 src/Model/AccountRegistrationSettings.php delete mode 100644 src/Model/AccountRegistrationSettingsLocations.php create mode 100644 src/Model/AddPayoutRequestBatchOperation.php create mode 100644 src/Model/AddPayoutRequestBatchOperationExplicitIDs.php create mode 100644 src/Model/AddPayoutRequestBatchOperationFilterBased.php create mode 100644 src/Model/ApprovePayoutRequestBatchOperation.php create mode 100644 src/Model/AutoAllocatePayoutRequestBatchOperation.php rename src/Model/{PostPayoutRequestBatchBlockRequest.php => BlockPayoutRequestBatchOperation.php} (75%) create mode 100644 src/Model/ChangeQuoteOrderShipping.php create mode 100644 src/Model/CoinPricing.php create mode 100644 src/Model/CoinPricingFactory.php create mode 100644 src/Model/CoinPricingFlatRate.php create mode 100644 src/Model/CoinPricingVolume.php create mode 100644 src/Model/CoinPricingVolumeBracket.php delete mode 100644 src/Model/CustomerDefaultPaymentInstrumentFactory.php rename src/Model/{PayoutRequestSplit.php => DigitalWalletOnboardingApplePayDomains.php} (55%) create mode 100644 src/Model/FlexiblePlanTrialOnlyPlanTrial.php create mode 100644 src/Model/FlexiblePlanTrialOnlyPlanTrialPeriod.php create mode 100644 src/Model/GatewayAccountPayoutLimits.php create mode 100644 src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php rename src/Model/{GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php => GatewayAccountPayoutLimitsMaxPerTransaction.php} (94%) create mode 100644 src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php delete mode 100644 src/Model/GetPayoutRequestAllocationCollectionResponse.php delete mode 100644 src/Model/GetPayoutRequestBatchPreviewResponse.php create mode 100644 src/Model/GetReleaseFlagsResponse.php create mode 100644 src/Model/IMerchant.php create mode 100644 src/Model/IMerchantCredentials.php delete mode 100644 src/Model/KhelocardCard.php delete mode 100644 src/Model/KhelocardCardToken.php delete mode 100644 src/Model/KhelocardCardTokenPaymentInstrument.php create mode 100644 src/Model/KycAddressMatchesOverwrite.php create mode 100644 src/Model/KycFundsMatchesOverwrite.php create mode 100644 src/Model/KycIdentityMatchesOverwrite.php create mode 100644 src/Model/KycPurchaseMatchesOverwrite.php rename src/Model/{KhelocardCardEmbedded.php => KycSettingsIdentityFaceProofSettings.php} (54%) delete mode 100644 src/Model/Membership.php delete mode 100644 src/Model/MembershipEmbedded.php delete mode 100644 src/Model/MembershipOrganization.php delete mode 100644 src/Model/MembershipUser.php create mode 100644 src/Model/OneTimeSalePlan.php rename src/Model/{PlanOneTimeSalePlan.php => OneTimeSalePlanDetails.php} (84%) create mode 100644 src/Model/OrderItemsChange.php create mode 100644 src/Model/OrderItemsChangeItems.php rename src/Model/{WebsiteSettingsDepositForm.php => OrderPreviewItems0.php} (51%) create mode 100644 src/Model/OrderPreviewItems0PlanId.php create mode 100644 src/Model/OrderPreviewItems1.php create mode 100644 src/Model/OrderPreviewItems1Plan.php create mode 100644 src/Model/OrderPreviewItems2.php create mode 100644 src/Model/OrderPreviewItemsFactory.php create mode 100644 src/Model/OrganizationSettingsAnnualComplianceScreening.php create mode 100644 src/Model/PatchServiceCredentialRequestFactory.php create mode 100644 src/Model/PayGlocal.php create mode 100644 src/Model/PayGlocalCredentials.php create mode 100644 src/Model/PayoutRequestAllocationOperation.php create mode 100644 src/Model/PayoutRequestAllocationOperationRequest.php create mode 100644 src/Model/PayoutRequestAllocationOperationRequestFactory.php create mode 100644 src/Model/PayoutRequestBatchOperation.php create mode 100644 src/Model/PayoutRequestBatchOperationRequest.php create mode 100644 src/Model/PayoutRequestBatchOperationRequestFactory.php create mode 100644 src/Model/PlanRequest.php create mode 100644 src/Model/PostAvalaraCredential.php create mode 100644 src/Model/PostAwsSesCredential.php create mode 100644 src/Model/PostExperianCredential.php create mode 100644 src/Model/PostKycDocumentMatchesRequestFactory.php create mode 100644 src/Model/PostMailgunCredential.php create mode 100644 src/Model/PostOAuth2Credential.php rename src/Model/{PostPayoutRequestAutoAllocationRequest.php => PostPayoutRequestAutoAllocationsRequest.php} (94%) create mode 100644 src/Model/PostPayoutRequestBatchPreviewRequest.php create mode 100644 src/Model/PostPayoutRequestBatchPreviewResponse.php create mode 100644 src/Model/PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php create mode 100644 src/Model/PostPayoutRequestSplitRequest.php create mode 100644 src/Model/PostPlaidCredential.php create mode 100644 src/Model/PostPostmarkCredential.php rename src/Model/{DepositCustomPropertySet.php => PostSendGridCredential.php} (51%) create mode 100644 src/Model/PostServiceCredentialRequest.php create mode 100644 src/Model/PostServiceCredentialRequestFactory.php create mode 100644 src/Model/PostSmtpCredential.php create mode 100644 src/Model/PostTaxJarCredential.php create mode 100644 src/Model/PostWebhookCredential.php rename src/Model/{PostPayoutRequestAllocationsProcessRequest.php => ProcessPayoutRequestAllocationOperation.php} (84%) create mode 100644 src/Model/ProcessPayoutRequestBatchOperation.php delete mode 100644 src/Model/ProfileMfa.php create mode 100644 src/Model/ProfilePastDueInvoice.php create mode 100644 src/Model/ProofOfCreditFileKycDocumentParsedData.php create mode 100644 src/Model/QuoteReissue.php create mode 100644 src/Model/ReactivationQuoteOrderShipping.php delete mode 100644 src/Model/RegistrationField.php create mode 100644 src/Model/RemovePayoutRequestBatchOperation.php create mode 100644 src/Model/ReportAmlAuditReport.php rename src/Model/{RegistrationFieldStep.php => ReportAmlAuditReportLinkedCustomers.php} (69%) create mode 100644 src/Model/ReportAmlAuditReportScreeningHistory.php create mode 100644 src/Model/ReportAmlAuditReportSummary.php create mode 100644 src/Model/ReportAmlAuditReportTransactions.php create mode 100644 src/Model/RiskScoreBracketBrackets0End.php create mode 100644 src/Model/RiskScoreBracketBrackets1Start.php create mode 100644 src/Model/RiskScoreBracketBrackets2.php create mode 100644 src/Model/SubscriptionPlan.php rename src/Model/{PlanSubscriptionPlan.php => SubscriptionPlanDetails.php} (88%) create mode 100644 src/Model/SubscriptionPlanDetailsMeteredBilling.php create mode 100644 src/Model/SubscriptionPlanDetailsRecurringInterval.php rename src/Model/{PlanSubscriptionPlanMeteredBilling.php => SubscriptionPlanMeteredBilling.php} (81%) rename src/Model/{PlanSubscriptionPlanRecurringInterval.php => SubscriptionPlanRecurringInterval.php} (98%) delete mode 100644 src/Model/SubscriptionRecurringInterval.php create mode 100644 src/Model/Thunes.php create mode 100644 src/Model/ThunesCredentials.php create mode 100644 src/Model/ThunesSettings.php create mode 100644 src/Model/TrialOnlyPlan.php rename src/Model/{PlanTrialOnlyPlan.php => TrialOnlyPlanDetails.php} (86%) create mode 100644 src/Model/TrialOnlyPlanDetailsTrial.php create mode 100644 src/Model/TrialOnlyPlanDetailsTrialPeriod.php create mode 100644 src/Model/TrialOnlyPlanTrial.php create mode 100644 src/Model/TrialOnlyPlanTrialPeriod.php create mode 100644 src/Model/UnblockPayoutRequestBatchOperation.php create mode 100644 src/Model/UsersDataExport.php create mode 100644 src/Model/UsersDataExportDateRange.php create mode 100644 src/Model/UsersDataExportEmbedded.php create mode 100644 src/Model/WebhookEvent.php delete mode 100644 src/Model/WebsiteSettingsDepositFormTheme.php diff --git a/.changeset/big-rivers-yawn.md b/.changeset/big-rivers-yawn.md new file mode 100644 index 000000000..97047ef5e --- /dev/null +++ b/.changeset/big-rivers-yawn.md @@ -0,0 +1,33 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/bright-coins-retire.md b/.changeset/bright-coins-retire.md new file mode 100644 index 000000000..02f3f713d --- /dev/null +++ b/.changeset/bright-coins-retire.md @@ -0,0 +1,39 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided`, `transaction-reconciled` — `POST /tags-rules`, `PUT /tags-rules/{id}` + 11 more +- Enum value added on request `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `POST /previews/webhooks`, `POST /webhooks` + 1 more +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `POST /customers/{id}/timeline`, `POST /invoices/{id}/timeline` + 12 more +- Enum value added on response `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /tags-rules`, `POST /tags-rules` + 4 more +- Enum value added on response `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /webhooks`, `POST /webhooks` + 2 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `GET /customers/{id}/timeline`, `POST /customers/{id}/timeline` + 20 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- webhook-added (3x) — e.g. webhook `transaction-partially-refunded` added +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/clean-seahorses-invent.md b/.changeset/clean-seahorses-invent.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/clean-seahorses-invent.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/forty-insects-fail.md b/.changeset/forty-insects-fail.md new file mode 100644 index 000000000..16bbdcd39 --- /dev/null +++ b/.changeset/forty-insects-fail.md @@ -0,0 +1,14 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Enum changes + +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more diff --git a/.changeset/nervous-falcons-stare.md b/.changeset/nervous-falcons-stare.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/nervous-falcons-stare.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/perfect-numbers-battle.md b/.changeset/perfect-numbers-battle.md new file mode 100644 index 000000000..81cd3c1c4 --- /dev/null +++ b/.changeset/perfect-numbers-battle.md @@ -0,0 +1,27 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/quick-zebras-sell.md b/.changeset/quick-zebras-sell.md new file mode 100644 index 000000000..a42acf295 --- /dev/null +++ b/.changeset/quick-zebras-sell.md @@ -0,0 +1,34 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/rotten-tools-protect.md b/.changeset/rotten-tools-protect.md new file mode 100644 index 000000000..a42acf295 --- /dev/null +++ b/.changeset/rotten-tools-protect.md @@ -0,0 +1,34 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/sharp-bottles-repair.md b/.changeset/sharp-bottles-repair.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/sharp-bottles-repair.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/slimy-ducks-melt.md b/.changeset/slimy-ducks-melt.md new file mode 100644 index 000000000..30c56cdc9 --- /dev/null +++ b/.changeset/slimy-ducks-melt.md @@ -0,0 +1,9 @@ +--- +"@rebilly/client-php": minor +--- + +### Enum changes + +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more diff --git a/.changeset/slow-adults-drive.md b/.changeset/slow-adults-drive.md new file mode 100644 index 000000000..f8cacb7a1 --- /dev/null +++ b/.changeset/slow-adults-drive.md @@ -0,0 +1,29 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/spec-diff.md b/.changeset/spec-diff.md new file mode 100644 index 000000000..02263b7ca --- /dev/null +++ b/.changeset/spec-diff.md @@ -0,0 +1,335 @@ +--- +"@rebilly/client-php": patch +--- + +### Endpoints +- Added endpoint `endpoint added` + +### Added +- Added `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` **(breaking)** +- Added `CryptocurrencyToken` on `CryptocurrencyToken` (response only) **(breaking)** +- Added `FlexiblePlan` on `FlexiblePlan, OneTimeSale, Subscription` **(breaking)** +- Added `TrialOnlyPlanDetails` on `TrialOnlyPlanDetails` (response only) **(breaking)** +- Added `UsersDataExport` on `UsersDataExport` **(breaking)** +- Added `method` on `OneTimeOrder, RecurringOrder` **(breaking)** +- Added `paymentInstrumentId` on `OneTimeOrder, RecurringOrder` **(breaking)** +- Added `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` **(breaking)** +- Added success status `200` (response only) +- Added error status `404` (response only) +- Added error status `409` (response only) +- Added error status `422` (response only) +- Added `_links` (response only) +- Added `amount` (response only) +- Added `annualComplianceScreening` on `Organization` +- Added `applyAt` +- Added `automaticReadinessLastExecutedAt` on `OneTimeOrder, RecurringOrder` (response only) +- Added `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` +- Added `batchId` (response only) +- Added `billingManagementToken` (response only) +- Added `canWithdraw` (response only) +- Added `checkList` +- Added `coinPricing` +- Added `createdTime` (response only) +- Added `currency` (response only) +- Added `defaultPaymentInstrumentId` on `OneTimeOrder, RecurringOrder, StorefrontAccount` (request only) +- Added `description` +- Added `documentMatches` on `StorefrontProofOfFundsKycDocument` (response only) +- Added `documentNumber` on `KycSettingsIdentity` +- Added `exposureAmount` (response only) +- Added `faceProofBrightness` (response only) +- Added `faceProofSettings` on `KycSettingsIdentity` +- Added `failureReason` on `AmlChecksDataExport, CustomersDataExport, DisputesDataExport, InvoiceItemsDataExport, InvoicesDataExport, JournalRecordsDataExport, PayoutRequestAllocationsDataExport, PayoutRequestsDataExport, SubscriptionsDataExport, TransactionsDataExport` (response only) +- Added `gatewayAccountId` (response only) +- Added `gatewayName` (response only) +- Added `gatewayPayoutInstruction` (response only) +- Added `hasCardOnFile` (response only) +- Added `id` (response only) +- Added `includeUnpaidInvoices` on `StorefrontReactivationQuote` +- Added `isPayoutable` (response only) +- Added `issuanceCountry` on `KycSettingsIdentity` +- Added `issuanceRegion` on `KycSettingsIdentity` +- Added `parsedData` (response only) +- Added `pastDueInvoice` (response only) +- Added `paymentInstrumentFingerprint` on `OneTimeOrder, RecurringOrder` (response only) +- Added `paymentMethod` (response only) +- Added `payoutLimits` +- Added `payoutRequestId` (response only) +- Added `periodEnd` (response only) +- Added `periodStart` (response only) +- Added `plan` +- Added `preset` +- Added `promotionId` (request only) +- Added `quantityFilled` on `QuoteSubscriptionItem` +- Added optional parameter `query` (request only) +- Added `recordCount` (request only) +- Added `regulatorOperatorId` on `Organization` +- Added `regulatorSiteId` on `OneTimeOrder, RecurringOrder` +- Added `requiresCardOnFile` (response only) +- Added `schemas` on `GlobalEventType` (request only) +- Added `score` +- Added `setupFee` (response only) +- Added `splitReason` +- Added `status` +- Added `sticky` (response only) +- Added `title` +- Added `transactionId` (response only) +- Added `transactionResult` (response only) +- Added `transactionStatus` (response only) +- Added `type` (response only) +- Added `updatedTime` (response only) +- Added `version` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` (response only) +- Added media type `webp` (response only) + +### Removed +- Removed `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` (request only) **(breaking)** +- Removed `CheckInstrument` on `CheckInstrument, OneTimeOrder, RecurringOrder` **(breaking)** +- Removed `FlexiblePlan` on `OneTimeSale, Subscription` (request only) **(breaking)** +- Removed `schemas` on `DashboardMetric` (request only) **(breaking)** +- Removed `subschema #1, subschema #2` (request only) **(breaking)** +- Removed `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` (request only) **(breaking)** +- Removed schema `AccountRegistrationSettings` +- Removed schema `DepositCustomPropertySet` +- Removed schema `KhelocardCard` +- Removed schema `KhelocardCardToken` +- Removed schema `Membership` +- Removed schema `PayoutRequestSplit` +- Removed schema `PostCashierPayoutRequestCancellation` +- Removed schema `ProfileMfa` +- Removed `RebillyShipping` on `RebillyShipping, StorefrontChangeQuote, StorefrontReactivationQuote` +- Removed schema `RegistrationField` +- Removed schema `RegistrationFieldStep` +- Removed schema `StorefrontKhelocardCard` +- Removed `StorefrontKhelocardCard` on `StorefrontKhelocardCard` (response only) +- Removed schema `StorefrontProofOfCreditFileKycDocument` +- Removed `balance` (request only) +- Removed `bonusBalance` (request only) +- Removed `customPropertySetId` (request only) +- Removed `depositForm` on `OneTimeOrder, RecurringOrder` +- Removed `discountAmount` on `OneTimeOrder, RecurringOrder, StorefrontInvoice` (response only) +- Removed `failureCount` (response only) +- Removed `isDigitallyTampered` on `StorefrontProofOfIdentityKycDocument` +- Removed `isPhotocopy` on `StorefrontProofOfIdentityKycDocument` +- Removed `isPublishedOnline` on `StorefrontProofOfIdentityKycDocument` +- Removed `isTampered` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Removed `matchingImages` on `StorefrontProofOfIdentityKycDocument` (response only) +- Removed `mrzChecksumValid` on `StorefrontProofOfIdentityKycDocument` (response only) +- Removed `pendingPayoutTotal` (request only) +- Removed `planId` on `OneTimeOrder, OneTimeSaleItem, SubscriptionItem` +- Removed `properties` +- Removed `propertiesSchema` (response only) +- Removed `query` (request only) +- Removed `recurringInterval` on `Subscription` +- Removed `score` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Removed `subaggregate` (response only) +- Removed `successCount` (response only) +- Removed `value` (response only) + +### Changed +- Type changed `date` on `StorefrontProofOfAddressKycDocument` **(breaking)** +- Made nullable `dateRange` **(breaking)** +- Made nullable `defaultPaymentInstrument` on `StorefrontAccount` **(breaking)** +- Made nullable `documentMatches` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` **(breaking)** +- Type changed `eventsFilter` (response only) **(breaking)** +- Made nullable `hasMatchingFaceProof` on `StorefrontProofOfIdentityKycDocument` **(breaking)** +- Made nullable `isAdBlockEnabled` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` **(breaking)** +- Made nullable `kountFraudSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` **(breaking)** +- Made nullable `latitude` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` **(breaking)** +- Type changed `metric` (request only) **(breaking)** +- Made nullable `payPalMerchantSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` **(breaking)** +- Made optional `planId` **(breaking)** +- Made required `quantity` **(breaking)** +- Made nullable `quantityFilled` on `OneTimeSale, Subscription` **(breaking)** +- Type changed `subaggregates` (response only) **(breaking)** +- Made nullable `threatMetrixSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` **(breaking)** +- Made required `type` on `QuoteOneTimeSaleItem, QuoteSubscriptionItem` **(breaking)** +- Discriminator mapping added `IMerchant, Thunes, PayGlocal` (request only) +- Discriminator mapping changed `Khelocard` on `AlternativeInstrument, AlternativePaymentToken` +- Discriminator mapping added `PayGlocal, Thunes, IMerchant` (response only) +- Discriminator mapping added `Thunes, PayGlocal, IMerchant` (request only) +- Discriminator mapping added `Thunes-Checkout` on `OneTimeOrder, ReadyToPayMethods, RecurringOrder` +- Discriminator mapping changed `avalara` on `PostAvalaraCredential` (request only) +- Discriminator mapping changed `aws-ses` on `PostAwsSesCredential` (request only) +- Made required `collectedAmount` (response only) +- Made required `currency` (response only) +- Became read-only `defaultPaymentInstrument` on `OneTimeOrder, RecurringOrder, StorefrontAccount` +- Discriminator mapping changed `experian` on `PostExperianCredential` (request only) +- Made nullable `fileId` (request only) +- Made required `invoiceCount` (response only) +- Made required `invoicedAmount` (response only) +- Discriminator mapping changed `mailgun` on `PostMailgunCredential` (request only) +- Pattern changed `name` on `OneTimeOrder, RecurringOrder` +- Discriminator mapping changed `oauth2` on `PostOAuth2Credential` (request only) +- Made required `paymentInstrumentId` on `StorefrontAccount` +- Discriminator mapping changed `plaid` on `PostPlaidCredential` (request only) +- Discriminator mapping changed `postmark` on `PostPostmarkCredential` (request only) +- Discriminator mapping changed `sendgrid` on `PostSendGridCredential` (request only) +- Discriminator mapping changed `smtp` on `PostSmtpCredential` (request only) +- Discriminator mapping changed `taxjar` on `PostTaxJarCredential` (request only) +- Discriminator mapping added `users` +- Discriminator mapping changed `webhook` on `PostWebhookCredential` (request only) + +### Deprecated +- Deprecated `ignoreRecurring` (request only) +- Deprecated `keepTrial` on `StorefrontChangeQuote` +- Deprecated `planId` +- Deprecated `price` (response only) +- Deprecated `setup` (response only) + +### Enum changes +- `acquirerName` on `AcquirerName` accepts new values: `PayGlocal`, `Thunes` +- `eventType` on `GlobalEventType` accepts new values: `invoice-past-due-reminder-15-days`, `invoice-past-due-reminder-30-days`, `invoice-past-due-reminder-60-days`, `invoice-past-due-reminder-90-days`, `order-change-applied`, `order-change-canceled` + 16 more **(breaking)** +- `gatewayName` on `GatewayName` accepts new values: `IMerchant`, `PayGlocal`, `Thunes` **(breaking)** +- `method` on `AlternativePaymentMethods, PaymentMethod, ReadyToPayMethods, StorefrontAccount, StorefrontInvoice, StorefrontTransaction` accepts new values: `PIX-Automatico`, `Thunes-Checkout` **(breaking)** +- `methods` on `PaymentInstruction` accepts new values: `PIX-Automatico`, `Thunes-Checkout` +- `mime` accepts new values: `image/webp` **(breaking)** +- `name` accepts new values: `documentNumber`, `issuanceCountry`, `issuanceRegion` **(breaking)** +- `not` accepts new values: `data-export-failed`, `invoice-past-due-reminder-15-days`, `invoice-past-due-reminder-30-days`, `invoice-past-due-reminder-60-days`, `invoice-past-due-reminder-90-days`, `order-change-applied` + 11 more +- `paymentMethod` on `PaymentMethod` accepts new values: `PIX-Automatico`, `Thunes-Checkout` +- `paymentMethods` accepts new values: `PIX-Automatico`, `Thunes-Checkout` **(breaking)** +- `reason` accepts new values: `gateway-unreachable` **(breaking)** +- `rejectionReason` (response only) accepts new values: `document-was-valid-but-expired`, `name-and-dob-mismatch`, `no-document-data-detected` **(breaking)** +- `rel` on `OneTimeSale, Subscription` accepts new values: `leadSource` **(breaking)** +- `relatedType` accepts new values: `credit-memo-timeline-comment`, `payout-request-timeline-comment`, `quote-timeline-comment` **(breaking)** +- `renewalPolicy` on `StorefrontChangeQuote` accepts new values: `resetToRecurring`, `retainRecurring`, `retainTrialThenRecurring`, `retainTrialOnly` **(breaking)** +- `resourceType` accepts new values: `payout-request-batch` **(breaking)** +- `status` on `AmlChecksDataExport, CustomersDataExport, DisputesDataExport, InvoiceItemsDataExport, InvoicesDataExport, JournalRecordsDataExport, PayoutRequestAllocationsDataExport, PayoutRequestsDataExport, SubscriptionsDataExport, TransactionsDataExport` accepts new values: `failed`, `approved`, `canceled`, `merged`, `ready`, `split` **(breaking)** +- `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` accepts new values: `order-change-applied`, `order-change-canceled`, `order-change-created`, `subscription-pause-created`, `subscription-pause-revoked`, `transaction-partially-refunded` + 10 more **(breaking)** +- `documentType` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` no longer accepts: `credit-file-proof` **(breaking)** +- `eventsFilter` no longer accepts: `aml-list-possibly-matched`, `application-instance-disabled`, `application-instance-enabled`, `autodeposit-lookup-performed`, `balance-transaction-settled`, `coupon-application-removed` + 111 more **(breaking)** +- `not` no longer accepts: `Khelocard` +- `rel` (response only) no longer accepts: `deposit`, `documents` + +### Schema composition refactors +- Refactored under `_embedded/quote/oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `POST webhook:quote-accepted`, `POST webhook:quote-canceled` + 6 more +- Refactored under `_embedded/quote/oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `POST webhook:quote-accepted`, `POST webhook:quote-canceled` + 6 more +- Refactored under `currency` to compose `CurrencyCode` — `POST /invoices/{id}/allocate-credit-balance` +- Refactored under `customerId` to compose `CustomerId` — `POST /storefront/kyc-liveness-sessions`, `GET /storefront/kyc-liveness-sessions/{id}` + 1 more +- Refactored under `items/oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `GET /quotes` +- Refactored under `items/oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `GET /quotes` +- Refactored under `oneOf[#/components/schemas/StorefrontChangeQuote]/order/shipping` to compose `Shipping`, `StorefrontChangeQuote` — `GET /storefront/quotes/{id}`, `POST /storefront/quotes/{id}/accept` + 1 more +- Refactored under `oneOf[#/components/schemas/StorefrontReactivationQuote]/order/shipping` to compose `Shipping`, `StorefrontReactivationQuote` — `GET /storefront/quotes/{id}`, `POST /storefront/quotes/{id}/accept` + 1 more +- Refactored under `oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `POST /quotes`, `PUT /quotes/{id}` + 7 more +- Refactored under `oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `POST /quotes`, `PUT /quotes/{id}` + 7 more +- Refactored under `order/shipping` to compose `Shipping` — `POST /storefront/subscription-reactivations`, `POST /storefront/subscriptions/{id}/change-items` + +### Other +- all-of-removed-annotation-only on `subschema #1: Validation error` (response only) +- Uncomposed schema from `GlobalEventType` on `GlobalEventType` (response only) +- Uncomposed schema from `schemas` on `BaseProblem, PayoutRequestAllocation` (response only) +- Added union member to `schemas` on `GlobalEventType` (response only) +- Removed union member from `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` (response only) +- Removed union member from `CryptocurrencyToken` on `CryptocurrencyToken` +- Removed union member from `FlexiblePlan` on `FlexiblePlan, OneTimeSale, Subscription` (response only) +- Removed union member from `KycAddressMatches` on `KycAddressMatches` (request only) +- Removed union member from `PatchTaxJarCredential` on `PatchTaxJarCredential` (request only) +- Removed union member from `schemas` on `DashboardMetric` (response only) +- Removed union member from `subschema #1, subschema #2` (response only) +- Removed union member from `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` +- api-operation-id-removed on `DeleteMembership` (response only) +- api-path-removed-without-deprecation (24x) — e.g. api path removed without deprecation +- api-removed-without-deprecation (3x) — e.g. api removed without deprecation +- api-security-added on `PublishableApiKey` (response only) +- api-tag-added on `Orders` (response only) +- api-tag-added on `Orders (legacy)` (response only) +- api-tag-added on `Users` (response only) +- api-tag-removed on `Memberships` (response only) +- api-tag-removed on `Orders` (response only) +- api-tag-removed on `Orders experimental` (response only) +- Made not nullable `city` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `firstName` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Made not nullable `lastName` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Made not nullable `line1` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `phone` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `postalCode` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `region` on `StorefrontProofOfAddressKycDocument` +- became-required (1x) — e.g. request body became required +- default-value-changed on `renewalPolicy` +- Default removed on `isLegacy` +- Default removed on `pendingPeriodHours` +- discriminator-added (2x) — e.g. added request discriminator +- discriminator-added on `200` (response only) +- discriminator-added on `201` (response only) +- discriminator-added on `items/` (response only) +- Added discriminator mapping for `IMerchant, Thunes, PayGlocal` +- Added discriminator mapping for `PayGlocal, IMerchant, Thunes` (response only) +- Added discriminator mapping for `PayGlocal, Thunes, IMerchant` (response only) +- Added discriminator mapping for `Thunes, IMerchant, PayGlocal` (response only) +- Added discriminator mapping for `Thunes, PayGlocal, IMerchant` (response only) +- Added discriminator mapping for `Thunes-Checkout` (response only) +- Added discriminator mapping for `users` +- Changed discriminator mapping for `Khelocard` on `AlternativeInstrument, AlternativePaymentToken, OneTimeOrder, RecurringOrder` +- Removed discriminator mapping for `credit-file-proof` +- discriminator-removed on `shipping` on `StorefrontChangeQuote, StorefrontReactivationQuote` +- endpoint-deprecated (17x) — e.g. endpoint deprecated +- header-added on `rate-limit-limit` (response only) +- header-added on `rate-limit-remaining` (response only) +- header-added on `rate-limit-retry-after` (response only) +- header-added on `retry-after` (response only) +- max-length-set on `kountFraudSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- max-length-set on `payPalMerchantSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- max-length-set on `reportCurrency` on `Organization` (request only) +- max-length-set on `threatMetrixSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- max-length-unset on `currency` (response only) +- max-length-unset on `customerId` (response only) +- max-set on `quantity` (request only) +- Raised minimum on `pendingPeriodHours` on `OneTimeOrder, RecurringOrder` (request only) +- Shortened minimum length on `currency` (response only) +- Raised minimum length on `cancellationDescription` (request only) +- Raised minimum length on `kountFraudSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- Raised minimum length on `payPalMerchantSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- Raised minimum length on `reportCurrency` on `Organization` (request only) +- Raised minimum length on `threatMetrixSessionId` on `BBANType, IBANType, OneTimeOrder, OneTimeSale, PaymentInstruction, ReadyToPay, RecurringOrder, Subscription, Transaction` (request only) +- min-set on `quantity` (request only) +- Added discriminator variant to `AlternativeInstrument` on `AlternativeInstrument` (response only) +- Added discriminator variant to `CryptocurrencyToken` on `CryptocurrencyToken` +- Added discriminator variant to `DataExportLimitExceeded` on `DataExportLimitExceeded` (response only) +- Added discriminator variant to `KycFundsMatchesOverwrite` on `KycFundsMatchesOverwrite` (request only) +- Added discriminator variant to `PatchTaxJarCredential` on `PatchTaxJarCredential` (request only) +- Added discriminator variant to `PostPlaidCredential` on `PostPlaidCredential` (request only) +- Added discriminator variant to `TrialOnlyPlan` on `TrialOnlyPlan` (request only) +- Added discriminator variant to `TrialOnlyPlanDetails` on `TrialOnlyPlanDetails` (response only) +- Added discriminator variant to `UsersDataExport` on `UsersDataExport` +- Removed discriminator variant from `PlaidCredential` on `PlaidCredential` (request only) +- Removed discriminator variant from `StorefrontKhelocardCard` on `StorefrontKhelocardCard` (response only) +- Removed discriminator variant from `StorefrontProofOfCreditFileKycDocument` on `StorefrontProofOfCreditFileKycDocument` +- optional-property-became-not-write-only on `billingAddress` +- optional-property-became-not-write-only on `deliveryAddress` +- optional-response-header-removed on `x-ratelimit-limit` (response only) +- optional-response-header-removed on `x-ratelimit-remaining` (response only) +- optional-response-header-removed on `x-ratelimit-retry-after` (response only) +- optional-write-only-property-added on `defaultPaymentInstrumentId` on `OneTimeOrder, RecurringOrder` (response only) +- parameter-max-decreased on `query` (request only) +- pattern-added on `^_` (request only) +- pattern-added on `name` (response only) +- pattern-removed on `^[A-Z]{3}$` on `Organization` (request only) +- pattern-removed on `reportCurrency` (response only) +- required-property-became-read-only on `balance` (response only) +- required-property-became-read-only on `bonusBalance` (response only) +- required-property-became-read-only on `pendingPayoutTotal` (response only) +- type-generalized on `eventsFilter` (request only) +- type-generalized on `shipping` (request only) +- type-specialized on `items/` (response only) +- type-specialized on `metric` (response only) +- type-specialized on `type` (response only) +- webhook-added on `data-export-failed` (response only) +- webhook-added on `invoice-past-due-reminder-15-days` (response only) +- webhook-added on `invoice-past-due-reminder-30-days` (response only) +- webhook-added on `invoice-past-due-reminder-60-days` (response only) +- webhook-added on `invoice-past-due-reminder-90-days` (response only) +- webhook-added on `orders-experimental-order-change-applied` (response only) +- webhook-added on `orders-experimental-order-change-canceled` (response only) +- webhook-added on `orders-experimental-order-change-created` (response only) +- webhook-added on `payment-card-expiration-reminder-1-day` (response only) +- webhook-added on `payment-card-expiration-reminder-14-days` (response only) +- webhook-added on `payment-card-expiration-reminder-7-days` (response only) +- webhook-added on `payout-request-batch-created` (response only) +- webhook-added on `payout-request-batch-deleted` (response only) +- webhook-added on `payout-request-batch-modified` (response only) +- webhook-added on `payout-request-changed` (response only) +- webhook-added on `subscription-renewal-reminder-1-day` (response only) +- webhook-added on `subscription-renewal-reminder-30-days` (response only) +- webhook-added on `subscription-renewal-reminder-7-days` (response only) +- webhook-added on `transaction-partially-refunded` (response only) +- webhook-added on `transaction-refunded` (response only) +- webhook-added on `transaction-voided` (response only) +- webhook-removed on `orders-experimental-subscription-renewal-reminder` (response only) diff --git a/.changeset/stupid-trainers-develop.md b/.changeset/stupid-trainers-develop.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/stupid-trainers-develop.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/two-days-tap.md b/.changeset/two-days-tap.md new file mode 100644 index 000000000..4421b39cf --- /dev/null +++ b/.changeset/two-days-tap.md @@ -0,0 +1,41 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional response property `quantityFilled` on `QuoteSubscriptionItem` — `GET /quotes`, `POST /quotes` + 13 more +- Added optional request property `quantityFilled` on `QuoteSubscriptionItem` — `POST /quotes`, `PUT /quotes/{id}` + 8 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided`, `transaction-reconciled` — `POST /tags-rules`, `PUT /tags-rules/{id}` + 11 more +- Enum value added on request `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `POST /previews/webhooks`, `POST /webhooks` + 1 more +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `POST /customers/{id}/timeline`, `POST /invoices/{id}/timeline` + 12 more +- Enum value added on response `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /tags-rules`, `POST /tags-rules` + 4 more +- Enum value added on response `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /webhooks`, `POST /webhooks` + 2 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `GET /customers/{id}/timeline`, `POST /customers/{id}/timeline` + 20 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- webhook-added (3x) — e.g. webhook `transaction-partially-refunded` added +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.openapi-snapshot.yaml b/.openapi-snapshot.yaml index 8b2c0fa88..89d156099 100644 --- a/.openapi-snapshot.yaml +++ b/.openapi-snapshot.yaml @@ -28,8 +28,6 @@ info: # Authentication - This topic describes the different forms of authentication that are available in the Rebilly API, and how to use them. - Rebilly offers four forms of authentication: secret key, publishable key, JSON Web Tokens, and public signature key. - Secret API key: Use to make requests from the server side. @@ -38,8 +36,6 @@ info: - Publishable API key: Use in your client-side code to tokenize payment information. - JWT: Use to make short-life tokens that expire after a set period of time. - - ## Manage API keys To create or manage API keys, select one of the following: @@ -95,12 +91,15 @@ info: # Rate limits - Rebilly enforces rate limits on the API to ensure that no single organization consumes too many resources. - Rate limits are applied to the organization, and not to the API key. - In sandbox environment, rate limits are enforced for non-GET endpoints and are set at 3000 requests per 10 minutes. - You can find the exact number of consumed requests in the `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers in the response. - If the rate limit is exceeded, the API returns a `429 Too Many Requests` response - and a `X-RateLimit-Retry-After` header that includes a UTC timestamp of when the rate limit resets. + Rate limits apply to the organization, not to the API key. + + API responses for rate-limited operations include `Rate-Limit-Limit` and `Rate-Limit-Remaining`. + `Rate-Limit-Limit` is the maximum number of requests available at one time. + `Rate-Limit-Remaining` is the number of requests still available. + + A request over the limit returns `429 Too Many Requests`. + The response includes `Retry-After` and `Rate-Limit-Retry-After`. + Both values are the number of seconds to wait before retrying. servers: - url: https://api-sandbox.rebilly.com/organizations/{organizationId} description: Sandbox server @@ -124,8 +123,6 @@ security: - SecretApiKey: [] - JWT: [] tags: - - name: Account registration settings - description: Use account registration settings operations to configure the fields and steps that customers see during account registration. - name: Allowlists description: |- Use allowlists to exclude specific customer attribute data from risk score checks. @@ -152,7 +149,6 @@ tags: Use application owner operations to register applications to the Rebilly App Store, and manage application instances. An application owner is a person or organization that submits an app to the Rebilly App Store. - For more information on submitting apps, see [Submit an app](https://www.rebilly.com/docs/dev-docs/submit-a-rebilly-app/). - name: Application users description: |- Use application user operations to browse available apps in the Rebilly App Store, @@ -298,9 +294,7 @@ tags: For information on how manage reconciliation, see [Transaction reconciliation](https://www.rebilly.com/docs/dev-docs/transaction-reconciliation). - name: Deposits description: |- - Create and manage deposit requests and manage strategies that determine the deposit amounts to display on the page. - Rebilly hosted deposit form provides a secure and compliant way to deposit funds. - Deposit forms are customizable, and use fully responsive design, built-in error messaging and validation. + Create and manage deposit requests and manage strategies that determine the deposit amounts to display in the deposit form. > **Important:** These operations are experimental and may change. - name: Disputes @@ -419,18 +413,25 @@ tags: List order may not be maintained and duplicates may be removed. For more information, see [Value lists](https://www.rebilly.com/docs/automations/create-a-value-list/#value-lists). - - name: Memberships - description: |- - Use these operations to manage user membership within your organizations. - Membership describes the relationship between organizations and users. - For example, one user could be a member of more than one organization. - name: Metadata description: |- Use these operations to retrieve and manage metadata. Metadata is structured information on other data. - name: Orders + description: Use these operations to manage orders that include items with mixed recurring subscription plans. + - name: Orders (legacy) description: |- Use these operations to manage customer orders. + + {% admonition type="warning" %} + This is the legacy order model. + If you are new to Rebilly, use [these order operations](#tag/orders). + Organizations that use the current order model cannot create legacy orders. + For these organizations, the operations that create a legacy order return a validation error. + + For information on the legacy order model, and how to upgrade to the current order model, see [Legacy orders model](https://www.rebilly.com/docs/glossary#legacy-orders-model). + {% /admonition %} + An order is a customer's request to purchase items. It can contain subscription and one-time sale items. When an order contains one or more subscription items, it is a subscription order. @@ -438,8 +439,6 @@ tags: An order generates an invoice. A subscription order generates an invoice for each service period. For more information, see [Orders](https://www.rebilly.com/docs/dev-docs/concepts/#orders). - - name: Orders experimental - description: Use these operations to manage orders that include items with mixed recurring subscription plans. - name: Orders timeline description: Use order timelines to maintain an audit trail of changes and activity for each order. - name: Organization data exports @@ -561,7 +560,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront billing portals @@ -573,7 +572,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront cashiers description: |- @@ -586,7 +585,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. > **Important:** These operations are experimental and may change. @@ -599,7 +598,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront custom fields description: |- @@ -610,7 +609,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront deposits description: |- @@ -619,7 +618,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront invoices description: |- @@ -628,7 +627,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront KYC documents description: |- @@ -637,7 +636,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront orders description: |- @@ -646,7 +645,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront payment instruments description: |- @@ -655,7 +654,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront plans description: |- @@ -666,7 +665,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront products description: |- @@ -678,7 +677,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, - see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront purchases description: |- @@ -690,7 +689,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront quotes description: |- @@ -699,7 +698,7 @@ tags: Storefront operations interact directly with the customer, and provide the customer with access to their own data. - To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + To use Storefront operations, the customer must be issued a JWT with limited permissions. For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront transactions description: |- @@ -710,7 +709,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Storefront websites description: |- @@ -721,7 +720,7 @@ tags: To use Storefront operations, the customer must be issued a JWT with limited permissions. - For more information, see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin) and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). + For more information, see the Create a session with username and password operation and [Exchange an authentication token](https://www.rebilly.com/catalog/all/customer-authentication/postauthenticationtokenexchange). Storefront operations are intended to be used directly from an untrusted browser. - name: Tags description: Use tags to organize and categorize customers or KYC documents based on keywords. @@ -748,7 +747,7 @@ tags: Use metered billing when product quantity is unknown to the customer at the moment of creating a subscription. Metered billing is based on reported usage records. Every reported usage updates the quantity of an upcoming invoice item for a specified subscription and a plan. - To create a metered billing plan, see [Plans](../Plans). + To create a metered billing plan, see [Plans](https://www.rebilly.com/catalog/all/plans). - name: Users description: |- Use these operations to manage users. @@ -772,184 +771,6 @@ tags: or make them exclusive to particular websites. For more information, see [My organizations and websites](https://www.rebilly.com/docs/settings/organizations-and-websites/). paths: - /account-registration-settings: - get: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Account registration settings - summary: Retrieve account registration settings - operationId: GetAccountRegistrationSettingsCollection - x-sdk-operation-name: getAll - description: Retrieves a list of all account registration settings. - parameters: - - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' - responses: - '200': - description: List of account registration settings retrieved. - headers: - Pagination-Total: - $ref: '#/components/headers/Pagination-Total' - Pagination-Limit: - $ref: '#/components/headers/Pagination-Limit' - Pagination-Offset: - $ref: '#/components/headers/Pagination-Offset' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/AccountRegistrationSettings' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - post: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Account registration settings - summary: Create account registration settings - operationId: PostAccountRegistrationSettings - x-sdk-operation-name: create - description: Creates a new account registration settings resource. - requestBody: - $ref: '#/components/requestBodies/AccountRegistrationSettings' - responses: - '201': - description: Account registration settings created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/AccountRegistrationSettings' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /account-registration-settings/{id}: - parameters: - - $ref: '#/components/parameters/resourceId' - get: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Account registration settings - summary: Retrieve account registration settings - operationId: GetAccountRegistrationSettings - x-sdk-operation-name: get - description: Retrieves account registration settings with a specified ID. - responses: - '200': - description: Account registration settings retrieved. - content: - application/json: - schema: - $ref: '#/components/schemas/AccountRegistrationSettings' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - put: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Account registration settings - summary: Upsert account registration settings - operationId: PutAccountRegistrationSettings - x-sdk-operation-name: update - description: Creates or updates account registration settings with a specified ID. - requestBody: - $ref: '#/components/requestBodies/AccountRegistrationSettings' - responses: - '200': - description: Account registration settings updated. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/AccountRegistrationSettings' - '201': - description: Account registration settings created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/AccountRegistrationSettings' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - delete: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Account registration settings - summary: Delete account registration settings - operationId: DeleteAccountRegistrationSettings - x-sdk-operation-name: delete - description: |- - Deletes account registration settings with a specified ID. - Default account registration settings cannot be deleted. - responses: - '204': - description: Account registration settings deleted. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '429': - $ref: '#/components/responses/TooManyRequests' /aml-checks: get: x-products: @@ -1037,10 +858,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1078,10 +899,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1121,10 +942,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1182,10 +1003,10 @@ paths: '200': description: AML settings updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1195,10 +1016,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1311,10 +1132,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1411,6 +1232,7 @@ paths: $service = new \Rebilly\Sdk\Service($client); $attachment = $service->files()->getAttachment('attachmentId'); put: + x-internal: true x-products: - Core tags: @@ -1426,10 +1248,10 @@ paths: '200': description: Attachment updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1439,10 +1261,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1590,10 +1412,10 @@ paths: '200': description: Authentication options updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1730,10 +1552,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -1854,10 +1676,10 @@ paths: '204': description: Customer logged out. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '404': @@ -1920,10 +1742,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2025,10 +1847,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2128,6 +1950,7 @@ paths: $service = new \Rebilly\Sdk\Service($client); $blocklist = $service->blocklists()->get('blocklistId'); put: + x-internal: true x-products: - Core tags: @@ -2150,10 +1973,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2227,10 +2050,10 @@ paths: '204': description: Blocklist deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -2355,10 +2178,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2479,10 +2302,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -2600,10 +2423,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2750,10 +2573,10 @@ paths: '200': description: Coupon updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2763,10 +2586,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -2867,6 +2690,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Core tags: @@ -2892,10 +2716,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3006,10 +2830,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3130,10 +2954,10 @@ paths: '200': description: Credential updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3143,10 +2967,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3220,6 +3044,7 @@ paths: print_r($e->getValidationErrors()); } delete: + x-internal: true x-products: - Core tags: @@ -3233,10 +3058,10 @@ paths: '204': description: Credential deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '404': @@ -3391,10 +3216,10 @@ paths: '200': description: Custom field updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3404,10 +3229,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3572,10 +3397,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3747,10 +3572,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -3892,10 +3717,10 @@ paths: '204': description: Customer is merged and deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -3945,6 +3770,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Core tags: @@ -3967,10 +3793,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4084,10 +3910,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4147,6 +3973,7 @@ paths: print_r($e->getValidationErrors()); } delete: + x-internal: true x-products: - Core tags: @@ -4159,10 +3986,10 @@ paths: '204': description: Lead source deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -4263,10 +4090,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4333,6 +4160,7 @@ paths: .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'}); console.log(message.fields.eventType); delete: + x-internal: true x-products: - Core tags: @@ -4345,10 +4173,10 @@ paths: '204': description: Customer timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -4393,6 +4221,43 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + /customers/{id}/compliance-screening-report: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-products: + - Core + tags: + - Customers + summary: Create a compliance screening report + operationId: PostCustomerComplianceScreeningReport + x-sdk-operation-name: generateComplianceScreeningReport + description: |- + Creates a compliance screening report that includes Know Your Customer (KYC) and Anti-Money Laundering (AML) results for a customer. + The report is stored as a PDF customer attachment. + Requires the KYC and AML products to be enabled for the organization. + responses: + '201': + description: Compliance screening report generated. + headers: + Location: + $ref: '#/components/headers/Location' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' /disputes: get: x-products: @@ -4483,10 +4348,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4608,10 +4473,10 @@ paths: '200': description: Dispute updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4621,10 +4486,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4712,6 +4577,7 @@ paths: } /external-identifiers: get: + x-internal: true x-products: - Users tags: @@ -4751,6 +4617,7 @@ paths: - $ref: '#/components/parameters/externalIdentifierResourceId' - $ref: '#/components/parameters/externalIdentifierService' get: + x-internal: true x-products: - Users tags: @@ -4774,6 +4641,7 @@ paths: '404': $ref: '#/components/responses/NotFound' post: + x-internal: true x-products: - Users tags: @@ -4787,10 +4655,10 @@ paths: '204': description: External identifier sync scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -4802,6 +4670,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' put: + x-internal: true x-products: - Users tags: @@ -4821,10 +4690,10 @@ paths: '200': description: External identifier updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4834,10 +4703,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -4853,6 +4722,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Users tags: @@ -4866,10 +4736,10 @@ paths: '204': description: External identifier deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -4882,6 +4752,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /external-services-settings: get: + x-internal: true x-products: - Users tags: @@ -4902,6 +4773,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' put: + x-internal: true x-products: - Users tags: @@ -4920,10 +4792,10 @@ paths: '200': description: External service settings updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5032,7 +4904,7 @@ paths: the file body is sent as the request body, with the appropriate `Content-Type`. No additional properties can be set with the request data. - Permitted file types: `.jpg`, `.png`, `.gif`, and `.pdf`. + Permitted file types: `.jpg`, `.png`, `.gif`, `.webp`, and `.pdf`. When using a publishable API key, only private files can be created. The files can be modified at a later point or time, @@ -5051,10 +4923,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5175,10 +5047,10 @@ paths: '200': description: File updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5255,10 +5127,10 @@ paths: '204': description: File deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -5354,6 +5226,11 @@ paths: type: string readOnly: true format: binary + image/webp: + schema: + type: string + readOnly: true + format: binary text/csv: schema: type: string @@ -5378,6 +5255,8 @@ paths: parameters: - $ref: '#/components/parameters/applicationId' get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5417,6 +5296,8 @@ paths: $service = new \Rebilly\Sdk\Service($client); $applicationInstance = $service->applicationInstances()->get('applicationId'); put: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5434,10 +5315,10 @@ paths: '200': description: Application instance updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5447,10 +5328,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5499,6 +5380,8 @@ paths: print_r($e->getValidationErrors()); } delete: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5542,6 +5425,8 @@ paths: parameters: - $ref: '#/components/parameters/applicationId' get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5573,6 +5458,8 @@ paths: '403': $ref: '#/components/responses/Forbidden' put: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5594,10 +5481,10 @@ paths: '200': description: Application instance configuration updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5607,10 +5494,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5625,6 +5512,8 @@ paths: $ref: '#/components/responses/TooManyRequests' /applications: get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5701,6 +5590,8 @@ paths: printf("Application #%s (%s): %s\n", $application->getId(), $application->getStatus(), $application->getName()); } post: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5722,10 +5613,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -5784,6 +5675,8 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5826,6 +5719,8 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5874,6 +5769,8 @@ paths: - $ref: '#/components/parameters/resourceId' - $ref: '#/components/parameters/organizationId' get: + x-internal: true + deprecated: true x-products: - Users tags: @@ -5925,11 +5822,15 @@ paths: - SecretApiKey: [] - JWT: [] - ApplicationJWT: [] - description: Retrieves a list of invoices. + description: |- + Retrieves a list of invoices. + Each invoice in the list includes up to 10 of the most recent transactions in `transactions`. + To retrieve transactions for an invoice, use [Retrieve transactions](https://www.rebilly.com/catalog/all/transactions/gettransactioncollection) with the `invoiceIds` filter. + Search results can lag briefly behind a write. parameters: - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' - - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/invoiceCollectionLimit' - $ref: '#/components/parameters/collectionOffset' - $ref: '#/components/parameters/collectionQuery' - $ref: '#/components/parameters/collectionExpand' @@ -6006,10 +5907,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6212,17 +6113,19 @@ paths: summary: Upsert an invoice operationId: PutInvoice x-sdk-operation-name: update - description: Creates or updates (upserts) an invoice with a specified ID. + description: |- + Creates or updates (upserts) an invoice with a specified ID. + Returns a conflict error if the specified ID belongs to an upcoming invoice. requestBody: $ref: '#/components/requestBodies/Invoice' responses: '200': description: Invoice updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6232,10 +6135,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6246,6 +6149,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -6476,10 +6381,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6588,10 +6493,10 @@ paths: '200': description: Invoice item updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6653,10 +6558,10 @@ paths: '204': description: Invoice item deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '422': @@ -6702,10 +6607,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6754,17 +6659,20 @@ paths: summary: Abandon an invoice operationId: PostInvoiceAbandonment x-sdk-operation-name: abandon - description: Abandons an invoice with a specified ID. + description: |- + Abandons an invoice with a specified ID. + This operation removes credit memo allocations from the invoice. + Unused credit returns to the credit memo. responses: '201': description: Invoice abandoned. headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6801,17 +6709,20 @@ paths: summary: Void an invoice operationId: PostInvoiceVoid x-sdk-operation-name: void - description: Voids an invoice with a specified ID. + description: |- + Voids an invoice with a specified ID. + This operation removes credit memo allocations from the invoice. + Unused credit returns to the credit memo. responses: '201': description: Invoice voided. headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6859,10 +6770,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -6909,10 +6820,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7010,10 +6921,10 @@ paths: '200': description: Credit memos allocated to invoice. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7032,6 +6943,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Core tags: @@ -7053,10 +6965,10 @@ paths: '200': description: Transaction applied to invoice. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7173,10 +7085,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7272,10 +7184,10 @@ paths: '204': description: Invoice timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -7361,10 +7273,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7431,10 +7343,10 @@ paths: '200': description: Credit memo updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7444,10 +7356,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7481,10 +7393,10 @@ paths: '200': description: Credit memo updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7510,17 +7422,21 @@ paths: summary: Void a credit memo operationId: PostCreditMemoVoid x-sdk-operation-name: void - description: Voids a credit memo with a specified ID. + description: |- + Voids a credit memo with a specified ID. + Removes the invoice allocations of the credit memo and returns the allocated amounts to the invoices. + If the credit memo is allocated to an invoice that is not payable, such as a paid invoice, + the request fails with a `409` response and the credit memo is not changed. responses: '201': description: Credit memo voided. headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7531,12 +7447,15 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/TooManyRequests' /credit-memos/{id}/refund: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Core tags: @@ -7553,10 +7472,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7632,10 +7551,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7692,10 +7611,10 @@ paths: '204': description: Credit memo timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -7763,10 +7682,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7805,6 +7724,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-products: - Core tags: @@ -7824,10 +7744,10 @@ paths: '200': description: Journal account updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7837,10 +7757,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7891,6 +7811,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Core tags: @@ -7912,10 +7833,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7954,6 +7875,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-products: - Core tags: @@ -7973,10 +7895,10 @@ paths: '200': description: Journal entry updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -7986,10 +7908,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8041,6 +7963,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Core tags: @@ -8062,10 +7985,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8104,6 +8027,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-products: - Core tags: @@ -8123,10 +8047,10 @@ paths: '200': description: Journal record updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8136,10 +8060,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8155,6 +8079,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -8167,10 +8092,10 @@ paths: '204': description: Journal record deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -8219,7 +8144,7 @@ paths: pass the customer's first name to the `accept` field. If an incorrect first name is passed, the document is rejected. value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: credit-file-proof @@ -8230,7 +8155,7 @@ paths: identity-with-face-proof: summary: Identity with face proof value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: identity-proof @@ -8240,7 +8165,7 @@ paths: identity-and-address: summary: Identity and address value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: identity-proof @@ -8254,10 +8179,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8331,6 +8256,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Core tags: @@ -8342,15 +8268,14 @@ paths: requestBody: $ref: '#/components/requestBodies/PatchKycRequest' description: KYC document resource. - required: true responses: '200': description: KYC request updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8366,6 +8291,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -8378,10 +8304,10 @@ paths: '204': description: KYC request deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '404': @@ -8458,10 +8384,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8535,10 +8461,10 @@ paths: '200': description: KYC document updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8548,10 +8474,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8597,10 +8523,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8633,29 +8559,47 @@ paths: Updates the document matches of a KYC document with a specified ID. > **Note:** Use this operation for manual overrides. + + The request body schema depends on the KYC document `documentType`. + The operation rejects unknown fields. + + Send `type` with one of: + `identity-proof`, `address-proof`, `purchase-proof`, or `funds-proof`. + The specified value identifies the `type` of the document match. requestBody: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/KycIdentityMatches' - - $ref: '#/components/schemas/KycAddressMatches' - description: Kyc document resource. + oneOf: + - $ref: '#/components/schemas/KycIdentityMatchesOverwrite' + - $ref: '#/components/schemas/KycAddressMatchesOverwrite' + - $ref: '#/components/schemas/KycPurchaseMatchesOverwrite' + - $ref: '#/components/schemas/KycFundsMatchesOverwrite' + discriminator: + propertyName: type + mapping: + identity-proof: '#/components/schemas/KycIdentityMatchesOverwrite' + address-proof: '#/components/schemas/KycAddressMatchesOverwrite' + purchase-proof: '#/components/schemas/KycPurchaseMatchesOverwrite' + funds-proof: '#/components/schemas/KycFundsMatchesOverwrite' + description: KYC document matches overwrite payload. required: true responses: '204': description: Document matches updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /kyc-documents/{id}/rejection: @@ -8687,10 +8631,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8732,10 +8676,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8777,10 +8721,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8818,10 +8762,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8879,10 +8823,10 @@ paths: '200': description: KYC settings updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -8971,10 +8915,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9054,6 +8998,7 @@ paths: $passwordToken = $service->customerAuthentication()->getResetPasswordToken('tokenId'); delete: + x-internal: true x-products: - Core tags: @@ -9067,10 +9012,10 @@ paths: '204': description: Reset password token deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -9189,10 +9134,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9202,10 +9147,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9424,10 +9369,10 @@ paths: '200': description: Payment instrument updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9546,10 +9491,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9604,10 +9549,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9714,7 +9659,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Plan' + $ref: '#/components/schemas/PlanRequest' description: Plan resource. required: true responses: @@ -9723,10 +9668,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9778,14 +9723,14 @@ paths: source: |- $service = new \Rebilly\Sdk\Service($client); - $plan = \Rebilly\Sdk\Model\SubscriptionPlan::from([]) + $plan = \Rebilly\Sdk\Model\PlanSubscriptionPlan::from([]) ->setProductId('productId') ->setName('Test plan') ->setCurrency('USD') ->setPricing(new \Rebilly\Sdk\Model\PlanFormulaFlatRate(['price' => 9.99])) ->setRecurringInterval( - \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::from() - ->setUnit(\Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_MONTH) + \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::from() + ->setUnit(\Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_MONTH) ->setLength(1), ); @@ -9849,17 +9794,17 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Plan' + $ref: '#/components/schemas/PlanRequest' description: Plan resource. required: true responses: '200': description: Plan updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9869,10 +9814,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -9925,9 +9870,9 @@ paths: source: |- $service = new \Rebilly\Sdk\Service($client); - $plan = new \Rebilly\Sdk\Model\SubscriptionPlan([ + $plan = new \Rebilly\Sdk\Model\PlanSubscriptionPlan([ 'recurringInterval' => [ - 'unit' => \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_WEEK, + 'unit' => \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_WEEK, 'length' => 2, ], ]); @@ -9941,8 +9886,8 @@ paths: // OR $plan = $service->plans()->get('planId'); - $plan->setRecurringInterval(new \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval([ - 'unit' => \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_WEEK, + $plan->setRecurringInterval(new \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval([ + 'unit' => \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_WEEK, 'length' => 2, ])); @@ -9964,10 +9909,10 @@ paths: '204': description: Plan deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '404': @@ -10079,10 +10024,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10183,10 +10128,10 @@ paths: '200': description: Product updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10196,10 +10141,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10304,8 +10249,6 @@ paths: $service->products()->delete('productId'); /quotes: get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10341,8 +10284,6 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10363,10 +10304,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10375,6 +10316,8 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -10383,8 +10326,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10414,8 +10355,6 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10437,10 +10376,10 @@ paths: '200': description: Quote updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10450,10 +10389,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10464,13 +10403,14 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' patch: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: @@ -10492,10 +10432,10 @@ paths: '200': description: Quote updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10514,8 +10454,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10528,10 +10466,10 @@ paths: '200': description: Quote accepted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10544,14 +10482,14 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /quotes/{id}/cancel: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10564,10 +10502,10 @@ paths: '200': description: Quote canceled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10586,8 +10524,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10600,10 +10536,10 @@ paths: '200': description: Quote issued. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10622,8 +10558,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10638,10 +10572,62 @@ paths: '200': description: Quote recalled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/Quote' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' + /quotes/{id}/reissue: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-products: + - Core + tags: + - Quotes + summary: Reissue a quote + operationId: PostQuoteReissue + x-sdk-operation-name: reissue + description: |- + Reissues an expired, canceled, or rejected quote with a specified ID. + This operation assigns the quote the `status` of `issued`, + clears the `canceledTime` and `rejectedTime` fields, + and resets the fulfilled acceptance conditions. + If the request omits `expirationTime`, the quote keeps its expiration time when it has not passed, + otherwise the quote expires one month after it is reissued. + + This operation restores the voided quotation invoice to the `quotation` status, + and recalculates the invoice from the current quote items and order. + Reissuing a quote triggers the same webhooks, rules, and timeline entries as issuing it. + To reissue a change or reactivation quote, the order must still allow that quote type, + and no other draft or issued quote may exist for the same order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QuoteReissue' + description: Quote reissue resource. + responses: + '200': + description: Quote reissued. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10654,14 +10640,15 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /quotes/{id}/reject: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: @@ -10674,10 +10661,10 @@ paths: '200': description: Quote rejected. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10696,8 +10683,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10733,8 +10718,6 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -10756,10 +10739,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10782,8 +10765,7 @@ paths: schema: type: string get: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: @@ -10806,8 +10788,7 @@ paths: '404': $ref: '#/components/responses/NotFound' delete: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: @@ -10820,10 +10801,10 @@ paths: '204': description: Quote timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -10865,10 +10846,10 @@ paths: '200': description: Payment methods retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -10921,8 +10902,47 @@ paths: } catch (\Rebilly\Sdk\Exception\DataValidationException $e) { print_r($e->getValidationErrors()); } + /release-flags: + get: + x-internal: true + x-products: + - Users + tags: + - Organizations + summary: Retrieve enabled release flags + operationId: GetReleaseFlags + x-sdk-resource: ReleaseFlags + x-sdk-operation-name: getEnabled + description: |- + Retrieves the keys of the release flags that are on for the current organization. + + A release flag is a temporary switch that turns an unfinished feature on for some organizations. + Every user of the organization can call this operation. + responses: + '200': + description: Enabled release flags retrieved. + content: + application/json: + schema: + type: object + title: ReleaseFlags + required: + - enabled + properties: + enabled: + description: Keys of the release flags that are on for the current organization. + type: array + items: + type: string + pattern: ^[a-z][a-z0-9-]{0,63}$ + example: new-webhooks + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' /search: get: + x-internal: true x-products: - Core tags: @@ -11011,6 +11031,7 @@ paths: // access the collection items, each item is a ShippingRate secondCollection.items.forEach(shippingRate => console.log(shippingRate.fields.name)); post: + x-internal: true x-products: - Core tags: @@ -11032,10 +11053,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11107,10 +11128,10 @@ paths: '200': description: Shipping rate updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11120,10 +11141,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11171,6 +11192,7 @@ paths: const shippingRate = await api.shippingRates.update({id: 'my-second-key', data}); delete: + x-internal: true x-products: - Core tags: @@ -11183,10 +11205,10 @@ paths: '204': description: Shipping rate deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -11207,12 +11229,10 @@ paths: console.log(request.response.status); // 204 /orders: get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve orders operationId: GetOrderCollection x-sdk-operation-name: getAll @@ -11249,12 +11269,10 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Create an order operationId: PostOrder x-sdk-operation-name: create @@ -11287,12 +11305,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve an order operationId: GetOrder x-sdk-operation-name: get @@ -11317,12 +11333,10 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Upsert an order operationId: PutOrder x-sdk-operation-name: update @@ -11357,18 +11371,21 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + description: |- + Change to the order rejected. + For example, the renewal time cannot change while the next invoice is already issued with a scheduled change. + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' /orders/{id}/upcoming-invoice: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve an upcoming order invoice operationId: GetOrderUpcomingInvoice x-sdk-operation-name: getUpcomingInvoice @@ -11395,12 +11412,10 @@ paths: $ref: '#/components/responses/NotFound' /order-pauses: get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve order pauses operationId: GetOrderPauseCollection x-sdk-operation-name: getAll @@ -11431,13 +11446,11 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental - summary: Pause a order + - Orders + summary: Pause an order operationId: PostOrderPause x-sdk-operation-name: pause description: Pauses an order with a specified ID. @@ -11454,10 +11467,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11474,12 +11487,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve an order pause operationId: GetOrderPause x-sdk-operation-name: get @@ -11498,12 +11509,10 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Update an order pause operationId: PutOrderPause x-sdk-operation-name: update @@ -11517,10 +11526,10 @@ paths: '200': description: Pause updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11530,10 +11539,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11547,12 +11556,10 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Delete an order pause operationId: DeleteOrderPause x-sdk-operation-name: delete @@ -11564,10 +11571,198 @@ paths: '204': description: Order pause revoked or finished. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' + /order-changes: + get: + x-products: + - Core + tags: + - Orders + summary: Retrieve order changes + operationId: GetOrderChangeCollection + x-sdk-operation-name: getAll + description: |- + Retrieves a list of order changes. + To find the pending change of an order, use `filter=orderId:{orderId};status:pending`. + parameters: + - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/collectionOffset' + - $ref: '#/components/parameters/collectionFilter' + - $ref: '#/components/parameters/collectionSort' + responses: + '200': + description: List of order changes retrieved. + headers: + Pagination-Total: + $ref: '#/components/headers/Pagination-Total' + Pagination-Limit: + $ref: '#/components/headers/Pagination-Limit' + Pagination-Offset: + $ref: '#/components/headers/Pagination-Offset' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OrderChange' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + post: + x-products: + - Core + tags: + - Orders + summary: Change order items + operationId: PostOrderChange + x-sdk-operation-name: create + description: Changes the items of an order immediately, or schedules the change for the next renewal. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + description: Order change resource. + required: true + responses: + '201': + description: Order change created. + headers: + Location: + $ref: '#/components/headers/Location' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + description: |- + Order change rejected. + For example, the order is in trial, the next renewal invoice is already issued, + or the new items are the same as the current items. + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /order-changes/{id}: + parameters: + - $ref: '#/components/parameters/resourceId' + get: + x-products: + - Core + tags: + - Orders + summary: Retrieve an order change + operationId: GetOrderChange + x-sdk-operation-name: get + description: Retrieves an order change with a specified ID. + responses: + '200': + description: Order change retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + put: + x-products: + - Core + tags: + - Orders + summary: Upsert an order change + operationId: PutOrderChange + x-sdk-operation-name: update + description: |- + Creates an order change with a specified ID, or replaces the items of a pending order change. + A change that is not pending cannot be updated. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + responses: + '200': + description: Order change updated. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + '201': + description: Order change created. + headers: + Location: + $ref: '#/components/headers/Location' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/OrderChange' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + description: Order change rejected, or the change is not pending. + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + delete: + x-products: + - Core + tags: + - Orders + summary: Cancel an order change + operationId: DeleteOrderChange + x-sdk-operation-name: delete + description: |- + Cancels a pending order change with a specified ID. + The current items of the order stay as they are. + A change cannot be canceled after it is locked by an issued invoice, applied, canceled, or superseded. + responses: + '204': + description: Order change canceled. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -11580,12 +11775,10 @@ paths: $ref: '#/components/responses/TooManyRequests' /order-cancellations: get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve order cancellation collection operationId: GetOrderCancellationCollection x-sdk-operation-name: getAll @@ -11616,12 +11809,10 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Cancel an order operationId: PostOrderCancellation x-sdk-operation-name: create @@ -11639,10 +11830,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11659,12 +11850,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve an order cancellation operationId: GetOrderCancellation x-sdk-operation-name: get @@ -11683,12 +11872,11 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: - - Orders experimental + - Orders summary: Upsert an order cancellation operationId: PutOrderCancellation x-sdk-operation-name: update @@ -11704,10 +11892,10 @@ paths: '200': description: Cancellation updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11717,10 +11905,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11734,12 +11922,11 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' patch: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: - - Orders experimental + - Orders summary: Update an order cancellation operationId: PatchOrderCancellation x-sdk-operation-name: patch @@ -11763,10 +11950,10 @@ paths: '200': description: Cancellation updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11780,12 +11967,11 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: - - Orders experimental + - Orders summary: Delete an order cancellation operationId: DeleteOrderCancellation x-sdk-operation-name: delete @@ -11797,10 +11983,10 @@ paths: '204': description: Order cancellation deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -11813,12 +11999,10 @@ paths: $ref: '#/components/responses/TooManyRequests' /order-reactivations: get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve order reactivations operationId: GetOrderReactivationCollection x-sdk-operation-name: getAll @@ -11861,12 +12045,11 @@ paths: // access the collection items, each item is a Member secondCollection.items.forEach(order => console.log(order.fields.customerId)); post: - x-badges: - - name: Experimental + x-internal: true x-products: - Core tags: - - Orders experimental + - Orders summary: Reactivate an order operationId: PostOrderReactivation x-sdk-operation-name: reactivate @@ -11886,10 +12069,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -11919,12 +12102,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Retrieve an order reactivation operationId: GetOrderReactivation x-sdk-operation-name: get @@ -11952,7 +12133,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve orders operationId: GetSubscriptionCollection x-sdk-operation-name: getAll @@ -11964,13 +12145,13 @@ paths: parameters: - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' - - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/subscriptionCollectionLimit' - $ref: '#/components/parameters/collectionOffset' - $ref: '#/components/parameters/collectionQuery' - $ref: '#/components/parameters/subscriptionExpand' responses: '200': - description: List of subscriptions retrieved. + description: List of orders retrieved. headers: Pagination-Total: $ref: '#/components/headers/Pagination-Total' @@ -12028,14 +12209,17 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Create an order operationId: PostSubscription x-sdk-operation-name: create description: |- Creates an order. - To create or update an order with a specified ID, use the [Upsert an order](../PutSubscription) operation. + To create or update an order with a specified ID, use the [`PUT /subscriptions/{id}`](https://www.rebilly.com/catalog/all/orders-(legacy)/putsubscription) operation. + + Organizations that use the current order model cannot create legacy orders, and this operation returns a validation error for them. + To create an order with the current order model, use the [`POST /orders`](https://www.rebilly.com/catalog/all/orders/postorder) operation. parameters: - $ref: '#/components/parameters/subscriptionExpand' requestBody: @@ -12046,10 +12230,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12180,7 +12364,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve an order operationId: GetSubscription x-sdk-operation-name: get @@ -12221,11 +12405,16 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Upsert an order operationId: PutSubscription x-sdk-operation-name: update - description: Creates or updates (upserts) an order with a specified ID. + description: |- + Creates or updates (upserts) an order with a specified ID. + + Organizations that use the current order model cannot create legacy orders. + For these organizations, this operation only updates an existing order, and returns a validation error when the order does not exist. + To create an order with the current order model, use the [`POST /orders`](https://www.rebilly.com/catalog/all/orders/postorder) operation. parameters: - $ref: '#/components/parameters/subscriptionExpand' requestBody: @@ -12234,10 +12423,10 @@ paths: '200': description: Order updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12393,7 +12582,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Delete a pending order operationId: DeleteSubscription x-sdk-operation-name: delete @@ -12402,10 +12591,10 @@ paths: '204': description: Pending order deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -12428,7 +12617,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Void a subscription order operationId: PostSubscriptionVoid x-sdk-operation-name: void @@ -12439,10 +12628,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12473,12 +12662,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Void an order operationId: PostOrderVoid x-sdk-operation-name: void @@ -12489,10 +12676,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12518,13 +12705,15 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Change subscription order items operationId: PostSubscriptionItemsChange x-sdk-operation-name: changeItems parameters: - $ref: '#/components/parameters/subscriptionExpand' - description: Changes subscription order items or quantities, and designates if or when pro-rata credits should be given. + description: |- + Changes the items or quantities of an order that contains subscription items and specifies if and when to give pro rata credits. + To change the items at the next renewal, use the `POST /order-changes` operation with `applyAt` set to `nextRenewal`. requestBody: content: application/json: @@ -12538,10 +12727,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12550,6 +12739,11 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + description: Change to the order items rejected. + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -12558,23 +12752,23 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Change order items operationId: PostOrderItemsChange x-sdk-operation-name: changeItems parameters: - $ref: '#/components/parameters/orderExpand' - description: Changes order items or quantities, and designates if or when pro-rata credits should be given. + description: |- + Changes order items or quantities and specifies if and when to give pro rata credits. + To change the items at the next renewal, use the `POST /order-changes` operation with `applyAt` set to `nextRenewal`. requestBody: content: application/json: schema: - $ref: '#/components/schemas/OrderChange' + $ref: '#/components/schemas/OrderItemsChange' description: Change items request. required: true responses: @@ -12583,10 +12777,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12595,6 +12789,13 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + description: |- + Change to the order items rejected. + For example, the next renewal invoice is already issued with a pending order change. + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -12604,17 +12805,18 @@ paths: - $ref: '#/components/parameters/resourceId' - name: itemId in: path - description: ID of subscription item. + description: ID of the subscription item. required: true schema: type: string patch: + x-internal: true x-badges: - name: Experimental x-products: - Core tags: - - Orders + - Orders (legacy) summary: Update a subscription order item operationId: PatchSubscriptionItem x-sdk-operation-name: updateItem @@ -12632,10 +12834,10 @@ paths: '200': description: Order item updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12670,12 +12872,10 @@ paths: schema: type: string patch: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Update an order item operationId: PatchOrderItem x-sdk-operation-name: updateItem @@ -12693,10 +12893,10 @@ paths: '200': description: Order item updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12728,7 +12928,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Issue an interim invoice operationId: PostSubscriptionInterimInvoice x-sdk-operation-name: createInterimInvoice @@ -12755,10 +12955,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12775,12 +12975,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Issue an interim invoice operationId: PostOrderInterimInvoice x-sdk-operation-name: createInterimInvoice @@ -12807,10 +13005,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12828,7 +13026,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve subscription order pauses operationId: GetSubscriptionPauseCollection x-sdk-operation-name: getAll @@ -12862,7 +13060,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Pause a subscription order operationId: PostSubscriptionPause x-sdk-operation-name: pause @@ -12880,10 +13078,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12903,7 +13101,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve a subscription order pause operationId: GetSubscriptionPause x-sdk-operation-name: get @@ -12925,7 +13123,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Update a subscription order pause operationId: PutSubscriptionPause x-sdk-operation-name: update @@ -12939,10 +13137,10 @@ paths: '200': description: Pause updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12952,10 +13150,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -12972,7 +13170,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Delete a subscription order pause operationId: DeleteSubscriptionPause x-sdk-operation-name: delete @@ -12984,10 +13182,10 @@ paths: '204': description: Subscription order pause revoked or finished. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -13003,7 +13201,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve subscription order cancellations operationId: GetSubscriptionCancellationCollection x-sdk-operation-name: getAll @@ -13071,7 +13269,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Cancel a subscription order operationId: PostSubscriptionCancellation x-sdk-operation-name: create @@ -13084,10 +13282,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13148,7 +13346,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve a subscription order cancellation operationId: GetSubscriptionCancellation x-sdk-operation-name: get @@ -13175,7 +13373,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Upsert a subscription order cancellation operationId: PutSubscriptionCancellation x-sdk-operation-name: update @@ -13186,10 +13384,10 @@ paths: '200': description: Cancellation updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13199,10 +13397,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13248,7 +13446,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Update a subscription order cancellation operationId: PatchSubscriptionCancellation x-sdk-operation-name: patch @@ -13272,10 +13470,10 @@ paths: '200': description: Cancellation updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13306,7 +13504,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Delete a subscription order cancellation operationId: DeleteSubscriptionCancellation x-sdk-operation-name: delete @@ -13318,10 +13516,10 @@ paths: '204': description: Subscription order cancellation deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -13342,7 +13540,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve subscription order reactivations operationId: GetSubscriptionReactivationCollection x-sdk-operation-name: getAll @@ -13388,7 +13586,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Reactivate a subscription order operationId: PostSubscriptionReactivation x-sdk-operation-name: reactivate @@ -13408,10 +13606,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13444,7 +13642,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve a subscription order reactivation operationId: GetSubscriptionReactivation x-sdk-operation-name: get @@ -13474,7 +13672,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve upcoming subscription order invoice operationId: GetSubscriptionUpcomingInvoiceCollection x-sdk-operation-name: getAllUpcomingInvoices @@ -13482,7 +13680,7 @@ paths: Retrieves an upcoming invoice for a specified subscription order. This endpoint is deprecated. - Use [Retrieve an upcoming invoice](../GetSubscriptionUpcomingInvoice) instead. + Use [Retrieve an upcoming subscription order invoice](https://www.rebilly.com/catalog/all/orders-(legacy)/getsubscriptionupcominginvoice) instead. parameters: - $ref: '#/components/parameters/collectionExpand' deprecated: true @@ -13508,7 +13706,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Retrieve an upcoming subscription order invoice operationId: GetSubscriptionUpcomingInvoice x-sdk-operation-name: getUpcomingInvoice @@ -13540,7 +13738,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Issue an upcoming invoice for early pay operationId: PostSubscriptionUpcomingInvoiceIssuance x-sdk-operation-name: issueEarlyUpcomingInvoice @@ -13558,10 +13756,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13580,12 +13778,10 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: - - Orders experimental + - Orders summary: Issue an upcoming invoice for early pay operationId: PostOrderUpcomingInvoiceIssuance x-sdk-operation-name: issueEarlyUpcomingInvoice @@ -13603,10 +13799,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13634,7 +13830,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Issue a specific upcoming invoice for early pay operationId: PostUpcomingInvoiceIssuance x-sdk-operation-name: issueUpcomingInvoice @@ -13643,7 +13839,7 @@ paths: Issues an upcoming invoice with a specified ID for early pay. This endpoint is deprecated. - Use [Issue an upcoming invoice for early pay](../PostSubscriptionUpcomingInvoiceIssuance) instead. + Use [Issue an upcoming invoice for early pay](https://www.rebilly.com/catalog/all/orders-(legacy)/postsubscriptionupcominginvoiceissuance) instead. requestBody: content: application/json: @@ -13657,10 +13853,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13747,10 +13943,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13796,7 +13992,7 @@ paths: summary: Retrieve an order timeline message operationId: GetSubscriptionTimeline x-sdk-operation-name: getTimelineMessage - description: Retrieves a order message with a specified ID. + description: Retrieves an order timeline message with a specified ID. responses: '200': description: Order timeline message retrieved. @@ -13817,6 +14013,7 @@ paths: .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'}); console.log(message.fields.eventType); delete: + x-internal: true x-products: - Core tags: @@ -13829,10 +14026,10 @@ paths: '204': description: Order timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -13909,10 +14106,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -13931,6 +14128,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Core tags: @@ -13968,10 +14166,10 @@ paths: '204': description: Usage record deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14054,10 +14252,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -14090,6 +14288,7 @@ paths: parameters: - $ref: '#/components/parameters/tag' get: + x-internal: true x-products: - Core tags: @@ -14112,6 +14311,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Core tags: @@ -14126,10 +14326,10 @@ paths: '200': description: Tag updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -14147,6 +14347,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -14161,10 +14362,10 @@ paths: '204': description: Tag deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14177,6 +14378,7 @@ paths: parameters: - $ref: '#/components/parameters/tag' post: + x-internal: true x-products: - Core tags: @@ -14209,10 +14411,10 @@ paths: '204': description: Customers tagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14222,6 +14424,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -14254,10 +14457,10 @@ paths: '204': description: Customers untagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14283,10 +14486,10 @@ paths: '204': description: Customer tagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14308,10 +14511,10 @@ paths: '204': description: Customer untagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14324,6 +14527,7 @@ paths: parameters: - $ref: '#/components/parameters/tag' post: + x-internal: true x-products: - Core tags: @@ -14357,10 +14561,10 @@ paths: '204': description: KYC documents tagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14370,6 +14574,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -14403,10 +14608,10 @@ paths: '204': description: KYC documents untagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14432,10 +14637,10 @@ paths: '204': description: KYC document tagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14457,10 +14662,10 @@ paths: '204': description: KYC document untagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14473,6 +14678,7 @@ paths: parameters: - $ref: '#/components/parameters/tag' post: + x-internal: true x-products: - Core tags: @@ -14506,10 +14712,10 @@ paths: '204': description: AML checks tagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14519,6 +14725,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core tags: @@ -14552,10 +14759,10 @@ paths: '204': description: AML checks untagging process has been scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14589,10 +14796,10 @@ paths: '204': description: AML check tagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14617,10 +14824,10 @@ paths: '204': description: AML check untagged. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -14662,10 +14869,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -14950,10 +15157,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15009,10 +15216,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15298,10 +15505,10 @@ paths: '200': description: Transaction updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15373,10 +15580,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15406,17 +15613,17 @@ paths: Queries a transaction with a specified ID. The query interacts with the related gateway account to obtain the result, amount, and currency. - If after analysis, the transaction must be updated, see [Update a transaction status](../PostTransactionUpdate). + If after analysis, the transaction must be updated, see [Update a transaction status](https://www.rebilly.com/catalog/all/transactions/posttransactionupdate). responses: '201': description: Transaction queried. headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15453,10 +15660,10 @@ paths: '200': description: Transaction updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15499,10 +15706,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15611,10 +15818,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15693,10 +15900,10 @@ paths: '204': description: Transaction timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -15718,6 +15925,7 @@ paths: console.log(request.response.status); // 204 /fees: get: + x-internal: true x-badges: - name: Experimental x-products: @@ -15757,6 +15965,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-badges: - name: Experimental x-products: @@ -15789,10 +15998,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15816,6 +16025,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-badges: - name: Experimental x-products: @@ -15850,6 +16060,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-badges: - name: Experimental x-products: @@ -15895,10 +16106,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -15919,6 +16130,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' patch: + x-internal: true x-badges: - name: Experimental x-products: @@ -15968,6 +16180,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-badges: - name: Experimental x-products: @@ -15985,10 +16198,10 @@ paths: '204': description: Fee deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -16085,10 +16298,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16197,10 +16410,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16262,10 +16475,10 @@ paths: '204': description: API key deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -16413,10 +16626,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16472,10 +16685,10 @@ paths: '200': description: Billing portal updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16485,10 +16698,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16521,10 +16734,10 @@ paths: '204': description: Billing portal deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -16535,6 +16748,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /broadcast-messages: get: + x-internal: true x-products: - Users tags: @@ -16569,6 +16783,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Users tags: @@ -16583,10 +16798,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16610,6 +16825,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Users tags: @@ -16632,6 +16848,7 @@ paths: '404': $ref: '#/components/responses/NotFound' delete: + x-internal: true x-products: - Users tags: @@ -16646,6 +16863,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' patch: + x-internal: true x-products: - Users tags: @@ -16658,10 +16876,10 @@ paths: '200': description: Broadcast message updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16683,6 +16901,7 @@ paths: required: true /deposit-requests: post: + x-internal: true x-products: - Core x-badges: @@ -16694,7 +16913,7 @@ paths: x-sdk-operation-name: create description: |- Creates a deposit request. - To complete the deposit, the customer is redirected to the [deposit](/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=response&c=201&path=_links/href) link. + To complete the deposit, use the `cashierToken` from the response to show the customer a Cashier deposit form. After the deposit, the customer is redirected to the `redirectUrl`. Corresponding transaction webhooks are sent to webhooks subscribers. requestBody: @@ -16710,10 +16929,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16727,6 +16946,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' get: + x-internal: true x-products: - Core x-badges: @@ -16767,6 +16987,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Core x-badges: @@ -16794,6 +17015,7 @@ paths: $ref: '#/components/responses/NotFound' /cashiers: post: + x-internal: true x-products: - Core x-badges: @@ -16822,10 +17044,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16842,6 +17064,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Core x-badges: @@ -16867,6 +17090,7 @@ paths: $ref: '#/components/responses/NotFound' /deposit-strategies: post: + x-internal: true x-products: - Core x-badges: @@ -16902,10 +17126,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -16919,6 +17143,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' get: + x-internal: true x-products: - Core x-badges: @@ -16958,6 +17183,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Core x-badges: @@ -16982,6 +17208,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-products: - Core x-badges: @@ -17017,10 +17244,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17036,6 +17263,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Core x-badges: @@ -17050,197 +17278,10 @@ paths: '204': description: Deposit amount strategy deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '429': - $ref: '#/components/responses/TooManyRequests' - /deposit-custom-property-sets: - post: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Deposits - summary: Create a custom deposit property set - operationId: PostDepositCustomPropertySet - x-sdk-operation-name: create - description: |- - Creates a custom deposit property set. - A custom property set is a JSON-schema to extend the request form with extra form fields. - The collected information is stored at the deposit request. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - description: Custom deposit property set resource. - required: true - responses: - '201': - description: Custom deposit property set created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - get: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Deposits - summary: Retrieve custom deposit properties sets - operationId: GetDepositCustomPropertySetCollection - x-sdk-operation-name: getAll - description: Retrieves a list of custom deposit property sets. - parameters: - - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' - - $ref: '#/components/parameters/collectionFilter' - - $ref: '#/components/parameters/collectionSort' - responses: - '200': - description: List of custom deposit property sets retrieved. - headers: - Pagination-Total: - $ref: '#/components/headers/Pagination-Total' - Pagination-Limit: - $ref: '#/components/headers/Pagination-Limit' - Pagination-Offset: - $ref: '#/components/headers/Pagination-Offset' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepositCustomPropertySet' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - /deposit-custom-property-sets/{id}: - parameters: - - $ref: '#/components/parameters/resourceId' - get: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Deposits - summary: Retrieve a custom deposit property set - operationId: GetDepositCustomPropertySet - x-sdk-operation-name: get - description: Retrieves a custom deposit property set with a specified ID. - responses: - '200': - description: Custom deposit property set retrieved. - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - put: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Deposits - summary: Upsert a custom deposit property set - operationId: PutDepositCustomPropertySet - x-sdk-operation-name: update - description: Creates or updates (upserts) a custom deposit property set with a specified ID. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - description: Custom deposit property set resource. - required: true - responses: - '200': - description: Custom deposit property updated. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - '201': - description: Custom deposit property set created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/DepositCustomPropertySet' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - delete: - x-products: - - Core - x-badges: - - name: Experimental - tags: - - Deposits - summary: Delete a custom deposit property set - operationId: DeleteDepositCustomPropertySet - x-sdk-operation-name: delete - description: Deletes a custom deposit property set with a specified ID. - responses: - '204': - description: Custom deposit property set deleted. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -17251,6 +17292,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /checkout-forms: get: + x-internal: true deprecated: true x-products: - Users @@ -17287,6 +17329,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true deprecated: true x-products: - Users @@ -17302,10 +17345,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17327,6 +17370,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true deprecated: true x-products: - Users @@ -17350,6 +17394,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true deprecated: true x-products: - Users @@ -17371,10 +17416,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17395,6 +17440,7 @@ paths: schema: $ref: '#/components/schemas/CheckoutForm' delete: + x-internal: true deprecated: true x-products: - Users @@ -17408,10 +17454,10 @@ paths: '204': description: Checkout form deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -17442,10 +17488,10 @@ paths: '200': description: List of service credentials retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17487,10 +17533,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17500,10 +17546,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17517,17 +17563,13 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceCredential' - description: Service credential resource. - required: true + $ref: '#/components/requestBodies/PostCredential' x-codeSamples: - lang: JavaScript source: | // first set the required properties for the new service credential const data = { + type: 'webhook', host: 'foobar.test.com', auth: { type: 'none' @@ -17583,10 +17625,10 @@ paths: '200': description: Service credential updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17606,6 +17648,7 @@ paths: source: | // first set the status to update for the service credential const data = { + type: 'webhook', status: 'deactivated' }; @@ -17615,6 +17658,7 @@ paths: - $ref: '#/components/parameters/credentialType' - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Users tags: @@ -17710,10 +17754,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17742,6 +17786,7 @@ paths: maxLength: 255 pattern: ^[@~\-\.\w]+$ get: + x-internal: true x-products: - Users tags: @@ -17776,10 +17821,10 @@ paths: '204': description: Custom domains deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -17805,10 +17850,10 @@ paths: '200': description: Email delivery setting verified. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17875,10 +17920,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17936,10 +17981,10 @@ paths: '204': description: Email delivery setting deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '409': $ref: '#/components/responses/Conflict' '429': @@ -17964,10 +18009,10 @@ paths: '200': description: Email delivery setting updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -17998,10 +18043,10 @@ paths: '200': description: Verification email sent. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18067,10 +18112,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18116,6 +18161,7 @@ paths: '404': $ref: '#/components/responses/NotFound' delete: + x-internal: true x-products: - Users tags: @@ -18128,10 +18174,10 @@ paths: '204': description: Email message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '409': $ref: '#/components/responses/Conflict' '429': @@ -18149,10 +18195,10 @@ paths: '200': description: Email message accepted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18336,10 +18382,10 @@ paths: '200': description: Rules updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18425,6 +18471,7 @@ paths: parameters: - $ref: '#/components/parameters/systemEventType' get: + x-internal: true x-products: - Users tags: @@ -18460,6 +18507,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Users tags: @@ -18481,10 +18529,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18507,6 +18555,7 @@ paths: schema: type: string get: + x-internal: true x-products: - Users tags: @@ -18529,6 +18578,7 @@ paths: '404': $ref: '#/components/responses/NotFound' delete: + x-internal: true x-products: - Users tags: @@ -18541,10 +18591,10 @@ paths: '204': description: Rules engine timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -18610,6 +18660,7 @@ paths: - $ref: '#/components/parameters/systemEventType' - $ref: '#/components/parameters/rulesVersion' get: + x-internal: true x-products: - Users tags: @@ -18647,6 +18698,7 @@ paths: - $ref: '#/components/parameters/systemEventType' - $ref: '#/components/parameters/rulesVersion' get: + x-internal: true x-products: - Users tags: @@ -18683,6 +18735,7 @@ paths: parameters: - $ref: '#/components/parameters/systemEventType' get: + x-internal: true x-products: - Users tags: @@ -18723,6 +18776,7 @@ paths: '404': $ref: '#/components/responses/NotFound' post: + x-internal: true x-products: - Users tags: @@ -18737,10 +18791,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18762,6 +18816,7 @@ paths: - $ref: '#/components/parameters/systemEventType' - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Users tags: @@ -18786,6 +18841,7 @@ paths: '404': $ref: '#/components/responses/NotFound' delete: + x-internal: true x-products: - Users tags: @@ -18798,10 +18854,10 @@ paths: '204': description: Draft ruleset deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '404': @@ -18809,6 +18865,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' put: + x-internal: true x-products: - Users tags: @@ -18821,10 +18878,10 @@ paths: '200': description: Draft ruleset updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18834,10 +18891,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -18861,6 +18918,7 @@ paths: - url: https://api.rebilly.com description: Live server post: + x-internal: true x-products: - Users tags: @@ -19008,10 +19066,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19154,10 +19212,10 @@ paths: '200': description: Gateway account updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19167,10 +19225,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19273,10 +19331,10 @@ paths: '200': description: Gateway account updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19303,6 +19361,7 @@ paths: const secondKey = await api.gatewayAccounts.update({id: 'my-second-id', data}); delete: + x-internal: true x-products: - Users tags: @@ -19315,10 +19374,10 @@ paths: '204': description: Gateway account deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -19370,10 +19429,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19413,10 +19472,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19505,10 +19564,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19547,6 +19606,7 @@ paths: schema: type: string get: + x-internal: true x-products: - Users tags: @@ -19586,10 +19646,10 @@ paths: '200': description: Gateway account downtime schedule updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19634,10 +19694,10 @@ paths: '204': description: Gateway account downtime schedule deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -19675,10 +19735,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19738,6 +19798,7 @@ paths: - daily-count - monthly-count get: + x-internal: true x-products: - Users tags: @@ -19780,10 +19841,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19818,10 +19879,10 @@ paths: '204': description: Gateway account limit deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -19902,10 +19963,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -19944,6 +20005,7 @@ paths: schema: type: string get: + x-internal: true x-products: - Users tags: @@ -19972,6 +20034,7 @@ paths: .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'}); console.log(message.fields.eventType); delete: + x-internal: true x-products: - Users tags: @@ -19984,10 +20047,10 @@ paths: '204': description: Gateway account timeline message deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -20023,10 +20086,10 @@ paths: '204': description: Supplied credentials are valid. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -20092,10 +20155,10 @@ paths: '200': description: Gateway account financial settings updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20105,10 +20168,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20124,6 +20187,30 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' /digital-wallets/onboarding/apple-pay: + get: + x-products: + - Users + tags: + - Gateway accounts + summary: Retrieve Apple Pay domains + operationId: GetDigitalWalletOnboardingApplePay + x-sdk-operation-name: getApplePayDomains + description: |- + Retrieves the domains that Apple Pay has registered for the organization. + Apple Pay registers domains for the whole organization, not for one gateway account. + responses: + '200': + description: Apple Pay domains retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/DigitalWalletOnboardingApplePayDomains' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' post: x-products: - Users @@ -20154,10 +20241,10 @@ paths: '200': description: Action executed without error. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20167,10 +20254,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20183,8 +20270,48 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' + /digital-wallets/onboarding/apple-pay/{domain}: + parameters: + - name: domain + in: path + description: Domain to remove from Apple Pay. + required: true + schema: + type: string + maxLength: 255 + pattern: ^[@~\-\.\w]+$ + delete: + x-products: + - Users + tags: + - Gateway accounts + summary: Remove an Apple Pay domain + operationId: DeleteDigitalWalletOnboardingApplePayDomain + x-sdk-operation-name: deleteApplePayDomain + description: |- + Removes a domain from Apple Pay for the organization. + Apple Pay stops working on the domain. + responses: + '204': + description: Apple Pay domain removed. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' /grid-segments: get: + x-internal: true x-products: - Users tags: @@ -20219,6 +20346,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Users tags: @@ -20234,10 +20362,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20254,6 +20382,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Users tags: @@ -20282,6 +20411,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-products: - Users tags: @@ -20295,10 +20425,10 @@ paths: '200': description: Segment updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20317,6 +20447,7 @@ paths: schema: $ref: '#/components/schemas/GridSegment' delete: + x-internal: true x-products: - Users tags: @@ -20334,10 +20465,10 @@ paths: '204': description: Segment deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '403': $ref: '#/components/responses/Forbidden' '404': @@ -20472,6 +20603,7 @@ paths: printf("List #%s (%s): %s\n", $list->getId(), $list->getDescription(), $list->getVersion()); } post: + x-internal: true x-products: - Users tags: @@ -20486,10 +20618,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20594,10 +20726,10 @@ paths: '200': description: List updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20607,10 +20739,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -20680,10 +20812,10 @@ paths: '204': description: List deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -20743,41 +20875,6 @@ paths: source: |- $service = new \Rebilly\Sdk\Service($client); $list = $service->lists()->getByVersion('listId', 1); - /memberships: - get: - x-products: - - Users - tags: - - Memberships - summary: Retrieve memberships - operationId: GetMembershipCollection - x-sdk-operation-name: getAll - description: Retrieves a list of organization memberships. - parameters: - - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' - - $ref: '#/components/parameters/collectionFilter' - - $ref: '#/components/parameters/collectionSort' - responses: - '200': - description: List of organization memberships retrieved. - headers: - Pagination-Total: - $ref: '#/components/headers/Pagination-Total' - Pagination-Limit: - $ref: '#/components/headers/Pagination-Limit' - Pagination-Offset: - $ref: '#/components/headers/Pagination-Offset' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Membership' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' /memberships/{organizationId}/{userId}: parameters: - name: organizationId @@ -20795,95 +20892,23 @@ paths: description: ID of the user. schema: $ref: '#/components/schemas/ResourceId' - get: - x-products: - - Users - tags: - - Memberships - summary: Retrieve a membership - operationId: GetMembership - x-sdk-operation-name: get - description: Retrieves a membership with a specified organization ID and user ID. - responses: - '200': - description: Membership retrieved. - content: - application/json: - schema: - $ref: '#/components/schemas/Membership' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - put: - x-products: - - Users - tags: - - Memberships - summary: Upsert membership - operationId: PutMembership - x-sdk-operation-name: update - description: |- - Creates or updates (upserts) a membership with a specified organization ID and user ID. - Only the organization owner can grant organization membership to new users. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Membership' - required: true - responses: - '200': - description: Membership updated. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/Membership' - '201': - description: Membership created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/Membership' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '409': - $ref: '#/components/responses/Conflict' - '429': - $ref: '#/components/responses/TooManyRequests' delete: x-products: - Users tags: - - Memberships - summary: Delete a membership - operationId: DeleteMembership - x-sdk-operation-name: delete + - Users + summary: Delete a user membership + operationId: DeleteUserMembership + x-sdk-operation-name: deleteUserMembership description: Deletes a membership with a specified organization ID and user ID. responses: '204': description: Membership deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -20947,10 +20972,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21039,10 +21064,10 @@ paths: '200': description: Organization updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21242,7 +21267,7 @@ paths: description: |- Retrieves a list of payout requests. - Filter by: `id`, `customerId`, `websiteId`, `batchId`, `status`, `blocked`, `blockReason`, `createdTime`, `updatedTime`, `currency`, `amount`. + Filter by: `id`, `customerId`, `websiteId`, `batchId`, `status`, `blocked`, `blockReason`, `splitReason`, `createdTime`, `updatedTime`, `currency`, `amount`. parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' @@ -21298,10 +21323,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21342,6 +21367,7 @@ paths: '404': $ref: '#/components/responses/NotFound' put: + x-internal: true x-badges: - name: Experimental x-products: @@ -21351,7 +21377,10 @@ paths: summary: Upsert a payout request operationId: PutPayoutRequest x-sdk-operation-name: update - description: Creates or updates (upserts) a payout request with a specified ID. + description: |- + Creates or updates (upserts) a payout request with a specified ID. + The customer cannot be changed after the payout request is created. + When funds are reserved for a payout request, changes to the amount and currency are rejected. requestBody: content: application/json: @@ -21361,10 +21390,10 @@ paths: '200': description: Payout request updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21374,10 +21403,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21388,6 +21417,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -21411,57 +21442,10 @@ paths: '200': description: Payout request updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /payout-requests/{id}/cancel: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Cancel a payout request - operationId: PostPayoutRequestCancellation - x-sdk-operation-name: cancel - description: Cancels a payout request with a specified ID. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestCancellation' - description: Payout request resource. - required: true - responses: - '200': - description: Payout request canceled. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21478,64 +21462,6 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' - /payout-requests/{id}/split: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Request a payout request split - operationId: PostPayoutRequestSplit - x-sdk-operation-name: split - description: |- - Splits a pending payout request into two or more separate requests. - - Use this operation when the full amount cannot be processed due to amount restrictions, but a smaller amount can be processed. - For example, if a payout request for `$4,000` cannot be processed, but `$3,000` can be processed, split the request into two. This allows you to approve and process `$3,000` instead of blocking the entire request. - - Provide an array of at least two amounts; one new payout request is created per amount. - The sum of the amounts must equal the original payout request amount. - The original request transitions to the `split` status. - This operation returns the newly created payout requests. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestSplit' - description: Payout request split parameters. - required: true - responses: - '201': - description: Payout requests created by the split operation. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PayoutRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' /payout-requests/{id}/payment-instruments: parameters: - $ref: '#/components/parameters/resourceId' @@ -21595,7 +21521,10 @@ paths: - null example: covered-payout exposureAmount: - description: Total amount of sales minus credit for the specified gateway and instrument. + description: |- + Approved sales and captures minus approved payouts for the specified gateway account and payment instrument in the last 180 days. + Allocations on the same gateway account and payment instrument that are pending, queued, processing, or waiting-completion are also subtracted. + The resulting amount is the usable exposure for ranking during auto-allocation. type: number format: double previousAllocatedAmount: @@ -21667,6 +21596,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' post: + x-internal: true x-badges: - name: Experimental x-products: @@ -21690,10 +21620,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21716,6 +21646,7 @@ paths: type: string description: ID of the timeline message. get: + x-internal: true x-badges: - name: Experimental x-products: @@ -21742,6 +21673,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-badges: - name: Experimental x-products: @@ -21763,6 +21695,167 @@ paths: $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + /payout-request-splits: + post: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Create a payout request split + operationId: PostPayoutRequestSplit + x-sdk-operation-name: create + description: |- + Splits a payout request that is in `pending`, `ready`, or `approved` status into two or more separate requests. + + Use this operation when the full amount cannot be processed due to amount restrictions, but a smaller amount can be processed. + For example, if a payout request for `$4,000` cannot be processed, but `$3,000` can be processed, split the request into two. This allows you to approve and process `$3,000` instead of blocking the entire request. + + Provide an array of at least two amounts; one new payout request is created per amount. + The sum of the amounts must equal the original payout request amount. + Each new payout request is created in `pending` status. + The original request transitions to the `split` status. + This operation returns the newly created payout requests. + requestBody: + content: + application/json: + schema: + type: object + properties: + payoutRequestId: + type: string + description: ID of the payout request to split. + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + amounts: + description: |- + Amounts for each new payout request. + One request is created per amount. + Provide at least two amounts. + Each amount must be greater than zero. + The sum must equal the original payout request amount. + type: array + minItems: 2 + maxItems: 100 + items: + type: number + format: double + x-type: Money + exclusiveMinimum: 0 + example: + - 50 + - 30 + - 20 + splitReason: + $ref: '#/components/schemas/PayoutRequestSplitReason' + splitDescription: + description: Additional description for splitting the payout request. + type: + - string + - 'null' + maxLength: 255 + required: + - payoutRequestId + - amounts + - splitReason + description: Payout request split resource. + required: true + responses: + '201': + description: Payout requests created by the split operation. + headers: + Location: + $ref: '#/components/headers/Location' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PayoutRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /payout-request-auto-allocations: + post: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Create automatic payout request allocations + operationId: PostPayoutRequestAutoAllocations + x-sdk-operation-name: create + description: |- + Creates allocations for a payout request using automatically selected payment instruments and gateway accounts. + Only the payout request ID is required. + + When an allocation is created, the payout request transitions to the `in-progress` status, + and the allocation starts in the `pending` status. + The allocation transitions to the `processing` status when payment processing begins. + This operation returns the created allocations. + requestBody: + content: + application/json: + schema: + type: object + properties: + payoutRequestId: + type: string + description: |- + ID of the payout request to allocate automatically. + A payout request is a customer request to withdraw funds. + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + required: + - payoutRequestId + description: Payout request auto-allocation resource. + required: true + responses: + '201': + description: Allocations created. + headers: + Location: + $ref: '#/components/headers/Location' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PayoutRequestAllocation' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' /payout-request-allocations: get: x-badges: @@ -21795,16 +21888,7 @@ paths: schema: type: array items: - allOf: - - $ref: '#/components/schemas/PayoutRequestAllocation' - - type: object - properties: - exposureAmount: - description: Total approved sales and captures minus approved payouts for the customer, gateway account, and payment instrument, in the allocation currency. - readOnly: true - type: number - format: double - example: 2 + $ref: '#/components/schemas/PayoutRequestAllocation' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -21865,10 +21949,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -21885,58 +21969,11 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' - /payout-request-allocations/auto: - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Create an automatic payout request allocation - operationId: PostPayoutRequestAutoAllocation - x-sdk-operation-name: autoAllocate - description: |- - Creates an automatic payout request allocation using system-selected parameters. - Only the payout request ID is required; all allocation details are determined automatically. - - When an allocation is created, the payout request transitions to the `in-progress` status, - and the allocation starts in the `pending` status. - The allocation transitions to the `processing` status when payment processing begins. - requestBody: - content: - application/json: - schema: - type: object - properties: - payoutRequestId: - type: string - description: ID of the payout request to allocate. - maxLength: 50 - example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 - required: - - payoutRequestId - description: Payout request allocation resource. - required: true - responses: - '204': - description: Payout request auto-allocation completed. - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' /payout-request-allocations/{id}: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-badges: - name: Experimental x-products: @@ -22003,10 +22040,10 @@ paths: '200': description: Payout request allocation updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22023,49 +22060,227 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' - /payout-request-allocations/process: + /payout-request-allocation-operations: post: + x-internal: true x-badges: - name: Experimental x-products: - Core tags: - Transactions - summary: Initiate processing of allocations - operationId: PostPayoutRequestAllocationsProcess - x-sdk-operation-name: process + summary: Create a payout request allocation operation + operationId: PostPayoutRequestAllocationOperations + x-sdk-operation-name: create description: |- - Initiates the processing of one or more payout request allocations. + Creates a payout request allocation operation and queues the given allocations for processing. + + The `type` field specifies the action: + - `process`: Queues the given allocations for processing. Only allocations with status `pending` are processed. - Each allocation is processed by creating a transaction. + Rejects the request without queueing allocations when any allocation uses an inactive gateway account + or a gateway account with payout instruction `none`. + Poll the allocation status for the result. + The operation completes before the response returns. + requestBody: + required: true + description: Action to apply to payout request allocations. + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestAllocationOperationRequest' + responses: + '200': + description: Allocation operation completed. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestAllocationOperation' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /payout-request-batch-operations: + post: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Create a payout request batch operation + operationId: PostPayoutRequestBatchOperations + x-sdk-operation-name: create + description: |- + Creates a payout request batch operation that applies one action to a payout request batch. + A payout request batch is a group of payout requests that you manage together. + + The `type` field specifies the action: + - `approve`: Approves payout requests in the `ready` status. + - `block`: Blocks payout requests that are not blocked and can be blocked in their current status. + - `unblock`: Removes the block from blocked payout requests. + - `auto-allocate`: Creates allocations automatically for payout requests that can be allocated. + - `process`: Queues pending allocations of the payout requests in the batch for processing. + - `add`: Adds the specified payout requests, or the payout requests that match a filter, to the batch. + - `remove`: Removes the specified payout requests from the batch. + + A batch contains a maximum of 1000 payout requests. + For `add` and `remove`, the operation is atomic. + If the operation cannot add or remove a specified payout request, + the operation returns a `409` response and changes no batch membership. + For the other types, each payout request is checked independently. + Payout requests that do not qualify for the action are skipped. + For `process`, allocations that do not qualify are skipped, and allocations that qualify are queued together. + If queueing fails, no allocation is queued and the operation returns an error. + The operation completes before the response returns. + If the batch does not exist, the operation returns a `422` response. + requestBody: + required: true + description: Action to apply to a payout request batch. + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestBatchOperationRequest' + responses: + '200': + description: Batch operation completed. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestBatchOperation' + '400': + description: Invalid filter provided or no payout requests match the filter. + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + description: Batch limit reached or would be exceeded by the request, a specified payout request is already associated with another batch, or a specified payout request is not associated with this batch. + content: + application/json: + schema: + $ref: '#/components/schemas/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /payout-request-batch-previews: + post: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Create a payout request batch preview + operationId: PostPayoutRequestBatchPreview + x-sdk-operation-name: create + description: |- + Creates a preview of the payout requests that match a specified filter and that a batch can include. + This operation does not create a batch or change payout requests. + + A batch can contain a maximum of 1000 payout requests. + If more payout requests match the filter than the batch can accept, only the oldest payout requests are selected, sorted by creation time. + To preview payout requests to add to an existing batch, provide the `batchId` of that batch. requestBody: content: application/json: schema: type: object required: - - allocationIds + - filter properties: - allocationIds: - description: Array of allocation IDs to process. - type: array - minItems: 1 - maxItems: 1000 - items: - type: string - maxLength: 50 - example: pra_0YVDMDE2BMC6KBB5MX76RF6T80 - description: Allocation processing options. + filter: + type: string + description: |- + Filter string that is used to select payout requests. + This field uses the same format as collection filter parameters. + + Use semicolons to separate multiple filter conditions. + Available filter fields: `id`, `status`, `websiteId`, `customerId`, `currency`, `amount`, `createdTime`, `updatedTime`. + + If a `batchId` filter is provided, it is ignored. + Payout requests that are already included in a batch are always excluded from the results. + example: status:pending;websiteId:ws_0YVDMDE2BMC6KBB5MX76RF6T80 + batchId: + type: string + description: |- + ID of the payout request batch to add payout requests to. + If this field is provided, the preview selects only as many payout requests as the batch can accept. + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + description: Payout request batch preview resource. required: true responses: - '204': - description: Allocation processing has been initiated. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + '200': + description: Preview created. + content: + application/json: + schema: + type: object + required: + - matchingCount + - selectedCount + - customerCount + - totalAmountByCurrency + properties: + matchingCount: + description: Total number of payout requests that match the filter, regardless of the batch limit. + type: integer + minimum: 0 + example: 1450 + selectedCount: + description: |- + Number of payout requests that a batch includes when you use the same filter. + This value is the lower of `matchingCount` and the number of payout requests that the batch can accept. + type: integer + minimum: 0 + example: 1000 + customerCount: + description: Number of unique customers in the selected payout requests. + type: integer + minimum: 0 + example: 212 + totalAmountByCurrency: + description: Total amount grouped by currency for the selected payout requests. + type: array + items: + type: object + required: + - currency + - amount + properties: + currency: + $ref: '#/components/schemas/CurrencyCode' + amount: + type: number + '400': + description: Invalid filter provided. + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -22089,6 +22304,7 @@ paths: parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' + - $ref: '#/components/parameters/collectionQuery' - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' responses: @@ -22114,6 +22330,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' post: + x-internal: true x-badges: - name: Experimental x-products: @@ -22137,7 +22354,7 @@ paths: - **Filter-based**: Provide a `filter` string to select payout requests that match the specified criteria at execution time. Payout requests that are already included in a batch are automatically excluded from the filter results. If more than 1000 payout requests match the filter, only the oldest 1000 are included in the batch, sorted by creation time. - To view the number of matching items before creating the batch, use the [Preview payout request batch filter results](../GetPayoutRequestBatchPreview) operation. + To view the number of matching items before creating the batch, use the [Create a payout request batch preview](../PostPayoutRequestBatchPreview) operation. requestBody: content: application/json: @@ -22197,10 +22414,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22226,6 +22443,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-badges: - name: Experimental x-products: @@ -22240,10 +22458,10 @@ paths: '200': description: Payout request batch retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22257,6 +22475,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' patch: + x-internal: true x-badges: - name: Experimental x-products: @@ -22275,10 +22494,10 @@ paths: '200': description: Payout request batch updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22293,213 +22512,29 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' - /payout-request-batches/{id}/auto-allocate: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Allocate batch payout requests automatically - operationId: PostPayoutRequestBatchAutoAllocate - x-sdk-operation-name: autoAllocate - description: |- - Creates allocations automatically for all payout requests in the batch using the auto-allocation algorithm. - - Each payout request is processed independently. - responses: - '200': - description: Batch auto-allocation completed. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestBatch' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /payout-request-batches/{id}/approve: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Approve payout requests in a batch - operationId: PostPayoutRequestBatchApprove - x-sdk-operation-name: approve - description: |- - Approves all payout requests in a specified batch. - - Each payout request is processed independently. - Only payout requests with a status of `ready` can be approved. - responses: - '200': - description: Batch approval completed. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestBatch' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /payout-request-batches/{id}/block: - parameters: - - $ref: '#/components/parameters/resourceId' - post: + delete: + x-internal: true x-badges: - name: Experimental x-products: - Core tags: - Transactions - summary: Block batch payout requests - operationId: PostPayoutRequestBatchBlock - x-sdk-operation-name: block + summary: Delete a payout request batch + operationId: DeletePayoutRequestBatch + x-sdk-operation-name: delete description: |- - Blocks all payout requests in a specified batch. - - Each payout request is processed independently. - requestBody: - content: - application/json: - schema: - type: object - required: - - reason - properties: - reason: - $ref: '#/components/schemas/PayoutRequestBlockReason' - description: - description: Additional description for blocking the payout requests in the batch. - type: - - string - - 'null' - maxLength: 255 + Deletes a payout request batch with a specified ID and clears the `batchId` field from every payout request in the batch. + This operation preserves every payout request, status, and blocked state. + This operation is atomic. It clears all `batchId` fields or leaves them all unchanged. responses: - '200': - description: Batch blocking completed. + '204': + description: Payout request batch deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestBatch' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /payout-request-batches/preview: - get: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Preview payout request batch results - operationId: GetPayoutRequestBatchPreview - x-sdk-operation-name: preview - description: |- - Retrieves aggregate information for the payout requests that match a specified filter. - - If more than 1000 payout requests match the filter, only the oldest 1000 are included in the preview. - parameters: - - name: filter - in: query - description: |- - Filter string that is used to select payout requests. - This field uses the same format as collection filter parameters. - - Use semicolons to separate multiple filter conditions. - Available filter fields: `id`, `status`, `websiteId`, `customerId`, `currency`, `amount`, `createdTime`, `updatedTime`. - - If a `batchId` filter is provided, it is ignored. - Payout requests that are already included in a batch are always excluded from the results. - schema: - type: string - example: status:pending;websiteId:ws_0YVDMDE2BMC6KBB5MX76RF6T80 - responses: - '200': - description: Preview retrieved. - content: - application/json: - schema: - type: object - properties: - matchingCount: - description: Total number of matching payout requests, regardless of the preview limit. - type: integer - minimum: 0 - example: 42 - customerCount: - description: Number of unique customers in the matching payout requests. - type: integer - minimum: 0 - example: 3 - totalAmountByCurrency: - description: Total amount grouped by currency for matching payout requests. - type: array - items: - type: object - required: - - currency - - amount - properties: - currency: - $ref: '#/components/schemas/CurrencyCode' - amount: - type: number - '400': - description: Empty or invalid filter provided. - content: - application/json: - schema: - $ref: '#/components/schemas/Problem' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -22510,6 +22545,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /permissions-emulation: post: + x-internal: true x-products: - Users tags: @@ -22543,10 +22579,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22560,6 +22596,7 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: + x-internal: true x-products: - Users tags: @@ -22579,10 +22616,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22598,7 +22635,7 @@ paths: x-products: - Core tags: - - Orders + - Orders (legacy) summary: Preview an order operationId: PostPreviewOrder x-sdk-operation-name: order @@ -22614,10 +22651,10 @@ paths: '200': description: Order preview retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22652,10 +22689,10 @@ paths: '200': description: Test email sent. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22701,10 +22738,10 @@ paths: '204': description: Test webhook sent. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -22786,10 +22823,10 @@ paths: '200': description: Profile updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -22813,105 +22850,6 @@ paths: }; const profile = await api.profile.update({data}); - /profile/mfa: - get: - x-products: - - Users - tags: - - Profile - summary: Retrieve user MFA status - operationId: GetProfileMfa - x-sdk-operation-name: getMfa - description: Retrieves Multi-Factor Authentication (MFA) status of a user. - responses: - '200': - description: User MFA status retrieved. - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileMfa' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - x-codeSamples: - - lang: JavaScript - source: | - const mfa = await api.profile.getMfa(); - console.log(mfa.fields.status, mfa.fields.type, mfa.fields.lastAuthTime); - post: - x-products: - - Users - tags: - - Profile - summary: Update user MFA - operationId: PostProfileMfa - x-sdk-operation-name: updateMfa - description: |- - Updates the Multi-Factor Authentication (MFA) information of a user. - - The generated link with an `enrollment` `rel` link must be followed to verify the existing MFA or enroll new MFA. - responses: - '201': - description: User MFA update URL created. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileMfa' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '429': - $ref: '#/components/responses/TooManyRequests' - x-codeSamples: - - lang: JavaScript - source: | - const mfa = await api.profile.updateMfa(); - console.log(mfa.fields._links); - delete: - x-products: - - Users - tags: - - Profile - summary: Delete user MFA - operationId: DeleteProfileMfa - x-sdk-operation-name: deleteMfa - description: |- - Deletes the Multi-Factor Authentication (MFA) information of a user. - - To complete this operation, the `lastAuthTime` value must be no more than 10 minutes before this request. - responses: - '204': - description: User MFA deleted. - headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '429': - $ref: '#/components/responses/TooManyRequests' - x-codeSamples: - - lang: JavaScript - source: | - await api.profile.deleteMfa(); /roles: get: x-products: @@ -22971,10 +22909,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23027,10 +22965,10 @@ paths: '200': description: Role updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23040,10 +22978,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23064,6 +23002,7 @@ paths: description: Role resource. required: true delete: + x-internal: true x-products: - Users tags: @@ -23320,6 +23259,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Users tags: @@ -23403,11 +23343,12 @@ paths: summary: Retrieve webhook tracking logs operationId: GetTrackingWebhookCollection x-sdk-operation-name: getAllWebhookTrackingLogs - description: Retrieves webhook tracking logs. + description: |- + Retrieves webhook tracking logs. + Logs are sorted by creation time in descending order. parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' - - $ref: '#/components/parameters/collectionSort' - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionQuery' responses: @@ -23476,6 +23417,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Users tags: @@ -23490,10 +23432,10 @@ paths: '204': description: Webhook resend attempt scheduled. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -23591,10 +23533,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23707,10 +23649,10 @@ paths: '200': description: User updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23720,10 +23662,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23797,36 +23739,6 @@ paths: } catch (\Rebilly\Sdk\Exception\DataValidationException $e) { print_r($e->getValidationErrors()); } - /users/{id}/mfa: - parameters: - - $ref: '#/components/parameters/resourceId' - get: - x-products: - - Users - tags: - - Users - summary: Retrieve user MFA status - operationId: GetUserMfa - x-sdk-operation-name: getMfa - description: Retrieves the Multi-Factor Authentication (MFA) status of a user with a specified ID. - responses: - '200': - description: User MFA status retrieved. - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileMfa' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - x-codeSamples: - - lang: JavaScript - source: | - const mfa = await api.users.get({id: 'foobar-001'}); - console.log(mfa.fields.status, mfa.fields.type, mfa.fields.lastAuthTime); /webhooks: get: x-products: @@ -23894,10 +23806,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23933,6 +23845,44 @@ paths: // or you can provide one const secondWebhook = await api.webhooks.create({id: 'my-second-key', data}); + /webhook-events: + get: + x-internal: true + x-products: + - Users + tags: + - Webhooks + summary: Retrieve webhook event types + operationId: GetWebhookEventCollection + x-sdk-operation-name: getAll + description: |- + Retrieves the event types that your organization can use in the events filter of a webhook. + If your organization uses the Replay add-on, the list also contains Replay event types. + parameters: + - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/collectionOffset' + - $ref: '#/components/parameters/collectionFilter' + - $ref: '#/components/parameters/collectionQuery' + responses: + '200': + description: Webhook event types retrieved. + headers: + Pagination-Total: + $ref: '#/components/headers/Pagination-Total' + Pagination-Limit: + $ref: '#/components/headers/Pagination-Limit' + Pagination-Offset: + $ref: '#/components/headers/Pagination-Offset' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/WebhookEvent' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' /webhooks/{id}: parameters: - $ref: '#/components/parameters/resourceId' @@ -23986,10 +23936,10 @@ paths: '200': description: Webhook updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -23999,10 +23949,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24134,10 +24084,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24253,10 +24203,10 @@ paths: '200': description: Website updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24266,10 +24216,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24344,6 +24294,7 @@ paths: print_r($e->getValidationErrors()); } delete: + x-internal: true x-products: - Users tags: @@ -24390,6 +24341,7 @@ paths: schema: type: string get: + x-internal: true x-badges: - name: Experimental x-products: @@ -24445,6 +24397,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' put: + x-internal: true x-badges: - name: Experimental x-products: @@ -24466,10 +24419,10 @@ paths: '200': description: Profile dashboard updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24557,10 +24510,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24570,7 +24523,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' '422': - $ref: '#/components/responses/ValidationError' + $ref: '#/components/responses/DataExportValidationError' '429': $ref: '#/components/responses/TooManyRequests' x-codeSamples: @@ -24736,6 +24689,7 @@ paths: $dataExport = $service->dataExports()->get('dataExportId'); put: + x-internal: true x-products: - Reports tags: @@ -24752,10 +24706,10 @@ paths: '200': description: Data export modified. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24774,7 +24728,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' '422': - $ref: '#/components/responses/ValidationError' + $ref: '#/components/responses/DataExportValidationError' '429': $ref: '#/components/responses/TooManyRequests' x-codeSamples: @@ -24906,10 +24860,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -24949,6 +24903,7 @@ paths: $ref: '#/components/responses/NotFound' /experimental/histograms/aml-checks: get: + x-internal: true x-badges: - name: Experimental x-products: @@ -25301,6 +25256,74 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + /experimental/reports/aml-audit-reports: + get: + x-badges: + - name: Experimental + x-products: + - Reports + tags: + - Reports + summary: Retrieve an AML audit report + operationId: GetAmlAuditReport + x-sdk-operation-name: getAmlAuditReport + description: |- + Retrieves an Anti-Money Laundering (AML) audit report for a person with a specified ID. + The maximum reporting period is 180 days. + + The report includes linked customers, screening summary metrics, screening history, and related transactions for the selected period. + + Use the `Accept` header to select the response format: `application/json` (default), `application/pdf`, or `text/csv`. + + Each section of the report includes at most 10,000 records, and the `truncated` property is `true` when a section reaches that limit. + parameters: + - name: personId + in: query + required: true + description: ID of the person for the report. + schema: + type: string + maxLength: 50 + - name: periodStart + in: query + description: |- + Date and time when the report starts. + If this value is not provided or is `null`, the report starts 90 days before the current date and time at midnight utc. + schema: + type: string + format: date-time + - name: periodEnd + in: query + description: |- + Date and time when the report ends. + If this value is not provided or is `null`, the report ends at the current date and time. + schema: + type: string + format: date-time + - $ref: '#/components/parameters/collectionFilter' + - $ref: '#/components/parameters/mediaTypeJsonPdfCsv' + responses: + '200': + description: Report retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/ReportAmlAuditReport' + application/pdf: + schema: + type: string + format: binary + text/csv: + schema: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' /experimental/reports/cumulative-subscriptions: get: x-badges: @@ -27188,7 +27211,12 @@ paths: - cash - accrual - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' + - name: offset + in: query + description: Starting point within the collection of items to return. + schema: + type: integer + minimum: 0 responses: '200': description: Report retrieved. @@ -27231,11 +27259,15 @@ paths: summary: Retrieve a time series transactions report operationId: GetTimeSeriesTransactionReport x-sdk-operation-name: getTimeSeriesTransaction - description: Retrieves a transactions report that is aggregated by time periods. + description: |- + Retrieves a report of sale and capture transactions, with one row for each day of the period. + Each row holds an aggregation of every transaction of the day, + and a breakdown of that day by the `subaggregate` field. + Transactions occur on the day of the `processedTime` value. parameters: - name: type in: query - description: Type of report aggregation. + description: Aggregate the transactions of each day by count, sum of amounts, approval rate, or incomplete rate. schema: type: string default: count @@ -27246,7 +27278,7 @@ paths: - incomplete-rate - name: subaggregate in: query - description: Report subaggregate. + description: Group the transactions of each day by this field, one subaggregate for each value. schema: type: string default: gateway-account @@ -27525,12 +27557,13 @@ paths: schema: type: string get: + x-internal: true x-badges: - name: Experimental x-products: - Reports tags: - - Orders + - Orders (legacy) summary: Retrieve subscription order summary metrics operationId: GetSubscriptionSummaryMetricReport x-sdk-operation-name: getSubscriptionSummaryMetrics @@ -27554,6 +27587,7 @@ paths: $report = $service->subscriptions()->getSubscriptionSummaryMetrics('subscriptionId'); /storefront/account: get: + x-internal: true x-products: - Storefront tags: @@ -27578,6 +27612,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' patch: + x-internal: true x-products: - Storefront tags: @@ -27598,10 +27633,10 @@ paths: '200': description: Account updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -27616,6 +27651,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/account/forgot-password: post: + x-internal: true x-products: - Storefront tags: @@ -27641,10 +27677,10 @@ paths: '204': description: Email sent. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -27655,6 +27691,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/account/password: patch: + x-internal: true x-products: - Storefront tags: @@ -27671,10 +27708,10 @@ paths: '200': description: Account password updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -27689,6 +27726,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/account/resend-verification: post: + x-internal: true x-products: - Storefront tags: @@ -27714,10 +27752,10 @@ paths: '204': description: Email sent. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -27730,6 +27768,7 @@ paths: parameters: - $ref: '#/components/parameters/token' post: + x-internal: true x-products: - Storefront tags: @@ -27758,10 +27797,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -27778,6 +27817,7 @@ paths: parameters: - $ref: '#/components/parameters/token' post: + x-internal: true x-products: - Storefront tags: @@ -27792,10 +27832,10 @@ paths: '204': description: Account verified. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -27815,6 +27855,7 @@ paths: maxLength: 100 pattern: ^[@~\-\.\w]+$ get: + x-internal: true x-products: - Storefront tags: @@ -27841,6 +27882,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront x-badges: @@ -27870,6 +27912,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront x-badges: @@ -27901,6 +27944,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-badges: - name: Experimental x-products: @@ -27926,50 +27970,9 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' - /storefront/cashiers/{id}/cancel-payout-requests: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Storefront - tags: - - Storefront cashiers - summary: Cancel pending payout requests - operationId: StorefrontPostCashierPayoutRequestCancellation - x-sdk-operation-name: cancelPayoutRequests - security: - - CustomerJWT: [] - description: |- - Cancels pending payout requests that are associated with the cashier resource. - - - To cancel all pending payout requests, omit the request body. - - To cancel payout requests based on a specific amount, include the amount in the request body. - The oldest requests are canceled first until the specified amount is reached. - requestBody: - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/PostCashierPayoutRequestCancellation' - responses: - '200': - description: Canceled all applicable pending cashier payout requests. - content: - application/json: - schema: - $ref: '#/components/schemas/Cashier' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '422': - $ref: '#/components/responses/ValidationError' /storefront/deposit: post: + x-internal: true x-products: - Storefront x-badges: @@ -27990,10 +27993,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28012,6 +28015,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true deprecated: true x-products: - Storefront @@ -28039,6 +28043,7 @@ paths: parameters: - $ref: '#/components/parameters/storefrontCustomFieldResource' get: + x-internal: true x-products: - Storefront tags: @@ -28048,6 +28053,7 @@ paths: x-sdk-operation-name: getAll security: - CustomerJWT: [] + - PublishableApiKey: [] parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' @@ -28068,6 +28074,7 @@ paths: $ref: '#/components/responses/Forbidden' /storefront/invoices: get: + x-internal: true x-products: - Storefront tags: @@ -28109,6 +28116,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28133,6 +28141,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' patch: + x-internal: true x-products: - Storefront tags: @@ -28149,10 +28158,10 @@ paths: '200': description: Invoice updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28173,6 +28182,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28204,41 +28214,8 @@ paths: '404': $ref: '#/components/responses/NotFound' /storefront/kyc-documents: - get: - x-products: - - Storefront - tags: - - Storefront KYC documents - summary: Retrieve KYC documents - operationId: StorefrontGetKycDocumentCollection - x-sdk-operation-name: getAll - security: - - CustomerJWT: [] - description: Retrieves a list of KYC documents. - parameters: - - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' - responses: - '200': - description: List of KYC documents retrieved. - headers: - Pagination-Total: - $ref: '#/components/headers/Pagination-Total' - Pagination-Limit: - $ref: '#/components/headers/Pagination-Limit' - Pagination-Offset: - $ref: '#/components/headers/Pagination-Offset' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/StorefrontKycDocument' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Storefront tags: @@ -28262,10 +28239,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28282,6 +28259,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28306,6 +28284,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Storefront tags: @@ -28327,10 +28306,10 @@ paths: '200': description: KYC document updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28349,6 +28328,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28376,6 +28356,7 @@ paths: $ref: '#/components/responses/NotFound' /storefront/kyc-liveness-sessions: post: + x-internal: true x-products: - Storefront tags: @@ -28389,17 +28370,16 @@ paths: requestBody: $ref: '#/components/requestBodies/PostKycLivenessSession' description: KYC request resource. - required: true responses: '201': description: KYC liveness session created. headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28416,6 +28396,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28443,6 +28424,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Storefront tags: @@ -28459,10 +28441,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28475,6 +28457,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/login: post: + x-internal: true x-products: - Storefront tags: @@ -28506,10 +28489,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28520,6 +28503,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/logout: post: + x-internal: true x-products: - Storefront tags: @@ -28534,16 +28518,17 @@ paths: '204': description: Account logged out. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '429': $ref: '#/components/responses/TooManyRequests' /storefront/orders: get: + x-internal: true x-products: - Storefront tags: @@ -28553,7 +28538,7 @@ paths: x-sdk-operation-name: getAll security: - CustomerJWT: [] - description: Retrieve a list of orders. + description: Retrieves a list of orders. parameters: - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' @@ -28585,6 +28570,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28596,7 +28582,7 @@ paths: - CustomerJWT: [] parameters: - $ref: '#/components/parameters/collectionExpand' - description: Retrieve an order with a specified ID. + description: Retrieves an order with a specified ID. responses: '200': description: Order retrieved. @@ -28611,6 +28597,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Storefront tags: @@ -28627,10 +28614,10 @@ paths: '200': description: Order updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28649,6 +28636,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Storefront tags: @@ -28667,10 +28655,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28691,6 +28679,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Storefront tags: @@ -28709,10 +28698,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28733,6 +28722,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-badges: - name: Experimental x-products: @@ -28760,10 +28750,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28774,12 +28764,94 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' + /storefront/order-changes: + get: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Storefront + tags: + - Storefront orders + summary: Retrieve order changes + operationId: StorefrontGetOrderChangeCollection + x-sdk-operation-name: getAll + security: + - CustomerJWT: [] + description: |- + Retrieves a list of changes to the items of the orders of the customer. + To find the pending change of an order, use `filter=orderId:{orderId};status:pending`. + parameters: + - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/collectionOffset' + - $ref: '#/components/parameters/collectionFilter' + responses: + '200': + description: List of order changes retrieved. + headers: + Pagination-Total: + $ref: '#/components/headers/Pagination-Total' + Pagination-Limit: + $ref: '#/components/headers/Pagination-Limit' + Pagination-Offset: + $ref: '#/components/headers/Pagination-Offset' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/StorefrontOrderChange' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + /storefront/order-changes/{id}: + parameters: + - $ref: '#/components/parameters/resourceId' + delete: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Storefront + tags: + - Storefront orders + summary: Cancel an order change + operationId: StorefrontDeleteOrderChange + x-sdk-operation-name: delete + security: + - CustomerJWT: [] + description: |- + Cancels a pending change to the items of an order of the customer. + The current items of the order stay as they are. + A change cannot be canceled after it is locked by an issued invoice, applied, canceled, or superseded. + responses: + '204': + description: Order change canceled. + headers: + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '429': + $ref: '#/components/responses/TooManyRequests' /storefront/subscription-reactivations: post: + x-internal: true x-badges: - name: Experimental x-products: @@ -28793,6 +28865,7 @@ paths: - CustomerJWT: [] description: |- Creates a quote for requested reactivation. + The quote invoice includes items from outstanding unpaid and past-due invoices for the related order. This operation applies the requested reactivation to the subscription when the quote invoice is paid. requestBody: content: @@ -28801,6 +28874,12 @@ paths: $ref: '#/components/schemas/PostSubscriptionReactivation' description: Change items request. responses: + '200': + description: Quote preview retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/StorefrontReactivationQuote' '201': description: Quote for requested reactivation is created and issued. headers: @@ -28820,6 +28899,7 @@ paths: $ref: '#/components/responses/ValidationError' /storefront/payment: post: + x-internal: true x-products: - Storefront tags: @@ -28842,10 +28922,10 @@ paths: '200': description: Transaction created. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28855,10 +28935,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28877,6 +28957,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/payment-instruments: get: + x-internal: true x-products: - Storefront tags: @@ -28914,6 +28995,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-products: - Storefront tags: @@ -28938,10 +29020,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -28958,6 +29040,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -28992,6 +29075,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Storefront tags: @@ -29012,10 +29096,10 @@ paths: '200': description: Payment instrument updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29034,6 +29118,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: + x-internal: true x-products: - Storefront tags: @@ -29050,10 +29135,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29078,6 +29163,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -29105,6 +29191,7 @@ paths: '404': $ref: '#/components/responses/NotFound' post: + x-internal: true x-products: - Storefront tags: @@ -29128,10 +29215,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29148,6 +29235,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/payout-requests: get: + x-internal: true x-badges: - name: Experimental x-products: @@ -29187,6 +29275,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: + x-internal: true x-badges: - name: Experimental x-products: @@ -29221,6 +29310,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-badges: - name: Experimental x-products: @@ -29247,6 +29337,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-badges: - name: Experimental x-products: @@ -29276,10 +29367,10 @@ paths: '200': description: Payout request updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29294,8 +29385,46 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' + /storefront/payout-request-cancellations: + post: + x-internal: true + x-badges: + - name: Experimental + x-products: + - Storefront + tags: + - Storefront cashiers + summary: Cancel pending payout requests + operationId: StorefrontPostPayoutRequestCancellation + x-sdk-operation-name: create + security: + - CustomerJWT: [] + description: |- + Cancels pending payout requests that are associated with a cashier resource. + + - To cancel all pending payout requests, omit the `amount` field. + - To cancel payout requests based on a specific amount, include the amount in the request body. + The oldest requests are canceled first until the specified amount is reached. + requestBody: + $ref: '#/components/requestBodies/PostPayoutRequestCancellation' + responses: + '200': + description: Canceled all applicable pending cashier payout requests. + content: + application/json: + schema: + $ref: '#/components/schemas/Cashier' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' /storefront/plans: get: + x-internal: true x-products: - Storefront tags: @@ -29305,6 +29434,7 @@ paths: x-sdk-operation-name: getAll security: - CustomerJWT: [] + - PublishableApiKey: [] description: Retrieves a list of plans. parameters: - $ref: '#/components/parameters/collectionFilter' @@ -29337,6 +29467,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -29346,6 +29477,7 @@ paths: x-sdk-operation-name: get security: - CustomerJWT: [] + - PublishableApiKey: [] description: Retrieves a plan with a specified ID. parameters: - $ref: '#/components/parameters/collectionExpand' @@ -29364,6 +29496,7 @@ paths: $ref: '#/components/responses/NotFound' /storefront/products: get: + x-internal: true x-products: - Storefront tags: @@ -29373,6 +29506,7 @@ paths: x-sdk-operation-name: getAll security: - CustomerJWT: [] + - PublishableApiKey: [] description: Retrieves a list of products. parameters: - $ref: '#/components/parameters/collectionFilter' @@ -29404,6 +29538,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -29413,6 +29548,7 @@ paths: x-sdk-operation-name: get security: - CustomerJWT: [] + - PublishableApiKey: [] description: Retrieves a product with a specified ID. responses: '200': @@ -29429,6 +29565,7 @@ paths: $ref: '#/components/responses/NotFound' /storefront/purchase: post: + x-internal: true x-products: - Storefront tags: @@ -29458,10 +29595,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29470,12 +29607,15 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /storefront/preview-purchase: post: + x-internal: true x-badges: - name: Experimental x-products: @@ -29506,10 +29646,10 @@ paths: '200': description: Purchase preview retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29526,8 +29666,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental + x-internal: true x-products: - Storefront tags: @@ -29562,8 +29701,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental + x-internal: true x-products: - Storefront tags: @@ -29578,10 +29716,10 @@ paths: '200': description: Quote accepted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29594,14 +29732,15 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /storefront/quotes/{id}/reject: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental + x-internal: true x-products: - Storefront tags: @@ -29616,10 +29755,10 @@ paths: '200': description: Quote rejected. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29636,6 +29775,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/ready-to-pay: post: + x-internal: true x-products: - Storefront tags: @@ -29669,10 +29809,10 @@ paths: '200': description: Payment methods retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29687,6 +29827,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/ready-to-payout: post: + x-internal: true x-products: - Storefront tags: @@ -29717,10 +29858,10 @@ paths: '200': description: Payment methods retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29735,6 +29876,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/register: post: + x-internal: true x-products: - Storefront tags: @@ -29753,10 +29895,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29771,6 +29913,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/subscriptions: post: + x-internal: true x-badges: - name: Experimental x-products: @@ -29780,7 +29923,10 @@ paths: summary: Create a subscription operationId: StorefrontPostSubscription x-sdk-operation-name: create - description: Creates a subscription order in a billing portal. + description: |- + Creates a subscription order in a billing portal. + + Organizations that use the current order model cannot create legacy orders, and this operation returns a validation error for them. security: - CustomerJWT: [] requestBody: @@ -29796,10 +29942,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29816,6 +29962,7 @@ paths: $ref: '#/components/responses/TooManyRequests' /storefront/transactions: get: + x-internal: true x-products: - Storefront tags: @@ -29856,6 +30003,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -29883,6 +30031,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -29907,6 +30056,7 @@ paths: '404': $ref: '#/components/responses/NotFound' patch: + x-internal: true x-products: - Storefront tags: @@ -29935,10 +30085,10 @@ paths: '200': description: Transaction DCC offer updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29958,6 +30108,7 @@ paths: - $ref: '#/components/parameters/resourceId' - $ref: '#/components/parameters/token' post: + x-internal: true x-products: - Storefront tags: @@ -29975,10 +30126,10 @@ paths: '200': description: KYC verification finished. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -29998,6 +30149,7 @@ paths: - $ref: '#/components/parameters/resourceId' - $ref: '#/components/parameters/token' post: + x-internal: true x-products: - Storefront tags: @@ -30015,10 +30167,10 @@ paths: '200': description: KYC verification skipped. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30035,6 +30187,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Storefront tags: @@ -30044,6 +30197,7 @@ paths: x-sdk-operation-name: get security: - CustomerJWT: [] + - PublishableApiKey: [] description: |- Retrieves a website with a specified ID. Use this operation to find the website name, logo, or more. @@ -30085,6 +30239,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' put: + x-internal: true x-products: - Core tags: @@ -30104,10 +30259,10 @@ paths: '200': description: Risk score rules set. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30117,10 +30272,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30158,6 +30313,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' put: + x-internal: true x-products: - Core tags: @@ -30177,10 +30333,10 @@ paths: '200': description: Risk score blocklist rules set. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30190,10 +30346,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30261,10 +30417,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30279,6 +30435,7 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: + x-internal: true x-products: - Core tags: @@ -30294,10 +30451,10 @@ paths: '200': description: Allowlist record retrieved. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30307,6 +30464,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' delete: + x-internal: true x-products: - Core tags: @@ -30319,10 +30477,10 @@ paths: '204': description: Allowlist record deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '429': $ref: '#/components/responses/TooManyRequests' /tags-rules: @@ -30383,10 +30541,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30437,10 +30595,10 @@ paths: '200': description: Tags rule updated. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30450,10 +30608,10 @@ paths: headers: Location: $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' content: application/json: schema: @@ -30474,6 +30632,7 @@ paths: description: Tags rule resource. required: true delete: + x-internal: true x-products: - Core tags: @@ -30486,10 +30645,10 @@ paths: '204': description: Tags rule deleted. headers: - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + $ref: '#/components/headers/Rate-Limit-Remaining' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -30503,6 +30662,7 @@ webhooks: post: summary: Application instance disabled operationId: application-instance-disabled + deprecated: true x-products: - Users tags: @@ -30516,6 +30676,7 @@ webhooks: post: summary: Application instance enabled operationId: application-instance-enabled + deprecated: true x-products: - Users tags: @@ -30857,7 +31018,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -30870,7 +31031,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -31088,6 +31249,7 @@ webhooks: post: summary: Invoice past due reminder operationId: invoice-past-due-reminder + deprecated: true x-products: - Core tags: @@ -31097,6 +31259,78 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + invoice-past-due-reminder-15-days: + post: + summary: Renewal invoice reminder, 15 days past due + description: |- + Sends a reminder when an unpaid renewal invoice is 15 days past its due date. + The reminder is sent once for that due date, + and remains available until 30 days after the due date. + For more information, see [Invoice past due reminders](https://www.rebilly.com/docs/dev-docs/invoices/#invoice-past-due-reminders). + operationId: invoice-past-due-reminder-15-days + x-products: + - Core + tags: + - Invoices + requestBody: + $ref: '#/components/requestBodies/InvoicePastDueReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + invoice-past-due-reminder-30-days: + post: + summary: Renewal invoice reminder, 30 days past due + description: |- + Sends a reminder when an unpaid renewal invoice is 30 days past its due date. + The reminder is sent once for that due date, + and remains available until 60 days after the due date. + For more information, see [Invoice past due reminders](https://www.rebilly.com/docs/dev-docs/invoices/#invoice-past-due-reminders). + operationId: invoice-past-due-reminder-30-days + x-products: + - Core + tags: + - Invoices + requestBody: + $ref: '#/components/requestBodies/InvoicePastDueReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + invoice-past-due-reminder-60-days: + post: + summary: Renewal invoice reminder, 60 days past due + description: |- + Sends a reminder when an unpaid renewal invoice is 60 days past its due date. + The reminder is sent once for that due date, + and remains available until 90 days after the due date. + For more information, see [Invoice past due reminders](https://www.rebilly.com/docs/dev-docs/invoices/#invoice-past-due-reminders). + operationId: invoice-past-due-reminder-60-days + x-products: + - Core + tags: + - Invoices + requestBody: + $ref: '#/components/requestBodies/InvoicePastDueReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + invoice-past-due-reminder-90-days: + post: + summary: Renewal invoice reminder, 90 days past due + description: |- + Sends a reminder when an unpaid renewal invoice is 90 days past its due date. + The reminder is sent once for that due date, + and remains available until 120 days after the due date. + For more information, see [Invoice past due reminders](https://www.rebilly.com/docs/dev-docs/invoices/#invoice-past-due-reminders). + operationId: invoice-past-due-reminder-90-days + x-products: + - Core + tags: + - Invoices + requestBody: + $ref: '#/components/requestBodies/InvoicePastDueReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. invoice-reissued: post: summary: Invoice reissued @@ -31283,10 +31517,11 @@ webhooks: post: summary: Order abandoned reminder operationId: order-abandon-reminder + deprecated: true x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/OrderAbandonReminderSent' responses: @@ -31296,10 +31531,11 @@ webhooks: post: summary: Order abandoned reminder operationId: orders-experimental-order-abandon-reminder + deprecated: true x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/OrderAbandonReminderSent' responses: @@ -31312,7 +31548,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31325,7 +31561,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31338,7 +31574,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31351,7 +31587,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31387,6 +31623,7 @@ webhooks: post: summary: Payment card expiration reminder operationId: payment-card-expiration-reminder + deprecated: true x-products: - Core tags: @@ -31396,6 +31633,65 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + payment-card-expiration-reminder-14-days: + post: + summary: Payment card expiration reminder, 14 days before expiration + description: |- + Sends a reminder when the active default payment card of a customer is 14 days from expiring. + The reminder is sent only when the customer has an order that contains subscription items, + and that order has started and is not churned. + The reminder is sent once for that expiration, + and remains available until 7 days before the card expires. + For more information, see [Payment card expiration reminders](https://www.rebilly.com/docs/dev-docs/payment-instruments/#payment-card-expiration-reminders). + operationId: payment-card-expiration-reminder-14-days + x-products: + - Core + tags: + - Payment instruments + requestBody: + $ref: '#/components/requestBodies/PaymentCardExpirationReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + payment-card-expiration-reminder-7-days: + post: + summary: Payment card expiration reminder, 7 days before expiration + description: |- + Sends a reminder when the active default payment card of a customer is 7 days from expiring. + The reminder is sent only when the customer has an order that contains subscription items, + and that order has started and is not churned. + The reminder is sent once for that expiration, + and remains available until 1 day before the card expires. + For more information, see [Payment card expiration reminders](https://www.rebilly.com/docs/dev-docs/payment-instruments/#payment-card-expiration-reminders). + operationId: payment-card-expiration-reminder-7-days + x-products: + - Core + tags: + - Payment instruments + requestBody: + $ref: '#/components/requestBodies/PaymentCardExpirationReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + payment-card-expiration-reminder-1-day: + post: + summary: Payment card expiration reminder, 1 day before expiration + description: |- + Sends a reminder when the active default payment card of a customer is 1 day from expiring. + The reminder is sent only when the customer has an order that contains subscription items, + and that order has started and is not churned. + The reminder is sent once for that expiration, and remains available until the card expires. + For more information, see [Payment card expiration reminders](https://www.rebilly.com/docs/dev-docs/payment-instruments/#payment-card-expiration-reminders). + operationId: payment-card-expiration-reminder-1-day + x-products: + - Core + tags: + - Payment instruments + requestBody: + $ref: '#/components/requestBodies/PaymentCardExpirationReminderWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. payment-card-expired: post: summary: Payment card expired @@ -31422,6 +31718,45 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + payout-request-batch-created: + post: + summary: Payout request batch created + operationId: payout-request-batch-created + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/PayoutRequestBatchWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + payout-request-batch-deleted: + post: + summary: Payout request batch deleted + operationId: payout-request-batch-deleted + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/PayoutRequestBatchDeletedWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + payout-request-batch-modified: + post: + summary: Payout request batch modified + operationId: payout-request-batch-modified + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/PayoutRequestBatchWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. payout-request-canceled: post: summary: Payout request canceled @@ -31435,6 +31770,19 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + payout-request-changed: + post: + summary: Payout request changed + operationId: payout-request-changed + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/PayoutRequestChangedWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. payout-request-created: post: summary: Payout request created @@ -31598,7 +31946,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/RenewalInvoiceIssued' responses: @@ -31611,7 +31959,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/RenewalInvoiceIssued' responses: @@ -31663,7 +32011,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -31676,7 +32024,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -31689,7 +32037,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31702,7 +32050,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31715,7 +32063,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31728,7 +32076,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31741,7 +32089,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31754,7 +32102,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31767,7 +32115,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31780,7 +32128,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31793,7 +32141,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31806,7 +32154,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31819,7 +32167,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31832,7 +32180,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31845,7 +32193,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31858,7 +32206,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31871,7 +32219,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionQuantityFilledLimitReached' responses: @@ -31884,7 +32232,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionQuantityFilledLimitReached' responses: @@ -31897,7 +32245,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31910,7 +32258,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31920,25 +32268,72 @@ webhooks: post: summary: Subscription renewal reminder operationId: subscription-renewal-reminder + deprecated: true x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: 2xx: description: Returns any 2xx status to indicate that data is received. - orders-experimental-subscription-renewal-reminder: + subscription-renewal-reminder-30-days: post: - summary: Subscription renewal reminder - operationId: orders-experimental-subscription-renewal-reminder + summary: Subscription renewal reminder, 30 days before renewal + description: |- + Sends a reminder when an active order that contains subscription items is 30 days from renewal. + The reminder is sent only when the recurring interval of the order is 90 days or more. + The reminder is not sent for a paused order, or for the renewal at the end of a trial. + The reminder is sent once for that renewal, + and remains available until 7 days before the order renews. + For more information, see [Subscription renewal reminders](https://www.rebilly.com/docs/dev-docs/orders/#subscription-renewal-reminders). + operationId: subscription-renewal-reminder-30-days x-products: - Core tags: - - Orders experimental + - Orders requestBody: - $ref: '#/components/requestBodies/SubscriptionWebhook' + $ref: '#/components/requestBodies/SubscriptionRenewalReminder' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + subscription-renewal-reminder-7-days: + post: + summary: Subscription renewal reminder, 7 days before renewal + description: |- + Sends a reminder when an active order that contains subscription items is 7 days from renewal. + The reminder is sent only when the recurring interval of the order is 14 days or more. + The reminder is not sent for a paused order, or for the renewal at the end of a trial. + The reminder is sent once for that renewal, + and remains available until 1 day before the order renews. + For more information, see [Subscription renewal reminders](https://www.rebilly.com/docs/dev-docs/orders/#subscription-renewal-reminders). + operationId: subscription-renewal-reminder-7-days + x-products: + - Core + tags: + - Orders + requestBody: + $ref: '#/components/requestBodies/SubscriptionRenewalReminder' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + subscription-renewal-reminder-1-day: + post: + summary: Subscription renewal reminder, 1 day before renewal + description: |- + Sends a reminder when an active order that contains subscription items is 1 day from renewal. + The reminder is sent only when the recurring interval of the order is longer than 1 day. + The reminder is not sent for a paused order, or for the renewal at the end of a trial. + The reminder is sent once for that renewal, and remains available until the order renews. + For more information, see [Subscription renewal reminders](https://www.rebilly.com/docs/dev-docs/orders/#subscription-renewal-reminders). + operationId: subscription-renewal-reminder-1-day + x-products: + - Core + tags: + - Orders + requestBody: + $ref: '#/components/requestBodies/SubscriptionRenewalReminder' responses: 2xx: description: Returns any 2xx status to indicate that data is received. @@ -31949,7 +32344,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31962,7 +32357,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31975,7 +32370,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -31988,7 +32383,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32001,7 +32396,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32014,7 +32409,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32027,7 +32422,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32040,7 +32435,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32053,7 +32448,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32066,7 +32461,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32079,7 +32474,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32092,7 +32487,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32105,7 +32500,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32118,7 +32513,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32131,7 +32526,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32144,7 +32539,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32157,7 +32552,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32170,12 +32565,51 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: 2xx: description: Returns any 2xx status to indicate that data is received. + orders-experimental-order-change-created: + post: + summary: Order change created + operationId: orders-experimental-order-change-created + x-products: + - Core + tags: + - Orders + requestBody: + $ref: '#/components/requestBodies/OrderAndOrderChange' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + orders-experimental-order-change-canceled: + post: + summary: Order change canceled + operationId: orders-experimental-order-change-canceled + x-products: + - Core + tags: + - Orders + requestBody: + $ref: '#/components/requestBodies/OrderAndOrderChange' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + orders-experimental-order-change-applied: + post: + summary: Order change applied + operationId: orders-experimental-order-change-applied + x-products: + - Core + tags: + - Orders + requestBody: + $ref: '#/components/requestBodies/OrderAndOrderChange' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. subscription-resumed: post: summary: Subscription order resumed @@ -32183,7 +32617,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32196,7 +32630,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionAndSubscriptionPause' responses: @@ -32280,6 +32714,45 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + transaction-partially-refunded: + post: + summary: Transaction partially refunded + operationId: transaction-partially-refunded + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + transaction-refunded: + post: + summary: Transaction refunded + operationId: transaction-refunded + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + transaction-voided: + post: + summary: Transaction voided + operationId: transaction-voided + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. transaction-timeout-resolved: post: summary: Transaction timeout resolved @@ -32300,7 +32773,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -32313,7 +32786,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/UsageLimitWebhook' responses: @@ -32345,6 +32818,19 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + data-export-failed: + post: + summary: Data export failed + operationId: data-export-failed + x-products: + - Reports + tags: + - Data exports + requestBody: + $ref: '#/components/requestBodies/DataExportWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. order-delinquency-reached: post: summary: Order delinquency time reached @@ -32352,7 +32838,7 @@ webhooks: x-products: - Core tags: - - Orders + - Orders (legacy) requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32365,7 +32851,7 @@ webhooks: x-products: - Core tags: - - Orders experimental + - Orders requestBody: $ref: '#/components/requestBodies/SubscriptionWebhook' responses: @@ -32397,7 +32883,7 @@ components: ApplicationJWT: description: |- Applications in the Rebilly App Store can create a JSON Web Token (JWT) by fetching an user's instance. - For more information, see [Retrieve an application instance](https://www.rebilly.com/catalog/all/application-owners/getapplicationinstancebyorganization/). + For more information, see Retrieve an application instance. Usage format: `Bearer `. type: http @@ -32424,7 +32910,7 @@ components: CustomerJWT: description: |- To create a JSON Web Token (JWT) using Storefront authentication, - see [Create a session with username and password](https://www.rebilly.com/catalog/all/storefront-account/storefrontpostlogin). + see the Create a session with username and password operation. Usage format: `Bearer `. type: http @@ -32434,7 +32920,9 @@ components: collectionLimit: name: limit in: query - description: Limits the number of collection items to be returned. + description: |- + Limit the number of collection items to be returned. + Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`. schema: type: integer minimum: 0 @@ -32447,15 +32935,6 @@ components: type: integer minimum: 0 maximum: 1000 - resourceId: - name: id - in: path - description: ID of the resource. - required: true - schema: - type: string - maxLength: 50 - pattern: ^[@~\-\.\w]+$ collectionSort: name: sort in: query @@ -32486,6 +32965,15 @@ components: description: Use this field to perform a partial search of text fields. schema: type: string + resourceId: + name: id + in: path + description: ID of the resource. + required: true + schema: + type: string + maxLength: 50 + pattern: ^[@~\-\.\w]+$ collectionExpand: name: expand in: query @@ -32588,6 +33076,17 @@ components: type: string maxLength: 50 pattern: ^[@~\-\.\w]+$ + invoiceCollectionLimit: + name: limit + in: query + description: |- + Limit the number of invoices to return. + Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`. + Values greater than `100` are treated as `100`. + schema: + type: integer + minimum: 0 + maximum: 100 mediaTypeJsonPdf: name: Accept in: header @@ -32619,6 +33118,17 @@ components: For more information, see [Embedded resources](https://www.rebilly.com/docs/dev-docs/expand-embedded-resources). schema: type: string + subscriptionCollectionLimit: + name: limit + in: query + description: |- + Limit the number of subscriptions to return. + Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`. + When `expand` includes `initialInvoice` or `recentInvoice`, cap values greater than `100` at `100`. + schema: + type: integer + minimum: 0 + maximum: 1000 subscriptionExpand: name: expand in: query @@ -32649,7 +33159,7 @@ components: required: true schema: type: string - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ customerId: name: customerId in: path @@ -32729,6 +33239,17 @@ components: description: Criteria parameter for requesting a collection. schema: type: string + mediaTypeJsonPdfCsv: + name: Accept + in: header + description: Type of response media. + schema: + type: string + enum: + - application/json + - application/pdf + - text/csv + default: application/json storefrontCustomFieldResource: name: resource in: path @@ -32743,7 +33264,9 @@ components: - transactions headers: Pagination-Total: - description: Total number of items. + description: |- + Total number of items that match the request. + The value is independent of `limit`, including when `limit` is `0`. schema: type: integer example: 332 @@ -32768,195 +33291,26 @@ components: type: string format: uri example: https://api.rebilly.com/example - X-RateLimit-Limit: + Rate-Limit-Limit: description: |- - Total number of rate limit tokens for this request within a rate limit period. + Maximum number of requests available at one time for this rate limit. For more information, see [Rate limits](#section/Rate-limits). schema: type: integer - example: 3600 - X-RateLimit-Remaining: + example: 500 + Rate-Limit-Remaining: description: |- - Remaining number of rate limit tokens for this request within the rate limit period. - For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes. + Number of requests still available for this rate limit. + For more information, see [Rate limits](#section/Rate-limits). schema: type: integer - example: 3600 - X-RateLimit-Retry-After: - description: UTC timestamp after which the rate limit resets and the request can be retried. + example: 499 + Rate-Limit-Retry-After: + description: Number of seconds to wait before retrying the request. schema: type: integer - example: 1713187500 + example: 1 schemas: - RegistrationFieldStep: - type: object - required: - - id - - displayHeader - properties: - id: - type: string - description: |- - ID of the registration step. - This value must start with `step-` followed by lowercase alphanumeric characters or hyphens. - pattern: ^step-[a-z0-9-]+$ - example: step-0 - displayHeader: - type: string - description: Display header of the registration step. - minLength: 1 - maxLength: 255 - example: Contact information - RegistrationField: - type: object - required: - - attribute - - displayName - - requirementLevel - - validationType - - order - - step - properties: - attribute: - type: string - description: |- - Attribute of the Keycloak user profile. - This value determines which user attribute the field maps to. - Use the `contentBlock` attribute for static text in the registration form that requires no user input. - enum: - - username - - firstName - - lastName - - email - - gender - - dateOfBirth - - addressLine1 - - addressLine2 - - city - - postalCode - - country - - province - - currency - - mobileNumber - - industry - - occupation - - marketingOptIn - - termsAccepted - - passwordStep - - contentBlock - example: email - displayName: - type: string - description: Display name of the registration field. - minLength: 1 - maxLength: 255 - example: Email Address - requirementLevel: - type: string - description: |- - Requirement level of the field. - This value determines whether the field is required, optional, or hidden during registration. - enum: - - required - - optional - - hidden - default: required - example: required - validationType: - type: string - description: Type of validation applied to the field input. - enum: - - none - - email - - phone - - alphanumeric - - numeric - - date - - url - - regex - - password - default: none - example: email - validationPattern: - type: - - string - - 'null' - description: |- - Custom validation regex pattern for the field. - Only applicable when `validationType` is `regex`. - maxLength: 255 - minLength: - type: - - integer - - 'null' - description: |- - Minimum length of the field value. - Not applicable when the `attribute` value is `dateOfBirth` or `contentBlock`. - minimum: 0 - example: 1 - maxLength: - type: - - integer - - 'null' - description: |- - Maximum length of the field value. - Not applicable when the `attribute` value is `dateOfBirth` or `contentBlock`. - minimum: 1 - example: 255 - helpText: - type: - - string - - 'null' - description: Help text displayed to the user for the field. - maxLength: 500 - example: Enter your email address - minimumAge: - type: - - integer - - 'null' - description: |- - Minimum age in years for the registrant, calculated from their date of birth. - This field is only applicable when the `attribute` value is `dateOfBirth`. - minimum: 1 - maximum: 100 - example: 19 - inputType: - type: - - string - - 'null' - description: Type of input control for the field in the registration form. - enum: - - text - - select - - checkbox - - date - - null - example: text - placeholder: - type: - - string - - 'null' - description: Placeholder text displayed in the input field before the user enters a value. - maxLength: 255 - example: Enter your email address - contentBlock: - type: - - string - - 'null' - description: |- - Static informational text in the registration form. - This field is only applicable when the `attribute` value is `contentBlock`. - maxLength: 2048 - example: For problem gaming assistance call 1-111-111-1111. - order: - type: integer - description: Display order of the field within a registration step. - minimum: 0 - default: 0 - example: 0 - step: - description: Registration step associated with the field. - $ref: '#/components/schemas/RegistrationFieldStep' CreatedTime: type: string description: |- @@ -32975,6 +33329,11 @@ components: readOnly: true x-sortable: true x-label: Last Update Time + ResourceId: + type: string + description: Unique resource ID. + maxLength: 50 + example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 SelfLink: type: array description: Related links. @@ -32990,229 +33349,6 @@ components: type: string enum: - self - AccountRegistrationSettings: - type: object - description: |- - Account registration settings define the fields, steps, and validation rules - for a customer registration flow. - Each account registration settings resource is scoped to a set of locations - and is synchronized with a Keycloak realm. - required: - - name - properties: - id: - type: string - description: |- - ID of the account registration settings. - If not provided, the ID is generated from the name. - maxLength: 50 - pattern: ^[a-z0-9\-]+$ - example: eu-registration - name: - type: string - description: Name of the account registration settings. - minLength: 1 - maxLength: 255 - example: EU Registration Requirements - description: - type: - - string - - 'null' - description: Description of the account registration settings. - maxLength: 1000 - example: Account registration settings for EU customers - isEnabled: - type: boolean - description: Specifies if the account registration settings are active. - default: true - example: true - locations: - type: array - description: |- - List of locations that the account registration settings apply to. - Each location consists of a country and an optional region. - items: - type: object - required: - - country - properties: - country: - type: string - description: |- - Country code of the location. - Use ISO 3166-1 alpha-2 country codes. - example: CA - region: - type: string - description: |- - Region code of the location within the country. - Use ISO 3166-2 subdivision codes without the country prefix. - example: 'ON' - example: - - country: CA - region: 'ON' - - country: GB - fields: - type: array - description: List of registration fields that define the registration form. - items: - $ref: '#/components/schemas/RegistrationField' - realm: - type: - - string - - 'null' - description: Keycloak realm associated with the account registration settings. - readOnly: true - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - _links: - $ref: '#/components/schemas/SelfLink' - BaseProblem: - type: object - additionalProperties: true - minProperties: 1 - description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. - properties: - type: - type: string - description: |- - Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. - It should provide human-readable documentation for the problem type. - When this member is not present, its value is assumed to be "about:blank". - format: uri - title: - type: string - description: |- - Short, human-readable summary of the problem type. - Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - detail: - type: string - description: Human-readable explanation that is specific to this occurrence of the problem. - instance: - type: string - description: |- - URI reference that identifies the specific occurrence of the problem. - It may or may not yield further information if dereferenced. - Unauthorized: - allOf: - - title: Unauthorized - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 401 - maximum: 401 - - $ref: '#/components/schemas/BaseProblem' - Forbidden: - allOf: - - title: Forbidden - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 403 - maximum: 403 - - $ref: '#/components/schemas/BaseProblem' - Conflict: - allOf: - - title: Conflict - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 409 - maximum: 409 - - $ref: '#/components/schemas/BaseProblem' - InvalidFields: - type: array - description: Invalid field details. - items: - type: object - properties: - field: - type: string - description: |- - Name of the field. - Dot notation is used for nested object field names. - message: - description: Message field. - type: string - example: - - field: field1 - message: field1 is invalid - - field: subObject.field2 - message: field2 is invalid - - field: subObject.field2 - message: another error in the field2 - ValidationError: - allOf: - - title: Validation error - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 422 - maximum: 422 - - $ref: '#/components/schemas/BaseProblem' - - type: object - properties: - invalidFields: - $ref: '#/components/schemas/InvalidFields' - TooManyRequests: - type: object - additionalProperties: true - minProperties: 1 - description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. - properties: - type: - type: string - description: |- - Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. - It should provide human-readable documentation for the problem type. - When this member is not present, its value is assumed to be "about:blank". - format: uri - example: about:blank - title: - type: string - description: |- - Short, human-readable summary of the problem type. - Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - example: Rate Limit Exceeded - status: - type: integer - description: HTTP status code. - minimum: 429 - maximum: 429 - detail: - type: string - description: Human-readable explanation that is specific to this occurrence of the problem. - example: A request cannot be executed because the user has sent too many requests within a certain period of time - instance: - type: string - description: |- - URI reference that identifies the specific occurrence of the problem. - It may or may not yield further information if dereferenced. - NotFound: - allOf: - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 404 - maximum: 404 - - $ref: '#/components/schemas/BaseProblem' - ResourceId: - type: string - description: Unique resource ID. - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 AML: type: object properties: @@ -33479,7 +33615,7 @@ components: Tag names are not case-sensitive. type: string maxLength: 255 - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ example: New type: description: |- @@ -33742,6 +33878,134 @@ components: enum: - self - customer + BaseProblem: + type: object + additionalProperties: true + minProperties: 1 + description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. + properties: + type: + type: string + description: |- + Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. + It should provide human-readable documentation for the problem type. + When this member is not present, its value is assumed to be "about:blank". + format: uri + title: + type: string + description: |- + Short, human-readable summary of the problem type. + Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. + detail: + type: string + description: Human-readable explanation that is specific to this occurrence of the problem. + instance: + type: string + description: |- + URI reference that identifies the specific occurrence of the problem. + It may or may not yield further information if dereferenced. + Unauthorized: + allOf: + - title: Unauthorized + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 401 + maximum: 401 + - $ref: '#/components/schemas/BaseProblem' + Forbidden: + allOf: + - title: Forbidden + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 403 + maximum: 403 + - $ref: '#/components/schemas/BaseProblem' + NotFound: + allOf: + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 404 + maximum: 404 + - $ref: '#/components/schemas/BaseProblem' + InvalidFields: + type: array + description: Invalid field details. + items: + type: object + properties: + field: + type: string + description: |- + Name of the field. + Dot notation is used for nested object field names. + message: + description: Message field. + type: string + example: + - field: field1 + message: field1 is invalid + - field: subObject.field2 + message: field2 is invalid + - field: subObject.field2 + message: another error in the field2 + ValidationError: + allOf: + - title: Validation error + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 422 + maximum: 422 + - $ref: '#/components/schemas/BaseProblem' + - type: object + properties: + invalidFields: + $ref: '#/components/schemas/InvalidFields' + TooManyRequests: + type: object + additionalProperties: true + minProperties: 1 + description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. + properties: + type: + type: string + description: |- + Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. + It should provide human-readable documentation for the problem type. + When this member is not present, its value is assumed to be "about:blank". + format: uri + example: about:blank + title: + type: string + description: |- + Short, human-readable summary of the problem type. + Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. + example: Rate Limit Exceeded + status: + type: integer + description: HTTP status code. + minimum: 429 + maximum: 429 + detail: + type: string + description: Human-readable explanation that is specific to this occurrence of the problem. + example: A request cannot be executed because the user has sent too many requests within a certain period of time + instance: + type: string + description: |- + URI reference that identifies the specific occurrence of the problem. + It may or may not yield further information if dereferenced. AmlCheckReview: type: object description: AML check review. @@ -33945,6 +34209,7 @@ components: description: Linked object type. type: string enum: + - credit-memo-timeline-comment - customer - customer-timeline-comment - dispute @@ -33954,8 +34219,10 @@ components: - order-timeline-comment - organization - payment + - payout-request-timeline-comment - plan - product + - quote-timeline-comment - subscription - transaction - transaction-timeline-comment @@ -33995,6 +34262,17 @@ components: properties: file: type: object + Conflict: + allOf: + - title: Conflict + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 409 + maximum: 409 + - $ref: '#/components/schemas/BaseProblem' AuthenticationOptions: type: object properties: @@ -34188,7 +34466,6 @@ components: - PostFile - StorefrontGetAccount - StorefrontGetWebsite - - StorefrontGetKycDocumentCollection - StorefrontGetKycDocument - StorefrontPostKycDocument Acl: @@ -34365,7 +34642,6 @@ components: maxLength: 3 example: USD x-label: Currency - x-sortable: true CouponRestrictionMaximumOrderAmount: type: object description: |- @@ -35467,32 +35743,6 @@ components: For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id). maxLength: 50 example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG - VaultedInstrument: - title: Vaulted payment instrument - description: |- - Vaulted payment instrument. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - required: - - method - - paymentInstrumentId - properties: - method: - description: |- - Payment method supported vault. - For more information, see [Payment instrument](https://www.rebilly.com/catalog/all/payment-instruments). - type: string - enum: - - payment-card - - ach - - paypal - paymentInstrumentId: - type: string - description: ID of the payment instrument. - maxLength: 50 - example: inst_0YVB8KPKNXCBR9EDX7JHSED75N PaymentMethod: type: string description: Payment method. @@ -35637,6 +35887,7 @@ components: - Perfect-money - Piastrix - PIX + - PIX-Automatico - PinPay - phone - PhonePe @@ -35667,6 +35918,7 @@ components: - Telr - Terminaly-RF - Tether + - Thunes-Checkout - ToditoCash-card - Trustly - Tupay @@ -35695,78 +35947,6 @@ components: - Zotapay - Zimpler - Zip - AlternativePaymentInstrument: - title: Alternative instrument - description: |- - Alternative payment method instrument. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - allOf: - - $ref: '#/components/schemas/PaymentMethod' - - not: - enum: - - payment-card - - ach - - paypal - - cash - - check - paymentInstrumentId: - type: string - description: ID of the payment instrument. - maxLength: 50 - example: inst_0YVB8KPKNXCBR9EDX7JHSED75N - reference: - description: |- - Reference data. - This field is available only for the `bank-transfer` payment method. - type: - - string - - 'null' - CashInstrument: - title: Cash - description: |- - Cash payment instrument object. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - type: string - enum: - - cash - receivedBy: - description: Individual or entity that received the payment. - type: string - CheckInstrument: - title: Check - description: |- - Check payment instrument object. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - type: string - enum: - - check - reference: - description: Reference data. - type: string ResourceCustomFields: description: |- Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. @@ -36203,18 +36383,42 @@ components: writeOnly: true description: |- Write-only payment token. - If supplied, the token is converted into a payment instrument and set as the `defaultPaymentInstrument` value. - If both are supplied, the value of this property overrides the `defaultPaymentInstrument` value. - The token expires after first use. + If supplied, the token is converted into a payment instrument, and its ID is assigned to `defaultPaymentInstrumentId` value. + The value of this property overrides the `defaultPaymentInstrumentId` if both are supplied. + This token may only be used once before it expires. defaultPaymentInstrument: type: - object - 'null' - oneOf: - - $ref: '#/components/schemas/VaultedInstrument' - - $ref: '#/components/schemas/AlternativePaymentInstrument' - - $ref: '#/components/schemas/CashInstrument' - - $ref: '#/components/schemas/CheckInstrument' + description: |- + Default payment instrument of the customer. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + readOnly: true + required: + - method + - paymentInstrumentId + properties: + method: + $ref: '#/components/schemas/PaymentMethod' + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + defaultPaymentInstrumentId: + type: + - string + - 'null' + description: |- + ID of the customer's default payment instrument. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + writeOnly: true preferredPayoutInstrumentId: type: - string @@ -36319,7 +36523,10 @@ components: example: prs_0YV7DDSDD1C8DA64KHH2W33CPF notificationEmails: type: array - description: Additional email addresses for notification delivery. + description: |- + Email addresses for notification delivery in event-based email notifications. + When you configure event-based email notifications, you can send to these addresses, the customer's primary email address, or another email address you specify. + For more information, see [Manage notification emails](https://www.rebilly.com/docs/data-tables/manage-customer-information#manage-notification-emails). items: type: string format: email @@ -36602,6 +36809,7 @@ components: - dispute - coupon - external + - payout-request-batch resourceId: $ref: '#/components/schemas/ResourceId' placeholder: @@ -36678,6 +36886,9 @@ components: - order-completed - order-created - order-downgraded + - order-change-applied + - order-change-canceled + - order-change-created - order-paid-early - order-reactivated - order-renewed @@ -36699,6 +36910,8 @@ components: - quote-rejected - quote-updated - refund-was-reflected-in-invoices + - subscription-pause-created + - subscription-pause-revoked - subscription-paused - subscription-resumed - subscription-trial-end-changed @@ -36710,14 +36923,17 @@ components: - transaction-discrepancy-found - transaction-disputed - transaction-reconciled + - transaction-partially-refunded - transaction-refunded - transaction-voided - transaction-waiting-gateway + - wallet-admin-credited + - wallet-admin-debited customEventType: description: |- Timeline custom event type. Used with `custom-event` type. - This value must be defined using the [Create customer timeline custom event type](https://www.rebilly.com/catalog/all/customers-timeline/postcustomertimelinecustomeventtype) operation. + This value must be defined using the Create customer timeline custom event type operation. type: - string - 'null' @@ -37201,6 +37417,7 @@ components: - image/png - image/jpeg - image/gif + - image/webp - application/pdf - application/json - application/zip @@ -37374,7 +37591,7 @@ components: description: |- Specifies if the configuration of the application instance is complete. Some applications require additional configuration after installation before they can be used. - Configuration is completed using the [Upsert an application instance configuration](https://www.rebilly.com/catalog/all/application-users/putapplicationinstanceconfiguration) operation. + Configuration is completed using the Upsert an application instance configuration operation. type: boolean readOnly: true settings: @@ -37912,11 +38129,6 @@ components: maxLength: 50 readOnly: true example: sub_01HRF27SATGE4Z6PBJE6PD8328 - discountAmount: - description: Discount amount applied to the invoice item. - type: number - format: double - readOnly: true periodStartTime: description: Date and time when the billing period starts. type: @@ -38095,6 +38307,7 @@ components: - iCheque - iDebit - Ilixium + - IMerchant - Ingenico - INOVAPAY - Inovio @@ -38157,6 +38370,7 @@ components: - PayEcards - Payeezy - Payflow + - PayGlocal - Paynote - PaymentAsia - PaymenTechnologies @@ -38209,6 +38423,7 @@ components: - Tabby - Telr - TestProcessor + - Thunes - ToditoCash - Triple000 - Truevo @@ -38382,6 +38597,7 @@ components: - PayCash - PayClub - PayEcards + - PayGlocal - PaymentAsia - PaymenTechnologies - PaymentsOS @@ -38427,6 +38643,7 @@ components: - TBI - Telr - TestProcessor + - Thunes - ToditoCash - Triple000 - Truevo @@ -38450,6 +38667,104 @@ components: - XPay - Zimpler - Zotapay + VaultedInstrument: + title: Vaulted payment instrument + description: |- + Vaulted payment instrument. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + required: + - method + - paymentInstrumentId + properties: + method: + description: |- + Payment method supported vault. + For more information, see [Payment instrument](https://www.rebilly.com/catalog/all/payment-instruments). + type: string + enum: + - payment-card + - ach + - paypal + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + AlternativePaymentInstrument: + title: Alternative instrument + description: |- + Alternative payment method instrument. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + allOf: + - $ref: '#/components/schemas/PaymentMethod' + - not: + enum: + - payment-card + - ach + - paypal + - cash + - check + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + reference: + description: |- + Reference data. + This field is available only for the `bank-transfer` payment method. + type: + - string + - 'null' + CashInstrument: + title: Cash + description: |- + Cash payment instrument object. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + type: string + enum: + - cash + receivedBy: + description: Individual or entity that received the payment. + type: string + CheckInstrument: + title: Check + description: |- + Check payment instrument object. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + type: string + enum: + - check + reference: + description: Reference data. + type: string MoneyAmount: type: number format: double @@ -38562,7 +38877,9 @@ components: example: 300 isAdBlockEnabled: description: Specifies if the usage of ad block has been detected in the browser. - type: boolean + type: + - boolean + - 'null' extraData: type: - object @@ -38571,22 +38888,28 @@ components: properties: kountFraudSessionId: description: Alpha-numeric `fraudSessionId` as provided by the Kount SDK. - type: string - minimum: 10 - maximum: 32 + type: + - string + - 'null' + minLength: 10 + maxLength: 32 example: abcdefg12345abababab123456789012 payPalMerchantSessionId: description: PayPal `MerchantSessionID` as generated by the PayPal Fraudnet SDK. - type: string - minimum: 1 - maximum: 64 + type: + - string + - 'null' + minLength: 1 + maxLength: 64 example: dd65ratxc5qv15iph3vyoq7l6davuowa threatMetrixSessionId: description: Temporary identifier that is unique to the visitor session and passed to ThreatMetrix. pattern: '[a-zA-Z0-9_-]+' - type: string - minimum: 1 - maximum: 128 + type: + - string + - 'null' + minLength: 1 + maxLength: 128 example: dd65ratxc5qv15iph3vyoq7l6davuowadd65ratxc5qv15iph3vyoq7l6davuowa isProxy: description: Specifies if the customer's IP address is related to a proxy. @@ -38640,7 +38963,9 @@ components: example: New York latitude: description: Latitude of the specified IP address. - type: number + type: + - number + - 'null' format: double readOnly: true longitude: @@ -38906,7 +39231,7 @@ components: type: object description: |- Authentication object. - For more information, see [3D Secure (3DS)](https://www.rebilly.com/docs/docs/settings/3ds/). + For more information, see [3D Secure (3DS)](https://www.rebilly.com/docs/settings/3ds/). readOnly: true properties: server: @@ -39155,6 +39480,15 @@ components: - 'null' format: bin readOnly: true + paymentInstrumentFingerprint: + description: |- + Unique value that is used to identify the payment instrument of the transaction. + This value is `null` if the transaction has no payment instrument, + or the payment instrument has no fingerprint. + type: + - string + - 'null' + readOnly: true paymentInstrument: type: object oneOf: @@ -39907,7 +40241,10 @@ components: - $ref: '#/components/schemas/CustomerId' transactions: type: array - description: Invoice transactions array. + description: |- + Up to 10 of the most recent transactions for the invoice. + To retrieve transactions for an invoice, use [Retrieve transactions](https://www.rebilly.com/catalog/all/transactions/gettransactioncollection) with the `invoiceIds` filter. + Search results can lag briefly behind a write. maxItems: 10 readOnly: true items: @@ -40164,8 +40501,9 @@ components: maxLength: 50 example: in_0YVF9605RKC62BP14NE2R7V2XT currency: - $ref: '#/components/schemas/CurrencyCode' readOnly: true + allOf: + - $ref: '#/components/schemas/CurrencyCode' appliedCreditMemos: type: array readOnly: true @@ -40217,6 +40555,7 @@ components: - invoice-refunded - invoice-reissued - invoice-renewal-payment-declined + - invoice-restored - invoice-revenue-recognized - invoice-tax-calculation-failed - invoice-voided @@ -40233,6 +40572,7 @@ components: - transaction-canceled - transaction-declined - transaction-initiated + - transaction-partially-refunded - transaction-refunded - transaction-voided triggeredBy: @@ -41055,8 +41395,8 @@ components: - 3 default: 2 x-enumDescriptions: - '1': Strict verification requirements. This option is used for credit transactions. - '2': Moderate verification requirements. This option is used for sale transactions. + '1': Moderate verification requirements. This option is used for sale transactions. + '2': Strict verification requirements. This option is used for credit transactions. '3': Basic verification requirements. This option is used when a high level of verification is not required. KycRequest: type: object @@ -41195,6 +41535,7 @@ components: enum: - document-unreadable - document-expired + - document-was-valid-but-expired - document-not-matching - document-duplicate - document-invalid @@ -41206,9 +41547,11 @@ components: - subtype-missing - dob-mismatch - name-mismatch + - name-and-dob-mismatch - critical-info-missing - old-address-on-id - tampered-document + - no-document-data-detected - other KycDocumentRejection: description: Reason the document is rejected. @@ -41226,6 +41569,11 @@ components: type: string maxLength: 255 example: Provided document is unreadable + KycDocumentMatchesVersion: + type: string + description: Version of the document matches. + readOnly: true + example: '2.0' KycDocumentMatchesScore: type: integer description: Calculated score that represents the percentage of confidence that this ID document represents the customer. @@ -41246,6 +41594,7 @@ components: - dateIsInvalid - dateOfBirth - decision + - documentNumber - documentSubtype - expirationDate - firstName @@ -41254,6 +41603,8 @@ components: - isIdentityDocument - isPublishedOnline - isTampered + - issuanceCountry + - issuanceRegion - issueDate - lastName - line1 @@ -41439,6 +41790,18 @@ components: type: boolean readOnly: true example: false + faceProofBrightness: + description: |- + Brightness of the lighting in the detected face area of the face proof image, on a scale from `0` to `100`. + A higher value indicates brighter lighting. + This value is `null` if no face proof is compared with the document. + type: + - number + - 'null' + minimum: 0 + maximum: 100 + readOnly: true + example: 72.5 expiryDate: description: Use `expirationDate` field instead. type: @@ -41537,6 +41900,21 @@ components: minimum: 0 maximum: 100 description: Weight added when MRZ check digits fail validation. + documentNumber: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if a document number is not detected on the document. + issuanceCountry: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if the country that issued the document is not detected. + issuanceRegion: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if the region, state, province, or territory that issued the document is not detected. thresholds: type: object description: Pass and fail threshold definition for the document verification process. @@ -41598,6 +41976,22 @@ components: - country: US state: AL minimumAge: 19 + faceProofSettings: + type: object + description: Quality requirements for the face proof image of an identity proof document. + properties: + minimumBrightness: + type: integer + minimum: 0 + maximum: 100 + default: 40 + description: |- + Minimum brightness of the lighting in the detected face area of the face proof image. + The brightness scale ranges from `0` to `100`. + A higher value indicates brighter lighting. + If the detected brightness is below this value, + the `hasMatchingFaceProof` check fails with the `face_match_low_brightness` reason. + Use `0` to disable the brightness requirement. ProofOfIdentityKycDocument: title: KYC documents. type: object @@ -41733,6 +42127,8 @@ components: readOnly: true description: Proof of identity document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -41746,6 +42142,8 @@ components: readOnly: true description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -41852,8 +42250,8 @@ components: type: - string - 'null' - format: date - example: '2021-01-01' + format: date-time + example: '2021-01-01T00:00:00+00:00' phone: description: Phone number of the company or agency that issued the document. type: @@ -42082,6 +42480,8 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -42094,6 +42494,8 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -42298,6 +42700,12 @@ components: readOnly: true description: Proof of funds document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/FundsMatches' parsedData: @@ -42305,7 +42713,14 @@ components: - object - 'null' readOnly: true + description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/FundsMatches' _links: @@ -42508,6 +42923,12 @@ components: readOnly: true description: Proof of purchase document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/PurchaseMatches' parsedData: @@ -42517,6 +42938,12 @@ components: readOnly: true description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/PurchaseMatches' _links: @@ -42849,10 +43276,29 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/CreditFileMatches' + parsedData: + type: + - object + - 'null' + readOnly: true + description: Parsed data. + properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: $ref: '#/components/schemas/KycDocumentCheckList' + data: + $ref: '#/components/schemas/CreditFileMatches' _links: type: array description: Related links. @@ -42897,6 +43343,74 @@ components: - $ref: '#/components/schemas/ProofOfFundsKycDocument' - $ref: '#/components/schemas/ProofOfPurchaseKycDocument' - $ref: '#/components/schemas/ProofOfCreditFileKycDocument' + KycIdentityMatchesOverwrite: + type: object + description: Request body for overwriting identity KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `identity-proof`. + type: string + enum: + - identity-proof + example: identity-proof + - $ref: '#/components/schemas/KycIdentityMatches' + KycAddressMatchesOverwrite: + type: object + description: Request body for overwriting address KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `address-proof`. + type: string + enum: + - address-proof + example: address-proof + - $ref: '#/components/schemas/KycAddressMatches' + KycPurchaseMatchesOverwrite: + type: object + description: Request body for overwriting purchase KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `purchase-proof`. + type: string + enum: + - purchase-proof + example: purchase-proof + - $ref: '#/components/schemas/PurchaseMatches' + KycFundsMatchesOverwrite: + type: object + description: Request body for overwriting funds KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `funds-proof`. + type: string + enum: + - funds-proof + example: funds-proof + - $ref: '#/components/schemas/FundsMatches' KycSettings: type: object description: Settings for KYC score calculation. @@ -43002,7 +43516,7 @@ components: An `active` status means that a payment instrument has been used at least once for an approved transaction. To remove an instrument from use, set this value to `deactivated`. - For more information, see [Deactivate a payment instrument](./PostPaymentInstrumentDeactivation). + For more information, see [`POST /payment-instruments/{id}/deactivation`](https://www.rebilly.com/catalog/all/payment-instruments/postpaymentinstrumentdeactivation). enum: - active - inactive @@ -43065,6 +43579,13 @@ components: description: Bank name of the payment instrument. type: string readOnly: true + isPayoutable: + description: |- + Specifies if payouts are supported for cards with this BIN. + Defaults to `true`. + This value is `false` if the BIN does not support payouts. + type: boolean + readOnly: true billingAddress: description: Contact's billing address. $ref: '#/components/schemas/ContactObject' @@ -43373,107 +43894,6 @@ components: properties: customer: type: object - KhelocardCard: - type: object - title: Khelocard card - required: - - method - properties: - id: - type: string - description: ID of the payment instrument. - readOnly: true - maxLength: 50 - example: inst_0YVB8KPKNXCBR9EDX7JHSED75N - customerId: - $ref: '#/components/schemas/CustomerId' - method: - description: Method of payment instrument. - type: string - enum: - - Khelocard - fingerprint: - description: |- - Unique value which identifies the payment instrument. - This value contains alphanumeric characters. - This value is generated from the card number, CVV, and expiration date. - type: string - number: - description: Khelocard card masked number. - type: string - last4: - description: Last 4 digits of the number. - type: string - expYear: - description: Khelocard card expiration year. - type: integer - expMonth: - description: Khelocard card expiration month. - type: integer - billingAddress: - description: Billing address. - $ref: '#/components/schemas/ContactObject' - status: - description: Payment instrument status. - type: string - enum: - - active - - deactivated - useAsBackup: - $ref: '#/components/schemas/UseAsBackup' - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - lastPaymentTime: - $ref: '#/components/schemas/LastPaymentTime' - customFields: - $ref: '#/components/schemas/ResourceCustomFields' - stickyGatewayAccountId: - description: |- - ID of the sticky gateway account. - All future payments are processed by this gateway account. - - For more information, - see [Gateway routing](https://www.rebilly.com/docs/settings/intelligent-payment-routing/#sticky-gateway-accounts). - type: - - string - - 'null' - readOnly: true - riskMetadata: - oneOf: - - $ref: '#/components/schemas/RiskMetadata' - - type: 'null' - revision: - description: |- - Number of times the payment instrument data has been modified. - - Use this value when analyzing webhook data to determine if a change must take precedence over the current representation. - type: integer - readOnly: true - _links: - type: array - description: Related links. - readOnly: true - items: - type: object - properties: - href: - description: Link URL. - type: string - rel: - description: Type of link. - type: string - enum: - - self - - customer - _embedded: - type: object - description: Embedded objects that are requested by the `expand` query parameter. - readOnly: true - properties: - customer: - type: object AlternativePaymentMethods: type: string description: Payment method. @@ -43588,6 +44008,7 @@ components: - Perfect-money - Piastrix - PIX + - PIX-Automatico - plaid-account - PayTabs - Paysafecard @@ -43617,6 +44038,7 @@ components: - swift-dbt - Tele2 - Terminaly-RF + - Thunes-Checkout - ToditoCash-card - Trustly - Tupay @@ -43670,7 +44092,6 @@ components: - paypal - ach - echeck - - Khelocard billingAddress: description: Billing address of the user that is associated with the payment instrument. $ref: '#/components/schemas/ContactObject' @@ -43750,7 +44171,7 @@ components: payment-card: '#/components/schemas/PaymentCard' ach: '#/components/schemas/BankAccount' paypal: '#/components/schemas/PayPalAccount' - Khelocard: '#/components/schemas/KhelocardCard' + Khelocard: '#/components/schemas/AlternativeInstrument' cash: '#/components/schemas/AlternativeInstrument' check: '#/components/schemas/AlternativeInstrument' AdvCash: '#/components/schemas/AlternativeInstrument' @@ -43870,6 +44291,7 @@ components: swift-dbt: '#/components/schemas/AlternativeInstrument' Tele2: '#/components/schemas/AlternativeInstrument' Terminaly-RF: '#/components/schemas/AlternativeInstrument' + Thunes-Checkout: '#/components/schemas/AlternativeInstrument' ToditoCash-card: '#/components/schemas/AlternativeInstrument' Trustly: '#/components/schemas/AlternativeInstrument' UPayCard: '#/components/schemas/AlternativeInstrument' @@ -43891,11 +44313,10 @@ components: Yandex-money: '#/components/schemas/AlternativeInstrument' Zotapay: '#/components/schemas/AlternativeInstrument' Zimpler: '#/components/schemas/AlternativeInstrument' - anyOf: + oneOf: - $ref: '#/components/schemas/PaymentCard' - $ref: '#/components/schemas/BankAccount' - $ref: '#/components/schemas/PayPalAccount' - - $ref: '#/components/schemas/KhelocardCard' - $ref: '#/components/schemas/AlternativeInstrument' PaymentInstrumentCreateToken: title: Payment token @@ -44559,100 +44980,22 @@ components: price: description: |- One-time setup fee charged when the plan starts. - Set to `0` if no setup fee applies. + This field is deprecated. + Use the `setupFee` field instead. type: number format: double - OneTimeSalePlan: - title: OneTimeSalePlan - type: object + deprecated: true + deprecated: true + PlanSetupFee: description: |- - Details of the one-time sale plan. - Use this plan for non-recurring, one-time, sales. - required: - - name - - currency - - productId - - pricing - properties: - name: - description: |- - Name of the plan. - This name is displayed on invoices and receipts. - type: string - maxLength: 255 - description: - type: string - description: |- - Plain-text description of the plan. - This field accepts plain-text only. - maxLength: 65535 - richDescription: - type: string - description: |- - Rich-text description of the plan. - This field accepts rich text formatting, such as: bold, underline, italic, and hyperlinks. - maxLength: 65535 - productId: - type: string - description: ID of the related product. - maxLength: 50 - example: prod_0YV7DES3WPC5J8JD8QTVNZBZNZ - productOptions: - type: - - object - - 'null' - description: Name-value pairs that specify the product options. - additionalProperties: - type: string - example: - color: red - size: xxl - currency: - $ref: '#/components/schemas/CurrencyCode' - currencySign: - description: Currency sign. - readOnly: true - type: string - pricing: - $ref: '#/components/schemas/PlanPriceFormula' - setup: - $ref: '#/components/schemas/PlanSetup' - customFields: - $ref: '#/components/schemas/ResourceCustomFields' - isActive: - type: boolean - description: Specifies if the plan is active. - default: true - revision: - type: integer - readOnly: true - description: |- - Number of times the plan is modified. - Compare this value with materialized subscription item revision values. - isTrialOnly: - type: boolean - description: Specifies if a plan is a trial that does not have recurring instructions. - readOnly: true - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - _links: - type: array - description: Related links. - readOnly: true - items: - type: object - properties: - href: - description: Link URL. - type: string - rel: - description: Type of link. - type: string - enum: - - self - - attachments + One-time setup fee charged when the plan starts. + Set to `0` or `null` if no setup fee applies. + type: + - number + - 'null' + format: double + minimum: 0 + example: 0 SchedulingMethodDayAndMonthOfYear: type: object properties: @@ -44756,7 +45099,7 @@ components: This is used in conjunction with the service period anchor to calculate the time at which the invoice is issued. For more information, see - [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/concepts/#service-period-anchor-and-billing-timing-and-invoice-time-shift). + [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/subscriptions#service-period-anchor-billing-timing-and-invoice-time-shift). required: - chronology - duration @@ -44784,9 +45127,9 @@ components: description: |- Calculation instruction of the invoice due time. - This is used in conjunction with the billing anchor to calculate when + This is used in conjunction with the service period anchor to calculate when an invoice is due for payment. For more information, see - [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/concepts/#service-period-anchor-and-billing-timing-and-invoice-time-shift). + [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/subscriptions#service-period-anchor-billing-timing-and-invoice-time-shift). The sequential order of due time shift is always after the due date. default: @@ -44808,12 +45151,239 @@ components: Details of the subscription order plan. Use this plan for subscriptions or sales that reoccur over a period of time. type: object + required: + - name + - currency + - productId + - pricing + - recurringInterval + properties: + type: + type: string + description: |- + Variant of the plan. + This field is optional in create and update requests. + The variant is `subscription` when `recurringInterval` is present. + If included, this field must match the applicable variant. + A mismatch results in an HTTP `422` response. + Responses always include this field. + enum: + - subscription + name: + description: |- + Name of the plan. + This name is displayed on invoices and receipts. + type: string + maxLength: 255 + description: + type: string + description: |- + Plain-text description of the plan. + This field accepts plain-text only. + maxLength: 65535 + richDescription: + type: string + description: |- + Rich-text description of the plan. + This field accepts rich text formatting, such as: bold, underline, italic, and hyperlinks. + maxLength: 65535 + productId: + type: string + description: ID of the related product. + maxLength: 50 + example: prod_0YV7DES3WPC5J8JD8QTVNZBZNZ + productOptions: + type: + - object + - 'null' + description: Name-value pairs that specify the product options. + additionalProperties: + type: string + example: + color: red + size: xxl + currency: + $ref: '#/components/schemas/CurrencyCode' + currencySign: + description: Currency sign. + readOnly: true + type: string + pricing: + $ref: '#/components/schemas/PlanPriceFormula' + setup: + $ref: '#/components/schemas/PlanSetup' + setupFee: + $ref: '#/components/schemas/PlanSetupFee' + customFields: + $ref: '#/components/schemas/ResourceCustomFields' + isActive: + type: boolean + description: Specifies if the plan is active. + default: true + revision: + type: integer + readOnly: true + description: |- + Number of times the plan is modified. + Compare this value with materialized subscription item revision values. + isTrialOnly: + type: boolean + const: false + description: Specifies if a plan is a trial that does not have recurring instructions. + readOnly: true + recurringInterval: + description: Service interval settings. + type: object + required: + - unit + - length + properties: + periodAnchorInstruction: + $ref: '#/components/schemas/ServicePeriodAnchorInstruction' + unit: + description: Unit of time. + type: string + enum: + - day + - week + - month + - year + length: + description: Length of time. + type: integer + minimum: 1 + limit: + description: |- + Number of invoices the subscription order generates. + If this value is `1`, only the initial order creation is generated. + + Example: For a 1 year contract that is billed monthly, + where the `periodUnit` is `month` and the `periodDuration` is `1`, + set this field to `12`. + type: + - integer + - 'null' + minimum: 1 + maximum: 65535 + billingTiming: + type: string + default: prepaid + description: |- + Billing timing in relation to the service period. + For `prepaid` plans the customer pays when the service period starts, + whereas, for `postpaid` plans, the customer pays when the service period ends. + enum: + - prepaid + - postpaid + trial: + description: |- + Trial configuration setting. + If you do not want to offer a trial, set this value to `null`. + $ref: '#/components/schemas/PlanTrial' + meteredBilling: + type: + - object + - 'null' + required: + - strategy + description: |- + Use metered billing when an exact quantity is unknown. + Report usage during a service period and charge customers afterwards. + Metered billing plans must be postpaid. + properties: + strategy: + type: string + enum: + - sum + - last + x-enumDescriptions: + sum: Total amount of reported invoice item quantity usage. + last: Last reported invoice item quantity usage. + min: + description: Minimum quantity that is charged at the end of a service period regardless of reported usage. + type: + - number + - 'null' + format: float + minimum: 0.01 + max: + description: Maximum quantity that is charged at the end of a service period regardless of reported usage. + type: + - number + - 'null' + format: float + minimum: 0.01 + sticky: + description: |- + When enabled, if no usage is reported during a service period, + the plan bills the last known reported quantity from a previous period instead of zero. + This is suitable for hosted or persistent resources whose usage does not change every period. + Only supported with `strategy`: `last`. + type: boolean + default: false + example: false + invoiceTimeShift: + readOnly: true + deprecated: true + $ref: '#/components/schemas/InvoiceTimeShift' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + _links: + type: array + description: Related links. + readOnly: true + items: + type: object + properties: + href: + description: Link URL. + type: string + rel: + description: Type of link. + type: string + enum: + - self + - attachments + SubscriptionPlanDetails: + title: SubscriptionPlanDetails + allOf: + - type: object + required: + - id + - type + properties: + id: + type: string + description: ID of the plan. + readOnly: true + maxLength: 50 + example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + - $ref: '#/components/schemas/SubscriptionPlan' + OneTimeSalePlan: + title: OneTimeSalePlan + type: object + description: |- + Details of the one-time sale plan. + Use this plan for non-recurring, one-time, sales. required: - name - currency - productId - pricing properties: + type: + type: string + description: |- + Variant of the plan. + This field is optional in create and update requests. + The variant is `one-time-sale` when both `recurringInterval` and `trial` are omitted. + If included, this field must match the applicable variant. + A mismatch results in an HTTP `422` response. + Responses always include this field. + enum: + - one-time-sale name: description: |- Name of the plan. @@ -44857,6 +45427,8 @@ components: $ref: '#/components/schemas/PlanPriceFormula' setup: $ref: '#/components/schemas/PlanSetup' + setupFee: + $ref: '#/components/schemas/PlanSetupFee' customFields: $ref: '#/components/schemas/ResourceCustomFields' isActive: @@ -44871,96 +45443,17 @@ components: Compare this value with materialized subscription item revision values. isTrialOnly: type: boolean + const: false description: Specifies if a plan is a trial that does not have recurring instructions. readOnly: true recurringInterval: - description: |- - Service interval settings. - For a one-time sale, set this value to `null`. - type: object - required: - - unit - - length - properties: - periodAnchorInstruction: - $ref: '#/components/schemas/ServicePeriodAnchorInstruction' - unit: - description: Unit of time. - type: string - enum: - - day - - week - - month - - year - length: - description: Length of time. - type: integer - minimum: 1 - limit: - description: |- - Number of invoices the subscription order generates. - If this value is `1`, only the initial order creation is generated. - - Example: For a 1 year contract that is billed monthly, - where the `periodUnit` is `month` and the `periodDuration` is `1`, - set this field to `12`. - type: - - integer - - 'null' - minimum: 1 - maximum: 65535 - billingTiming: - type: string - default: prepaid - description: |- - Billing timing in relation to the service period. - For `prepaid` plans the customer pays when the service period starts, - whereas, for `postpaid` plans, the customer pays when the service period ends. - enum: - - prepaid - - postpaid + type: 'null' + description: Service interval settings. + readOnly: true trial: - description: |- - Trial configuration setting. - If you do not want to offer a trial, set this value to `null`. - $ref: '#/components/schemas/PlanTrial' - meteredBilling: - type: - - object - - 'null' - required: - - strategy - description: |- - Use metered billing when an exact quantity is unknown. - Report usage during a service period and charge customers afterwards. - Metered billing plans must be postpaid. - properties: - strategy: - type: string - enum: - - sum - - last - x-enumDescriptions: - sum: Total amount of reported invoice item quantity usage. - last: Last reported invoice item quantity usage. - min: - description: Minimum quantity that is charged at the end of a service period regardless of reported usage. - type: - - number - - 'null' - format: float - minimum: 0.01 - max: - description: Maximum quantity that is charged at the end of a service period regardless of reported usage. - type: - - number - - 'null' - format: float - minimum: 0.01 - invoiceTimeShift: + type: 'null' + description: Trial configuration setting. readOnly: true - deprecated: true - $ref: '#/components/schemas/InvoiceTimeShift' createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -44981,6 +45474,21 @@ components: enum: - self - attachments + OneTimeSalePlanDetails: + title: OneTimeSalePlanDetails + allOf: + - type: object + required: + - id + - type + properties: + id: + type: string + description: ID of the plan. + readOnly: true + maxLength: 50 + example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + - $ref: '#/components/schemas/OneTimeSalePlan' TrialOnlyPlan: title: TrialOnlyPlan description: |- @@ -44994,6 +45502,17 @@ components: - productId - trial properties: + type: + type: string + description: |- + Variant of the plan. + This field is optional in create and update requests. + The variant is `trial-only` when `trial` is present without `recurringInterval`. + If included, this field must match the applicable variant. + A mismatch results in an HTTP `422` response. + Responses always include this field. + enum: + - trial-only name: description: |- Name of the plan. @@ -45035,6 +45554,8 @@ components: type: string setup: $ref: '#/components/schemas/PlanSetup' + setupFee: + $ref: '#/components/schemas/PlanSetupFee' customFields: $ref: '#/components/schemas/ResourceCustomFields' isActive: @@ -45049,11 +45570,18 @@ components: Compare this value with materialized subscription item revision values. isTrialOnly: type: boolean + const: true description: Specifies if a plan is a trial that does not have recurring instructions. readOnly: true + recurringInterval: + type: 'null' + description: Service interval settings. + readOnly: true trial: description: Trial configuration settings. - $ref: '#/components/schemas/PlanTrial' + allOf: + - type: object + - $ref: '#/components/schemas/PlanTrial' invoiceTimeShift: readOnly: true deprecated: true @@ -45061,7 +45589,7 @@ components: Use invoice time shift to adjust the invoice issue and due date when billing must occur before the service period changes. For example, rent must be paid in advance, so the invoice must be in advance of the billing date. - For more information, see [Service period anchor, and billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/concepts/#service-period-anchor-and-billing-timing-and-invoice-time-shift). + For more information, see [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/subscriptions#service-period-anchor-billing-timing-and-invoice-time-shift). $ref: '#/components/schemas/InvoiceTimeShift' createdTime: $ref: '#/components/schemas/CreatedTime' @@ -45083,44 +45611,39 @@ components: enum: - self - attachments + TrialOnlyPlanDetails: + title: TrialOnlyPlanDetails + allOf: + - type: object + required: + - id + - type + properties: + id: + type: string + description: ID of the plan. + readOnly: true + maxLength: 50 + example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + - $ref: '#/components/schemas/TrialOnlyPlan' Plan: - anyOf: - - allOf: - - type: object - required: - - id - properties: - id: - type: string - description: ID of the plan. - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X - readOnly: true - - $ref: '#/components/schemas/OneTimeSalePlan' - - allOf: - - type: object - required: - - id - properties: - id: - type: string - description: ID of the plan. - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X - readOnly: true - - $ref: '#/components/schemas/SubscriptionPlan' - - allOf: - - type: object - required: - - id - properties: - id: - type: string - description: ID of the plan. - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X - readOnly: true - - $ref: '#/components/schemas/TrialOnlyPlan' + type: object + discriminator: + propertyName: type + mapping: + subscription: '#/components/schemas/SubscriptionPlanDetails' + one-time-sale: '#/components/schemas/OneTimeSalePlanDetails' + trial-only: '#/components/schemas/TrialOnlyPlanDetails' + oneOf: + - $ref: '#/components/schemas/SubscriptionPlanDetails' + - $ref: '#/components/schemas/OneTimeSalePlanDetails' + - $ref: '#/components/schemas/TrialOnlyPlanDetails' + PlanRequest: + title: PlanRequest + oneOf: + - $ref: '#/components/schemas/SubscriptionPlan' + - $ref: '#/components/schemas/OneTimeSalePlan' + - $ref: '#/components/schemas/TrialOnlyPlan' Product: type: object required: @@ -45220,12 +45743,13 @@ components: To create a new plan, see [Create a plan](https://www.rebilly.com/catalog/all/plans/postplan). required: - id + additionalProperties: false properties: id: description: ID of the plan. $ref: '#/components/schemas/ResourceId' FlexiblePlan: - anyOf: + oneOf: - allOf: - type: object required: @@ -45271,7 +45795,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is triggered. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -45303,6 +45831,10 @@ components: When the total usage reaches the hard limit quantity, or amount values, metered billing plan usages can no longer be reported. + Plans with a minimum quantity, fixed fee, or flat stairstep bracket set a minimum billable quantity and amount. + A `quantity` value below the minimum billable quantity is invalid. + An `amount` value below the minimum billable amount is invalid. + A `0` value remains valid even on plans with minimum billing. minProperties: 1 maxProperties: 1 properties: @@ -45332,6 +45864,7 @@ components: type: object required: - plan + - type properties: id: description: ID of the quote item. @@ -45352,6 +45885,15 @@ components: default: 1 minimum: 0 maximum: 1000000000 + quantityFilled: + description: |- + Number of filled product units. + This field is not used for metered billing plans. + type: + - number + - 'null' + format: double + example: 5.125 plan: description: Plan details. oneOf: @@ -45384,6 +45926,7 @@ components: type: object required: - plan + - type properties: id: description: ID of the quote item. @@ -45563,9 +46106,12 @@ components: x-basic: true format: date-time isLegacy: - description: Specifies if the order is a legacy order. + description: |- + Specifies if the order is a legacy order. + If omitted when the quote is created, the value follows the order model that is used by the organization: `false` for the current order model and `true` for the legacy order model. + If omitted when the quote is updated, the value does not change. + Organizations that use the current order model cannot set this value to `true`. type: boolean - default: true example: true invoicePreview: type: object @@ -45848,6 +46394,8 @@ components: description: |- Type of the quote. When a quote is accepted, quote items and settings are applied to the related order. + Change quotes can only be created for orders with `active` or `trial-ended` status. + For `trial-ended` orders, use this quote type to convert a trial-only order to a regular recurring order. type: string enum: - change @@ -45934,16 +46482,39 @@ components: items: $ref: '#/components/schemas/QuoteItem' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + Policy for managing service periods and trial state of the related order when the quote is accepted. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` flag is ignored unless `retain` is used, or this field is omitted. + If this field is omitted, this value defaults to `retainRecurring`. + If this field is omitted and `keepTrial` is `true`, `renewalPolicy` is set to `retainTrialThenRecurring`. type: string - default: retain + default: retainRecurring enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring` or `retainTrialThenRecurring` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring` or `retainTrialThenRecurring`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period length. type: boolean effectiveTime: @@ -45954,10 +46525,38 @@ components: - string - 'null' format: date-time + applyAt: + description: |- + Time when the new items are applied. + + - `now`: The items change at once. + `prorated`, `renewalPolicy` and `effectiveTime` apply. + - `nextRenewal`: The current items stay until the next renewal. + The new items are billed on the next renewal invoice. + `prorated` and `renewalPolicy` are ignored. + Omit `effectiveTime`. + If the request includes `effectiveTime`, a validation error is returned. + `couponIds` and `usageSettings` are not supported. + If the request includes either field, a validation error is returned. + `interimOnly` must be `true`. + A later request replaces the pending change. + The pending change is locked when the next renewal invoice is issued. + One-time sale items that are already on the order are retained. + A one-time sale item cannot be added with `nextRenewal`. + type: string + enum: + - now + - nextRenewal + default: now keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`, or omitted. + If `renewalPolicy` is omitted and this field is `true`, `renewalPolicy` is set to `retainTrialThenRecurring`. type: boolean default: false interimOnly: @@ -45966,6 +46565,8 @@ components: description: |- Specifies if the quotation invoice must include interim items only. If this value is set to `false`, all upcoming items are included. + With `applyAt` set to `nextRenewal`, this value must be `true`. + To bill the next period now, issue the upcoming invoice of the order. usageSettings: type: array default: [] @@ -46006,7 +46607,11 @@ components: or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -46428,8 +47033,20 @@ components: If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at `paymentInstrumentId`, or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. + includeUnpaidInvoices: + type: boolean + default: false + example: false + description: |- + Specifies whether the quote invoice includes items from outstanding unpaid and past-due invoices for the related order. + When this value is `true`, the quote invoice includes charges for eligible items from those invoices. + When the quote is accepted, only invoices included in the quote that remain unpaid or past due and can be voided are voided. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -46723,6 +47340,18 @@ components: properties: tax: $ref: '#/components/schemas/Taxes' + QuoteReissue: + type: object + properties: + expirationTime: + description: |- + Date and time when the reissued quote expires. + If this field is `null` or omitted, the quote keeps its expiration time when it has not passed. + Otherwise, the quote expires one month after it is reissued. + type: + - string + - 'null' + format: date-time QuoteTimeline: type: object properties: @@ -46746,6 +47375,7 @@ components: - quote-updated - quote-expired - quote-order-attached + - timeline-comment-created triggeredBy: description: Specifies who, or what, triggered the timeline message. type: string @@ -46840,6 +47470,13 @@ components: type: string pattern: ^[A-Z]{2}$ example: US + DigitalWalletCountry: + description: |- + ISO 3166 alpha-2 country code where the payment is processed. + This is often the location for settling the payment. + Consult with your Payment Service Provider (PSP) to determine the + appropriate country code. + $ref: '#/components/schemas/Country' ApplePayFeature: type: object title: Apple Pay Digital Wallet @@ -46857,7 +47494,7 @@ components: type: string example: Test Merchant country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' GooglePayFeature: type: object title: Google Pay Digital Wallet @@ -46878,7 +47515,7 @@ components: type: string example: www.example.com country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' SamsungPayFeature: type: object title: Samsung Pay Digital Wallet @@ -47229,6 +47866,7 @@ components: swift-dbt: '#/components/schemas/ReadyToPayGenericMethod' Tele2: '#/components/schemas/ReadyToPayGenericMethod' Terminaly-RF: '#/components/schemas/ReadyToPayGenericMethod' + Thunes-Checkout: '#/components/schemas/ReadyToPayGenericMethod' ToditoCash-card: '#/components/schemas/ReadyToPayGenericMethod' Trustly: '#/components/schemas/ReadyToPayGenericMethod' UPayCard: '#/components/schemas/ReadyToPayGenericMethod' @@ -47284,7 +47922,10 @@ components: readOnly: true maxLength: 50 planId: - description: ID of the plan. + description: |- + ID of the plan. + + > **Note:** This field is deprecated. Use the `plan.id` field instead. deprecated: true x-basic: true type: string @@ -47297,11 +47938,13 @@ components: maximum: 1000000000 quantityFilled: description: Number of filled product units. - type: number + type: + - number + - 'null' format: double example: 5.125 plan: - anyOf: + oneOf: - $ref: '#/components/schemas/OriginalPlan' - $ref: '#/components/schemas/FlexiblePlan' usageLimits: @@ -47426,6 +48069,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -47459,20 +48103,6 @@ components: all plans must have the same billing period, this property enables the customer to subscribe to different plans. $ref: '#/components/schemas/InvoiceTimeShift' - recurringInterval: - type: - - object - - 'null' - description: |- - Recurring interval to override plan settings. - To use plan settings, set this value to `null`. - - To use multiple plans in one subscription, - all plans must have the same recurring period length. - example: null - properties: - periodAnchorInstruction: - $ref: '#/components/schemas/ServicePeriodAnchorInstruction' autopay: description: |- Specifies if payment attempts are made automatically. @@ -47665,12 +48295,20 @@ components: items: $ref: '#/components/schemas/SubscriptionOrOneTimeSaleItem' deliveryAddress: - description: Delivery address of the order. + description: |- + Delivery address of the order. + Changes to the delivery address apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change the delivery address on an unpaid, past-due, or partially paid invoice, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=deliveryaddress). oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' billingAddress: - description: Billing address of the order. + description: |- + Billing address of the order. + Changes to the billing address apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change the billing address on an issued invoice that has no payment attempts or applied credits, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=billingaddress). oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -47746,6 +48384,11 @@ components: - 'null' example: PO123456 shipping: + description: |- + Shipping settings of the order. + Changes to shipping apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change shipping on an unpaid, past-due, or partially paid invoice, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=shipping). $ref: '#/components/schemas/Shipping' notes: description: Notes for the customer displayed on the order invoice. @@ -47848,6 +48491,7 @@ components: - recentInvoice - approvalUrl - attachments + - leadSource _embedded: type: object description: Embedded objects that are requested by the `expand` query parameter. @@ -48067,6 +48711,7 @@ components: - recentInvoice - approvalUrl - attachments + - leadSource _embedded: type: object description: Embedded objects that are requested by the `expand` query parameter. @@ -48202,12 +48847,6 @@ components: type: string x-basic: true const: one-time-sale - planId: - description: ID of the plan. - x-basic: true - type: string - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X productId: type: string description: ID of the related product. @@ -48305,12 +48944,6 @@ components: - 'null' readOnly: true x-sortable: true - planId: - description: ID of the plan. - x-basic: true - type: string - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X productId: type: string description: ID of the related product. @@ -48556,6 +49189,16 @@ components: description: Customer service email address of the website. type: string format: email + regulatorSiteId: + x-internal: true + description: |- + Website ID assigned by the gaming regulator for this website. + This field is used in regulatory reports and requires the Replay add-on. + type: + - string + - 'null' + minLength: 1 + maxLength: 255 createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -48566,37 +49209,6 @@ components: type: object description: Website settings. properties: - depositForm: - type: object - description: Deposit form settings. - properties: - theme: - description: Theme settings that are used in the deposit form. - type: - - object - - 'null' - properties: - colorPrimary: - description: Primary color for the deposit form in hexadecimal format. - type: - - string - - 'null' - maxLength: 6 - example: 0044d4 - colorSecondary: - description: Secondary color for the deposit form in hexadecimal format. - type: - - string - - 'null' - maxLength: 6 - example: ffffff - buttonTemplate: - description: Submit button template. `{{amount}}` can be used as a placeholder for amount and currency. - type: - - string - - 'null' - maxLength: 100 - example: Pay {{amount}} paymentForm: type: object description: Payment form settings. @@ -48607,7 +49219,11 @@ components: - string - 'null' theme: - description: Hosted payment form [theme options](https://www.rebilly.com/docs/content/concepts-and-features/tutorial/customize-style-rebilly-instruments/#adjust-the-default-style). + description: |- + Hosted payment form [theme options](https://www.rebilly.com/docs/content/concepts-and-features/tutorial/customize-style-rebilly-instruments/#adjust-the-default-style). + + The `pageColorBackground` property sets the background color of the page around the form. + It is read by the hosted payment form page and is not passed to Rebilly Instruments. type: - object - 'null' @@ -48615,6 +49231,7 @@ components: type: string example: colorPrimary: '#504CCA' + pageColorBackground: '#F6F8F9' features: description: Hosted payment form features. type: @@ -48670,13 +49287,34 @@ components: automaticReadinessEnabled: type: boolean default: false - description: Specifies whether pending payout requests are automatically marked as ready after the pending period. + description: |- + Specifies whether pending payout requests are automatically marked as `ready`. + When this value is `false`, payout requests are created in the `ready` status and automatic transition is not used. + When this value is `true`, payout requests remain in the `pending` status until the pending period elapses and the configured transition time is reached. pendingPeriodHours: type: integer - description: Number of hours a payout request stays pending before the automatic readiness job can set it to ready. - minimum: 0 + description: |- + Minimum number of hours a payout request stays in the `pending` status before it can be automatically set to `ready`. + Required when `automaticReadinessEnabled` is `true`. + minimum: 1 maximum: 8760 - default: 48 + example: 48 + automaticReadinessTime: + description: |- + Time of day when the automatic readiness job processes eligible pending payout requests. + Required when `automaticReadinessEnabled` is `true`. + Use extended ISO-8601 time format (`HH:MM:SS`) with an optional timezone offset. + When the timezone offset is omitted, the server timezone is used. + allOf: + - $ref: '#/components/schemas/TimeIso8601Extended' + example: 10:00:00Z + automaticReadinessLastExecutedAt: + type: + - string + - 'null' + format: date-time + readOnly: true + description: Date and time when the automatic readiness job last completed successfully for this website. logoId: type: - string @@ -48790,6 +49428,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -48867,12 +49506,20 @@ components: description: Notes for the customer that are displayed on the order invoice. type: string billingAddress: - description: Billing address of the order. + description: |- + Billing address of the order. + Changes to the billing address apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change the billing address on an issued invoice that has no payment attempts or applied credits, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=billingaddress). oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' deliveryAddress: - description: Delivery address of the order. + description: |- + Delivery address of the order. + Changes to the delivery address apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change the delivery address on an unpaid, past-due, or partially paid invoice, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=deliveryaddress). oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -48943,6 +49590,11 @@ components: readOnly: true $ref: '#/components/schemas/CurrencyCode' shipping: + description: |- + Shipping settings of the order. + Changes to shipping apply to the upcoming invoice and to invoices created after the change. + Issued invoices are not updated unless the order is `pending`. + To change shipping on an unpaid, past-due, or partially paid invoice, use the [upsert an invoice API operation](https://www.rebilly.com/catalog/all/invoices/putinvoice#invoices/putinvoice/t=request&path=shipping). $ref: '#/components/schemas/Shipping' autopay: description: |- @@ -49368,7 +50020,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -49379,9 +50031,9 @@ components: description: |- Date and time when the pause ends and the order resumes billing. - To resume a order from this point in time, + To resume an order from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the order is indefinitely paused. type: - string @@ -49392,15 +50044,15 @@ components: Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal. - Example: A $30 per month subscription on a 30-day month is paused on day 20 of the order. + Example: A $30 per month order on a 30-day month is paused on day 20. There are 10 unused days on the order. Therefore, the order renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. - If the order uses a billing anchor, + If a subscription item in the order uses a service period anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an [Order API operation](https://www.rebilly.com/catalog/all/orders), - and the billing anchor is ignored for that period. + and the service period anchor is ignored for that period. - For more information, see [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/concepts/#service-period-anchor-and-billing-timing-and-invoice-time-shift). + For more information, see [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/subscriptions#service-period-anchor-billing-timing-and-invoice-time-shift). type: - string - 'null' @@ -49411,6 +50063,162 @@ components: $ref: '#/components/schemas/UpdatedTime' _links: $ref: '#/components/schemas/SelfLink' + OrderChange: + type: object + description: |- + Change to the items of a recurring order. + A change with `applyAt` set to `now` replaces the items immediately. + A change with `applyAt` set to `nextRenewal` records the new items and applies them at the next renewal. + The current items remain until the next renewal, when the new items are applied and billed on the renewal invoice. + + This resource records changes made through this resource and changes created by a quote with `applyAt` set to `nextRenewal`. + Changes made through the `POST /orders/{id}/change-items` operation or through a quote with `applyAt` set to `now` are not recorded. + A change with `applyAt` set to `now` triggers the `order-change-created` and `order-change-applied` events and the item events of the order. + required: + - orderId + - items + properties: + id: + description: ID of the order change. + type: string + maxLength: 50 + readOnly: true + example: ord_chg_0YV7DES3WPC5J8JD8QTVNZBZQ8 + orderId: + description: ID of the order. + type: string + maxLength: 50 + example: ord_01HRF27SATGE4Z6PBJE6PD8328 + status: + description: Status of the order change. + type: string + readOnly: true + enum: + - pending + - applied + - canceled + - superseded + x-enumDescriptions: + pending: Scheduled to apply at the next renewal. + applied: Items of the order are replaced. + canceled: Canceled before the change is applied. + superseded: Replaced by a later change for the same order. + applyAt: + description: |- + Time when the new items are applied. + + - `now`: The items change immediately. + `renewalPolicy`, `prorated`, and `effectiveTime` apply. + - `nextRenewal`: The current items stay until the next renewal. + The new items are billed on the next renewal invoice. + `renewalPolicy`, `prorated`, and `effectiveTime` are not allowed. + A later change for the same order supersedes the pending change. + The pending change is locked once the next renewal invoice is issued. + To remove a pending change, use the `DELETE /order-changes/{id}` operation. + The new items must differ from the current items. + One-time sale items that are already on the order remain. + A one-time sale item cannot be added with `nextRenewal`. + type: string + enum: + - now + - nextRenewal + default: now + effectiveTime: + description: |- + Date and time when the change is applied. + If `applyAt` is set to `now`, this value is the date from which the renewal time for `resetToRecurring` and the proration are calculated. + If this field is omitted, this value defaults to the current time. + If `applyAt` is set to `nextRenewal`, this value is read-only and equals the renewal time of the order. + type: string + format: date-time + lockedTime: + description: |- + Date and time when the items of a pending change are billed. + After this time, the change is locked and cannot be modified until the renewal. + type: + - string + - 'null' + format: date-time + readOnly: true + appliedTime: + description: Date and time when the items of the order are replaced. + type: + - string + - 'null' + format: date-time + readOnly: true + quoteId: + description: |- + ID of the quote that is used to create the change. + This value is `null` if the change is not created from a quote. + type: + - string + - 'null' + maxLength: 50 + readOnly: true + items: + description: |- + New items for the order. + To remove an item, include the items array and exclude the items you want to remove. + type: array + minItems: 1 + items: + type: object + required: + - plan + properties: + plan: + description: Plan details. + oneOf: + - $ref: '#/components/schemas/OriginalPlan' + - $ref: '#/components/schemas/FlexiblePlan' + quantity: + description: Number of units of the product on the given plan. + type: integer + usageLimits: + oneOf: + - $ref: '#/components/schemas/UsageLimits' + - type: 'null' + excludeFromMrr: + description: Specifies if this item is excluded from monthly recurring revenue calculations. + type: + - boolean + - 'null' + renewalPolicy: + description: |- + How the service periods and trial state of the order are managed when its items change now. + Required when `applyAt` is `now`. + Not allowed when `applyAt` is `nextRenewal`. + type: string + enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring + - retainTrialOnly + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + retainTrialOnly: |- + Retains the trial and keeps the item as trial-only. + Returns a validation error if the order is not trial-only. + prorated: + description: |- + Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. + Required when `applyAt` is `now`. + Not allowed when `applyAt` is `nextRenewal`. + + If `renewalTime` is retained by setting `renewalPolicy` to `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly`, + a pro rata debit is also applied for the time between `effectiveTime` and `renewalTime`, as a percentage of the normal period size. + type: boolean + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + _links: + $ref: '#/components/schemas/SelfLink' OrderCancellation: type: object required: @@ -49678,16 +50486,41 @@ components: usageLimits: $ref: '#/components/schemas/UsageLimits' renewalPolicy: - description: Specifies if the subscription retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + How the service periods and trial state of the subscription order are managed when its items change. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` and `ignoreRecurring` are ignored unless `reset` or `retain` is used. type: string enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring + - retainTrialOnly - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + retainTrialOnly: |- + Retains the trial and keeps the item as trial-only. + Returns a validation error if the order is not trial-only. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring`, `retainTrialThenRecurring` or `retainTrialOnly`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period size. type: boolean effectiveTime: @@ -49703,19 +50536,27 @@ components: type: boolean default: false keepTrial: + deprecated: true description: |- - Specifies if the subscription order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + Deprecated. + Use the `retainTrialThenRecurring` or `retainTrialOnly` value of `renewalPolicy` instead. + + Specifies if the order must retain its active trial. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false ignoreRecurring: + deprecated: true description: |- - Specifies if the subscription order must ignore the recurring settings of items in the order. - This field is only applicable if the subscription is trial-only and the `keepTrial` value is `true`. - For more information, see [Trial-only subscription](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). + Deprecated. + Use the `retainTrialOnly` value of `renewalPolicy` instead. + + Specifies if the order must ignore the recurring settings of its items. + This field is only applicable if the order is trial-only and the `keepTrial` value is `true`. + For more information, see [Trial-only order](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). type: boolean default: false - OrderChange: + OrderItemsChange: type: object required: - items @@ -49740,27 +50581,52 @@ components: - $ref: '#/components/schemas/OriginalPlan' - $ref: '#/components/schemas/FlexiblePlan' quantity: - description: Number of units of the product on the given plan. + description: Number of units of the product on the specified plan. type: integer usageLimits: $ref: '#/components/schemas/UsageLimits' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + How the service periods and trial state of the order that contains subscription items is managed when its items change. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` and `ignoreRecurring` are ignored unless the value is `reset` or `retain`. type: string enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring + - retainTrialOnly - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + retainTrialOnly: |- + Retains the trial and keeps the item as trial-only. + Returns a validation error if the order is not trial-only. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, - a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period size. + If `renewalTime` is retained by setting `renewalPolicy` to `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly`, + a pro rata debit is also applied for the time between `effectiveTime` and `renewalTime`, as a percentage of the normal period size. type: boolean effectiveTime: description: |- - Date from which the renewal time for `reset` operations and proration calculations are made. - If this field is omitted, this value defaults to the current time. + Date and time that is used to calculate the renewal time for `reset` operations and proration. + If this field is omitted, the date and time default to the current time. type: string format: date-time preview: @@ -49770,13 +50636,21 @@ components: type: boolean default: false keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` or `retainTrialOnly` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false ignoreRecurring: + deprecated: true description: |- + Deprecated. + Use the `retainTrialOnly` value of `renewalPolicy` instead. + Specifies if the order must ignore the recurring settings of its items. This field is only applicable if the order is trial-only and the `keepTrial` value is `true`. For more information, see [Trial-only order](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). @@ -49786,8 +50660,10 @@ components: type: object properties: quantityFilled: - description: Filled quantity of the subscription item (experimental property). - type: number + description: Filled quantity of the subscription item. + type: + - number + - 'null' format: double example: 5.125 excludeFromMrr: @@ -49859,7 +50735,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -49872,7 +50748,7 @@ components: To resume a subscription from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the subscription is indefinitely paused. type: - string @@ -49887,11 +50763,11 @@ components: There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. - If the subscription uses a billing anchor, - the renewal time after a pause shift behaves as though the renewal time is moved forward by an [Order API operation](https://www.rebilly.com/catalog/all/orders), - and the billing anchor is ignored for that period. + If the subscription uses a service period anchor, + the renewal time after a pause shift behaves as though the renewal time is moved forward by an [Order API operation](https://www.rebilly.com/catalog/all/orders-(legacy)), + and the service period anchor is ignored for that period. - For more information, see [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/concepts/#service-period-anchor-and-billing-timing-and-invoice-time-shift). + For more information, see [Service period anchor, billing timing, and invoice time shift](https://www.rebilly.com/docs/dev-docs/subscriptions#service-period-anchor-billing-timing-and-invoice-time-shift). type: - string - 'null' @@ -49975,7 +50851,7 @@ components: - completed - revoked x-enumDescriptions: - draft: Creates a daft cancellation so that the cancellation and charge can be previewed. + draft: Creates a draft cancellation so that the cancellation and charge can be previewed. confirmed: |- Confirms a subscription cancellation. Sets the subscription to cancel when the `churnTime` is reached. @@ -50433,6 +51309,9 @@ components: - order-custom-fields-changed - order-delivery-address-changed - order-downgraded + - order-change-applied + - order-change-canceled + - order-change-created - order-items-changed - order-paid-early - order-quantity-changed @@ -51056,46 +51935,28 @@ components: readOnly: true _links: $ref: '#/components/schemas/SelfLink' - KhelocardCardToken: + AlternativePaymentToken: type: object - title: Khelocard card token + title: Alternative payment token required: - method - billingAddress - - paymentInstrument properties: method: description: Payment method of the token. type: string - enum: - - Khelocard - paymentInstrument: - description: Token instrument details. - type: object - required: - - number - - cvv - - expYear - - expMonth - properties: - number: - description: Khelocard card number. - type: string - writeOnly: true - cvv: - description: Khelocard Card Verification Value (CVV). - type: string - writeOnly: true - last4: - description: Last 4 digits of the Khelocard card number. - type: string - readOnly: true - expMonth: - description: Khelocard card expiration month. - type: integer - expYear: - description: Khelocard card expiration year. - type: integer + allOf: + - $ref: '#/components/schemas/AlternativePaymentMethods' + - not: + enum: + - payment-card + - paypal + - ach + - echeck + - digital-wallet + - plaid-account + - Klarna + - cryptocurrency billingAddress: description: Billing address object. $ref: '#/components/schemas/ContactObject' @@ -51203,69 +52064,6 @@ components: readOnly: true _links: $ref: '#/components/schemas/SelfLink' - AlternativePaymentToken: - type: object - title: Alternative payment token - required: - - method - - billingAddress - properties: - method: - description: Payment method of the token. - type: string - allOf: - - $ref: '#/components/schemas/AlternativePaymentMethods' - - not: - enum: - - payment-card - - paypal - - ach - - echeck - - digital-wallet - - plaid-account - - Khelocard - - Klarna - - cryptocurrency - billingAddress: - description: Billing address object. - $ref: '#/components/schemas/ContactObject' - id: - description: ID of the token. - readOnly: true - $ref: '#/components/schemas/ResourceId' - isUsed: - description: Specifies if the token is already used. - type: boolean - default: false - readOnly: true - riskMetadata: - oneOf: - - $ref: '#/components/schemas/RiskMetadata' - - type: 'null' - leadSource: - allOf: - - $ref: '#/components/schemas/LeadSource' - writeOnly: true - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - usageTime: - description: Date and time when the token is used. - type: - - string - - 'null' - format: date-time - readOnly: true - expirationTime: - description: Date and time when the token expired. - type: - - string - - 'null' - format: date-time - readOnly: true - _links: - $ref: '#/components/schemas/SelfLink' CryptocurrencyToken: type: object title: Cryptocurrency token @@ -51354,7 +52152,7 @@ components: echeck: '#/components/schemas/BankAccountToken' digital-wallet: '#/components/schemas/DigitalWalletToken' plaid-account: '#/components/schemas/PlaidAccountToken' - Khelocard: '#/components/schemas/KhelocardCardToken' + Khelocard: '#/components/schemas/AlternativePaymentToken' Klarna: '#/components/schemas/KlarnaToken' cash: '#/components/schemas/AlternativePaymentToken' check: '#/components/schemas/AlternativePaymentToken' @@ -51494,13 +52292,12 @@ components: Yandex-money: '#/components/schemas/AlternativePaymentToken' Zotapay: '#/components/schemas/AlternativePaymentToken' Zimpler: '#/components/schemas/AlternativePaymentToken' - anyOf: + oneOf: - $ref: '#/components/schemas/PaymentCardToken' - $ref: '#/components/schemas/PayPalToken' - $ref: '#/components/schemas/BankAccountToken' - $ref: '#/components/schemas/DigitalWalletToken' - $ref: '#/components/schemas/PlaidAccountToken' - - $ref: '#/components/schemas/KhelocardCardToken' - $ref: '#/components/schemas/KlarnaToken' - $ref: '#/components/schemas/AlternativePaymentToken' - $ref: '#/components/schemas/CryptocurrencyToken' @@ -51540,7 +52337,7 @@ components: description: |- Domain where the client code, such as [FramePay](https://docs.rebilly.com/docs/developer-docs/framepay/), is executed. The domain name must be registered in the Apple Pay console. - For more information, see [Register a domain for Apple Pay](./PostDigitalWalletOnboardingApplePay). + For more information, see [Register a domain for Apple Pay](https://www.rebilly.com/catalog/all/gateway-accounts/postdigitalwalletonboardingapplepay). example: www.example.com displayName: type: string @@ -51737,6 +52534,7 @@ components: - transaction-disputed - transaction-initiated - transaction-payment-method-changed + - transaction-partially-refunded - transaction-process-requested - transaction-processed - transaction-queried @@ -52871,6 +53669,97 @@ components: enum: - draft - archived + CoinPricingFlatRate: + title: Flat rate + description: |- + Flat-rate coin pricing that multiplies the full paid amount in minor units by `coinsPerFiatMinor`. + For example, if `coinsPerFiatMinor` is `10`, + a `$10.00` deposit credits `10,000` coins and a `$10.01` deposit credits `10,010` coins. + type: object + additionalProperties: false + required: + - formula + - coinsPerFiatMinor + properties: + formula: + type: string + description: Flat-rate formula for converting the paid fiat amount into coins. + enum: + - flat-rate + coinsPerFiatMinor: + type: integer + minimum: 1 + maximum: 1000000 + example: 10 + description: |- + Number of coins credited for each minor unit of the paid currency. + For example, a value of `10` means 10 coins for each US cent. + CoinPricingVolumeBracket: + title: Volume bracket + description: Amount range and coin rate for volume pricing. + type: object + additionalProperties: false + required: + - coinsPerFiatMinor + properties: + coinsPerFiatMinor: + type: integer + minimum: 1 + maximum: 1000000 + example: 10 + description: |- + Number of coins credited for each minor unit of the paid currency when the paid amount falls in this range. + For example, a value of `10` means 10 coins for each US cent. + maxAmount: + type: + - number + - 'null' + format: double + minimum: 0 + maximum: 9999999 + example: 50 + description: |- + Highest paid amount in this range, in major units of the currency for the deposit request. + This value is inclusive and must be exact at that currency scale for the deposit amount strategy. + A `null` value means this range has no upper limit. + CoinPricingVolume: + title: Volume + description: |- + Volume-based coin pricing that multiplies the full paid amount in minor units by `coinsPerFiatMinor` from the matching bracket. + For example, if `coinsPerFiatMinor` is `10` for amounts up to `$10.00` and `12` for amounts from `$10.01` through `$50.00`, + a `$10.00` deposit credits `10,000` coins and a `$10.01` deposit credits `12,012` coins. + type: object + additionalProperties: false + required: + - formula + - brackets + properties: + formula: + type: string + description: Volume-based formula for converting the paid fiat amount into coins. + enum: + - volume + brackets: + type: array + minItems: 1 + description: |- + Amount ranges that define the coin rate for a paid amount. + The first range matches amounts less than or equal to `maxAmount`. + Each subsequent range matches amounts greater than the previous `maxAmount` and less than or equal to the current `maxAmount`. + A final range with a `null` `maxAmount` has no upper limit. + items: + $ref: '#/components/schemas/CoinPricingVolumeBracket' + CoinPricing: + description: Formula for calculating the number of coins to credit to the coin balance based on a paid amount in fiat currency. + type: object + discriminator: + propertyName: formula + mapping: + flat-rate: '#/components/schemas/CoinPricingFlatRate' + volume: '#/components/schemas/CoinPricingVolume' + oneOf: + - $ref: '#/components/schemas/CoinPricingFlatRate' + - $ref: '#/components/schemas/CoinPricingVolume' DepositRequest: type: object required: @@ -52918,6 +53807,14 @@ components: attempted: A funds deposit transaction was attempted and declined. This is a temporary state. completed: A funds deposit transaction has been approved and completed. This is a permanent state. expired: Request expired without an approved deposit transaction. This is a permanent state. + coinPricing: + readOnly: true + description: |- + Formula copied from the deposit amount strategy when the deposit request is created. + A `null` value means the deposit credits the cash balance instead of the coin balance. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' currency: $ref: '#/components/schemas/CurrencyCode' amounts: @@ -52926,7 +53823,7 @@ components: List of available deposit amounts. If `amounts` is not specified when a deposit is created, amounts are determined from the chosen deposit amount strategy. - For more information, see the [`strategyId` property](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=request&path=strategyid). + For more information, see the `strategyId` property. items: type: number format: double @@ -52948,7 +53845,7 @@ components: Custom amount restrictions. If this value is `null`, custom amounts are prohibited. If `customAmount` is not specified when a deposit request is created, amount restrictions are determined from the chosen strategy. - For more information, see the [`strategyId` property](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=request&path=strategyid). + For more information, see the `strategyId` property. required: - minimum - multipleOf @@ -53002,38 +53899,6 @@ components: The default expiration time is one hour from the time the request is created. type: string format: date-time - propertiesSchema: - readOnly: true - description: |- - Defines properties the user can complete when they use the hosted deposit form. - This field accepts [JSON-schema](https://json-schema.org/) drafts 4, 6, and 7. - type: - - object - - 'null' - example: - type: object - properties: - email: - type: string - max: - type: integer - minimum: 0 - exclusiveMaximum: 100 - required: - - email - properties: - readOnly: true - description: |- - Properties that are available for the user to complete when they use the hosted deposit form. - Use this object to describe fields that are rendered and completed on the hosted deposit form. - type: - - object - - 'null' - additionalProperties: - type: string - example: - email: email@example.com - max: '33' notificationUrl: description: |- URL where a server-to-server POST notification is sent. @@ -53083,11 +53948,9 @@ components: type: string enum: - self - - deposit - transactions x-enumDescriptions: self: Link to the deposit request. - deposit: Link to the hosted deposit form. transactions: Link to the deposit request transactions collection. _embedded: type: object @@ -53126,13 +53989,13 @@ components: calculator: absolute baseAmount: 10 increments: [10, 20] - adjustBaseToLastDeposit: true + adjustBaseToLastDeposit: false customAmount: minimum: 1 multipleOf: 1 maximum: 10000 ``` - For more information, see [Create a deposit amount strategy](https://www.rebilly.com/catalog/all/deposits/postdepositstrategy). + For more information, see the Create a deposit amount strategy operation. type: - string - 'null' @@ -53148,7 +54011,7 @@ components: List of available deposit amounts. If `amounts` is not specified when a deposit request is created, amounts are determined from the chosen deposit amount strategy. - For more information, see the [`strategyId` property](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=request&path=strategyid). + For more information, see the `strategyId` property. items: type: number format: double @@ -53185,7 +54048,7 @@ components: Custom amount restrictions. If this value is `null`, custom amounts are prohibited. If `customAmount` is not specified when a deposit request is created, amount restrictions are determined from the chosen deposit amount strategy. - For more information, see the [`strategyId` property](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=request&path=strategyid). + For more information, see the `strategyId` property. required: - minimum - multipleOf @@ -53230,13 +54093,6 @@ components: - string - 'null' format: date-time - customPropertySetId: - description: ID of a custom property set to apply to the request `propertiesSchema`. - type: - - string - - 'null' - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 notificationUrl: description: |- URL where a server-to-server `POST` notification is sent. @@ -53276,18 +54132,6 @@ components: - 'null' maxLength: 2083 format: uri - balance: - description: Current cash balance of the customer. - type: number - format: double - minimum: 0 - example: 1500 - bonusBalance: - description: Bonus balance available to the customer. - type: number - format: double - minimum: 0 - example: 0 depositLimits: type: object writeOnly: true @@ -53323,14 +54167,6 @@ components: - 'null' maxLength: 2083 format: uri - pendingPayoutTotal: - type: number - format: double - minimum: 0 - description: |- - Sum of all payout requests that are currently in a pending state. - This value is also the maximum possible "reverse withdrawal" amount. - example: 100 Cashier: type: object required: @@ -53343,6 +54179,7 @@ components: - balance - bonusBalance - pendingPayoutTotal + - canWithdraw - notificationUrl properties: id: @@ -53371,12 +54208,14 @@ components: format: double minimum: 0 description: Customer's current balance. + readOnly: true example: 1500 bonusBalance: type: number format: double minimum: 0 description: Bonus balance available to the customer. + readOnly: true example: 0 notificationUrl: description: |- @@ -53410,7 +54249,12 @@ components: description: |- Sum of all payout requests that are currently in a pending state. This value is also the maximum possible "reverse withdrawal" amount. + readOnly: true example: 100 + canWithdraw: + type: boolean + readOnly: true + description: Specifies if the customer can initiate a withdrawal. lastDepositRequestId: type: string description: ID of the last deposit request that is made for this cashier. @@ -53486,7 +54330,7 @@ components: description: |- List of incremental amounts that are displayed to customer. - For more information, see the [`calculator` property](https://www.rebilly.com/catalog/all/deposits/postdepositstrategy#deposits/postdepositstrategy/t=request&path=amounts/calculator). + For more information, see the `calculator` property. items: type: number format: double @@ -53507,7 +54351,7 @@ components: default: false description: |- Specifies if the base amount must be adjusted based on the last deposit. - If this value is `true`, the `baseAmount` is changed to the last successful deposit amount made using [Create a deposit request](https://www.rebilly.com/catalog/all/deposits/postdepositrequest). + If this value is `true`, the `baseAmount` is changed to the last successful deposit amount made using the Create a deposit request operation. If the customer has no successful deposits, `baseAmount` is not adjusted. hideBaseAmount: @@ -53534,7 +54378,7 @@ components: Custom amount restrictions. If this value is `null`, custom amounts are prohibited. If `customAmount` is not specified when a deposit request is created, amount restrictions are determined from the chosen deposit amount strategy. - For more information, see the [`strategyId` property](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=request&path=strategyid). + For more information, see the `strategyId` property. required: - minimum - multipleOf @@ -53587,45 +54431,19 @@ components: type: boolean description: Specifies if the deposit amount strategy is active. default: true - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - _links: - $ref: '#/components/schemas/SelfLink' - DepositCustomPropertySet: - type: object - required: - - name - - properties - properties: - id: - type: string - description: ID of the deposit property set. - readOnly: true - maxLength: 50 - example: dep_prop_0YVJ640MB4CXVB8KXBRW3B79R9 - name: - type: string - description: Name of the custom property set. - properties: + coinPricing: description: |- - Defines properties the user can complete when they use the hosted deposit form. - This field accepts [JSON-schema](https://json-schema.org/) drafts 4, 6, and 7. - Accepted properties types are: `string`, `number`, `integer`, `array`, and `enum`. - For more information, see [Configure custom hosted deposit properties](https://www.rebilly.com/docs/dev-docs/configure-custom-hosted-deposit-properties/). - type: object + Formula that converts the paid fiat amount into coins credited to the coin balance. + A `null` value means deposits created from this strategy credit the cash balance. + Setting a `coinPricing` object requires the Replay add-on. + For `volume`, every configured deposit amount must match a bracket, + and the last bracket has a `null` `maxAmount` when `customAmount` has a value or `adjustBaseToLastDeposit` is `true`. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' example: - type: object - properties: - email: - type: string - max: - type: integer - minimum: 0 - exclusiveMaximum: 100 - required: - - email + formula: flat-rate + coinsPerFiatMinor: 10 createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -54818,10 +55636,198 @@ components: - $ref: '#/components/schemas/TaxJarCredential' - $ref: '#/components/schemas/AvalaraCredential' - $ref: '#/components/schemas/PlaidCredential' + PostSmtpCredential: + allOf: + - $ref: '#/components/schemas/SmtpCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - smtp + readOnly: false + PostWebhookCredential: + allOf: + - $ref: '#/components/schemas/WebhookCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - webhook + readOnly: false + PostExperianCredential: + allOf: + - $ref: '#/components/schemas/ExperianCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - experian + readOnly: false + PostMailgunCredential: + allOf: + - $ref: '#/components/schemas/MailgunCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - mailgun + readOnly: false + PostOAuth2Credential: + allOf: + - $ref: '#/components/schemas/OAuth2Credential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - oauth2 + readOnly: false + PostPostmarkCredential: + allOf: + - $ref: '#/components/schemas/PostmarkCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - postmark + readOnly: false + PostSendGridCredential: + allOf: + - $ref: '#/components/schemas/SendGridCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - sendgrid + readOnly: false + PostAwsSesCredential: + allOf: + - $ref: '#/components/schemas/SESCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - aws-ses + readOnly: false + PostTaxJarCredential: + allOf: + - $ref: '#/components/schemas/TaxJarCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - taxjar + readOnly: false + PostAvalaraCredential: + allOf: + - $ref: '#/components/schemas/AvalaraCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - avalara + readOnly: false + PostPlaidCredential: + allOf: + - $ref: '#/components/schemas/PlaidCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - plaid + readOnly: false PatchServiceCredential: type: object required: - status + - type properties: status: description: Status of the credential. @@ -54834,9 +55840,28 @@ components: active: Credential is active and can be used. inactive: Credential is temporarily inactivated and cannot be used until reactivated. deactivated: Credential is permanently deactivated and cannot be reactivated. + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - smtp + - webhook + - mailgun + - sendgrid + - aws-ses + - oauth2 + - postmark + - experian + - avalara PatchPlaidCredential: type: object description: Plaid credential. + required: + - type properties: status: description: Status of the credential. @@ -54872,11 +55897,21 @@ components: This setting enables the creation of Stripe bank account tokens. default: false example: true + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - plaid PatchTaxJarCredential: type: object description: TaxJar credential. required: - status + - type properties: status: description: Status of the credential. @@ -54895,6 +55930,15 @@ components: Specifies if `from_` address fields must be omitted in TaxJar request. For more information, see [TaxJar API guide](https://developers.taxjar.com/api/guides/#when-to-use-from_-address-information). example: false + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - taxjar GoogleSpreadsheet: type: object properties: @@ -55169,6 +56213,10 @@ components: - invoice-partially-refunded - invoice-past-due - invoice-past-due-reminder + - invoice-past-due-reminder-15-days + - invoice-past-due-reminder-30-days + - invoice-past-due-reminder-60-days + - invoice-past-due-reminder-90-days - invoice-refunded - invoice-revenue-recognized - invoice-tax-calculation-failed @@ -55180,8 +56228,14 @@ components: - order-abandon-reminder - order-abandoned - order-completed + - order-change-applied + - order-change-canceled + - order-change-created - payment-card-created - payment-card-expiration-reminder + - payment-card-expiration-reminder-1-day + - payment-card-expiration-reminder-14-days + - payment-card-expiration-reminder-7-days - payment-card-expired - payment-instrument-modified - payout-request-created @@ -55215,6 +56269,9 @@ components: - subscription-quantity-filled-limit-reached - subscription-reactivated - subscription-renewal-reminder + - subscription-renewal-reminder-1-day + - subscription-renewal-reminder-30-days + - subscription-renewal-reminder-7-days - subscription-renewed - subscription-resumed - subscription-trial-converted @@ -55799,7 +56856,7 @@ components: Yandex-money: '#/components/schemas/AdjustReadyToPayoutGeneric' Zotapay: '#/components/schemas/AdjustReadyToPayoutGeneric' Zimpler: '#/components/schemas/AdjustReadyToPayoutGeneric' - anyOf: + oneOf: - $ref: '#/components/schemas/AdjustReadyToPayoutGeneric' RuleActionAdjustReadyToPayout: allOf: @@ -56350,6 +57407,7 @@ components: allOf: - $ref: '#/components/schemas/RuleAction' - type: object + deprecated: true properties: role: type: string @@ -57036,6 +58094,7 @@ components: ICEPAY: '#/components/schemas/ICEPAY' INOVAPAY: '#/components/schemas/INOVAPAY' Ilixium: '#/components/schemas/Ilixium' + IMerchant: '#/components/schemas/IMerchant' Ingenico: '#/components/schemas/Ingenico' Inovio: '#/components/schemas/Inovio' InstaDebit: '#/components/schemas/InstaDebit' @@ -57099,6 +58158,7 @@ components: PayPal: '#/components/schemas/PayPal' Payeezy: '#/components/schemas/Payeezy' Payflow: '#/components/schemas/Payflow' + PayGlocal: '#/components/schemas/PayGlocal' PaymentAsia: '#/components/schemas/PaymentAsia' PaymenTechnologies: '#/components/schemas/PaymenTechnologies' PaymentsOS: '#/components/schemas/PaymentsOS' @@ -57149,6 +58209,7 @@ components: Tabby: '#/components/schemas/Tabby' Telr: '#/components/schemas/Telr' TestProcessor: '#/components/schemas/TestProcessor' + Thunes: '#/components/schemas/Thunes' ToditoCash: '#/components/schemas/ToditoCash' Triple000: '#/components/schemas/Triple000' Truevo: '#/components/schemas/Truevo' @@ -57359,7 +58420,7 @@ components: readyToPayoutInstruction: type: string default: none - description: Defines the mode of gateway payout behaviour for the [Ready to payout](https://www.rebilly.com/catalog/all/storefront-purchases/storefrontpostreadytopayout) operation. + description: Defines the mode of gateway payout behaviour for the Ready to payout operation. enum: - all - covered-payout @@ -57371,10 +58432,19 @@ components: Payout from this gateway if it previously processed a payment for the same, or a greater, amount. approved-payment: |- - Payout any amount from this gateway if it processed an earlier payment. - The customer must have a previously approved transaction, - in the same currency, on this gateway. + Payout any amount from this gateway if the customer has a previously + approved transaction, in the same currency, on this gateway. none: Do not allow any payouts with this gateway. This is the default value, merchants must opt into payouts. + payoutLimits: + description: |- + Payout limits for the gateway account applied during payout request auto-allocation. + These limits do not apply to manual allocations. + + This field is distinct from deposit and sale + [volume limits](https://www.rebilly.com/catalog/all/gateway-accounts/getgatewayaccountlimitcollection/). + oneOf: + - $ref: '#/components/schemas/GatewayAccountPayoutLimits' + - type: 'null' transactionEmailAliasTemplate: description: |- Email address template used in place of a customer's real email address when sending transaction data to a processor. @@ -57680,6 +58750,12 @@ components: levelTwoThreeDataCustomField: type: string description: Name of the transaction custom field that holds the Level 2/3 data. + mastercardDpaId: + type: string + description: ID of the Digital Payment Application (DPA) for Mastercard Secure Card on File (SCOF). + mastercardServiceId: + type: string + description: ID of the Mastercard Secure Card on File (SCOF) service. required: - url threeDSecureServer: @@ -58159,9 +59235,6 @@ components: useRestApi: type: boolean description: Specifies whether to use REST API. - paymentCode: - type: string - description: Awepay payment code. methodType: type: string description: Awepay method type. @@ -60410,6 +61483,27 @@ components: type: string enum: - Ilixium3dsServer + IMerchant: + description: IMerchant gateway configuration. + allOf: + - $ref: '#/components/schemas/GatewayAccount' + - type: object + required: + - credentials + properties: + credentials: + type: object + description: Credentials of the IMerchant gateway. + properties: + apiKey: + type: string + description: IMerchant API key. + format: password + writeOnly: true + required: + - apiKey + threeDSecureServer: + $ref: '#/components/schemas/ThreeDSecureIO3dsServer' Ingenico: description: Ingenico gateway configuration. allOf: @@ -62156,6 +63250,11 @@ components: description: Paybilt API key. format: password writeOnly: true + hmacKey: + type: string + description: Paybilt HMAC key used to verify webhook signatures. + format: password + writeOnly: true required: - tokenId - tokenApiKey @@ -62446,6 +63545,43 @@ components: - user - vendor - password + PayGlocal: + description: PayGlocal gateway configuration. + allOf: + - $ref: '#/components/schemas/GatewayAccount' + - type: object + required: + - credentials + properties: + credentials: + type: object + description: PayGlocal credentials object. + properties: + merchantId: + type: string + description: ID of the PayGlocal merchant (MID). + privateKeyId: + type: string + description: Key ID of the merchant RSA private key used to sign payment API requests. + publicKeyId: + type: string + description: Key ID of the PayGlocal RSA public key used to encrypt payment API request payloads. + publicKey: + type: string + description: PayGlocal RSA public key used to encrypt payment API request payloads and verify merchant callback token signatures. + x-multiline: true + privateKey: + type: string + description: Merchant RSA private key used to sign payment API requests. + format: password + x-multiline: true + writeOnly: true + required: + - merchantId + - privateKeyId + - publicKeyId + - publicKey + - privateKey PaymentAsia: description: PaymentAsia gateway configuration. allOf: @@ -63271,8 +64407,14 @@ components: description: Quickpay API key. format: password writeOnly: true + privateKey: + type: string + description: Private key of the Quickpay account that signs callback checksums. + format: password + writeOnly: true required: - apiKey + - privateKey threeDSecureServer: $ref: '#/components/schemas/ThreeDSecureIO3dsServer' Rapyd: @@ -64113,6 +65255,52 @@ components: properties: threeDSecureServer: $ref: '#/components/schemas/ThreeDSecureIO3dsServer' + Thunes: + description: Thunes gateway configuration. + allOf: + - $ref: '#/components/schemas/GatewayAccount' + - type: object + required: + - credentials + - settings + properties: + credentials: + type: object + description: Thunes credentials object. + properties: + apiKey: + type: string + description: Thunes API key used for HTTP basic authentication. + format: password + writeOnly: true + apiSecret: + type: string + description: Thunes API secret used for HTTP basic authentication. + format: password + writeOnly: true + merchantId: + type: string + description: Thunes merchant identifier. + paymentPageId: + type: string + description: Thunes payment page identifier for hosted checkout. + required: + - apiKey + - apiSecret + - merchantId + - paymentPageId + settings: + type: object + description: Thunes settings object. + required: + - transactionType + properties: + transactionType: + type: string + description: Payer type for the Thunes payment order. + enum: + - C2B + - B2B ToditoCash: description: ToditoCash gateway configuration. allOf: @@ -64392,6 +65580,8 @@ components: - terminalId - password - ipnSecret + threeDSecureServer: + $ref: '#/components/schemas/ThreeDSecureIO3dsServer' UPayCard: description: UPayCard gateway configuration. allOf: @@ -64567,11 +65757,15 @@ components: description: API key for Viva basic authentication. format: password writeOnly: true + ipnKey: + type: string + description: Key of the Viva IPN validation. required: - clientId - clientSecret - merchantId - apiKey + - ipnKey settings: type: object description: Viva settings object. @@ -64731,17 +65925,13 @@ components: description: Merchant payment gateway ID from Mastercard. clientCertificate: type: string - description: |- - Client certificate for mutual TLS (mTLS) authentication. - This value is required if `useMtls` is set to `true`. + description: Client certificate for mutual TLS (mTLS) authentication. format: password writeOnly: true x-multiline: true privateKey: type: string - description: |- - Client private key for mutual TLS (mTLS) authentication. - This value is required if `useMtls` is set to `true`. + description: Client private key for mutual TLS (mTLS) authentication. format: password x-multiline: true writeOnly: true @@ -64749,6 +65939,8 @@ components: - cardAcceptorIdCode - acquiringInstitutionIdentificationCode - mpgId + - clientCertificate + - privateKey settings: type: object description: WorldlineAtosFrankfurt settings. @@ -64765,10 +65957,6 @@ components: terminalIds: type: string description: Comma-separated list of terminal IDs. - useMtls: - type: boolean - default: false - description: Indicates whether to use mutual TLS (mTLS) for the connection. required: - cardAcceptorName - cardAcceptorLocation @@ -65203,7 +66391,7 @@ components: - 'null' example: Test merchant country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' googlePay: type: object description: |- @@ -65231,7 +66419,122 @@ components: - 'null' example: www.example.com country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' + GatewayAccountPayoutLimits: + description: |- + Payout method limits for payout request auto-allocation. + Limits apply to auto-allocation only. + Manual allocations are uncapped. + + Validation is per currency. + When multiple limit types contain + an entry for the same currency, the following requirements apply: + - `minPerTransaction.amount < maxPerTransaction.amount`. + - `minPerTransaction.amount <= maxPerPeriod.amount`. + type: object + minProperties: 1 + properties: + maxPerTransaction: + description: |- + Maximum amount limit for single allocation. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 3000 + currency: + $ref: '#/components/schemas/CurrencyCode' + example: + - amount: 3000 + currency: CAD + minPerTransaction: + description: |- + Minimum amount limit for single allocation. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 100 + currency: + $ref: '#/components/schemas/CurrencyCode' + example: + - amount: 100 + currency: CAD + maxPerPeriod: + description: |- + Maximum amount limit for a rolling period. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + - period + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 10000 + currency: + $ref: '#/components/schemas/CurrencyCode' + period: + description: Rolling period for the amount limit. + type: string + enum: + - 24-hours + x-enumDescriptions: + 24-hours: Rolling 24-hour period. + example: + - amount: 10000 + currency: CAD + period: 24-hours + example: + maxPerTransaction: + - amount: 3000 + currency: CAD + minPerTransaction: + - amount: 100 + currency: CAD + maxPerPeriod: + - amount: 10000 + currency: CAD + period: 24-hours ValidationErrorExtensions: type: object properties: @@ -65289,6 +66592,7 @@ components: - scheduled-maintenance - daily-limit-reached - monthly-limit-reached + - gateway-unreachable startTime: description: Date and time when the gateway account scheduled downtime starts. type: string @@ -65392,6 +66696,7 @@ components: - gateway-account-limit-reset - gateway-account-onboarding-completed - gateway-account-onboarding-failed + - gateway-account-carding-circuit-opened triggeredBy: description: Specifies who, or what, triggered the timeline event. type: string @@ -65442,6 +66747,18 @@ components: period: description: Instruction for calculating the reserve release time. $ref: '#/components/schemas/SchedulingMethodDateInterval' + DigitalWalletOnboardingApplePayDomains: + type: object + description: Apple Pay domains of the organization. + required: + - domains + properties: + domains: + description: Domains that Apple Pay has registered for the organization, sorted alphabetically. + type: array + readOnly: true + items: + type: string DigitalWalletOnboardingApplePay: type: object description: Register a domain with Apple Pay and associate it with Rebilly. @@ -65675,81 +66992,6 @@ components: $ref: '#/components/schemas/UpdatedTime' _links: $ref: '#/components/schemas/SelfLink' - Membership: - type: object - required: - - organization - - user - properties: - organization: - description: Organization membership. - readOnly: true - type: object - properties: - id: - description: ID of the organization. - type: string - $ref: '#/components/schemas/ResourceId' - name: - description: Name of the organization. - type: string - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - user: - description: Membership user. - readOnly: true - type: object - properties: - id: - type: string - description: ID of the user. - maxLength: 50 - example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 - name: - description: First and last name of the user. - type: string - email: - description: Email address of the user. - type: string - format: email - maxLength: 100 - allowedIps: - $ref: '#/components/schemas/AllowedIps' - permissions: - description: |- - Permissions that the user has within the organization. - Use the wildcard character `*` for full access. - $ref: '#/components/schemas/AclPermissions' - isOwner: - description: Specifies if the user is the owner of the organization. - type: boolean - isDefault: - description: Specifies if the organization is the default organization for the user. - type: boolean - readOnly: true - roleIds: - type: array - description: |- - Role IDs associated with the user. - Role IDs specify the roles that the user performs within the organization. - For example, the user may be an organization admin. - items: - type: string - acl: - readOnly: true - allOf: - - $ref: '#/components/schemas/Acl' - _links: - $ref: '#/components/schemas/SelfLink' - _embedded: - type: object - description: Embedded objects that are requested by the `expand` query parameter. - readOnly: true - properties: - roles: - type: array Organization: type: object required: @@ -65831,6 +67073,19 @@ components: - string - 'null' maxLength: 255 + regulatorOperatorId: + x-internal: true + description: |- + Operator ID assigned by the gaming regulator. + This field is used in regulatory reports and requires the Replay add-on. + When you create an organization, this value must be null. + To set the operator ID after Replay is active, + use the [Update an organization](https://www.rebilly.com/catalog/all/organizations/patchorganization) operation. + type: + - string + - 'null' + minLength: 1 + maxLength: 255 invoiceTimeZone: description: |- Specifies the time zone to display on an invoice. @@ -65842,9 +67097,7 @@ components: description: |- Currency to use for conversion in reports. This value cannot be changed. - type: string - pattern: ^[A-Z]{3}$ - example: USD + $ref: '#/components/schemas/CurrencyCode' questionnaire: type: - object @@ -66003,6 +67256,28 @@ components: type: string format: email default: [] + annualComplianceScreening: + description: |- + Settings for annual compliance screening of all active customers. + When enabled, a compliance screening report is generated for every active customer + on the configured month and day each year. + type: object + properties: + enabled: + description: Specifies whether annual compliance screening is enabled for the organization. + type: boolean + default: false + monthDay: + description: |- + Month and day when annual compliance screening runs, in `MM-DD` format. + Required when `enabled` is `true`. + Valid calendar date only. Leap day `02-29` is not allowed. + type: + - string + - 'null' + pattern: ^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$ + example: 02-15 + default: null payoutRequestAllocationOrder: description: |- Default order for auto-allocation of payout requests. @@ -66493,6 +67768,17 @@ components: - insufficient-documentation - risk-review - other + PayoutRequestSplitReason: + type: string + description: Reason for splitting the payout request. + enum: + - payment-instrument-limit + - processor-limit + - risk-review + - compliance-review + - partial-processing + - operational-reconciliation + - other PayoutRequestAllocation: type: object required: @@ -66521,7 +67807,7 @@ components: - string - 'null' maxLength: 50 - example: preq_batch_0YVDMDE2BMC6KBB5MX76RF6T80 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 paymentInstrumentId: type: string description: ID of the payment instrument allocated to the payout request. @@ -66560,9 +67846,8 @@ components: Payout from this gateway if it previously processed a payment for the same, or a greater, amount. approved-payment: |- - Payout any amount from this gateway if it processed an earlier payment. - The customer must have a previously approved transaction, - in the same currency, on this gateway. + Payout any amount from this gateway if the customer has a previously + approved transaction, in the same currency, on this gateway. none: Do not allow any payouts with this gateway. example: covered-payout amount: @@ -66570,6 +67855,19 @@ components: type: number format: double x-type: Money + exposureAmount: + description: |- + Approved sales and captures minus approved payouts for the customer, + gateway account, and payment instrument, in the allocation currency. + The calculation includes only transactions created within the last 180 days. + The value is `0` when there are no transactions in the last 180 days, + the gateway account is inactive, + or its `readyToPayoutInstruction` is `none`. + readOnly: true + type: number + format: double + x-type: Money + example: 2 currency: description: Currency of the payout request allocation. $ref: '#/components/schemas/CurrencyCode' @@ -66760,16 +68058,26 @@ components: - split - merged x-enumDescriptions: - pending: Request was created by the customer. - ready: Request was assessed, deemed eligible for processing and is ready for approval. - approved: Request was approved and is ready for processing. + pending: |- + Request was created by the customer and is in a pending state for the [configured pending period](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/pendingperiodhours), unless it is marked as ready by a member of your organization. + When automatic readiness is enabled, the payout request transitions to the `ready` state after the pending period elapses and the configured [transition time](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinesstime) is reached. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests, or this status may not be used. + ready: |- + Request was created by the customer and is ready for review. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests. + approved: Request was reviewed, approved, and is ready for processing. in-progress: Request has allocations and is being processed. fulfilled: Request is fully paid out. canceled: Request is canceled by merchant or customer. split: Request was split into two or more payout requests. merged: Request was merged into another payout request. blocked: - description: Specifies whether the payout request is blocked or unblocked. + description: |- + Specifies whether the payout request is blocked or unblocked. + + When blocked, the payout request cannot transition to `ready`, `approved`, `in-progress`, `merged`, `split`, or `canceled`. + Allocation creation, allocation processing, and cancellation of pending allocations are also prevented. + A blocked payout request can still transition to the `fulfilled` status if allocation processing starts before the payout request is blocked. type: boolean readOnly: false example: false @@ -66777,6 +68085,10 @@ components: oneOf: - $ref: '#/components/schemas/PayoutRequestBlockReason' - type: 'null' + splitReason: + oneOf: + - $ref: '#/components/schemas/PayoutRequestSplitReason' + - type: 'null' batchId: description: ID of the payout request batch that contains this request. type: @@ -66784,7 +68096,7 @@ components: - 'null' readOnly: true maxLength: 50 - example: preq_batch_0YVDMDE2BMC6KBB5MX76RF6T80 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 selectPaymentInstrumentUrl: readOnly: true type: string @@ -66830,30 +68142,6 @@ components: - splitFrom - mergedInto - paymentInstrument - PayoutRequestSplit: - type: object - required: - - amounts - properties: - amounts: - description: |- - Amounts for each new payout request. - One request is created per amount. - Provide at least two amounts. - Each amount must be greater than zero. - The sum must equal the original payout request amount. - type: array - minItems: 2 - maxItems: 100 - items: - type: number - format: double - x-type: Money - exclusiveMinimum: 0 - example: - - 50 - - 30 - - 20 PayoutRequestTimelineMessage: type: object properties: @@ -66881,6 +68169,8 @@ components: - payout-request-reversed - payout-request-blocked - payout-request-unblocked + - payout-request-added-to-batch + - payout-request-removed-from-batch occurredTime: description: Date and time when the timeline event occurred. $ref: '#/components/schemas/ServerTimestamp' @@ -66904,6 +68194,313 @@ components: - triggeredBy - message - extraData + BadRequest: + allOf: + - title: Bad request + - type: object + properties: + status: + type: integer + description: HTTP status code. + minimum: 400 + maximum: 400 + invalidFields: + $ref: '#/components/schemas/InvalidFields' + - $ref: '#/components/schemas/BaseProblem' + ProcessPayoutRequestAllocationOperation: + type: object + required: + - type + - allocationIds + properties: + type: + description: Type of operation that queues the given allocations for processing. + type: string + enum: + - process + allocationIds: + description: Array of allocation IDs to process. + type: array + minItems: 1 + maxItems: 1000 + items: + type: string + maxLength: 50 + example: pra_0YVDMDE2BMC6KBB5MX76RF6T80 + PayoutRequestAllocationOperationRequest: + type: object + description: Action to apply to payout request allocations. + discriminator: + propertyName: type + mapping: + process: '#/components/schemas/ProcessPayoutRequestAllocationOperation' + oneOf: + - $ref: '#/components/schemas/ProcessPayoutRequestAllocationOperation' + PayoutRequestAllocationOperation: + type: object + description: Action applied to a set of payout request allocations. + required: + - type + - allocationIds + - status + properties: + type: + description: Type of action applied to the allocations. + type: string + readOnly: true + enum: + - process + allocationIds: + description: IDs of the payout request allocations in the operation. + type: array + readOnly: true + items: + type: string + maxLength: 50 + status: + description: |- + Status of the operation. + The operation completes before the response returns, so the status is always `completed`. + type: string + readOnly: true + enum: + - completed + ApprovePayoutRequestBatchOperation: + type: object + required: + - type + - batchId + properties: + type: + description: Type of operation that approves payout requests in the batch. + type: string + enum: + - approve + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + BlockPayoutRequestBatchOperation: + type: object + required: + - type + - batchId + - reason + properties: + type: + description: Type of operation that blocks payout requests in the batch. + type: string + enum: + - block + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + reason: + $ref: '#/components/schemas/PayoutRequestBlockReason' + description: + description: Additional description for blocking the payout requests in the batch. + type: + - string + - 'null' + maxLength: 255 + UnblockPayoutRequestBatchOperation: + type: object + required: + - type + - batchId + properties: + type: + description: Type of operation that removes the block from payout requests in the batch. + type: string + enum: + - unblock + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + AutoAllocatePayoutRequestBatchOperation: + type: object + required: + - type + - batchId + properties: + type: + description: Type of operation that creates allocations automatically for payout requests in the batch. + type: string + enum: + - auto-allocate + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + ProcessPayoutRequestBatchOperation: + type: object + required: + - type + - batchId + properties: + type: + description: Type of operation that initiates processing of pending allocations for payout requests in the batch. + type: string + enum: + - process + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + AddPayoutRequestBatchOperation: + type: object + required: + - type + - batchId + properties: + type: + description: Type of operation that adds payout requests to the batch. + type: string + enum: + - add + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + payoutRequestIds: + description: IDs of the payout requests to add to the batch. + type: array + minItems: 1 + maxItems: 1000 + uniqueItems: true + items: + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + filter: + description: |- + Filter string that selects payout requests to add to the batch. + This field uses the same format as filter parameters for collections. + Use semicolons to separate multiple filter conditions. + + Available fields for filtering: `id`, `status`, `websiteId`, `customerId`, `currency`, `amount`, `createdTime`, `updatedTime`. + + The operation ignores a `batchId` filter. + Filter results always exclude payout requests that are already associated with a batch. + If the filter matches more payout requests than the remaining batch capacity, + the operation adds only the oldest matching requests up to the batch limit, + sorted by creation time. + type: string + minLength: 1 + example: status:pending;websiteId:ws_0YVDMDE2BMC6KBB5MX76RF6T80 + oneOf: + - title: Explicit IDs + required: + - payoutRequestIds + - title: Filter-based + required: + - filter + RemovePayoutRequestBatchOperation: + type: object + required: + - type + - batchId + - payoutRequestIds + properties: + type: + description: Type of operation that removes payout requests from the batch. + type: string + enum: + - remove + batchId: + description: |- + ID of the payout request batch. + A payout request batch groups payout requests so one action applies to every request in the group. + type: string + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + payoutRequestIds: + description: IDs of the payout requests to remove from the batch. + type: array + minItems: 1 + maxItems: 1000 + uniqueItems: true + items: + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + PayoutRequestBatchOperationRequest: + type: object + description: Action to apply to a payout request batch. + discriminator: + propertyName: type + mapping: + approve: '#/components/schemas/ApprovePayoutRequestBatchOperation' + block: '#/components/schemas/BlockPayoutRequestBatchOperation' + unblock: '#/components/schemas/UnblockPayoutRequestBatchOperation' + auto-allocate: '#/components/schemas/AutoAllocatePayoutRequestBatchOperation' + process: '#/components/schemas/ProcessPayoutRequestBatchOperation' + add: '#/components/schemas/AddPayoutRequestBatchOperation' + remove: '#/components/schemas/RemovePayoutRequestBatchOperation' + oneOf: + - $ref: '#/components/schemas/ApprovePayoutRequestBatchOperation' + - $ref: '#/components/schemas/BlockPayoutRequestBatchOperation' + - $ref: '#/components/schemas/UnblockPayoutRequestBatchOperation' + - $ref: '#/components/schemas/AutoAllocatePayoutRequestBatchOperation' + - $ref: '#/components/schemas/ProcessPayoutRequestBatchOperation' + - $ref: '#/components/schemas/AddPayoutRequestBatchOperation' + - $ref: '#/components/schemas/RemovePayoutRequestBatchOperation' + PayoutRequestBatchOperation: + type: object + description: |- + Action applied to a payout request batch. + A payout request batch is a group of payout requests that you manage together. + required: + - type + - batchId + - status + properties: + type: + description: Type of action applied to the batch. + type: string + readOnly: true + enum: + - approve + - block + - unblock + - auto-allocate + - process + - add + - remove + batchId: + description: ID of the payout request batch. + type: string + readOnly: true + maxLength: 50 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 + status: + description: |- + Status of the operation. + The operation completes before the response returns, so the status is always `completed`. + type: string + readOnly: true + enum: + - completed PayoutRequestBatch: type: object properties: @@ -66912,7 +68509,7 @@ components: readOnly: true description: ID of the batch. maxLength: 50 - example: preq_batch_0YVDMDE2BMC6KBB5MX76RF6T80 + example: prb_0YVDMDE2BMC6KBB5MX76RF6T80 userId: type: string readOnly: true @@ -66925,18 +68522,6 @@ components: readOnly: true minimum: 0 example: 10 - successCount: - description: Number of payout requests successfully processed. - type: integer - readOnly: true - minimum: 0 - example: 8 - failureCount: - description: Number of payout requests that failed to process. - type: integer - readOnly: true - minimum: 0 - example: 2 customerCount: description: Number of unique customers in the batch. type: integer @@ -67063,25 +68648,50 @@ components: items: type: object required: - - planId + - quantity properties: planId: type: string - description: ID of the plan. + description: |- + ID of the plan. + Either this field or the `plan` object must be provided. + Use `plan.id` instead. maxLength: 50 example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + deprecated: true + plan: + description: |- + Details of the plan. + Either this object or the deprecated `planId` field must be provided. + oneOf: + - $ref: '#/components/schemas/OriginalPlan' + - $ref: '#/components/schemas/FlexiblePlan' quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 + oneOf: + - required: + - plan + properties: + planId: + not: {} + - required: + - planId + properties: + plan: + not: {} + - required: + - plan + - planId billingAddress: description: Billing address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' deliveryAddress: description: Delivery address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -67297,6 +68907,7 @@ components: - customer-tax-number-validated - customer-updated - data-export-completed + - data-export-failed - dispute-created - dispute-modified - experian-check-performed @@ -67316,6 +68927,10 @@ components: - invoice-partially-refunded - invoice-past-due - invoice-past-due-reminder + - invoice-past-due-reminder-15-days + - invoice-past-due-reminder-30-days + - invoice-past-due-reminder-60-days + - invoice-past-due-reminder-90-days - invoice-refunded - invoice-reissued - invoice-tax-calculation-failed @@ -67336,12 +68951,22 @@ components: - order-abandoned - order-completed - order-delinquency-reached + - order-change-applied + - order-change-canceled + - order-change-created - organization-tax-number-validated - payment-card-created - payment-card-expiration-reminder + - payment-card-expiration-reminder-1-day + - payment-card-expiration-reminder-14-days + - payment-card-expiration-reminder-7-days - payment-card-expired - payment-instrument-modified + - payout-request-batch-created + - payout-request-batch-deleted + - payout-request-batch-modified - payout-request-canceled + - payout-request-changed - payout-request-created - payout-request-fulfilled - payout-request-modified @@ -67373,6 +68998,9 @@ components: - subscription-quantity-filled-limit-reached - subscription-reactivated - subscription-renewal-reminder + - subscription-renewal-reminder-1-day + - subscription-renewal-reminder-30-days + - subscription-renewal-reminder-7-days - subscription-renewed - subscription-resumed - subscription-trial-converted @@ -67385,7 +69013,10 @@ components: - transaction-process-requested - transaction-processed - transaction-reconciled + - transaction-partially-refunded + - transaction-refunded - transaction-timeout-resolved + - transaction-voided - trial-usage-limit-reached - waiting-gateway-transaction-completed GlobalWebhook: @@ -67408,7 +69039,10 @@ components: type: array default: [] items: - $ref: '#/components/schemas/GlobalEventType' + anyOf: + - $ref: '#/components/schemas/GlobalEventType' + - type: string + description: Additional event type that is available to your organization. status: x-basic: true type: string @@ -67439,6 +69073,8 @@ components: name: description: Name of the header. type: string + pattern: ^[!#$%&'*+.^_`|~0-9A-Za-z-]+$ + example: Content-Type status: description: Status of the header. type: string @@ -67447,7 +69083,10 @@ components: - active - inactive value: - description: Value of the header. + description: |- + Value of the header. + Template placeholders are permitted. + If the value renders as an empty string, the header is not sent. type: string example: value1 required: @@ -67586,54 +69225,70 @@ components: type: string description: Unique hash value that represents the user. readOnly: true - _links: - $ref: '#/components/schemas/SelfLink' - ProfileMfa: - type: object - properties: - status: - description: Status of Multi-Factor Authentication (MFA) enrollment. - type: string - enum: - - active - - inactive - type: - description: |- - Type of MFA enrollment. - Type `duo` cannot be updated or deleted. - If you need to reset your Duo MFA, [Contact support](https://www.rebilly.com/support/). + requiresCardOnFile: + type: boolean + description: Specifies whether the current organization must have a payment card on file before it can transact in the live environment. + readOnly: true + default: false + hasCardOnFile: + type: boolean + description: Specifies whether the current organization has an active payment card on file. + readOnly: true + default: false + billingManagementToken: type: - string - 'null' - enum: - - duo - - otp - - null - lastAuthTime: + format: password description: |- - Date and time when MFA verification is most recently passed. - To disable MFA, no more than 10 minutes must elapse between this value and the request to disable MFA. + Session token used to manage the payment method on file for a Rebilly subscription. + This value is returned only to organization owners. + + {% admonition type="warning" %} + Treat as a secret. + Do not log, do not expose in URLs, do not store in shared client storage. + {% /admonition %} + readOnly: true + pastDueInvoice: type: - - string + - object - 'null' - format: date-time + description: |- + Details of the oldest past-due invoice for the Rebilly subscription associated with the current organization. + This value is returned to all organization members to support consistent enforcement of the billing gate. + The `token` is returned only to organization owners. readOnly: true + required: + - invoiceId + - websiteId + - token + properties: + invoiceId: + type: string + description: ID of the past-due invoice. + maxLength: 50 + readOnly: true + websiteId: + type: string + description: ID of the website for the invoice. + maxLength: 50 + readOnly: true + token: + type: + - string + - 'null' + format: password + description: |- + JWT that is used to authorize payment of the invoice through the Rebilly Instruments JavaScript library. + This value is `null` for non-owners, who cannot pay the invoice. + + {% admonition type="warning" %} + Treat as a secret. + Do not log, do not expose in URLs, do not store in shared client storage. + {% /admonition %} + readOnly: true _links: - type: array - description: Related links. - readOnly: true - items: - type: object - properties: - href: - description: Link URL. - type: string - rel: - description: Type of link. - type: string - enum: - - self - - enrollment + $ref: '#/components/schemas/SelfLink' Role: type: object required: @@ -67757,16 +69412,13 @@ components: $ref: '#/components/schemas/ResourceId' status: type: integer - x-sortable: true description: Response code of the HTTP request. url: type: string x-basic: true - x-sortable: true description: URL of the HTTP request. route: type: string - x-sortable: true description: API request route. example: /customers/{param} method: @@ -67782,11 +69434,9 @@ components: x-basic: true request: type: string - x-sortable: true description: Request body of the HTTP request. response: type: string - x-sortable: true description: Response body of the HTTP request. requestHeaders: $ref: '#/components/schemas/HttpHeaders' @@ -67798,7 +69448,6 @@ components: readOnly: true properties: userId: - x-sortable: true type: string description: ID of the user. maxLength: 50 @@ -67812,25 +69461,20 @@ components: description: Email address of the user. type: string format: email - x-sortable: true firstName: description: First name of the user. type: string - x-sortable: true lastName: description: Last name of the user. type: string - x-sortable: true ipAddress: type: string - x-sortable: true deprecated: true description: Client IP address. format: ipv4 userAgent: description: Software that is acting on behalf of the user. type: string - x-sortable: true fingerprint: description: |- User's device fingerprint hash. @@ -67838,11 +69482,9 @@ components: The device fingerprint is generated based on device attributes, such as: hardware, software, IP address, language, browser, and more. type: string - x-sortable: true isSupport: description: Specifies if the API request is completed by a Rebilly Support Team member. type: boolean - x-sortable: true ipAddress: type: string x-basic: true @@ -67866,7 +69508,14 @@ components: createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: - $ref: '#/components/schemas/UpdatedTime' + type: string + description: |- + Date and time when the resource is updated. + This value is set automatically when the resource is updated. + format: date-time + readOnly: true + x-sortable: false + x-label: Last Update Time _links: $ref: '#/components/schemas/SelfLink' _embedded: @@ -67941,6 +69590,24 @@ components: description: ID of the customer associated with the tax service request. _links: $ref: '#/components/schemas/SelfLink' + CreatedTimeNoSort: + type: string + description: |- + Date and time when the resource is created. + This value is set automatically when the resource is created. + format: date-time + readOnly: true + x-sortable: false + x-label: Creation Time + UpdatedTimeNoSort: + type: string + description: |- + Date and time when the resource is updated. + This value is set automatically when the resource is updated. + format: date-time + readOnly: true + x-sortable: false + x-label: Last Update Time WebhookTracking: type: object description: |- @@ -67955,23 +69622,18 @@ components: example: hook_log_01HXC7HJ1V2FNJD1R396WCG2HB status: type: integer - x-sortable: true description: Response code of the webhook request. duration: type: integer - x-sortable: true description: Duration of the webhook request in milliseconds. initiatedTime: description: Date and time when the webhook is initiated. - x-sortable: true $ref: '#/components/schemas/ServerTimestamp' url: type: string - x-sortable: true description: URL that receives the webhook. method: type: string - x-sortable: true description: HTTP method for sending the webhook. example: POST request: @@ -67986,37 +69648,31 @@ components: $ref: '#/components/schemas/HttpHeaders' entityId: type: string - x-sortable: true description: ID of the main entity related to the event type. organizationId: - x-sortable: true allOf: - $ref: '#/components/schemas/OrganizationId' eventType: - x-sortable: true - allOf: + anyOf: - $ref: '#/components/schemas/GlobalEventType' + - type: string + description: Additional event type that is available to your organization. source: type: string - x-sortable: true description: Source that triggered the webhook. enum: - webhooks - rules attempt: type: integer - x-sortable: true description: Number of attempts to send the webhook. sentTime: - x-sortable: true description: Date and time when the webhook is sent. $ref: '#/components/schemas/ServerTimestamp' createdTime: - x-sortable: true - $ref: '#/components/schemas/CreatedTime' + $ref: '#/components/schemas/CreatedTimeNoSort' updatedTime: - x-sortable: true - $ref: '#/components/schemas/UpdatedTime' + $ref: '#/components/schemas/UpdatedTimeNoSort' _links: $ref: '#/components/schemas/SelfLink' User: @@ -68128,6 +69784,30 @@ components: $ref: '#/components/schemas/AllowedIps' _links: $ref: '#/components/schemas/SelfLink' + WebhookEvent: + type: object + required: + - eventType + - product + properties: + eventType: + type: string + description: Event type that a webhook can subscribe to. + readOnly: true + example: wagering-requirement-met + product: + type: string + description: |- + Product in which the event occurs. + Use this value to distinguish between Replay events and non-Replay events. + enum: + - core + - replay + x-enumDescriptions: + core: Rebilly event. + replay: Replay event. + readOnly: true + example: replay CustomerInformation: type: object properties: @@ -68153,73 +69833,37 @@ components: readOnly: true type: number format: double - DashboardMetric: - type: string - description: Type of dashboard metric. - enum: - - approvalRate - - salesCount - - salesValue - - refundsValue - - chargebacksCount - - chargebacksValue - - transactionsCount - - redeemedCouponsCount - - newLeadsCount - - newCustomersCount - - appliedCouponsCount - - trialConversionsCount - - trialConversionsRate - - renewalSuccessRate - - renewalsCount - - newTrialsCount - - reactivationsCount - - successfulRetriesCount - - invoicedRevenue - - churnCount - - churnRate - - cancellationsCount - - cancellationsRate - - activeSubscriptionsCount - - newSubscriptionsCount - - upgradesCount - - downgradesCount - - monthlyRecurringRevenue - - annualRecurringRevenue - - averageRevenuePerCustomer - - customerLifetimeValue - - addressProofAcceptanceRate - - identityProofAcceptanceRate - - fundsProofAcceptanceRate - - purchaseProofAcceptanceRate - - creditFileProofAcceptanceRate - - kycAcceptanceRate - - kycReviewTime - - kycRejectionRate - - kycAccuracyRate - - addressProofAccuracyRate - - identityProofAccuracyRate - - creditFileProofAccuracyRate - - kycRequestCount - - kycRequestAbandonmentRate - - kycRequestAttemptedRate - - kycRequestFailureRate - - kycRequestFulfillmentRate - - kycRequestExpirationRate DashboardTile: type: object required: - metric properties: metric: - description: Metric displayed in the tile. - anyOf: - - $ref: '#/components/schemas/DashboardMetric' - - type: string - dateRange: type: string description: |- - Date range of the tile, in ISO-8601 interval format, extended with `NOW` and `NOW-P*` values for relative dates. + Metric displayed in the tile. + Publicly supported values are defined in `DashboardMetric`. + Additional values are accepted. + title: + type: + - string + - 'null' + description: Custom tile title. + minLength: 2 + maxLength: 36 + description: + type: + - string + - 'null' + description: Custom tile description. + minLength: 2 + maxLength: 48 + dateRange: + type: + - string + - 'null' + description: |- + Date range of the tile, in ISO-8601 interval format, extended with `NOW` and relative anchor tokens for relative dates. When omitted, the dashboard `dateRange` is used. Supported formats: @@ -68228,12 +69872,39 @@ components: - Duration and end: `P1M/2024-02-01T00:00:00Z`. - Now and duration: `NOW-P1M/NOW`. This format represents the last month. - Month before last month: `NOW-P2M/NOW-P1M`. + - Anchor tokens: `NOW_D`, `NOW_W`, `NOW_M` and `NOW_Y` resolve to the start of the current day, week, month or year when used as the start of the range, and to the end of that period when used as the end of the range. + Combine an anchor with a signed duration, for example `NOW_M-P1M`, to shift the period after snapping to the boundary. + - Today: `NOW_D/NOW_D`. + - Yesterday: `NOW_D-P1D/NOW_D-P1D`. + - This week: `NOW_W/NOW_D`. + - Last week: `NOW_W-P1W/NOW_W-P1W`. + - Last month: `NOW_M-P1M/NOW_M-P1M`. columnsWidth: type: integer description: Number of dashboard columns that the tile occupies. minimum: 1 maximum: 2 default: 1 + periodStart: + type: + - string + - 'null' + format: date-time + readOnly: true + description: |- + Date and time when the tile period starts. + The value is resolved from the tile `dateRange`. + This value is `null` when the tile does not define its own `dateRange`. + periodEnd: + type: + - string + - 'null' + format: date-time + readOnly: true + description: |- + Date and time when the tile period ends. + The value is resolved from the tile `dateRange`. + This value is `null` when the tile does not define its own `dateRange`. DashboardTab: type: object required: @@ -68252,6 +69923,17 @@ components: maxItems: 20 items: $ref: '#/components/schemas/DashboardTile' + preset: + type: + - string + - 'null' + description: |- + Specifies which preset the tab is associated with. + The preset is independent of the tiles configured on the tab. + enum: + - Payments + - Billing + - KYC ProfileDashboard: type: object required: @@ -68260,7 +69942,7 @@ components: dateRange: type: string description: |- - Date range of the dashboard, in ISO-8601 interval format, extended with `NOW` and `NOW-P*` values for relative dates. + Date range of the dashboard, in ISO-8601 interval format, extended with `NOW` and relative anchor tokens for relative dates. This range applies to every tile that does not define its own `dateRange`. Supported formats: @@ -68269,6 +69951,13 @@ components: - Duration and end: `P1M/2024-02-01T00:00:00Z`. - Now and duration: `NOW-P1M/NOW`. This format represents the last month. - Month before last month: `NOW-P2M/NOW-P1M`. + - Anchor tokens: `NOW_D`, `NOW_W`, `NOW_M` and `NOW_Y` resolve to the start of the current day, week, month or year when used as the start of the range, and to the end of that period when used as the end of the range. + Combine an anchor with a signed duration, for example `NOW_M-P1M`, to shift the period after snapping to the boundary. + - Today: `NOW_D/NOW_D`. + - Yesterday: `NOW_D-P1D/NOW_D-P1D`. + - This week: `NOW_W/NOW_D`. + - Last week: `NOW_W-P1W/NOW_W-P1W`. + - Last month: `NOW_M-P1M/NOW_M-P1M`. default: NOW-P1M/NOW periodStart: type: string @@ -68290,6 +69979,59 @@ components: maxItems: 10 items: $ref: '#/components/schemas/DashboardTab' + DashboardMetric: + type: string + description: Type of dashboard metric. + enum: + - approvalRate + - salesCount + - salesValue + - refundsValue + - chargebacksCount + - chargebacksValue + - transactionsCount + - redeemedCouponsCount + - newLeadsCount + - newCustomersCount + - appliedCouponsCount + - trialConversionsCount + - trialConversionsRate + - renewalSuccessRate + - renewalsCount + - newTrialsCount + - reactivationsCount + - successfulRetriesCount + - invoicedRevenue + - churnCount + - churnRate + - cancellationsCount + - cancellationsRate + - activeSubscriptionsCount + - newSubscriptionsCount + - upgradesCount + - downgradesCount + - monthlyRecurringRevenue + - annualRecurringRevenue + - averageRevenuePerCustomer + - customerLifetimeValue + - addressProofAcceptanceRate + - identityProofAcceptanceRate + - fundsProofAcceptanceRate + - purchaseProofAcceptanceRate + - creditFileProofAcceptanceRate + - kycAcceptanceRate + - kycReviewTime + - kycRejectionRate + - kycAccuracyRate + - addressProofAccuracyRate + - identityProofAccuracyRate + - creditFileProofAccuracyRate + - kycRequestCount + - kycRequestAbandonmentRate + - kycRequestAttemptedRate + - kycRequestFailureRate + - kycRequestFulfillmentRate + - kycRequestExpirationRate DashboardTileReport: type: object properties: @@ -68326,19 +70068,6 @@ components: - number - 'null' description: Value of the entry. - BadRequest: - allOf: - - title: Bad request - - type: object - properties: - status: - type: integer - description: HTTP status code. - minimum: 400 - maximum: 400 - invalidFields: - $ref: '#/components/schemas/InvalidFields' - - $ref: '#/components/schemas/BaseProblem' DataExportArguments: type: object description: |- @@ -68377,6 +70106,41 @@ components: description: |- Date and time when the first scheduled recurring export occurs. The default value is now. + DataExportFileId: + type: + - string + - 'null' + description: |- + ID of the data export file. + If the export contains more than 1,000,000 records, + the file is a ZIP archive. + The archive contains numbered part files, + such as `example-part1.csv` and `example-part2.csv`, + each with a maximum of 1,000,000 records. + Each part file can be processed independently: + + - `csv` and `detailed-csv` part files repeat the header row. + - `json` and `json-api` part files contain a complete array. + - `xml` part files contain their own root element. + + `pdf` exports are always a ZIP archive that contains one PDF per record, + and are never split into part files. + readOnly: true + maxLength: 50 + example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + DataExportFailureReason: + description: Reason the export failed, if the export status is `failed`. + readOnly: true + type: + - string + - 'null' + enum: + - record-limit-exceeded + - max-retries-reached + - null + x-enumDescriptions: + record-limit-exceeded: Export exceeded the maximum number of records allowed for a single export. + max-retries-reached: Export failed after the maximum number of retry attempts. DataExportDateRange: type: object description: |- @@ -68458,13 +70222,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68485,6 +70243,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68577,13 +70338,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68604,6 +70359,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68696,13 +70454,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68723,6 +70475,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68817,13 +70572,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68844,6 +70593,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68936,13 +70688,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68963,6 +70709,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68999,9 +70748,125 @@ components: type: object user: type: object - AmlChecksDataExport: + AmlChecksDataExport: + type: object + description: AML checks resource to export. + required: + - name + - format + - resource + properties: + id: + type: string + description: ID of the export. + readOnly: true + maxLength: 50 + example: exp_0YVCNQ2C1AD1RA3HXKP492GNZB + name: + description: Name of the export. + type: string + maxLength: 50 + resource: + description: Type of resource to export. + type: string + enum: + - amlChecks + format: + description: Output format of the export. + type: string + enum: + - csv + - json + - json-api + - xml + - detailed-csv + arguments: + $ref: '#/components/schemas/DataExportArguments' + emailNotification: + description: List of email addresses to notify when an export is completed. + type: array + items: + type: string + format: email + fields: + description: |- + List of fields to include in the export. + For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). + type: array + items: + type: string + recurring: + $ref: '#/components/schemas/DataExportRecurring' + userId: + description: ID of the user who requested the data export. + readOnly: true + type: string + maxLength: 50 + example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 + fileId: + $ref: '#/components/schemas/DataExportFileId' + recordCount: + description: Total number of records in the export, excluding the header row. + readOnly: true + type: integer + scheduledTime: + description: Date and time when the data export is scheduled to generate a file. + $ref: '#/components/schemas/ServerTimestamp' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + status: + description: Status of export request. + readOnly: true + type: string + enum: + - pending + - queued + - processing + - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' + dateRange: + allOf: + - $ref: '#/components/schemas/DataExportDateRange' + - type: object + properties: + field: + type: string + default: createdTime + example: createdTime + _links: + type: array + description: Related links. + readOnly: true + items: + type: object + properties: + href: + description: Link URL. + type: string + rel: + description: Type of link. + type: string + enum: + - self + - user + - download + - signedLink + _embedded: + type: object + description: Embedded objects that are requested by the `expand` query parameter. + readOnly: true + properties: + file: + type: object + user: + type: object + DisputesDataExport: type: object - description: AML checks resource to export. + description: Dispute resource to export. required: - name - format @@ -69021,7 +70886,7 @@ components: description: Type of resource to export. type: string enum: - - amlChecks + - disputes format: description: Output format of the export. type: string @@ -69030,7 +70895,6 @@ components: - json - json-api - xml - - detailed-csv arguments: $ref: '#/components/schemas/DataExportArguments' emailNotification: @@ -69055,13 +70919,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69074,7 +70932,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of export request. + description: Status of the export request. readOnly: true type: string enum: @@ -69082,6 +70940,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69118,9 +70979,9 @@ components: type: object user: type: object - DisputesDataExport: + JournalRecordsDataExport: type: object - description: Dispute resource to export. + description: Journal record resource to export. required: - name - format @@ -69140,7 +71001,7 @@ components: description: Type of resource to export. type: string enum: - - disputes + - journalRecords format: description: Output format of the export. type: string @@ -69160,7 +71021,7 @@ components: fields: description: |- List of fields to include in the export. - For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). + For more information, see [Fields](https://www.rebilly.com/docs/dev-docs/transaction-reconciliation/#fields). type: array items: type: string @@ -69173,13 +71034,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69192,7 +71047,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of the export request. + description: Status of export request. readOnly: true type: string enum: @@ -69200,6 +71055,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69236,9 +71094,9 @@ components: type: object user: type: object - JournalRecordsDataExport: + PayoutRequestsDataExport: type: object - description: Journal record resource to export. + description: Payout requests resource to export. required: - name - format @@ -69258,7 +71116,7 @@ components: description: Type of resource to export. type: string enum: - - journalRecords + - payoutRequests format: description: Output format of the export. type: string @@ -69278,7 +71136,7 @@ components: fields: description: |- List of fields to include in the export. - For more information, see [Fields](https://www.rebilly.com/docs/dev-docs/transaction-reconciliation/#fields). + For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). type: array items: type: string @@ -69291,13 +71149,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69310,7 +71162,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of export request. + description: Status of the export request. readOnly: true type: string enum: @@ -69318,12 +71170,16 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' - type: object properties: field: + x-sortable: true type: string default: createdTime example: createdTime @@ -69354,9 +71210,9 @@ components: type: object user: type: object - PayoutRequestsDataExport: + PayoutRequestAllocationsDataExport: type: object - description: Payout requests resource to export. + description: Payout request allocations resource to export. required: - name - format @@ -69376,7 +71232,7 @@ components: description: Type of resource to export. type: string enum: - - payoutRequests + - payoutRequestAllocations format: description: Output format of the export. type: string @@ -69409,13 +71265,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69436,6 +71286,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69473,9 +71326,9 @@ components: type: object user: type: object - PayoutRequestAllocationsDataExport: + UsersDataExport: type: object - description: Payout request allocations resource to export. + description: Users resource to export. required: - name - format @@ -69495,15 +71348,13 @@ components: description: Type of resource to export. type: string enum: - - payoutRequestAllocations + - users format: description: Output format of the export. type: string enum: - csv - json - - json-api - - xml arguments: $ref: '#/components/schemas/DataExportArguments' emailNotification: @@ -69528,13 +71379,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69555,6 +71400,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69607,6 +71455,7 @@ components: journalRecords: '#/components/schemas/JournalRecordsDataExport' payoutRequests: '#/components/schemas/PayoutRequestsDataExport' payoutRequestAllocations: '#/components/schemas/PayoutRequestAllocationsDataExport' + users: '#/components/schemas/UsersDataExport' oneOf: - $ref: '#/components/schemas/CustomersDataExport' - $ref: '#/components/schemas/SubscriptionsDataExport' @@ -69618,6 +71467,38 @@ components: - $ref: '#/components/schemas/JournalRecordsDataExport' - $ref: '#/components/schemas/PayoutRequestsDataExport' - $ref: '#/components/schemas/PayoutRequestAllocationsDataExport' + - $ref: '#/components/schemas/UsersDataExport' + DataExportLimitExceeded: + allOf: + - title: Data export limit exceeded + - type: object + required: + - type + properties: + type: + type: string + description: Machine-readable error code for this problem type, which consumers use to handle the failure programmatically. + enum: + - data-export-limit-exceeded + status: + type: integer + description: HTTP status code. + minimum: 422 + maximum: 422 + - $ref: '#/components/schemas/DetailedProblem' + - type: object + required: + - matchedRecords + - maxRecords + properties: + matchedRecords: + type: integer + description: Number of records that match the export request. + example: 12500000 + maxRecords: + type: integer + description: Maximum number of records for a single export. + example: 10000000 OrganizationExport: type: object properties: @@ -69833,6 +71714,203 @@ components: required: - totalInherited - categories + ReportAmlAuditReport: + type: object + description: AML audit report for a person. + properties: + personId: + type: string + description: ID of the person associated with the report. + maxLength: 50 + status: + type: + - string + - 'null' + description: Person-level AML screening status for the selected period. + enum: + - clear + - confirmed-match + - pending-review + linkedCustomers: + type: array + description: Customers linked to the person. + items: + type: object + properties: + id: + $ref: '#/components/schemas/CustomerId' + websiteId: + $ref: '#/components/schemas/WebsiteId' + required: + - id + - websiteId + summary: + type: object + description: Screening summary metrics for the selected period. + properties: + totalChecks: + type: integer + description: Total number of AML checks in the selected period. + hitCount: + type: integer + description: Number of AML hits across all checks in the selected period. + lastCheckTime: + type: + - string + - 'null' + format: date-time + description: Date and time of the most recent AML check in the selected period. + required: + - totalChecks + - hitCount + - lastCheckTime + screeningHistory: + type: array + description: AML screening history for the selected period. + items: + type: object + properties: + id: + type: string + description: ID of the AML check. + maxLength: 50 + example: aml_chk_0YV8XJT2ZWDR398Q8NFEM7DEPM + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + customerId: + $ref: '#/components/schemas/CustomerId' + source: + type: string + description: Source of the AML check. + enum: + - sign-up + - recurring + - purchase + hitSources: + type: + - string + - 'null' + description: |- + Comma-separated list of AML Hit sources for the AML check. + + The value is `null` if the AML Check did not find any hits. + result: + type: string + description: Screening result for the AML check. + enum: + - clear + - confirmed-match + - pending-review + reviewer: + type: + - string + - 'null' + description: Name of the reviewer, `bot` for checks that run automatically, or `null` when the check hasn't been reviewed yet. + required: + - id + - createdTime + - updatedTime + - customerId + - source + - hitSources + - result + - reviewer + transactions: + type: array + description: Transactions for customers linked to the person in the selected period. + items: + type: object + properties: + id: + $ref: '#/components/schemas/TransactionId' + customerId: + $ref: '#/components/schemas/CustomerId' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + amount: + type: number + description: Transaction amount converted to the report currency of the organization. + currency: + $ref: '#/components/schemas/CurrencyCode' + type: + description: Type of transaction. + type: string + x-basic: true + readOnly: true + enum: + - 3ds-authentication + - authorize + - capture + - credit + - refund + - sale + - setup + - void + status: + description: Status of the transaction. + type: string + readOnly: true + enum: + - completed + - conn-error + - disputed + - never-sent + - offsite + - partially-refunded + - pending + - refunded + - sending + - timeout + - voided + - waiting-approval + - waiting-capture + - waiting-gateway + - waiting-refund + result: + description: Result of the transaction. + type: string + x-basic: true + readOnly: true + enum: + - approved + - canceled + - declined + - unknown + required: + - id + - customerId + - createdTime + - updatedTime + - amount + - currency + - type + - status + - result + periodStart: + type: string + format: date-time + description: Start date time of the report period. + periodEnd: + type: string + format: date-time + description: End date time of the report period. + truncated: + type: boolean + description: Indicates whether any list within the report is truncated due to too many results. + required: + - personId + - status + - linkedCustomers + - summary + - screeningHistory + - transactions + - periodStart + - periodEnd + - truncated CumulativeSubscriptions: type: object properties: @@ -70857,22 +72935,40 @@ components: properties: date: type: string - description: Date in `YYYY-MM-DD` format . + description: Date in `YYYY-MM-DD` format. total: type: number format: double - description: Total number of all transactions within the aggregation. + description: |- + Aggregated value for all transactions for the day, in the unit specified by the `type` parameter: + - `count`: Total number of transactions. + - `amount`: Total amount of approved transactions in the merchant reporting currency. + - `approval-rate`: Ratio of approved transactions to all transactions. + - `incomplete-rate`: Ratio of incomplete transactions to all transactions. + + This value does not depend on the `subaggregate` parameter and is not the sum of the values in `subaggregates`. + Each transaction is included once, even if the `subaggregate` field contains multiple values for the transaction. + Transactions with no value for the `subaggregate` field are also included. subaggregates: - type: object - description: Subaggregates that have transactions within the range. - properties: - subaggregate: - type: string - description: ID of the subaggregate. - value: - type: number - format: double - description: Total number of all subaggregate transactions within the aggregation. + type: array + description: |- + Breakdown by the `subaggregate` field for the day. + Each element contains one `subaggregate` value and its aggregated value. + Each `subaggregate` value found in the report has an element, + in the same order for each day. + items: + type: object + properties: + subaggregate: + type: string + description: One value of the `subaggregate` field, such as a website ID, a currency code, or a lead source. + value: + type: number + format: double + description: |- + Aggregated value for transactions that have this `subaggregate` value, + in the same unit as `total`. + This value is `0` if no transactions have this `subaggregate` value. ReportDisputeDelays: type: object properties: @@ -70962,6 +73058,11 @@ components: format: double SubscriptionSummaryMetrics: type: object + required: + - currency + - invoicedAmount + - collectedAmount + - invoiceCount properties: currency: description: Currency code in ISO 4217 format. @@ -71006,17 +73107,22 @@ components: writeOnly: true description: |- Write-only payment token. - If this value is supplied, it converts into a payment instrument and set as the `defaultPaymentInstrument`. - The value of this property overrides the `defaultPaymentInstrument` if both are supplied. + If supplied, the token is converted into a payment instrument, and its ID is assigned to `defaultPaymentInstrumentId` value. + The value of this property overrides the `defaultPaymentInstrumentId` if both are supplied. This token may only be used once before it expires. defaultPaymentInstrument: - type: object + type: + - object + - 'null' description: |- - Default payment instrument. + Default payment instrument of the customer. + The default payment instrument is used to automatically pay subscription renewals, and for transaction requests where a specific payment instrument is not provided. + readOnly: true required: - method + - paymentInstrumentId properties: method: $ref: '#/components/schemas/PaymentMethod' @@ -71025,6 +73131,18 @@ components: description: ID of the payment instrument. maxLength: 50 example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + defaultPaymentInstrumentId: + type: + - string + - 'null' + description: |- + ID of the customer's default payment instrument. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + writeOnly: true preferredPayoutInstrumentId: type: - string @@ -71050,7 +73168,10 @@ components: $ref: '#/components/schemas/TaxNumber' notificationEmails: type: array - description: Additional email addresses for notification delivery. + description: |- + Email addresses for notification delivery in event-based email notifications. + When you configure event-based email notifications, you can send to these addresses, the customer's primary email address, or another email address you specify. + For more information, see [Manage notification emails](https://www.rebilly.com/docs/data-tables/manage-customer-information#manage-notification-emails). items: type: string format: email @@ -71192,11 +73313,13 @@ components: - balance - bonusBalance - pendingPayoutTotal + - canWithdraw - depositAmounts - defaultDepositAmount - depositCustomAmount - depositMethods - payoutMethods + - coinPricing properties: id: type: string @@ -71221,12 +73344,14 @@ components: format: double minimum: 0 description: Customer's current balance. + readOnly: true example: 1500 bonusBalance: type: number format: double minimum: 0 description: Bonus balance available to the customer. + readOnly: true example: 1500 pendingPayoutTotal: type: number @@ -71235,7 +73360,12 @@ components: description: |- Sum of all payout requests that are currently in a pending state. This value is also the maximum possible "reverse withdrawal" amount. + readOnly: true example: 100 + canWithdraw: + type: boolean + readOnly: true + description: Specifies if the customer can initiate a withdrawal. depositMethods: type: array items: @@ -71324,6 +73454,14 @@ components: description: |- Value of the default amount in the `depositAmounts` list. This value is calculated from the `defaultIndex` property of the deposit strategy that is applied to the deposit request. + coinPricing: + readOnly: true + description: |- + Formula copied from the deposit amount strategy when the deposit request is created. + A `null` value means the deposit credits the cash balance instead of the coin balance. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' lastDepositRequestId: type: string description: ID of the last deposit request that is made for this cashier. @@ -71334,17 +73472,6 @@ components: $ref: '#/components/schemas/UpdatedTime' _links: $ref: '#/components/schemas/SelfLink' - PostCashierPayoutRequestCancellation: - type: object - required: - - amount - properties: - amount: - description: Pending payout request amount to be canceled. - type: number - format: double - minimum: 0 - example: 1500 StorefrontTransactionRedirectUrl: type: - string @@ -72224,6 +74351,138 @@ components: type: string enum: - self + StorefrontKycDocumentTypes: + type: string + enum: + - identity-proof + - address-proof + - funds-proof + - purchase-proof + StorefrontKycIdentityMatches: + type: object + description: Matched identity data returned to the customer. + properties: + containsImage: + description: Specifies if the document includes an image that contains a face. + type: boolean + example: true + isIdentityDocument: + description: Specifies if the document resembles an ID. + type: boolean + example: true + firstName: + description: |- + First name of the customer. + This value is an empty string if no match is found. + type: string + example: John + lastName: + description: |- + Last name of the customer. + This value is an empty string if no match is found. + type: string + example: Doe + dateOfBirth: + description: |- + Date of birth detected on the document. + This value is `null` if no match is detected. + type: + - string + - 'null' + format: date-time + expirationDate: + description: |- + Expiration date detected on the document. + This value is `null` if no expiration date is detected. + type: + - string + - 'null' + format: date-time + issueDate: + description: |- + Issue date detected on the document. + This value is `null` if no issue date is detected. + type: + - string + - 'null' + format: date-time + hasMinimalAge: + description: |- + Specifies that the individual is older than the minimal age limit. + The minimal age is 21+ for the USA and 18+ for all other countries. + This value is `null` if `dateOfBirth` is not determined. + type: + - boolean + - 'null' + readOnly: true + example: true + nationality: + description: |- + Nationality detected on a passport or citizenship document. + This value is `null` if no nationality is detected. + type: + - string + - 'null' + example: US + maxLength: 3 + issuanceCountry: + description: Country that issued the document. + type: + - string + - 'null' + example: CA + minLength: 2 + maxLength: 2 + issuanceRegion: + description: Region, state, province, or territory that issued the document. + type: + - string + - 'null' + example: Ontario + documentNumber: + description: |- + Unique number on the identity document. + This value may contain alphanumeric characters. + type: + - string + - 'null' + example: '1234567890' + sex: + description: |- + MRZ sex code (ICAO 9303). + `M`, `F`, or `X`. + This value is `null` if not extracted. + type: + - string + - 'null' + pattern: ^[MFX]$ + example: M + documentSubtype: + description: Interpreted subtype of the uploaded document. + type: + - string + - 'null' + $ref: '#/components/schemas/KycDocumentSubtypes' + hasMatchingFaceProof: + description: |- + Specifies if an identity document has matching face proof. + This value is `null` if face proof is not required or not performed. + type: + - boolean + - 'null' + example: false + hasCompletedFaceLiveness: + description: Specifies if the face liveness session completed. + type: boolean + readOnly: true + example: false + expiryDate: + description: Use `expirationDate` field instead. + type: + - string + - 'null' + format: date-time + deprecated: true StorefrontProofOfIdentityKycDocument: type: object required: @@ -72248,7 +74507,7 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72288,19 +74547,87 @@ components: format: date-time readOnly: true documentMatches: - type: object + type: + - object + - 'null' readOnly: true description: Document matches. properties: - score: - description: Calculated score that represents the percentage of confidence that this ID represents the customer. - type: number - format: double - example: 0.75 + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/KycIdentityMatches' + $ref: '#/components/schemas/StorefrontKycIdentityMatches' _links: $ref: '#/components/schemas/SelfLink' + StorefrontKycAddressMatches: + type: object + description: Matched address data returned to the customer. + properties: + firstName: + description: |- + First name of the customer. + This value is an empty string if no match is found. + type: string + example: John + lastName: + description: |- + Last name of the customer. + This value is an empty string if no match is found. + type: string + example: Doe + line1: + description: |- + Address of the customer's residence. + This value is an empty string if no match is found. + type: string + example: 36 Craven St + city: + description: |- + Customer's city of residence. + This value is an empty string if no match is found. + type: string + example: London + region: + description: |- + Customer's region of residence. + This value is an empty string if no match is found. + type: string + example: London + postalCode: + description: |- + Postal code of the customer's residence. + This value is an empty string if no match is found. + type: string + example: WC2N 5NF + wordCount: + description: Total number of words in the document. + type: integer + example: 350 + uniqueWords: + description: Total number of unique words in the document. + type: integer + example: 175 + date: + description: |- + Date detected on the document. + Use this field to determine if the document is recent. + type: + - string + - 'null' + format: date-time + example: '2021-01-01T00:00:00+00:00' + phone: + description: |- + Phone number of the company or agency that issued the document. + This value is an empty string if no phone number is detected. + type: string + example: (123) 456-7890 + documentSubtype: + description: Interpreted subtype of the uploaded document. + type: + - string + - 'null' + $ref: '#/components/schemas/KycDocumentSubtypes' StorefrontProofOfAddressKycDocument: type: object required: @@ -72325,7 +74652,83 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' + documentSubtype: + description: Document subtype submitted for validation. + $ref: '#/components/schemas/KycDocumentSubtypes' + status: + description: Status of the validation. + type: string + readOnly: true + enum: + - pending + - in-progress + - accepted + - rejected + - archived + x-enumDescriptions: + pending: Waiting to be reviewed or analyzed. + in-progress: Being analyzed by the Rebilly AI. + accepted: Accepted by AI or a human. + rejected: Rejected by AI or a human. + archived: Archived by the Rebilly AI. + rejectionReason: + $ref: '#/components/schemas/KycDocumentRejection' + requestId: + readOnly: true + type: + - string + - 'null' + description: ID of the KYC request. + maxLength: 50 + example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + processedTime: + description: Date and time when the KYC document is processed. + type: string + format: date-time + readOnly: true + documentMatches: + description: Document matches. + type: + - object + - 'null' + readOnly: true + properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + data: + $ref: '#/components/schemas/StorefrontKycAddressMatches' + _links: + $ref: '#/components/schemas/SelfLink' + StorefrontProofOfFundsKycDocument: + type: object + required: + - documentType + - status + properties: + id: + readOnly: true + $ref: '#/components/schemas/ResourceId' + fileIds: + description: |- + IDs of linked file objects. + + Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: + `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. + + Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. + type: array + items: + $ref: '#/components/schemas/ResourceId' + documentType: + description: |- + Document type submitted for validation. + Only the `identity-proof` and `address-proof` types are analyzed automatically. + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72365,157 +74768,19 @@ components: format: date-time readOnly: true documentMatches: - description: Document matches. - type: object - readOnly: true - properties: - score: - description: Calculated score that represents the percentage of confidence that this proof of address represents the customer. - type: number - format: double - example: 0.75 - data: - $ref: '#/components/schemas/KycAddressMatches' - _links: - $ref: '#/components/schemas/SelfLink' - StorefrontProofOfFundsKycDocument: - type: object - required: - - documentType - - status - properties: - id: - readOnly: true - $ref: '#/components/schemas/ResourceId' - fileIds: - description: |- - IDs of linked file objects. - - Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: - `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. - - Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. - type: array - items: - $ref: '#/components/schemas/ResourceId' - documentType: - description: |- - Document type submitted for validation. - Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' - documentSubtype: - description: Document subtype submitted for validation. - $ref: '#/components/schemas/KycDocumentSubtypes' - status: - description: Status of the validation. - type: string - readOnly: true - enum: - - pending - - in-progress - - accepted - - rejected - - archived - x-enumDescriptions: - pending: Waiting to be reviewed or analyzed. - in-progress: Being analyzed by the Rebilly AI. - accepted: Accepted by AI or a human. - rejected: Rejected by AI or a human. - archived: Archived by the Rebilly AI. - rejectionReason: - $ref: '#/components/schemas/KycDocumentRejection' - requestId: - readOnly: true - type: - - string - - 'null' - description: ID of the KYC request. - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - processedTime: - description: Date and time when the KYC document is processed. - type: string - format: date-time - readOnly: true - _links: - $ref: '#/components/schemas/SelfLink' - StorefrontProofOfPurchaseKycDocument: - type: object - required: - - documentType - - status - properties: - id: - readOnly: true - $ref: '#/components/schemas/ResourceId' - fileIds: - description: |- - IDs of linked file objects. - - Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: - `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. - - Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. - type: array - items: - $ref: '#/components/schemas/ResourceId' - documentType: - description: |- - Document type submitted for validation. - Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' - documentSubtype: - description: Document subtype submitted for validation. - $ref: '#/components/schemas/KycDocumentSubtypes' - status: - description: Status of the validation. - type: string - readOnly: true - enum: - - pending - - in-progress - - accepted - - rejected - - archived - x-enumDescriptions: - pending: Waiting to be reviewed or analyzed. - in-progress: Being analyzed by the Rebilly AI. - accepted: Accepted by AI or a human. - rejected: Rejected by AI or a human. - archived: Archived by the Rebilly AI. - rejectionReason: - $ref: '#/components/schemas/KycDocumentRejection' - requestId: - readOnly: true type: - - string + - object - 'null' - description: ID of the KYC request. - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - processedTime: - description: Date and time when the KYC document is processed. - type: string - format: date-time - readOnly: true - documentMatches: - type: object readOnly: true description: Document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/PurchaseMatches' + $ref: '#/components/schemas/FundsMatches' _links: $ref: '#/components/schemas/SelfLink' - StorefrontProofOfCreditFileKycDocument: + StorefrontProofOfPurchaseKycDocument: type: object required: - documentType @@ -72539,7 +74804,7 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72579,12 +74844,16 @@ components: format: date-time readOnly: true documentMatches: - type: object + type: + - object + - 'null' readOnly: true description: Document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/CreditFileMatches' + $ref: '#/components/schemas/PurchaseMatches' _links: $ref: '#/components/schemas/SelfLink' StorefrontKycDocument: @@ -72593,7 +74862,6 @@ components: - $ref: '#/components/schemas/StorefrontProofOfAddressKycDocument' - $ref: '#/components/schemas/StorefrontProofOfFundsKycDocument' - $ref: '#/components/schemas/StorefrontProofOfPurchaseKycDocument' - - $ref: '#/components/schemas/StorefrontProofOfCreditFileKycDocument' discriminator: propertyName: documentType mapping: @@ -72601,7 +74869,6 @@ components: address-proof: '#/components/schemas/StorefrontProofOfAddressKycDocument' funds-proof: '#/components/schemas/StorefrontProofOfFundsKycDocument' purchase-proof: '#/components/schemas/StorefrontProofOfPurchaseKycDocument' - credit-file-proof: '#/components/schemas/StorefrontProofOfCreditFileKycDocument' StorefrontKycRequest: type: object description: KYC request information. @@ -72702,7 +74969,6 @@ components: type: string enum: - self - - documents _embedded: type: object description: Embedded objects that are requested by the `expand` query parameter. @@ -72723,8 +74989,9 @@ components: maxLength: 50 example: kyc_liv_01HXBZ0MS1GPS6S34MPQXYT5TZ customerId: - $ref: '#/components/schemas/CustomerId' readOnly: true + allOf: + - $ref: '#/components/schemas/CustomerId' kycRequestId: type: string description: ID of the KYC request that the liveness session is associated with. @@ -72832,11 +75099,13 @@ components: maximum: 1000000000 quantityFilled: description: Number of filled product units. - type: number + type: + - number + - 'null' format: double example: 5.125 plan: - anyOf: + oneOf: - $ref: '#/components/schemas/OriginalPlan' - $ref: '#/components/schemas/FlexiblePlan' usageLimits: @@ -73081,6 +75350,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -73105,22 +75375,6 @@ components: all plans must have the same billing period, this property enables the customer to subscribe to different plans. $ref: '#/components/schemas/InvoiceTimeShift' - recurringInterval: - deprecated: true - type: - - object - - 'null' - description: |- - Recurring interval to override plan settings. - To use plan settings, set this value to `null`. - - To use multiple plans in one subscription, - all plans must have the same same recurring period length, - this property enables the customer to subscribe to different plans. - example: null - properties: - periodAnchorInstruction: - $ref: '#/components/schemas/ServicePeriodAnchorInstruction' autopay: description: |- Specifies if payment attempts are made automatically. @@ -73486,6 +75740,15 @@ components: description: Number of units of the product on the given plan. type: integer minimum: 0 + quantityFilled: + description: |- + Number of filled product units. + This field is not used for metered billing plans. + type: + - number + - 'null' + format: double + example: 5.125 usageLimits: oneOf: - $ref: '#/components/schemas/UsageLimits' @@ -73534,6 +75797,8 @@ components: description: |- Type of the quote. When a quote is accepted, quote items and settings are applied to the related order. + Change quotes can only be created for orders with `active` or `trial-ended` status. + For `trial-ended` orders, use this quote type to convert a trial-only order to a regular recurring order. type: string enum: - change @@ -73614,16 +75879,38 @@ components: items: $ref: '#/components/schemas/QuoteItem' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + Policy for managing service periods and trial state of the related order when the quote is accepted. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` flag is ignored unless `reset` or `retain` is used. + In responses, the value is `reset` or `retain`. type: string - default: retain + default: retainRecurring enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring` or `retainTrialThenRecurring` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring` or `retainTrialThenRecurring`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period length. type: boolean effectiveTime: @@ -73635,9 +75922,13 @@ components: - 'null' format: date-time keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false interimOnly: @@ -73686,7 +75977,11 @@ components: or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -73955,6 +76250,124 @@ components: type: object invoice: type: object + StorefrontOrderChange: + type: object + description: |- + Change to the items of a recurring order of the customer. + A change with `applyAt` set to `nextRenewal` records the new items and applies them at the next renewal. + The current items remain until the next renewal, when the new items are applied and billed on the renewal invoice. + required: + - id + - orderId + - status + - applyAt + - effectiveTime + - items + - createdTime + - updatedTime + properties: + id: + description: ID of the order change. + type: string + maxLength: 50 + readOnly: true + example: ord_chg_0YV7DES3WPC5J8JD8QTVNZBZQ8 + orderId: + description: ID of the order. + type: string + maxLength: 50 + readOnly: true + example: ord_01HRF27SATGE4Z6PBJE6PD8328 + status: + description: Status of the order change. + type: string + readOnly: true + enum: + - pending + - applied + - canceled + - superseded + x-enumDescriptions: + pending: Scheduled to apply at the next renewal. + applied: Items of the order are replaced. + canceled: Canceled before the change is applied. + superseded: Replaced by a later change for the same order. + applyAt: + description: |- + Time when the new items are applied. + + - `now`: The items change immediately. + - `nextRenewal`: The current items stay until the next renewal. + The new items are billed on the next renewal invoice. + To cancel a pending change, use the `DELETE /storefront/order-changes/{id}` operation. + type: string + readOnly: true + enum: + - now + - nextRenewal + effectiveTime: + description: |- + Date and time when the change is applied. + If `applyAt` is set to `nextRenewal`, this value equals the renewal time of the order. + type: string + format: date-time + readOnly: true + lockedTime: + description: |- + Date and time when the items of a pending change are billed. + After this time, the change is locked and cannot be modified until the renewal. + type: + - string + - 'null' + format: date-time + readOnly: true + appliedTime: + description: Date and time when the items of the order are replaced. + type: + - string + - 'null' + format: date-time + readOnly: true + quoteId: + description: |- + ID of the quote that is used to create the change. + This value is `null` if the change is not created from a quote. + type: + - string + - 'null' + maxLength: 50 + readOnly: true + items: + description: New items for the order. + type: array + minItems: 1 + readOnly: true + items: + type: object + required: + - plan + properties: + plan: + description: Plan details. + oneOf: + - $ref: '#/components/schemas/OriginalPlan' + - $ref: '#/components/schemas/FlexiblePlan' + quantity: + description: Number of units of the product on the given plan. + type: integer + usageLimits: + oneOf: + - $ref: '#/components/schemas/UsageLimits' + - type: 'null' + excludeFromMrr: + description: Specifies if this item is excluded from monthly recurring revenue calculations. + type: + - boolean + - 'null' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' PostSubscriptionReactivation: type: object description: Reactivate customer subscription. @@ -73990,8 +76403,9 @@ components: default: null preview: description: |- - Specifies if the quote must be previewed before it is created. - Subscriptions cannot be reactivated in the preview. + Specifies if a preview of the quote is returned instead of creating the quote. + When a preview is returned, the quote and invoice are not saved, and other quotes for the order are not canceled. + The preview invoice has the `draft` status and no payment form URL. type: boolean default: false example: true @@ -74128,8 +76542,21 @@ components: If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at `paymentInstrumentId`, or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. + includeUnpaidInvoices: + type: boolean + default: false + example: false + readOnly: true + description: |- + Specifies whether the quote invoice includes items from outstanding unpaid and past-due invoices for the related order. + When this value is `true`, the quote invoice includes charges for eligible items from those invoices. + When the quote is accepted, only invoices included in the quote that remain unpaid or past due and can be voided are voided. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -74440,7 +76867,7 @@ components: An `active` status means that a payment instrument has been used at least once for an approved transaction. To remove an instrument from use, set this value to `deactivated`. - For more information, see [Deactivate a payment instrument](https://www.rebilly.com/catalog/all/storefront-payment-instruments/storefrontpostpaymentinstrumentdeactivation). + For more information, see the Deactivate a payment instrument operation. enum: - active - inactive @@ -74502,6 +76929,13 @@ components: description: Bank name of the payment instrument. type: string readOnly: true + isPayoutable: + description: |- + Specifies if payouts are supported for cards with this BIN. + Defaults to `true`. + This value is `false` if the BIN does not support payouts. + type: boolean + readOnly: true billingAddress: description: Contact's billing address. $ref: '#/components/schemas/ContactObject' @@ -74660,65 +77094,6 @@ components: readOnly: true _links: $ref: '#/components/schemas/SelfLink' - StorefrontKhelocardCard: - type: object - title: Khelocard card - properties: - id: - description: ID of the payment instrument. - $ref: '#/components/schemas/ResourceId' - method: - description: Method of payment instrument. - type: string - enum: - - Khelocard - fingerprint: - description: |- - Unique value which identifies the payment instrument. - This value contains alphanumeric characters. - This value is generated from the card number, CVV, and expiration date. - type: string - number: - description: Khelocard card masked number. - type: string - last4: - description: Last 4 digits of the number. - type: string - expYear: - description: Khelocard card expiration year. - type: integer - expMonth: - description: Khelocard card expiration month. - type: integer - billingAddress: - description: Billing address. - $ref: '#/components/schemas/ContactObject' - status: - description: Payment instrument status. - type: string - enum: - - active - - deactivated - useAsBackup: - $ref: '#/components/schemas/UseAsBackup' - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - lastPaymentTime: - $ref: '#/components/schemas/LastPaymentTime' - customFields: - $ref: '#/components/schemas/ResourceCustomFields' - token: - description: |- - New customer JSON Web Token (JWT) that is used for further requests. - This value is null if the customer is already authenticated. - type: - - string - - 'null' - readOnly: true - _links: - $ref: '#/components/schemas/SelfLink' StorefrontAlternativeInstrument: type: object title: Alternative instrument @@ -74737,7 +77112,6 @@ components: - paypal - ach - echeck - - Khelocard billingAddress: description: Billing address of the user that is associated with the payment instrument. $ref: '#/components/schemas/ContactObject' @@ -74788,7 +77162,6 @@ components: - $ref: '#/components/schemas/StorefrontPaymentCard' - $ref: '#/components/schemas/StorefrontBankAccount' - $ref: '#/components/schemas/StorefrontPayPalAccount' - - $ref: '#/components/schemas/StorefrontKhelocardCard' - $ref: '#/components/schemas/StorefrontAlternativeInstrument' StorefrontPayoutRequest: type: object @@ -74819,12 +77192,27 @@ components: readOnly: true enum: - pending + - ready + - approved - in-progress - fulfilled + - canceled + - split + - merged x-enumDescriptions: - pending: Request is awaiting fulfillment. + pending: |- + Request was created by the customer and is in a pending state for the [configured pending period](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/pendingperiodhours), unless it is marked as ready by a member of your organization. + When automatic readiness is enabled, the payout request transitions to the `ready` state after the pending period elapses and the configured [transition time](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinesstime) is reached. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests, or this status may not be used. + ready: |- + Request was created by the customer and is ready for review. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests. + approved: Request was reviewed, approved, and is ready for processing. in-progress: Request has allocations and is being processed. - fulfilled: Request is fully paid out when `availableAmount` reaches zero. + fulfilled: Request is fully paid out. + canceled: Request is canceled by merchant or customer. + split: Request was split into two or more payout requests. + merged: Request was merged into another payout request. createdTime: description: Date and time when the payout request is created. $ref: '#/components/schemas/ServerTimestamp' @@ -74860,6 +77248,22 @@ components: description: ID of the plan. maxLength: 50 example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + type: + description: |- + Variant of the plan. + The variant is `subscription` when `recurringInterval` is present. + The variant is `trial-only` when `trial` is present without `recurringInterval`. + The variant is `one-time-sale` when both fields are omitted. + type: string + readOnly: true + enum: + - subscription + - one-time-sale + - trial-only + x-enumDescriptions: + subscription: Recurring plan. + one-time-sale: Non-recurring, one-time sale plan. + trial-only: Trial plan without recurring interval settings. name: description: |- Name of the plan. @@ -74901,6 +77305,8 @@ components: $ref: '#/components/schemas/PlanPriceFormula' setup: $ref: '#/components/schemas/PlanSetup' + setupFee: + $ref: '#/components/schemas/PlanSetupFee' customFields: $ref: '#/components/schemas/ResourceCustomFields' isActive: @@ -74982,6 +77388,15 @@ components: - 'null' format: float minimum: 0.01 + sticky: + description: |- + When enabled, if no usage is reported during a service period, + the plan bills the last known reported quantity from a previous period instead of zero. + This is suitable for hosted or persistent resources whose usage does not change every period. + Only supported with `strategy`: `last`. + type: boolean + default: false + example: false createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -75105,6 +77520,7 @@ components: type: object required: - planId + - quantity properties: planId: type: string @@ -75114,6 +77530,8 @@ components: quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 billingAddress: description: Billing address details. writeOnly: true @@ -75210,6 +77628,7 @@ components: type: object required: - planId + - quantity properties: planId: type: string @@ -75219,15 +77638,15 @@ components: quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 billingAddress: description: Billing address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' deliveryAddress: description: Delivery address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -75542,9 +77961,12 @@ components: x-basic: true format: date-time isLegacy: - description: Specifies if the order is a legacy order. + description: |- + Specifies if the order is a legacy order. + If omitted when the quote is created, the value follows the order model that is used by the organization: `false` for the current order model and `true` for the legacy order model. + If omitted when the quote is updated, the value does not change. + Organizations that use the current order model cannot set this value to `true`. type: boolean - default: true example: true invoicePreview: type: object @@ -76077,7 +78499,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -76189,11 +78615,20 @@ components: value: type: integer description: Value added to the risk score of the transaction. - anyOf: + oneOf: - required: - start + properties: + end: + not: {} - required: - end + properties: + start: + not: {} + - required: + - start + - end RiskScoreRules: type: object description: Risk score rules. @@ -76486,13 +78921,26 @@ components: - invoice-created - invoice-modified - invoice-past-due-reminder + - invoice-past-due-reminder-15-days + - invoice-past-due-reminder-30-days + - invoice-past-due-reminder-60-days + - invoice-past-due-reminder-90-days - invoice-tax-calculation-failed - offsite-payment-completed - order-abandon-reminder + - order-change-applied + - order-change-canceled + - order-change-created - organization-tax-number-validated - payment-card-created - payment-card-expiration-reminder + - payment-card-expiration-reminder-14-days + - payment-card-expiration-reminder-7-days + - payment-card-expiration-reminder-1-day - payment-instrument-modified + - payout-request-batch-created + - payout-request-batch-deleted + - payout-request-batch-modified - renewal-invoice-payment-canceled - risk-score-changed - subscription-items-changed @@ -76501,6 +78949,9 @@ components: - subscription-pause-modified - subscription-pause-revoked - subscription-renewal-reminder + - subscription-renewal-reminder-30-days + - subscription-renewal-reminder-7-days + - subscription-renewal-reminder-1-day - subscription-trial-converted - subscription-trial-end-changed - subscription-trial-end-reminder @@ -76510,6 +78961,7 @@ components: - transaction-timeout-resolved - waiting-gateway-transaction-completed - data-export-completed + - data-export-failed - hard-usage-limit-reached - soft-usage-limit-reached - subscription-quantity-filled-limit-reached @@ -76565,6 +79017,279 @@ components: type: string enum: - self + PayoutRequestChange: + description: Details specific to the payout request or allocation change that triggered the webhook. + type: object + additionalProperties: false + properties: + previousStatus: + description: Resource status before the change. + type: string + status: + description: Resource status after the change. + type: string + blockReason: + description: Reason for blocking the payout request. + type: string + blockDescription: + description: Additional information about the block. + type: + - string + - 'null' + splitReason: + description: Reason for splitting the payout request. + type: string + splitDescription: + description: Additional information about the split. + type: + - string + - 'null' + canceledBy: + description: Party that canceled the payout request. + type: string + description: + description: Additional information about the cancellation. + type: string + amount: + description: Amount of the change in the resource currency. + type: number + format: double + x-type: Money + remainingAllocationAmount: + description: Payout request amount that remains available for allocation. + type: number + format: double + x-type: Money + totalFulfilled: + description: Total fulfilled amount in the payout request currency. + type: number + format: double + x-type: Money + paymentInstrumentId: + description: ID of the payment instrument. + type: string + maxLength: 50 + allocationId: + description: ID of the payout request allocation. + type: string + maxLength: 50 + transactionId: + description: ID of the transaction, or `null` when no transaction is available. + type: + - string + - 'null' + maxLength: 50 + mergedIntoPayoutRequestId: + description: ID of the payout request that received the merged amount. + type: string + maxLength: 50 + replayTransferId: + description: |- + ID of the transfer that reserves the payout funds. + This value is `null` if no transfer exists. + type: + - string + - 'null' + maxLength: 50 + isAutoAllocation: + description: Specifies whether the allocation is created automatically. + type: boolean + replacedByRemainder: + description: Specifies whether a replacement payout request contains the remaining amount. + type: boolean + PayoutRequestChangedRequest: + title: Payout request change + type: object + additionalProperties: false + required: + - eventType + - changeType + - change + - payoutRequestId + - customerId + - occurredTime + - _embedded + - _links + properties: + eventType: + description: Webhook event type. + type: string + const: payout-request-changed + changeType: + description: Specific payout request change that triggered the webhook. + type: string + enum: + - payout-request-created + - payout-request-modified + - payout-request-blocked + - payout-request-unblocked + - payout-request-ready + - payout-request-returned-to-pending + - payout-request-approved + - payout-request-approval-undone + - payout-request-processing-started + - payout-request-fulfilled + - payout-request-payment-instrument-selected + - payout-request-allocated + - payout-request-split + - payout-request-merged + - payout-request-canceled + change: + $ref: '#/components/schemas/PayoutRequestChange' + payoutRequestId: + description: ID of the payout request. + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + customerId: + description: ID of the customer associated with the payout request. + type: string + maxLength: 50 + example: cus_0YV7DDSDD1C8DA64KHH2W33CPF + occurredTime: + description: Date and time when the change occurred. + type: string + format: date-time + _embedded: + type: object + required: + - payoutRequest + - customer + properties: + payoutRequest: + $ref: '#/components/schemas/PayoutRequest' + customer: + $ref: '#/components/schemas/Customer' + _links: + type: array + items: + type: object + required: + - href + - rel + properties: + href: + description: URL of the related payout request. + type: string + rel: + type: string + const: payoutRequest + PayoutRequestChangedAllocation: + title: Payout request allocation change + type: object + additionalProperties: false + required: + - eventType + - changeType + - change + - allocationId + - payoutRequestId + - customerId + - occurredTime + - _embedded + - _links + properties: + eventType: + description: Webhook event type. + type: string + const: payout-request-changed + changeType: + description: Specific payout request allocation change that triggered the webhook. + type: string + enum: + - payout-request-allocation-created + - payout-request-allocation-queued + - payout-request-allocation-returned-to-pending + - payout-request-allocation-processing-started + - payout-request-allocation-waiting-completion + - payout-request-allocation-completed + - payout-request-allocation-declined + - payout-request-allocation-failed + - payout-request-allocation-canceled + change: + $ref: '#/components/schemas/PayoutRequestChange' + allocationId: + description: ID of the changed payout request allocation. + type: string + maxLength: 50 + example: pra_0YVDMDE2BMC6KBB5MX76RF6T80 + payoutRequestId: + description: ID of the payout request. + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + customerId: + description: ID of the customer associated with the payout request. + type: string + maxLength: 50 + example: cus_0YV7DDSDD1C8DA64KHH2W33CPF + occurredTime: + description: Date and time when the change occurred. + type: string + format: date-time + _embedded: + type: object + required: + - allocation + - payoutRequest + - customer + properties: + allocation: + $ref: '#/components/schemas/PayoutRequestAllocation' + payoutRequest: + $ref: '#/components/schemas/PayoutRequest' + customer: + $ref: '#/components/schemas/Customer' + _links: + type: array + items: + type: object + required: + - href + - rel + properties: + href: + description: URL of the related resource. + type: string + rel: + description: Type of related resource. + type: string + enum: + - allocation + - payoutRequest + PayoutRequestChangedWebhookPayload: + type: object + description: Payout request or payout request allocation change details. + discriminator: + propertyName: changeType + mapping: + payout-request-created: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-modified: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-blocked: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-unblocked: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-ready: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-returned-to-pending: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-approved: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-approval-undone: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-processing-started: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-fulfilled: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-payment-instrument-selected: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-allocated: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-split: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-merged: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-canceled: '#/components/schemas/PayoutRequestChangedRequest' + payout-request-allocation-created: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-queued: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-returned-to-pending: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-processing-started: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-waiting-completion: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-completed: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-declined: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-failed: '#/components/schemas/PayoutRequestChangedAllocation' + payout-request-allocation-canceled: '#/components/schemas/PayoutRequestChangedAllocation' + oneOf: + - $ref: '#/components/schemas/PayoutRequestChangedRequest' + - $ref: '#/components/schemas/PayoutRequestChangedAllocation' CheckoutFormId: type: string description: ID of the checkout form. @@ -76586,12 +79311,12 @@ components: application/json: schema: $ref: '#/components/schemas/Forbidden' - Conflict: - description: Conflict. + NotFound: + description: Resource not found. content: application/json: schema: - $ref: '#/components/schemas/Conflict' + $ref: '#/components/schemas/NotFound' ValidationError: description: Invalid data sent. content: @@ -76601,18 +79326,32 @@ components: TooManyRequests: description: Request rate limit exceeded. headers: - X-RateLimit-Retry-After: - $ref: '#/components/headers/X-RateLimit-Retry-After' + Rate-Limit-Limit: + $ref: '#/components/headers/Rate-Limit-Limit' + Rate-Limit-Remaining: + description: |- + Number of requests still available for this rate limit. + For more information, see [Rate limits](#section/Rate-limits). + schema: + type: integer + example: 0 + Rate-Limit-Retry-After: + $ref: '#/components/headers/Rate-Limit-Retry-After' + Retry-After: + description: Number of seconds to wait before retrying the request. + schema: + type: integer + example: 1 content: application/json: schema: $ref: '#/components/schemas/TooManyRequests' - NotFound: - description: Resource not found. + Conflict: + description: Conflict. content: application/json: schema: - $ref: '#/components/schemas/NotFound' + $ref: '#/components/schemas/Conflict' Customer: description: Customer. content: @@ -76633,18 +79372,19 @@ components: application/json: schema: $ref: '#/components/schemas/BadRequest' + DataExportValidationError: + description: Invalid data sent, or the export exceeds the maximum record limit. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/DataExportLimitExceeded' NoContent: description: |- Request accepted. No response body returned. requestBodies: - AccountRegistrationSettings: - content: - application/json: - schema: - $ref: '#/components/schemas/AccountRegistrationSettings' - description: Account registration settings resource. - required: true Attachment: content: application/json: @@ -77043,6 +79783,8 @@ components: customerId: readOnly: true - $ref: '#/components/schemas/KycRequest' + description: KYC request resource. + required: true PostPaymentInstrument: content: application/json: @@ -77106,7 +79848,7 @@ components: Tag names are not case-sensitive. type: string maxLength: 255 - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ example: New description: Tag resource. required: true @@ -77404,8 +80146,9 @@ components: ID of the payout request for which the transaction is fully allocated. > **Note:** Use the payout request allocation flow instead of this field. - Create an allocation with `POST /payout-request-allocations`, - then initiate processing with `POST /payout-request-allocations/process`. + Create an allocation with `POST /payout-request-allocations`. + To process a selected set, send `POST /payout-request-allocation-operations` with `type` set to `process`. + To process a batch, send `POST /payout-request-batch-operations` with `type` set to `process`. writeOnly: true type: string maxLength: 50 @@ -77418,14 +80161,60 @@ components: $ref: '#/components/schemas/ApiKey' description: ApiKey resource. required: true + PostCredential: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/PostSmtpCredential' + - $ref: '#/components/schemas/PostWebhookCredential' + - $ref: '#/components/schemas/PostExperianCredential' + - $ref: '#/components/schemas/PostMailgunCredential' + - $ref: '#/components/schemas/PostOAuth2Credential' + - $ref: '#/components/schemas/PostPostmarkCredential' + - $ref: '#/components/schemas/PostSendGridCredential' + - $ref: '#/components/schemas/PostAwsSesCredential' + - $ref: '#/components/schemas/PostTaxJarCredential' + - $ref: '#/components/schemas/PostAvalaraCredential' + - $ref: '#/components/schemas/PostPlaidCredential' + discriminator: + propertyName: type + mapping: + smtp: '#/components/schemas/PostSmtpCredential' + webhook: '#/components/schemas/PostWebhookCredential' + experian: '#/components/schemas/PostExperianCredential' + mailgun: '#/components/schemas/PostMailgunCredential' + oauth2: '#/components/schemas/PostOAuth2Credential' + postmark: '#/components/schemas/PostPostmarkCredential' + sendgrid: '#/components/schemas/PostSendGridCredential' + aws-ses: '#/components/schemas/PostAwsSesCredential' + taxjar: '#/components/schemas/PostTaxJarCredential' + avalara: '#/components/schemas/PostAvalaraCredential' + plaid: '#/components/schemas/PostPlaidCredential' + description: Service credential resource. + required: true PatchCredential: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/PatchServiceCredential' - $ref: '#/components/schemas/PatchPlaidCredential' - $ref: '#/components/schemas/PatchTaxJarCredential' + discriminator: + propertyName: type + mapping: + smtp: '#/components/schemas/PatchServiceCredential' + webhook: '#/components/schemas/PatchServiceCredential' + mailgun: '#/components/schemas/PatchServiceCredential' + sendgrid: '#/components/schemas/PatchServiceCredential' + aws-ses: '#/components/schemas/PatchServiceCredential' + oauth2: '#/components/schemas/PatchServiceCredential' + postmark: '#/components/schemas/PatchServiceCredential' + experian: '#/components/schemas/PatchServiceCredential' + avalara: '#/components/schemas/PatchServiceCredential' + plaid: '#/components/schemas/PatchPlaidCredential' + taxjar: '#/components/schemas/PatchTaxJarCredential' description: Service credential resource. required: true RuleSet: @@ -77521,6 +80310,7 @@ components: type: - string - 'null' + minLength: 1 maxLength: 255 description: description: Description of the payout request. @@ -77534,10 +80324,12 @@ components: `pending`, `ready`, `approved`, or `in-progress`. When a payout request is blocked, it cannot: - - Move to the next status in the workflow. - For example: `pending` → `ready` → `approved` → `in-progress`. + - Transition to `ready`, `approved`, `in-progress`, `merged`, `split`, or `canceled`. - Have allocations created. - - Have allocations processed. + - Start allocation processing. + - Cancel pending allocations. + + A blocked payout request can still transition to the `fulfilled` status if allocation processing starts before the payout request is blocked. type: boolean example: false blockReason: @@ -77671,18 +80463,19 @@ components: - string - 'null' description: ID of the payment token. - properties: - description: Properties completed by the user in the deposit form. - type: object - additionalProperties: - type: string - example: - email: email@example.com - max: '33' riskMetadata: $ref: '#/components/schemas/RiskMetadata' redirectUrl: $ref: '#/components/schemas/StorefrontTransactionRedirectUrl' + promotionId: + type: string + description: |- + ID of the Replay promotion to apply to this deposit. + The customer must have an active opt-in for the promotion. + If the customer does not have an active opt-in, the deposit completes without the promotion. + minLength: 1 + maxLength: 50 + example: prom_01KS2T05CHEN49NANT1CRVWGF8 required: true PatchInvoice: content: @@ -77769,7 +80562,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -77872,7 +80669,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -77885,7 +80682,7 @@ components: To resume a subscription from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the subscription is indefinitely paused. type: - string @@ -78057,6 +80854,30 @@ components: type: number format: double required: true + PostPayoutRequestCancellation: + content: + application/json: + schema: + type: object + required: + - cashierId + properties: + cashierId: + type: string + description: ID of the cashier resource with pending payout requests to cancel. + maxLength: 50 + example: cashier_0YV7DE4Z26DQSA1AC92FBJ7SEG + amount: + description: |- + Pending payout request amount to be canceled. + To cancel all pending payout requests, omit this field or set it to `null`. + type: + - number + - 'null' + format: double + exclusiveMinimum: 0 + example: 1500 + required: true PostRegister: content: application/json: @@ -78634,10 +81455,10 @@ components: usageAmount: type: number format: double - description: Reported usage amount. + description: Billed usage amount. currency: type: string - description: Currency of the reported usage amount. + description: Currency of the billed usage amount. eventType: type: string description: Type of event that triggered the webhook. @@ -78802,6 +81623,7 @@ components: - transaction-discrepancy-found - transaction-process-requested - transaction-processed + - transaction-reconciled - transaction-timeout-resolved - waiting-gateway-transaction-completed - autodeposit-lookup-performed @@ -78874,6 +81696,43 @@ components: enum: - invoice description: Payload of invoice-related webhook event. + InvoicePastDueReminderWebhook: + content: + application/json: + schema: + properties: + invoiceId: + description: ID of the invoice. + type: string + eventType: + description: Type of event that triggered the webhook. + type: string + enum: + - invoice-past-due-reminder-15-days + - invoice-past-due-reminder-30-days + - invoice-past-due-reminder-60-days + - invoice-past-due-reminder-90-days + _embedded: + type: object + description: Embedded objects related to the invoice event. + properties: + invoice: + $ref: '#/components/schemas/Invoice' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - invoice + description: Payload of the invoice past due reminder webhook event. KycDocumentWebhook: content: application/json: @@ -79141,6 +82000,42 @@ components: enum: - paymentCard description: Payload of payment card-related webhook event. + PaymentCardExpirationReminderWebhook: + content: + application/json: + schema: + properties: + paymentCardId: + description: ID of the payment card. + type: string + eventType: + description: Type of event that triggered the webhook. + type: string + enum: + - payment-card-expiration-reminder-14-days + - payment-card-expiration-reminder-7-days + - payment-card-expiration-reminder-1-day + _embedded: + type: object + description: Embedded objects related to the payment card event. + properties: + paymentCard: + $ref: '#/components/schemas/PaymentCard' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - paymentCard + description: Payload of the payment card expiration reminder webhook event. PaymentInstrumentWebhook: content: application/json: @@ -79178,6 +82073,84 @@ components: enum: - paymentInstrument description: Payload of payment instrument-related webhook event. + PayoutRequestBatchWebhook: + content: + application/json: + schema: + type: object + required: + - batchId + - eventType + - occurredTime + - _embedded + - _links + properties: + batchId: + description: ID of the batch of payout requests. + type: string + maxLength: 50 + example: preq_batch_0YVDMDE2BMC6KBB5MX76RF6T80 + eventType: + description: Type of event that triggered the webhook. + type: string + enum: + - payout-request-batch-created + - payout-request-batch-modified + occurredTime: + description: Date and time when the batch change occurred. + type: string + format: date-time + _embedded: + type: object + description: Embedded objects related to the batch event for payout requests. + required: + - payoutRequestBatch + properties: + payoutRequestBatch: + $ref: '#/components/schemas/PayoutRequestBatch' + _links: + type: array + description: Links to related resources. + items: + type: object + required: + - href + - rel + properties: + href: + description: URL of the link. + type: string + rel: + description: Type of relationship for the link. + type: string + enum: + - payoutRequestBatch + description: Payload of a webhook event for a batch of payout requests. + PayoutRequestBatchDeletedWebhook: + content: + application/json: + schema: + type: object + required: + - batchId + - eventType + - occurredTime + properties: + batchId: + description: ID of the deleted batch of payout requests. + type: string + maxLength: 50 + example: preq_batch_0YVDMDE2BMC6KBB5MX76RF6T80 + eventType: + description: Type of event that triggered the webhook. + type: string + enum: + - payout-request-batch-deleted + occurredTime: + description: Date and time of the batch deletion. + type: string + format: date-time + description: Payload of a webhook event for a deleted batch of payout requests. PayoutRequestWebhook: content: application/json: @@ -79215,6 +82188,12 @@ components: enum: - payoutRequest description: Payload of payout request-related webhook event. + PayoutRequestChangedWebhook: + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestChangedWebhookPayload' + description: Payload of a webhook event for a payout request or payout request allocation change. QuoteWebhook: content: application/json: @@ -79472,6 +82451,47 @@ components: enum: - subscription description: Payload of subscription quantity limit-related webhook event. + SubscriptionRenewalReminder: + content: + application/json: + schema: + properties: + subscriptionId: + type: string + description: ID of the order. + example: sub_01HRF27SATGE4Z6PBJE6PD8328 + renewalTime: + type: string + format: date-time + description: Date and time when the subscription renews. + eventType: + description: Type of event that triggered the webhook. + type: string + enum: + - subscription-renewal-reminder-30-days + - subscription-renewal-reminder-7-days + - subscription-renewal-reminder-1-day + _embedded: + type: object + description: Embedded objects related to the order event. + properties: + subscription: + $ref: '#/components/schemas/SubscriptionOrOneTimeSale' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - subscription + description: Payload of the subscription renewal reminder webhook event. SubscriptionAndSubscriptionPause: content: application/json: @@ -79518,6 +82538,88 @@ components: - subscription - pause description: Payload of subscription pause-related webhook event. + OrderAndOrderChange: + content: + application/json: + schema: + properties: + orderId: + type: string + description: ID of the order. + example: ord_01HRF27SATGE4Z6PBJE6PD8328 + orderChangeId: + type: string + description: ID of the order change. + example: ord_chg_0YV7DES3WPC5J8JD8QTVNZBZQ8 + eventType: + type: string + description: Type of event that triggered the webhook. + enum: + - order-change-created + - order-change-canceled + - order-change-applied + _embedded: + type: object + description: Embedded objects related to the order change event. + properties: + order: + $ref: '#/components/schemas/Order' + orderChange: + $ref: '#/components/schemas/OrderChange' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - order + - orderChange + description: Payload of a webhook event related to an order change. + TransactionWithChildWebhook: + content: + application/json: + schema: + properties: + transactionId: + $ref: '#/components/schemas/TransactionId' + eventType: + type: string + description: Type of event that triggered the webhook. + enum: + - transaction-partially-refunded + - transaction-refunded + - transaction-voided + _embedded: + type: object + description: Embedded objects related to the transaction event. + properties: + transaction: + $ref: '#/components/schemas/Transaction' + childTransaction: + $ref: '#/components/schemas/Transaction' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - transaction + - childTransaction + description: Payload of transaction-related webhook event. DataExportWebhook: content: application/json: @@ -79529,15 +82631,37 @@ components: maxLength: 50 example: exp_0YVCNQ2C1AD1RA3HXKP492GNZB fileId: - type: string - description: ID of the data export file. + type: + - string + - 'null' + description: |- + ID of the data export file. + This value is `null` if the export failed. maxLength: 50 example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + recordCount: + type: integer + description: |- + Total number of records in the export, excluding the header row. + This value is `0` if the export failed. + example: 1500 + status: + type: string + description: |- + Status of the data export. + This webhook is sent only when the data export reaches a terminal status. + This value is never `pending`, `queued`, or `processing`. + enum: + - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' eventType: type: string description: Type of event that triggered the webhook. enum: - data-export-completed + - data-export-failed _embedded: type: object description: Embedded objects related to the data export event. diff --git a/src/Api/AccountRegistrationSettingsApi.php b/src/Api/AccountRegistrationSettingsApi.php deleted file mode 100644 index 151500e60..000000000 --- a/src/Api/AccountRegistrationSettingsApi.php +++ /dev/null @@ -1,141 +0,0 @@ - 'application/json', - ], body: Utils::jsonEncode($accountRegistrationSettings)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return AccountRegistrationSettings::from($data, ['headers' => $response->getHeaders()]); - } - - public function delete( - string $id, - ): void { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/account-registration-settings/{id}'); - - $request = new Request('DELETE', $uri); - $this->client->send($request); - } - - public function get( - string $id, - ): AccountRegistrationSettings { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/account-registration-settings/{id}'); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return AccountRegistrationSettings::from($data, ['headers' => $response->getHeaders()]); - } - - /** - * @return Collection - */ - public function getAll( - ?int $limit = null, - ?int $offset = null, - ): Collection { - $queryParams = [ - 'limit' => $limit, - 'offset' => $offset, - ]; - $uri = '/account-registration-settings?' . http_build_query($queryParams); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return new Collection( - array_map(fn (array $item): AccountRegistrationSettings => AccountRegistrationSettings::from($item, ['headers' => $response->getHeaders()]), $data), - (int) $response->getHeaderLine(Collection::HEADER_LIMIT), - (int) $response->getHeaderLine(Collection::HEADER_OFFSET), - (int) $response->getHeaderLine(Collection::HEADER_TOTAL), - [ - 'headers' => $response->getHeaders(), - ] - ); - } - - /** - * @return Paginator - */ - public function getAllPaginator( - ?int $limit = null, - ?int $offset = null, - ): Paginator { - $closure = fn (?int $limit, ?int $offset): Collection => $this->getAll( - limit: $limit, - offset: $offset, - ); - - return new Paginator( - $limit !== null || $offset !== null ? $closure(limit: $limit, offset: $offset) : null, - $closure, - ); - } - - public function update( - string $id, - AccountRegistrationSettings $accountRegistrationSettings, - ): AccountRegistrationSettings { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/account-registration-settings/{id}'); - - $request = new Request('PUT', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($accountRegistrationSettings)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return AccountRegistrationSettings::from($data, ['headers' => $response->getHeaders()]); - } -} diff --git a/src/Api/CustomersApi.php b/src/Api/CustomersApi.php index 24c3f5df8..5ec40bca2 100644 --- a/src/Api/CustomersApi.php +++ b/src/Api/CustomersApi.php @@ -18,6 +18,7 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; +use Rebilly\Sdk\Model\Attachment; use Rebilly\Sdk\Model\Customer; use Rebilly\Sdk\Model\CustomerCreditBalance; use Rebilly\Sdk\Model\CustomerInformation; @@ -111,6 +112,24 @@ public function deleteTimelineMessage( $this->client->send($request); } + public function generateComplianceScreeningReport( + string $id, + ): Attachment { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/customers/{id}/compliance-screening-report'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return Attachment::from($data, ['headers' => $response->getHeaders()]); + } + public function get( string $id, ?string $expand = null, diff --git a/src/Api/DigitalWalletsApi.php b/src/Api/DigitalWalletsApi.php index 20b35ebee..b5cdcd370 100644 --- a/src/Api/DigitalWalletsApi.php +++ b/src/Api/DigitalWalletsApi.php @@ -18,6 +18,7 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Model\DigitalWalletOnboardingApplePay; +use Rebilly\Sdk\Model\DigitalWalletOnboardingApplePayDomains; use Rebilly\Sdk\Model\DigitalWalletValidation; class DigitalWalletsApi @@ -40,6 +41,32 @@ public function create( return DigitalWalletOnboardingApplePay::from($data, ['headers' => $response->getHeaders()]); } + public function deleteApplePayDomain( + string $domain, + ): void { + $pathParams = [ + '{domain}' => $domain, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/digital-wallets/onboarding/apple-pay/{domain}'); + + $request = new Request('DELETE', $uri); + $this->client->send($request); + } + + public function getApplePayDomains(): DigitalWalletOnboardingApplePayDomains + { + $uri = '/digital-wallets/onboarding/apple-pay'; + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return DigitalWalletOnboardingApplePayDomains::from($data, ['headers' => $response->getHeaders()]); + } + public function validate( DigitalWalletValidation $digitalWalletValidation, ): DigitalWalletValidation { diff --git a/src/Api/MembershipsApi.php b/src/Api/MembershipsApi.php index d9a4c6ffe..82899d06d 100644 --- a/src/Api/MembershipsApi.php +++ b/src/Api/MembershipsApi.php @@ -16,10 +16,6 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Psr7\Request; -use GuzzleHttp\Utils; -use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\Membership; -use Rebilly\Sdk\Paginator; class MembershipsApi { @@ -27,7 +23,7 @@ public function __construct(protected ?ClientInterface $client) { } - public function delete( + public function deleteUserMembership( string $organizationId, string $userId, ): void { @@ -41,101 +37,4 @@ public function delete( $request = new Request('DELETE', $uri); $this->client->send($request); } - - public function get( - string $organizationId, - string $userId, - ): Membership { - $pathParams = [ - '{organizationId}' => $organizationId, - '{userId}' => $userId, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/memberships/{organizationId}/{userId}'); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return Membership::from($data, ['headers' => $response->getHeaders()]); - } - - /** - * @return Collection - */ - public function getAll( - ?int $limit = null, - ?int $offset = null, - ?string $filter = null, - ?array $sort = null, - ): Collection { - $queryParams = [ - 'limit' => $limit, - 'offset' => $offset, - 'filter' => $filter, - 'sort' => $sort ? implode(',', $sort) : null, - ]; - $uri = '/memberships?' . http_build_query($queryParams); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return new Collection( - array_map(fn (array $item): Membership => Membership::from($item, ['headers' => $response->getHeaders()]), $data), - (int) $response->getHeaderLine(Collection::HEADER_LIMIT), - (int) $response->getHeaderLine(Collection::HEADER_OFFSET), - (int) $response->getHeaderLine(Collection::HEADER_TOTAL), - [ - 'headers' => $response->getHeaders(), - ] - ); - } - - /** - * @return Paginator - */ - public function getAllPaginator( - ?int $limit = null, - ?int $offset = null, - ?string $filter = null, - ?array $sort = null, - ): Paginator { - $closure = fn (?int $limit, ?int $offset): Collection => $this->getAll( - limit: $limit, - offset: $offset, - filter: $filter, - sort: $sort, - ); - - return new Paginator( - $limit !== null || $offset !== null ? $closure(limit: $limit, offset: $offset) : null, - $closure, - ); - } - - public function update( - string $organizationId, - string $userId, - Membership $membership, - ): Membership { - $pathParams = [ - '{organizationId}' => $organizationId, - '{userId}' => $userId, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/memberships/{organizationId}/{userId}'); - - $request = new Request('PUT', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($membership)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return Membership::from($data, ['headers' => $response->getHeaders()]); - } } diff --git a/src/Api/DepositCustomPropertySetsApi.php b/src/Api/OrderChangesApi.php similarity index 72% rename from src/Api/DepositCustomPropertySetsApi.php rename to src/Api/OrderChangesApi.php index 49d0219a6..7afb9436b 100644 --- a/src/Api/DepositCustomPropertySetsApi.php +++ b/src/Api/OrderChangesApi.php @@ -18,27 +18,27 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\DepositCustomPropertySet; +use Rebilly\Sdk\Model\OrderChange; use Rebilly\Sdk\Paginator; -class DepositCustomPropertySetsApi +class OrderChangesApi { public function __construct(protected ?ClientInterface $client) { } public function create( - DepositCustomPropertySet $depositCustomPropertySet, - ): DepositCustomPropertySet { - $uri = '/deposit-custom-property-sets'; + OrderChange $orderChange, + ): OrderChange { + $uri = '/order-changes'; $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($depositCustomPropertySet)); + ], body: Utils::jsonEncode($orderChange)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); - return DepositCustomPropertySet::from($data, ['headers' => $response->getHeaders()]); + return OrderChange::from($data, ['headers' => $response->getHeaders()]); } public function delete( @@ -48,7 +48,7 @@ public function delete( '{id}' => $id, ]; - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/deposit-custom-property-sets/{id}'); + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/order-changes/{id}'); $request = new Request('DELETE', $uri); $this->client->send($request); @@ -56,12 +56,12 @@ public function delete( public function get( string $id, - ): DepositCustomPropertySet { + ): OrderChange { $pathParams = [ '{id}' => $id, ]; - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/deposit-custom-property-sets/{id}'); + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/order-changes/{id}'); $request = new Request('GET', $uri, headers: [ 'Accept' => 'application/json', @@ -69,11 +69,11 @@ public function get( $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); - return DepositCustomPropertySet::from($data, ['headers' => $response->getHeaders()]); + return OrderChange::from($data, ['headers' => $response->getHeaders()]); } /** - * @return Collection + * @return Collection */ public function getAll( ?int $limit = null, @@ -87,7 +87,7 @@ public function getAll( 'filter' => $filter, 'sort' => $sort ? implode(',', $sort) : null, ]; - $uri = '/deposit-custom-property-sets?' . http_build_query($queryParams); + $uri = '/order-changes?' . http_build_query($queryParams); $request = new Request('GET', $uri, headers: [ 'Accept' => 'application/json', @@ -96,7 +96,7 @@ public function getAll( $data = Utils::jsonDecode((string) $response->getBody(), true); return new Collection( - array_map(fn (array $item): DepositCustomPropertySet => DepositCustomPropertySet::from($item, ['headers' => $response->getHeaders()]), $data), + array_map(fn (array $item): OrderChange => OrderChange::from($item, ['headers' => $response->getHeaders()]), $data), (int) $response->getHeaderLine(Collection::HEADER_LIMIT), (int) $response->getHeaderLine(Collection::HEADER_OFFSET), (int) $response->getHeaderLine(Collection::HEADER_TOTAL), @@ -107,7 +107,7 @@ public function getAll( } /** - * @return Paginator + * @return Paginator */ public function getAllPaginator( ?int $limit = null, @@ -130,20 +130,20 @@ public function getAllPaginator( public function update( string $id, - DepositCustomPropertySet $depositCustomPropertySet, - ): DepositCustomPropertySet { + OrderChange $orderChange, + ): OrderChange { $pathParams = [ '{id}' => $id, ]; - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/deposit-custom-property-sets/{id}'); + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/order-changes/{id}'); $request = new Request('PUT', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($depositCustomPropertySet)); + ], body: Utils::jsonEncode($orderChange)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); - return DepositCustomPropertySet::from($data, ['headers' => $response->getHeaders()]); + return OrderChange::from($data, ['headers' => $response->getHeaders()]); } } diff --git a/src/Api/OrdersApi.php b/src/Api/OrdersApi.php index 8c53f2e2e..d96ae688d 100644 --- a/src/Api/OrdersApi.php +++ b/src/Api/OrdersApi.php @@ -21,8 +21,8 @@ use Rebilly\Sdk\Model\Invoice; use Rebilly\Sdk\Model\InvoiceIssue; use Rebilly\Sdk\Model\Order; -use Rebilly\Sdk\Model\OrderChange; use Rebilly\Sdk\Model\OrderFactory; +use Rebilly\Sdk\Model\OrderItemsChange; use Rebilly\Sdk\Model\OrderItemUpdate; use Rebilly\Sdk\Model\OrderUpcomingInvoice; use Rebilly\Sdk\Model\SubscriptionInvoice; @@ -38,7 +38,7 @@ public function __construct(protected ?ClientInterface $client) public function changeItems( string $id, - OrderChange $orderChange, + OrderItemsChange $orderItemsChange, ?string $expand = null, ): Order { $pathParams = [ @@ -52,7 +52,7 @@ public function changeItems( $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($orderChange)); + ], body: Utils::jsonEncode($orderItemsChange)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); diff --git a/src/Api/PayoutRequestAllocationOperationsApi.php b/src/Api/PayoutRequestAllocationOperationsApi.php new file mode 100644 index 000000000..9f5898dfe --- /dev/null +++ b/src/Api/PayoutRequestAllocationOperationsApi.php @@ -0,0 +1,42 @@ + 'application/json', + ], body: Utils::jsonEncode($payoutRequestAllocationOperationRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestAllocationOperation::from($data, ['headers' => $response->getHeaders()]); + } +} diff --git a/src/Api/PayoutRequestAllocationsApi.php b/src/Api/PayoutRequestAllocationsApi.php index df8de05c0..88828a065 100644 --- a/src/Api/PayoutRequestAllocationsApi.php +++ b/src/Api/PayoutRequestAllocationsApi.php @@ -18,12 +18,9 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\GetPayoutRequestAllocationCollectionResponse; use Rebilly\Sdk\Model\PatchPayoutRequestAllocationRequest; use Rebilly\Sdk\Model\PayoutRequestAllocation; use Rebilly\Sdk\Model\PostPayoutRequestAllocationRequest; -use Rebilly\Sdk\Model\PostPayoutRequestAllocationsProcessRequest; -use Rebilly\Sdk\Model\PostPayoutRequestAutoAllocationRequest; use Rebilly\Sdk\Paginator; class PayoutRequestAllocationsApi @@ -32,15 +29,6 @@ public function __construct(protected ?ClientInterface $client) { } - public function autoAllocate( - PostPayoutRequestAutoAllocationRequest $postPayoutRequestAutoAllocationRequest, - ): void { - $uri = '/payout-request-allocations/auto'; - - $request = new Request('POST', $uri, body: Utils::jsonEncode($postPayoutRequestAutoAllocationRequest)); - $this->client->send($request); - } - public function create( PostPayoutRequestAllocationRequest $postPayoutRequestAllocationRequest, ): PayoutRequestAllocation { @@ -74,7 +62,7 @@ public function get( } /** - * @return Collection + * @return Collection */ public function getAll( ?int $limit = null, @@ -97,7 +85,7 @@ public function getAll( $data = Utils::jsonDecode((string) $response->getBody(), true); return new Collection( - array_map(fn (array $item): GetPayoutRequestAllocationCollectionResponse => GetPayoutRequestAllocationCollectionResponse::from($item, ['headers' => $response->getHeaders()]), $data), + array_map(fn (array $item): PayoutRequestAllocation => PayoutRequestAllocation::from($item, ['headers' => $response->getHeaders()]), $data), (int) $response->getHeaderLine(Collection::HEADER_LIMIT), (int) $response->getHeaderLine(Collection::HEADER_OFFSET), (int) $response->getHeaderLine(Collection::HEADER_TOTAL), @@ -108,7 +96,7 @@ public function getAll( } /** - * @return Paginator + * @return Paginator */ public function getAllPaginator( ?int $limit = null, @@ -129,15 +117,6 @@ public function getAllPaginator( ); } - public function process( - PostPayoutRequestAllocationsProcessRequest $postPayoutRequestAllocationsProcessRequest, - ): void { - $uri = '/payout-request-allocations/process'; - - $request = new Request('POST', $uri, body: Utils::jsonEncode($postPayoutRequestAllocationsProcessRequest)); - $this->client->send($request); - } - public function update( string $id, PatchPayoutRequestAllocationRequest $patchPayoutRequestAllocationRequest, diff --git a/src/Api/PayoutRequestAutoAllocationsApi.php b/src/Api/PayoutRequestAutoAllocationsApi.php new file mode 100644 index 000000000..c8cd36410 --- /dev/null +++ b/src/Api/PayoutRequestAutoAllocationsApi.php @@ -0,0 +1,45 @@ + 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestAutoAllocationsRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return array_map(fn (array $item): PayoutRequestAllocation => PayoutRequestAllocation::from($item, ['headers' => $response->getHeaders()]), $data); + } +} diff --git a/src/Api/PayoutRequestBatchOperationsApi.php b/src/Api/PayoutRequestBatchOperationsApi.php new file mode 100644 index 000000000..923caf3af --- /dev/null +++ b/src/Api/PayoutRequestBatchOperationsApi.php @@ -0,0 +1,42 @@ + 'application/json', + ], body: Utils::jsonEncode($payoutRequestBatchOperationRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestBatchOperation::from($data, ['headers' => $response->getHeaders()]); + } +} diff --git a/src/Api/PayoutRequestBatchPreviewsApi.php b/src/Api/PayoutRequestBatchPreviewsApi.php new file mode 100644 index 000000000..bcc2175c7 --- /dev/null +++ b/src/Api/PayoutRequestBatchPreviewsApi.php @@ -0,0 +1,42 @@ + 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestBatchPreviewRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PostPayoutRequestBatchPreviewResponse::from($data, ['headers' => $response->getHeaders()]); + } +} diff --git a/src/Api/PayoutRequestBatchesApi.php b/src/Api/PayoutRequestBatchesApi.php index bf4b19afe..76343d691 100644 --- a/src/Api/PayoutRequestBatchesApi.php +++ b/src/Api/PayoutRequestBatchesApi.php @@ -18,10 +18,8 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\GetPayoutRequestBatchPreviewResponse; use Rebilly\Sdk\Model\PatchPayoutRequestBatchRequest; use Rebilly\Sdk\Model\PayoutRequestBatch; -use Rebilly\Sdk\Model\PostPayoutRequestBatchBlockRequest; use Rebilly\Sdk\Model\PostPayoutRequestBatchRequest; use Rebilly\Sdk\Paginator; @@ -31,73 +29,31 @@ public function __construct(protected ?ClientInterface $client) { } - public function approve( - string $id, - ): PayoutRequestBatch { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/approve'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); - } - - public function autoAllocate( - string $id, + public function create( + PostPayoutRequestBatchRequest $postPayoutRequestBatchRequest, ): PayoutRequestBatch { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/auto-allocate'); + $uri = '/payout-request-batches'; $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ]); + ], body: Utils::jsonEncode($postPayoutRequestBatchRequest)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); } - public function block( + public function delete( string $id, - PostPayoutRequestBatchBlockRequest $postPayoutRequestBatchBlockRequest, - ): PayoutRequestBatch { + ): void { $pathParams = [ '{id}' => $id, ]; - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/block'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($postPayoutRequestBatchBlockRequest)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); - } - - public function create( - PostPayoutRequestBatchRequest $postPayoutRequestBatchRequest, - ): PayoutRequestBatch { - $uri = '/payout-request-batches'; - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($postPayoutRequestBatchRequest)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}'); - return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); + $request = new Request('DELETE', $uri); + $this->client->send($request); } public function get( @@ -124,12 +80,14 @@ public function get( public function getAll( ?int $limit = null, ?int $offset = null, + ?string $q = null, ?string $filter = null, ?array $sort = null, ): Collection { $queryParams = [ 'limit' => $limit, 'offset' => $offset, + 'q' => $q, 'filter' => $filter, 'sort' => $sort ? implode(',', $sort) : null, ]; @@ -158,12 +116,14 @@ public function getAll( public function getAllPaginator( ?int $limit = null, ?int $offset = null, + ?string $q = null, ?string $filter = null, ?array $sort = null, ): Paginator { $closure = fn (?int $limit, ?int $offset): Collection => $this->getAll( limit: $limit, offset: $offset, + q: $q, filter: $filter, sort: $sort, ); @@ -192,21 +152,4 @@ public function patch( return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); } - - public function preview( - ?string $filter = null, - ): GetPayoutRequestBatchPreviewResponse { - $queryParams = [ - 'filter' => $filter, - ]; - $uri = '/payout-request-batches/preview?' . http_build_query($queryParams); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return GetPayoutRequestBatchPreviewResponse::from($data, ['headers' => $response->getHeaders()]); - } } diff --git a/src/Api/PayoutRequestSplitsApi.php b/src/Api/PayoutRequestSplitsApi.php new file mode 100644 index 000000000..3208eeab4 --- /dev/null +++ b/src/Api/PayoutRequestSplitsApi.php @@ -0,0 +1,45 @@ + 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestSplitRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return array_map(fn (array $item): PayoutRequest => PayoutRequest::from($item, ['headers' => $response->getHeaders()]), $data); + } +} diff --git a/src/Api/PayoutRequestsApi.php b/src/Api/PayoutRequestsApi.php index 8a9370168..18aa8c150 100644 --- a/src/Api/PayoutRequestsApi.php +++ b/src/Api/PayoutRequestsApi.php @@ -21,8 +21,6 @@ use Rebilly\Sdk\Model\GetPayoutRequestPaymentInstrumentsResponse; use Rebilly\Sdk\Model\PatchPayoutRequestRequest; use Rebilly\Sdk\Model\PayoutRequest; -use Rebilly\Sdk\Model\PayoutRequestCancellation; -use Rebilly\Sdk\Model\PayoutRequestSplit; use Rebilly\Sdk\Model\PayoutRequestTimelineMessage; use Rebilly\Sdk\Paginator; @@ -32,25 +30,6 @@ public function __construct(protected ?ClientInterface $client) { } - public function cancel( - string $id, - PayoutRequestCancellation $payoutRequestCancellation, - ): PayoutRequest { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/cancel'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($payoutRequestCancellation)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return PayoutRequest::from($data, ['headers' => $response->getHeaders()]); - } - public function create( PayoutRequest $payoutRequest, ): PayoutRequest { @@ -300,28 +279,6 @@ public function patch( return PayoutRequest::from($data, ['headers' => $response->getHeaders()]); } - /** - * @return PayoutRequest[] - */ - public function split( - string $id, - PayoutRequestSplit $payoutRequestSplit, - ): array { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/split'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($payoutRequestSplit)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return array_map(fn (array $item): PayoutRequest => PayoutRequest::from($item, ['headers' => $response->getHeaders()]), $data); - } - public function update( string $id, PayoutRequest $payoutRequest, diff --git a/src/Api/PlansApi.php b/src/Api/PlansApi.php index 7bf80cfc5..97d7eb57d 100644 --- a/src/Api/PlansApi.php +++ b/src/Api/PlansApi.php @@ -20,6 +20,7 @@ use Rebilly\Sdk\Collection; use Rebilly\Sdk\Model\Plan; use Rebilly\Sdk\Model\PlanFactory; +use Rebilly\Sdk\Model\PlanRequest; use Rebilly\Sdk\Paginator; class PlansApi @@ -29,13 +30,13 @@ public function __construct(protected ?ClientInterface $client) } public function create( - Plan $plan, + PlanRequest $planRequest, ): Plan { $uri = '/plans'; $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($plan)); + ], body: Utils::jsonEncode($planRequest)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); @@ -135,7 +136,7 @@ public function getAllPaginator( public function update( string $id, - Plan $plan, + PlanRequest $planRequest, ): Plan { $pathParams = [ '{id}' => $id, @@ -145,7 +146,7 @@ public function update( $request = new Request('PUT', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($plan)); + ], body: Utils::jsonEncode($planRequest)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); diff --git a/src/Api/ProfileApi.php b/src/Api/ProfileApi.php index 48be28968..c699752d8 100644 --- a/src/Api/ProfileApi.php +++ b/src/Api/ProfileApi.php @@ -22,7 +22,6 @@ use Rebilly\Sdk\Model\PostPermissionsEmulationRequest; use Rebilly\Sdk\Model\Profile; use Rebilly\Sdk\Model\ProfileDashboard; -use Rebilly\Sdk\Model\ProfileMfa; use Rebilly\Sdk\Model\Session; class ProfileApi @@ -31,14 +30,6 @@ public function __construct(protected ?ClientInterface $client) { } - public function deleteMfa(): void - { - $uri = '/profile/mfa'; - - $request = new Request('DELETE', $uri); - $this->client->send($request); - } - public function get(): Profile { $uri = '/profile'; @@ -89,19 +80,6 @@ public function getDashboardMetricReport( return DashboardTileReport::from($data, ['headers' => $response->getHeaders()]); } - public function getMfa(): ProfileMfa - { - $uri = '/profile/mfa'; - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return ProfileMfa::from($data, ['headers' => $response->getHeaders()]); - } - public function startPermissionsEmulation( PostPermissionsEmulationRequest $postPermissionsEmulationRequest, ): Session { @@ -156,17 +134,4 @@ public function updateDashboard( return ProfileDashboard::from($data, ['headers' => $response->getHeaders()]); } - - public function updateMfa(): ProfileMfa - { - $uri = '/profile/mfa'; - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return ProfileMfa::from($data, ['headers' => $response->getHeaders()]); - } } diff --git a/src/Api/QuotesApi.php b/src/Api/QuotesApi.php index 84441896e..d4e231e58 100644 --- a/src/Api/QuotesApi.php +++ b/src/Api/QuotesApi.php @@ -22,6 +22,7 @@ use Rebilly\Sdk\Model\PatchQuote; use Rebilly\Sdk\Model\Quote; use Rebilly\Sdk\Model\QuoteFactory; +use Rebilly\Sdk\Model\QuoteReissue; use Rebilly\Sdk\Model\QuoteTimeline; use Rebilly\Sdk\Paginator; @@ -360,6 +361,25 @@ public function recall( return QuoteFactory::from($data, ['headers' => $response->getHeaders()]); } + public function reissue( + string $id, + QuoteReissue $quoteReissue, + ): Quote { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/quotes/{id}/reissue'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($quoteReissue)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return QuoteFactory::from($data, ['headers' => $response->getHeaders()]); + } + public function reject( string $id, ): Quote { diff --git a/src/Api/ReleaseFlagsApi.php b/src/Api/ReleaseFlagsApi.php new file mode 100644 index 000000000..2d4c961d6 --- /dev/null +++ b/src/Api/ReleaseFlagsApi.php @@ -0,0 +1,40 @@ + 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return GetReleaseFlagsResponse::from($data, ['headers' => $response->getHeaders()]); + } +} diff --git a/src/Api/ReportsApi.php b/src/Api/ReportsApi.php index e995f8e5d..7f8a61d05 100644 --- a/src/Api/ReportsApi.php +++ b/src/Api/ReportsApi.php @@ -18,6 +18,7 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; +use Psr\Http\Message\StreamInterface; use Rebilly\Sdk\Model\ApiLogSummary; use Rebilly\Sdk\Model\CumulativeSubscriptions; use Rebilly\Sdk\Model\DashboardResponse; @@ -26,6 +27,7 @@ use Rebilly\Sdk\Model\GetKycAcceptanceSummaryReportResponse; use Rebilly\Sdk\Model\JournalSummaryReport; use Rebilly\Sdk\Model\RenewalSales; +use Rebilly\Sdk\Model\ReportAmlAuditReport; use Rebilly\Sdk\Model\ReportAmlChecks; use Rebilly\Sdk\Model\ReportAmlChecksInheritedSummary; use Rebilly\Sdk\Model\ReportAnnualRecurringRevenue; @@ -54,6 +56,53 @@ public function __construct(protected ?ClientInterface $client) { } + public function getAmlAuditReport( + string $personId, + ?DateTimeImmutable $periodStart = null, + ?DateTimeImmutable $periodEnd = null, + ?string $filter = null, + ?string $accept = null, + ): ReportAmlAuditReport { + $queryParams = [ + 'personId' => $personId, + 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), + 'filter' => $filter, + ]; + $uri = '/experimental/reports/aml-audit-reports?' . http_build_query($queryParams); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return ReportAmlAuditReport::from($data, ['headers' => $response->getHeaders()]); + } + + public function getAmlAuditReportPdf( + string $personId, + ?DateTimeImmutable $periodStart = null, + ?DateTimeImmutable $periodEnd = null, + ?string $filter = null, + ?string $accept = null, + ): StreamInterface { + $queryParams = [ + 'personId' => $personId, + 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), + 'filter' => $filter, + ]; + $uri = '/experimental/reports/aml-audit-reports?' . http_build_query($queryParams); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/pdf', + ]); + $response = $this->client->send($request, ['allow_redirects' => ['refer' => true]]); + + return $response->getBody(); + } + public function getAmlChecks( ?DateTimeImmutable $periodStart = null, ?DateTimeImmutable $periodEnd = null, diff --git a/src/Api/ServiceCredentialsApi.php b/src/Api/ServiceCredentialsApi.php index c57c22d2c..f454edf74 100644 --- a/src/Api/ServiceCredentialsApi.php +++ b/src/Api/ServiceCredentialsApi.php @@ -20,6 +20,7 @@ use Rebilly\Sdk\Collection; use Rebilly\Sdk\Model\GoogleSpreadsheet; use Rebilly\Sdk\Model\PatchServiceCredentialRequest; +use Rebilly\Sdk\Model\PostServiceCredentialRequest; use Rebilly\Sdk\Model\ServiceCredential; use Rebilly\Sdk\Model\ServiceCredentialFactory; use Rebilly\Sdk\Paginator; @@ -32,7 +33,7 @@ public function __construct(protected ?ClientInterface $client) public function create( string $type, - ServiceCredential $serviceCredential, + PostServiceCredentialRequest $postServiceCredentialRequest, ): ServiceCredential { $pathParams = [ '{type}' => $type, @@ -42,7 +43,7 @@ public function create( $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($serviceCredential)); + ], body: Utils::jsonEncode($postServiceCredentialRequest)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); diff --git a/src/Api/TrackingApi.php b/src/Api/TrackingApi.php index 60a485115..10ac68af9 100644 --- a/src/Api/TrackingApi.php +++ b/src/Api/TrackingApi.php @@ -220,14 +220,12 @@ public function getAllTaxTrackingLogsPaginator( public function getAllWebhookTrackingLogs( ?int $limit = null, ?int $offset = null, - ?array $sort = null, ?string $filter = null, ?string $q = null, ): Collection { $queryParams = [ 'limit' => $limit, 'offset' => $offset, - 'sort' => $sort ? implode(',', $sort) : null, 'filter' => $filter, 'q' => $q, ]; @@ -256,14 +254,12 @@ public function getAllWebhookTrackingLogs( public function getAllWebhookTrackingLogsPaginator( ?int $limit = null, ?int $offset = null, - ?array $sort = null, ?string $filter = null, ?string $q = null, ): Paginator { $closure = fn (?int $limit, ?int $offset): Collection => $this->getAllWebhookTrackingLogs( limit: $limit, offset: $offset, - sort: $sort, filter: $filter, q: $q, ); diff --git a/src/Api/UsersApi.php b/src/Api/UsersApi.php index 4b8c0f22c..1090c02a3 100644 --- a/src/Api/UsersApi.php +++ b/src/Api/UsersApi.php @@ -18,7 +18,6 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\ProfileMfa; use Rebilly\Sdk\Model\User; use Rebilly\Sdk\Paginator; @@ -120,24 +119,6 @@ public function getAllPaginator( ); } - public function getMfa( - string $id, - ): ProfileMfa { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/users/{id}/mfa'); - - $request = new Request('GET', $uri, headers: [ - 'Accept' => 'application/json', - ]); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return ProfileMfa::from($data, ['headers' => $response->getHeaders()]); - } - public function update( string $id, User $user, diff --git a/src/Api/WebhookEventsApi.php b/src/Api/WebhookEventsApi.php new file mode 100644 index 000000000..b3ce15f66 --- /dev/null +++ b/src/Api/WebhookEventsApi.php @@ -0,0 +1,85 @@ + + */ + public function getAll( + ?int $limit = null, + ?int $offset = null, + ?string $filter = null, + ?string $q = null, + ): Collection { + $queryParams = [ + 'limit' => $limit, + 'offset' => $offset, + 'filter' => $filter, + 'q' => $q, + ]; + $uri = '/webhook-events?' . http_build_query($queryParams); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return new Collection( + array_map(fn (array $item): WebhookEvent => WebhookEvent::from($item, ['headers' => $response->getHeaders()]), $data), + (int) $response->getHeaderLine(Collection::HEADER_LIMIT), + (int) $response->getHeaderLine(Collection::HEADER_OFFSET), + (int) $response->getHeaderLine(Collection::HEADER_TOTAL), + [ + 'headers' => $response->getHeaders(), + ] + ); + } + + /** + * @return Paginator + */ + public function getAllPaginator( + ?int $limit = null, + ?int $offset = null, + ?string $filter = null, + ?string $q = null, + ): Paginator { + $closure = fn (?int $limit, ?int $offset): Collection => $this->getAll( + limit: $limit, + offset: $offset, + filter: $filter, + q: $q, + ); + + return new Paginator( + $limit !== null || $offset !== null ? $closure(limit: $limit, offset: $offset) : null, + $closure, + ); + } +} diff --git a/src/Model/AccountRegistrationSettings.php b/src/Model/AccountRegistrationSettings.php deleted file mode 100644 index 1aec483d5..000000000 --- a/src/Model/AccountRegistrationSettings.php +++ /dev/null @@ -1,280 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('name', $data)) { - $this->setName($data['name']); - } - if (array_key_exists('description', $data)) { - $this->setDescription($data['description']); - } - if (array_key_exists('isEnabled', $data)) { - $this->setIsEnabled($data['isEnabled']); - } - if (array_key_exists('locations', $data)) { - $this->setLocations($data['locations']); - } - if (array_key_exists('fields', $data)) { - $this->setFields($data['fields']); - } - if (array_key_exists('realm', $data)) { - $this->setRealm($data['realm']); - } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); - } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - public function getName(): string - { - return $this->fields['name']; - } - - public function setName(string $name): static - { - $this->fields['name'] = $name; - - return $this; - } - - public function getDescription(): ?string - { - return $this->fields['description'] ?? null; - } - - public function setDescription(null|string $description): static - { - $this->fields['description'] = $description; - - return $this; - } - - public function getIsEnabled(): ?bool - { - return $this->fields['isEnabled'] ?? null; - } - - public function setIsEnabled(null|bool $isEnabled): static - { - $this->fields['isEnabled'] = $isEnabled; - - return $this; - } - - /** - * @return null|AccountRegistrationSettingsLocations[] - */ - public function getLocations(): ?array - { - return $this->fields['locations'] ?? null; - } - - /** - * @param null|AccountRegistrationSettingsLocations[]|array[] $locations - */ - public function setLocations(null|array $locations): static - { - $locations = $locations !== null ? array_map( - fn ($value) => $value instanceof AccountRegistrationSettingsLocations ? $value : AccountRegistrationSettingsLocations::from($value), - $locations, - ) : null; - - $this->fields['locations'] = $locations; - - return $this; - } - - /** - * @return null|RegistrationField[] - */ - public function getFields(): ?array - { - return $this->fields['fields'] ?? null; - } - - /** - * @param null|array[]|RegistrationField[] $fields - */ - public function setFields(null|array $fields): static - { - $fields = $fields !== null ? array_map( - fn ($value) => $value instanceof RegistrationField ? $value : RegistrationField::from($value), - $fields, - ) : null; - - $this->fields['fields'] = $fields; - - return $this; - } - - public function getRealm(): ?string - { - return $this->fields['realm'] ?? null; - } - - public function getCreatedTime(): ?DateTimeImmutable - { - return $this->fields['createdTime'] ?? null; - } - - public function getUpdatedTime(): ?DateTimeImmutable - { - return $this->fields['updatedTime'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('name', $this->fields)) { - $data['name'] = $this->fields['name']; - } - if (array_key_exists('description', $this->fields)) { - $data['description'] = $this->fields['description']; - } - if (array_key_exists('isEnabled', $this->fields)) { - $data['isEnabled'] = $this->fields['isEnabled']; - } - if (array_key_exists('locations', $this->fields)) { - $data['locations'] = $this->fields['locations'] !== null - ? array_map( - static fn (AccountRegistrationSettingsLocations $accountRegistrationSettingsLocations) => $accountRegistrationSettingsLocations->jsonSerialize(), - $this->fields['locations'], - ) - : null; - } - if (array_key_exists('fields', $this->fields)) { - $data['fields'] = $this->fields['fields'] !== null - ? array_map( - static fn (RegistrationField $registrationField) => $registrationField->jsonSerialize(), - $this->fields['fields'], - ) - : null; - } - if (array_key_exists('realm', $this->fields)) { - $data['realm'] = $this->fields['realm']; - } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - - return $data; - } - - private function setRealm(null|string $realm): static - { - $this->fields['realm'] = $realm; - - return $this; - } - - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static - { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } - - $this->fields['createdTime'] = $createdTime; - - return $this; - } - - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static - { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); - } - - $this->fields['updatedTime'] = $updatedTime; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } -} diff --git a/src/Model/AccountRegistrationSettingsLocations.php b/src/Model/AccountRegistrationSettingsLocations.php deleted file mode 100644 index ef2bb455c..000000000 --- a/src/Model/AccountRegistrationSettingsLocations.php +++ /dev/null @@ -1,78 +0,0 @@ -setCountry($data['country']); - } - if (array_key_exists('region', $data)) { - $this->setRegion($data['region']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getCountry(): string - { - return $this->fields['country']; - } - - public function setCountry(string $country): static - { - $this->fields['country'] = $country; - - return $this; - } - - public function getRegion(): ?string - { - return $this->fields['region'] ?? null; - } - - public function setRegion(null|string $region): static - { - $this->fields['region'] = $region; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('country', $this->fields)) { - $data['country'] = $this->fields['country']; - } - if (array_key_exists('region', $this->fields)) { - $data['region'] = $this->fields['region']; - } - - return $data; - } -} diff --git a/src/Model/AddPayoutRequestBatchOperation.php b/src/Model/AddPayoutRequestBatchOperation.php new file mode 100644 index 000000000..65147d28a --- /dev/null +++ b/src/Model/AddPayoutRequestBatchOperation.php @@ -0,0 +1,36 @@ +setType($data['type']); + } + if (array_key_exists('batchId', $data)) { + $this->setBatchId($data['batchId']); + } + if (array_key_exists('payoutRequestIds', $data)) { + $this->setPayoutRequestIds($data['payoutRequestIds']); + } + if (array_key_exists('filter', $data)) { + $this->setFilter($data['filter']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + public function getBatchId(): ?string + { + return $this->fields['batchId'] ?? null; + } + + public function setBatchId(null|string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + /** + * @return string[] + */ + public function getPayoutRequestIds(): array + { + return $this->fields['payoutRequestIds']; + } + + /** + * @param string[] $payoutRequestIds + */ + public function setPayoutRequestIds(array $payoutRequestIds): static + { + $this->fields['payoutRequestIds'] = $payoutRequestIds; + + return $this; + } + + public function getFilter(): ?string + { + return $this->fields['filter'] ?? null; + } + + public function setFilter(null|string $filter): static + { + $this->fields['filter'] = $filter; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + if (array_key_exists('payoutRequestIds', $this->fields)) { + $data['payoutRequestIds'] = $this->fields['payoutRequestIds']; + } + if (array_key_exists('filter', $this->fields)) { + $data['filter'] = $this->fields['filter']; + } + + return $data; + } +} diff --git a/src/Model/AddPayoutRequestBatchOperationFilterBased.php b/src/Model/AddPayoutRequestBatchOperationFilterBased.php new file mode 100644 index 000000000..b5aca6160 --- /dev/null +++ b/src/Model/AddPayoutRequestBatchOperationFilterBased.php @@ -0,0 +1,121 @@ +setType($data['type']); + } + if (array_key_exists('batchId', $data)) { + $this->setBatchId($data['batchId']); + } + if (array_key_exists('payoutRequestIds', $data)) { + $this->setPayoutRequestIds($data['payoutRequestIds']); + } + if (array_key_exists('filter', $data)) { + $this->setFilter($data['filter']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + public function getBatchId(): ?string + { + return $this->fields['batchId'] ?? null; + } + + public function setBatchId(null|string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + /** + * @return null|string[] + */ + public function getPayoutRequestIds(): ?array + { + return $this->fields['payoutRequestIds'] ?? null; + } + + /** + * @param null|string[] $payoutRequestIds + */ + public function setPayoutRequestIds(null|array $payoutRequestIds): static + { + $this->fields['payoutRequestIds'] = $payoutRequestIds; + + return $this; + } + + public function getFilter(): string + { + return $this->fields['filter']; + } + + public function setFilter(string $filter): static + { + $this->fields['filter'] = $filter; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + if (array_key_exists('payoutRequestIds', $this->fields)) { + $data['payoutRequestIds'] = $this->fields['payoutRequestIds']; + } + if (array_key_exists('filter', $this->fields)) { + $data['filter'] = $this->fields['filter']; + } + + return $data; + } +} diff --git a/src/Model/AdjustReadyToPayGeneric.php b/src/Model/AdjustReadyToPayGeneric.php index 7271a2cac..2d91fb62c 100644 --- a/src/Model/AdjustReadyToPayGeneric.php +++ b/src/Model/AdjustReadyToPayGeneric.php @@ -154,6 +154,8 @@ class AdjustReadyToPayGeneric implements AdjustPaymentMethod public const PAYMENT_METHOD_KAKAO_PAY = 'KakaoPay'; + public const PAYMENT_METHOD_KHELOCARD = 'Khelocard'; + public const PAYMENT_METHOD_KNOT = 'KNOT'; public const PAYMENT_METHOD_LOONIE = 'loonie'; @@ -230,6 +232,8 @@ class AdjustReadyToPayGeneric implements AdjustPaymentMethod public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PAY_TABS = 'PayTabs'; public const PAYMENT_METHOD_PAYSAFECARD = 'Paysafecard'; @@ -286,6 +290,8 @@ class AdjustReadyToPayGeneric implements AdjustPaymentMethod public const PAYMENT_METHOD_TERMINALY_RF = 'Terminaly-RF'; + public const PAYMENT_METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const PAYMENT_METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const PAYMENT_METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/AdjustReadyToPayoutGeneric.php b/src/Model/AdjustReadyToPayoutGeneric.php index 1a4d522ef..16c0fe026 100644 --- a/src/Model/AdjustReadyToPayoutGeneric.php +++ b/src/Model/AdjustReadyToPayoutGeneric.php @@ -154,6 +154,8 @@ class AdjustReadyToPayoutGeneric implements AdjustReadyToPayoutPaymentMethod public const PAYMENT_METHOD_KAKAO_PAY = 'KakaoPay'; + public const PAYMENT_METHOD_KHELOCARD = 'Khelocard'; + public const PAYMENT_METHOD_KNOT = 'KNOT'; public const PAYMENT_METHOD_LOONIE = 'loonie'; @@ -230,6 +232,8 @@ class AdjustReadyToPayoutGeneric implements AdjustReadyToPayoutPaymentMethod public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PAY_TABS = 'PayTabs'; public const PAYMENT_METHOD_PAYSAFECARD = 'Paysafecard'; @@ -286,6 +290,8 @@ class AdjustReadyToPayoutGeneric implements AdjustReadyToPayoutPaymentMethod public const PAYMENT_METHOD_TERMINALY_RF = 'Terminaly-RF'; + public const PAYMENT_METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const PAYMENT_METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const PAYMENT_METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/AdyenSettings.php b/src/Model/AdyenSettings.php index fbdef9990..fce70846c 100644 --- a/src/Model/AdyenSettings.php +++ b/src/Model/AdyenSettings.php @@ -46,6 +46,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('levelTwoThreeDataCustomField', $data)) { $this->setLevelTwoThreeDataCustomField($data['levelTwoThreeDataCustomField']); } + if (array_key_exists('mastercardDpaId', $data)) { + $this->setMastercardDpaId($data['mastercardDpaId']); + } + if (array_key_exists('mastercardServiceId', $data)) { + $this->setMastercardServiceId($data['mastercardServiceId']); + } $this->setMetadata($metadata); } @@ -153,6 +159,30 @@ public function setLevelTwoThreeDataCustomField(null|string $levelTwoThreeDataCu return $this; } + public function getMastercardDpaId(): ?string + { + return $this->fields['mastercardDpaId'] ?? null; + } + + public function setMastercardDpaId(null|string $mastercardDpaId): static + { + $this->fields['mastercardDpaId'] = $mastercardDpaId; + + return $this; + } + + public function getMastercardServiceId(): ?string + { + return $this->fields['mastercardServiceId'] ?? null; + } + + public function setMastercardServiceId(null|string $mastercardServiceId): static + { + $this->fields['mastercardServiceId'] = $mastercardServiceId; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -182,6 +212,12 @@ public function jsonSerialize(): array if (array_key_exists('levelTwoThreeDataCustomField', $this->fields)) { $data['levelTwoThreeDataCustomField'] = $this->fields['levelTwoThreeDataCustomField']; } + if (array_key_exists('mastercardDpaId', $this->fields)) { + $data['mastercardDpaId'] = $this->fields['mastercardDpaId']; + } + if (array_key_exists('mastercardServiceId', $this->fields)) { + $data['mastercardServiceId'] = $this->fields['mastercardServiceId']; + } return $data; } diff --git a/src/Model/AlternativeInstrument.php b/src/Model/AlternativeInstrument.php index 47d216639..bdc8ca922 100644 --- a/src/Model/AlternativeInstrument.php +++ b/src/Model/AlternativeInstrument.php @@ -158,6 +158,8 @@ class AlternativeInstrument implements PaymentInstrument, PostPaymentInstrumentR public const METHOD_KAKAO_PAY = 'KakaoPay'; + public const METHOD_KHELOCARD = 'Khelocard'; + public const METHOD_KLARNA = 'Klarna'; public const METHOD_KNOT = 'KNOT'; @@ -236,6 +238,8 @@ class AlternativeInstrument implements PaymentInstrument, PostPaymentInstrumentR public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PLAID_ACCOUNT = 'plaid-account'; public const METHOD_PAY_TABS = 'PayTabs'; @@ -294,6 +298,8 @@ class AlternativeInstrument implements PaymentInstrument, PostPaymentInstrumentR public const METHOD_TERMINALY_RF = 'Terminaly-RF'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/AlternativePaymentInstrument.php b/src/Model/AlternativePaymentInstrument.php index 215c1073b..1ce6deb10 100644 --- a/src/Model/AlternativePaymentInstrument.php +++ b/src/Model/AlternativePaymentInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class AlternativePaymentInstrument implements TransactionPaymentInstrument { use HasMetadata; @@ -290,6 +290,8 @@ class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument, public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; @@ -350,6 +352,8 @@ class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument, public const METHOD_TETHER = 'Tether'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/AlternativePaymentToken.php b/src/Model/AlternativePaymentToken.php index 5c6da8cec..f9ecabce0 100644 --- a/src/Model/AlternativePaymentToken.php +++ b/src/Model/AlternativePaymentToken.php @@ -156,6 +156,8 @@ class AlternativePaymentToken implements CompositeToken public const METHOD_KAKAO_PAY = 'KakaoPay'; + public const METHOD_KHELOCARD = 'Khelocard'; + public const METHOD_KNOT = 'KNOT'; public const METHOD_LOONIE = 'loonie'; @@ -232,6 +234,8 @@ class AlternativePaymentToken implements CompositeToken public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PAY_TABS = 'PayTabs'; public const METHOD_PAYSAFECARD = 'Paysafecard'; @@ -288,6 +292,8 @@ class AlternativePaymentToken implements CompositeToken public const METHOD_TERMINALY_RF = 'Terminaly-RF'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/AmlChecksDataExport.php b/src/Model/AmlChecksDataExport.php index ad408db7a..01467964d 100644 --- a/src/Model/AmlChecksDataExport.php +++ b/src/Model/AmlChecksDataExport.php @@ -40,6 +40,14 @@ class AmlChecksDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?AmlChecksDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/ApprovePayoutRequestBatchOperation.php b/src/Model/ApprovePayoutRequestBatchOperation.php new file mode 100644 index 000000000..3ec902278 --- /dev/null +++ b/src/Model/ApprovePayoutRequestBatchOperation.php @@ -0,0 +1,66 @@ +setBatchId($data['batchId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'approve'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'approve', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + + return $data; + } +} diff --git a/src/Model/Attachment.php b/src/Model/Attachment.php index 92370d772..557dd3ee0 100644 --- a/src/Model/Attachment.php +++ b/src/Model/Attachment.php @@ -23,6 +23,8 @@ class Attachment implements JsonSerializable { use HasMetadata; + public const RELATED_TYPE_CREDIT_MEMO_TIMELINE_COMMENT = 'credit-memo-timeline-comment'; + public const RELATED_TYPE_CUSTOMER = 'customer'; public const RELATED_TYPE_CUSTOMER_TIMELINE_COMMENT = 'customer-timeline-comment'; @@ -41,10 +43,14 @@ class Attachment implements JsonSerializable public const RELATED_TYPE_PAYMENT = 'payment'; + public const RELATED_TYPE_PAYOUT_REQUEST_TIMELINE_COMMENT = 'payout-request-timeline-comment'; + public const RELATED_TYPE_PLAN = 'plan'; public const RELATED_TYPE_PRODUCT = 'product'; + public const RELATED_TYPE_QUOTE_TIMELINE_COMMENT = 'quote-timeline-comment'; + public const RELATED_TYPE_SUBSCRIPTION = 'subscription'; public const RELATED_TYPE_TRANSACTION = 'transaction'; diff --git a/src/Model/AutoAllocatePayoutRequestBatchOperation.php b/src/Model/AutoAllocatePayoutRequestBatchOperation.php new file mode 100644 index 000000000..057a3f00b --- /dev/null +++ b/src/Model/AutoAllocatePayoutRequestBatchOperation.php @@ -0,0 +1,66 @@ +setBatchId($data['batchId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'auto-allocate'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'auto-allocate', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + + return $data; + } +} diff --git a/src/Model/AwepaySettings.php b/src/Model/AwepaySettings.php index cb46e321f..ac599a02b 100644 --- a/src/Model/AwepaySettings.php +++ b/src/Model/AwepaySettings.php @@ -31,9 +31,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('useRestApi', $data)) { $this->setUseRestApi($data['useRestApi']); } - if (array_key_exists('paymentCode', $data)) { - $this->setPaymentCode($data['paymentCode']); - } if (array_key_exists('methodType', $data)) { $this->setMethodType($data['methodType']); } @@ -69,18 +66,6 @@ public function setUseRestApi(null|bool $useRestApi): static return $this; } - public function getPaymentCode(): ?string - { - return $this->fields['paymentCode'] ?? null; - } - - public function setPaymentCode(null|string $paymentCode): static - { - $this->fields['paymentCode'] = $paymentCode; - - return $this; - } - public function getMethodType(): ?string { return $this->fields['methodType'] ?? null; @@ -102,9 +87,6 @@ public function jsonSerialize(): array if (array_key_exists('useRestApi', $this->fields)) { $data['useRestApi'] = $this->fields['useRestApi']; } - if (array_key_exists('paymentCode', $this->fields)) { - $data['paymentCode'] = $this->fields['paymentCode']; - } if (array_key_exists('methodType', $this->fields)) { $data['methodType'] = $this->fields['methodType']; } diff --git a/src/Model/PostPayoutRequestBatchBlockRequest.php b/src/Model/BlockPayoutRequestBatchOperation.php similarity index 75% rename from src/Model/PostPayoutRequestBatchBlockRequest.php rename to src/Model/BlockPayoutRequestBatchOperation.php index aae078e73..1d1f6afc6 100644 --- a/src/Model/PostPayoutRequestBatchBlockRequest.php +++ b/src/Model/BlockPayoutRequestBatchOperation.php @@ -14,10 +14,9 @@ namespace Rebilly\Sdk\Model; -use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PostPayoutRequestBatchBlockRequest implements JsonSerializable +class BlockPayoutRequestBatchOperation implements PayoutRequestBatchOperationRequest { use HasMetadata; @@ -41,6 +40,9 @@ class PostPayoutRequestBatchBlockRequest implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('batchId', $data)) { + $this->setBatchId($data['batchId']); + } if (array_key_exists('reason', $data)) { $this->setReason($data['reason']); } @@ -55,6 +57,23 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'block'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + public function getReason(): string { return $this->fields['reason']; @@ -81,7 +100,12 @@ public function setDescription(null|string $description): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'block', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } if (array_key_exists('reason', $this->fields)) { $data['reason'] = $this->fields['reason']; } diff --git a/src/Model/CashInstrument.php b/src/Model/CashInstrument.php index 1671c953b..1d4d15d82 100644 --- a/src/Model/CashInstrument.php +++ b/src/Model/CashInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class CashInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class CashInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/Cashier.php b/src/Model/Cashier.php index 6663d31dd..b4bcb824d 100644 --- a/src/Model/Cashier.php +++ b/src/Model/Cashier.php @@ -57,6 +57,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('pendingPayoutTotal', $data)) { $this->setPendingPayoutTotal($data['pendingPayoutTotal']); } + if (array_key_exists('canWithdraw', $data)) { + $this->setCanWithdraw($data['canWithdraw']); + } if (array_key_exists('lastDepositRequestId', $data)) { $this->setLastDepositRequestId($data['lastDepositRequestId']); } @@ -138,33 +141,11 @@ public function getBalance(): float return $this->fields['balance']; } - public function setBalance(float|string $balance): static - { - if (is_string($balance)) { - $balance = (float) $balance; - } - - $this->fields['balance'] = $balance; - - return $this; - } - public function getBonusBalance(): float { return $this->fields['bonusBalance']; } - public function setBonusBalance(float|string $bonusBalance): static - { - if (is_string($bonusBalance)) { - $bonusBalance = (float) $bonusBalance; - } - - $this->fields['bonusBalance'] = $bonusBalance; - - return $this; - } - public function getNotificationUrl(): ?string { return $this->fields['notificationUrl'] ?? null; @@ -198,15 +179,9 @@ public function getPendingPayoutTotal(): float return $this->fields['pendingPayoutTotal']; } - public function setPendingPayoutTotal(float|string $pendingPayoutTotal): static + public function getCanWithdraw(): bool { - if (is_string($pendingPayoutTotal)) { - $pendingPayoutTotal = (float) $pendingPayoutTotal; - } - - $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; - - return $this; + return $this->fields['canWithdraw']; } public function getLastDepositRequestId(): ?string @@ -277,6 +252,9 @@ public function jsonSerialize(): array if (array_key_exists('pendingPayoutTotal', $this->fields)) { $data['pendingPayoutTotal'] = $this->fields['pendingPayoutTotal']; } + if (array_key_exists('canWithdraw', $this->fields)) { + $data['canWithdraw'] = $this->fields['canWithdraw']; + } if (array_key_exists('lastDepositRequestId', $this->fields)) { $data['lastDepositRequestId'] = $this->fields['lastDepositRequestId']; } @@ -308,6 +286,46 @@ private function setId(string $id): static return $this; } + private function setBalance(float|string $balance): static + { + if (is_string($balance)) { + $balance = (float) $balance; + } + + $this->fields['balance'] = $balance; + + return $this; + } + + private function setBonusBalance(float|string $bonusBalance): static + { + if (is_string($bonusBalance)) { + $bonusBalance = (float) $bonusBalance; + } + + $this->fields['bonusBalance'] = $bonusBalance; + + return $this; + } + + private function setPendingPayoutTotal(float|string $pendingPayoutTotal): static + { + if (is_string($pendingPayoutTotal)) { + $pendingPayoutTotal = (float) $pendingPayoutTotal; + } + + $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; + + return $this; + } + + private function setCanWithdraw(bool $canWithdraw): static + { + $this->fields['canWithdraw'] = $canWithdraw; + + return $this; + } + private function setCashierToken(null|string $cashierToken): static { $this->fields['cashierToken'] = $cashierToken; diff --git a/src/Model/ChangeQuoteOrder.php b/src/Model/ChangeQuoteOrder.php index 0a218bfe6..b2bddb94e 100644 --- a/src/Model/ChangeQuoteOrder.php +++ b/src/Model/ChangeQuoteOrder.php @@ -23,10 +23,20 @@ class ChangeQuoteOrder implements JsonSerializable { use HasMetadata; + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + public const RENEWAL_POLICY_RESET = 'reset'; public const RENEWAL_POLICY_RETAIN = 'retain'; + public const APPLY_AT_NOW = 'now'; + + public const APPLY_AT_NEXT_RENEWAL = 'nextRenewal'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -46,6 +56,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('effectiveTime', $data)) { $this->setEffectiveTime($data['effectiveTime']); } + if (array_key_exists('applyAt', $data)) { + $this->setApplyAt($data['applyAt']); + } if (array_key_exists('keepTrial', $data)) { $this->setKeepTrial($data['keepTrial']); } @@ -150,6 +163,18 @@ public function setEffectiveTime(null|DateTimeImmutable|string $effectiveTime): return $this; } + public function getApplyAt(): ?string + { + return $this->fields['applyAt'] ?? null; + } + + public function setApplyAt(null|string $applyAt): static + { + $this->fields['applyAt'] = $applyAt; + + return $this; + } + public function getKeepTrial(): ?bool { return $this->fields['keepTrial'] ?? null; @@ -209,15 +234,15 @@ public function setAutopay(null|bool $autopay): static return $this; } - public function getShipping(): ?Shipping + public function getShipping(): ?ChangeQuoteOrderShipping { return $this->fields['shipping'] ?? null; } - public function setShipping(null|Shipping|array $shipping): static + public function setShipping(null|ChangeQuoteOrderShipping|array $shipping): static { - if ($shipping !== null && !($shipping instanceof Shipping)) { - $shipping = ShippingFactory::from($shipping); + if ($shipping !== null && !($shipping instanceof ChangeQuoteOrderShipping)) { + $shipping = ChangeQuoteOrderShipping::from($shipping); } $this->fields['shipping'] = $shipping; @@ -278,6 +303,9 @@ public function jsonSerialize(): array if (array_key_exists('effectiveTime', $this->fields)) { $data['effectiveTime'] = $this->fields['effectiveTime']?->format(DateTimeInterface::RFC3339); } + if (array_key_exists('applyAt', $this->fields)) { + $data['applyAt'] = $this->fields['applyAt']; + } if (array_key_exists('keepTrial', $this->fields)) { $data['keepTrial'] = $this->fields['keepTrial']; } diff --git a/src/Model/ChangeQuoteOrderShipping.php b/src/Model/ChangeQuoteOrderShipping.php new file mode 100644 index 000000000..369c67238 --- /dev/null +++ b/src/Model/ChangeQuoteOrderShipping.php @@ -0,0 +1,35 @@ + '', + ] + $data, $metadata); + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } +} diff --git a/src/Model/CheckInstrument.php b/src/Model/CheckInstrument.php index 43413279d..bcf960e5a 100644 --- a/src/Model/CheckInstrument.php +++ b/src/Model/CheckInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class CheckInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class CheckInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/CheckoutForm.php b/src/Model/CheckoutForm.php index b73393060..910700df5 100644 --- a/src/Model/CheckoutForm.php +++ b/src/Model/CheckoutForm.php @@ -293,6 +293,8 @@ class CheckoutForm implements JsonSerializable public const PAYMENT_METHODS_PIX = 'PIX'; + public const PAYMENT_METHODS_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHODS_PIN_PAY = 'PinPay'; public const PAYMENT_METHODS_PHONE = 'phone'; @@ -353,6 +355,8 @@ class CheckoutForm implements JsonSerializable public const PAYMENT_METHODS_TETHER = 'Tether'; + public const PAYMENT_METHODS_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const PAYMENT_METHODS_TODITO_CASH_CARD = 'ToditoCash-card'; public const PAYMENT_METHODS_TRUSTLY = 'Trustly'; diff --git a/src/Model/CoinPricing.php b/src/Model/CoinPricing.php new file mode 100644 index 000000000..0179cd90e --- /dev/null +++ b/src/Model/CoinPricing.php @@ -0,0 +1,22 @@ + CoinPricingFlatRate::from($data, $metadata), + 'volume' => CoinPricingVolume::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/CoinPricingFlatRate.php b/src/Model/CoinPricingFlatRate.php new file mode 100644 index 000000000..a5ac8afb1 --- /dev/null +++ b/src/Model/CoinPricingFlatRate.php @@ -0,0 +1,66 @@ +setCoinsPerFiatMinor($data['coinsPerFiatMinor']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFormula(): string + { + return 'flat-rate'; + } + + public function getCoinsPerFiatMinor(): int + { + return $this->fields['coinsPerFiatMinor']; + } + + public function setCoinsPerFiatMinor(int $coinsPerFiatMinor): static + { + $this->fields['coinsPerFiatMinor'] = $coinsPerFiatMinor; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'formula' => 'flat-rate', + ]; + if (array_key_exists('coinsPerFiatMinor', $this->fields)) { + $data['coinsPerFiatMinor'] = $this->fields['coinsPerFiatMinor']; + } + + return $data; + } +} diff --git a/src/Model/CoinPricingVolume.php b/src/Model/CoinPricingVolume.php new file mode 100644 index 000000000..b2b82b62e --- /dev/null +++ b/src/Model/CoinPricingVolume.php @@ -0,0 +1,80 @@ +setBrackets($data['brackets']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFormula(): string + { + return 'volume'; + } + + /** + * @return CoinPricingVolumeBracket[] + */ + public function getBrackets(): array + { + return $this->fields['brackets']; + } + + /** + * @param array[]|CoinPricingVolumeBracket[] $brackets + */ + public function setBrackets(array $brackets): static + { + $brackets = array_map( + fn ($value) => $value instanceof CoinPricingVolumeBracket ? $value : CoinPricingVolumeBracket::from($value), + $brackets, + ); + + $this->fields['brackets'] = $brackets; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'formula' => 'volume', + ]; + if (array_key_exists('brackets', $this->fields)) { + $data['brackets'] = array_map( + static fn (CoinPricingVolumeBracket $coinPricingVolumeBracket) => $coinPricingVolumeBracket->jsonSerialize(), + $this->fields['brackets'], + ); + } + + return $data; + } +} diff --git a/src/Model/CoinPricingVolumeBracket.php b/src/Model/CoinPricingVolumeBracket.php new file mode 100644 index 000000000..f71e39256 --- /dev/null +++ b/src/Model/CoinPricingVolumeBracket.php @@ -0,0 +1,82 @@ +setCoinsPerFiatMinor($data['coinsPerFiatMinor']); + } + if (array_key_exists('maxAmount', $data)) { + $this->setMaxAmount($data['maxAmount']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCoinsPerFiatMinor(): int + { + return $this->fields['coinsPerFiatMinor']; + } + + public function setCoinsPerFiatMinor(int $coinsPerFiatMinor): static + { + $this->fields['coinsPerFiatMinor'] = $coinsPerFiatMinor; + + return $this; + } + + public function getMaxAmount(): ?float + { + return $this->fields['maxAmount'] ?? null; + } + + public function setMaxAmount(null|float|string $maxAmount): static + { + if (is_string($maxAmount)) { + $maxAmount = (float) $maxAmount; + } + + $this->fields['maxAmount'] = $maxAmount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('coinsPerFiatMinor', $this->fields)) { + $data['coinsPerFiatMinor'] = $this->fields['coinsPerFiatMinor']; + } + if (array_key_exists('maxAmount', $this->fields)) { + $data['maxAmount'] = $this->fields['maxAmount']; + } + + return $data; + } +} diff --git a/src/Model/CompositeTokenFactory.php b/src/Model/CompositeTokenFactory.php index 03db90c78..13e151601 100644 --- a/src/Model/CompositeTokenFactory.php +++ b/src/Model/CompositeTokenFactory.php @@ -58,6 +58,7 @@ public static function from(array $data = [], array $metadata = []): CompositeTo 'Interac-online' => AlternativePaymentToken::from($data, $metadata), 'Jeton' => AlternativePaymentToken::from($data, $metadata), 'KNOT' => AlternativePaymentToken::from($data, $metadata), + 'Khelocard' => AlternativePaymentToken::from($data, $metadata), 'MTS' => AlternativePaymentToken::from($data, $metadata), 'Matrix' => AlternativePaymentToken::from($data, $metadata), 'MaxiCash' => AlternativePaymentToken::from($data, $metadata), @@ -162,7 +163,6 @@ public static function from(array $data = [], array $metadata = []): CompositeTo 'echeck' => BankAccountToken::from($data, $metadata), 'cryptocurrency' => CryptocurrencyToken::from($data, $metadata), 'digital-wallet' => DigitalWalletToken::from($data, $metadata), - 'Khelocard' => KhelocardCardToken::from($data, $metadata), 'Klarna' => KlarnaToken::from($data, $metadata), 'payment-card' => PaymentCardToken::from($data, $metadata), 'paypal' => PayPalToken::from($data, $metadata), diff --git a/src/Model/Customer.php b/src/Model/Customer.php index 0b03c731c..c4ec01c6b 100644 --- a/src/Model/Customer.php +++ b/src/Model/Customer.php @@ -48,6 +48,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('defaultPaymentInstrument', $data)) { $this->setDefaultPaymentInstrument($data['defaultPaymentInstrument']); } + if (array_key_exists('defaultPaymentInstrumentId', $data)) { + $this->setDefaultPaymentInstrumentId($data['defaultPaymentInstrumentId']); + } if (array_key_exists('preferredPayoutInstrumentId', $data)) { $this->setPreferredPayoutInstrumentId($data['preferredPayoutInstrumentId']); } @@ -174,7 +177,7 @@ public function getDefaultPaymentInstrument(): ?CustomerDefaultPaymentInstrument public function setDefaultPaymentInstrument(null|CustomerDefaultPaymentInstrument|array $defaultPaymentInstrument): static { if ($defaultPaymentInstrument !== null && !($defaultPaymentInstrument instanceof CustomerDefaultPaymentInstrument)) { - $defaultPaymentInstrument = CustomerDefaultPaymentInstrumentFactory::from($defaultPaymentInstrument); + $defaultPaymentInstrument = CustomerDefaultPaymentInstrument::from($defaultPaymentInstrument); } $this->fields['defaultPaymentInstrument'] = $defaultPaymentInstrument; @@ -182,6 +185,18 @@ public function setDefaultPaymentInstrument(null|CustomerDefaultPaymentInstrumen return $this; } + public function getDefaultPaymentInstrumentId(): ?string + { + return $this->fields['defaultPaymentInstrumentId'] ?? null; + } + + public function setDefaultPaymentInstrumentId(null|string $defaultPaymentInstrumentId): static + { + $this->fields['defaultPaymentInstrumentId'] = $defaultPaymentInstrumentId; + + return $this; + } + public function getPreferredPayoutInstrumentId(): ?string { return $this->fields['preferredPayoutInstrumentId'] ?? null; @@ -447,6 +462,9 @@ public function jsonSerialize(): array if (array_key_exists('defaultPaymentInstrument', $this->fields)) { $data['defaultPaymentInstrument'] = $this->fields['defaultPaymentInstrument']?->jsonSerialize(); } + if (array_key_exists('defaultPaymentInstrumentId', $this->fields)) { + $data['defaultPaymentInstrumentId'] = $this->fields['defaultPaymentInstrumentId']; + } if (array_key_exists('preferredPayoutInstrumentId', $this->fields)) { $data['preferredPayoutInstrumentId'] = $this->fields['preferredPayoutInstrumentId']; } diff --git a/src/Model/CustomerDefaultPaymentInstrument.php b/src/Model/CustomerDefaultPaymentInstrument.php index 80f92288e..cb4f06141 100644 --- a/src/Model/CustomerDefaultPaymentInstrument.php +++ b/src/Model/CustomerDefaultPaymentInstrument.php @@ -15,7 +15,454 @@ namespace Rebilly\Sdk\Model; use JsonSerializable; +use Rebilly\Sdk\Trait\HasMetadata; -interface CustomerDefaultPaymentInstrument extends JsonSerializable +class CustomerDefaultPaymentInstrument implements JsonSerializable { + use HasMetadata; + + public const METHOD_ADV_CASH = 'AdvCash'; + + public const METHOD_AERA = 'Aera'; + + public const METHOD_AFFIRM = 'Affirm'; + + public const METHOD_AFTERPAY = 'Afterpay'; + + public const METHOD_AIRCASH = 'Aircash'; + + public const METHOD_AIRPAY = 'Airpay'; + + public const METHOD_ALFA_CLICK = 'Alfa-click'; + + public const METHOD_ALIPAY = 'Alipay'; + + public const METHOD_AMAZON_PAY = 'AmazonPay'; + + public const METHOD_APPLE_PAY = 'Apple Pay'; + + public const METHOD_ASTRO_PAY_CARD = 'AstroPay Card'; + + public const METHOD_ASTRO_PAY_GO = 'AstroPay-GO'; + + public const METHOD_BANK_SEND = 'BankSEND'; + + public const METHOD_BANK_REFERENCED = 'BankReferenced'; + + public const METHOD_BANK_TRANSFER = 'bank-transfer'; + + public const METHOD_BANK_TRANSFER2 = 'bank-transfer-2'; + + public const METHOD_BANK_TRANSFER3 = 'bank-transfer-3'; + + public const METHOD_BANK_TRANSFER4 = 'bank-transfer-4'; + + public const METHOD_BANK_TRANSFER5 = 'bank-transfer-5'; + + public const METHOD_BANK_TRANSFER6 = 'bank-transfer-6'; + + public const METHOD_BANK_TRANSFER7 = 'bank-transfer-7'; + + public const METHOD_BANK_TRANSFER8 = 'bank-transfer-8'; + + public const METHOD_BANK_TRANSFER9 = 'bank-transfer-9'; + + public const METHOD_BALOTO = 'Baloto'; + + public const METHOD_BEELINE = 'Beeline'; + + public const METHOD_BELFIUS_DIRECT_NET = 'Belfius-direct-net'; + + public const METHOD_BITCOIN = 'bitcoin'; + + public const METHOD_BIZUM = 'Bizum'; + + public const METHOD_BLIK = 'Blik'; + + public const METHOD_BOLETO = 'Boleto'; + + public const METHOD_BOLETO2 = 'Boleto-2'; + + public const METHOD_BOLETO3 = 'Boleto-3'; + + public const METHOD_CASH_DEPOSIT = 'cash-deposit'; + + public const METHOD_CAS_HLIB = 'CASHlib'; + + public const METHOD_CASH_TO_CODE = 'CashToCode'; + + public const METHOD_CC_AVENUE = 'CCAvenue'; + + public const METHOD_CHINA_UNION_PAY = 'China UnionPay'; + + public const METHOD_CLEARPAY = 'Clearpay'; + + public const METHOD_CLEO = 'Cleo'; + + public const METHOD_COD_VOUCHER = 'CODVoucher'; + + public const METHOD_CONEKTA_OXXO = 'Conekta-oxxo'; + + public const METHOD_CONEKTA_SPEI = 'Conekta-spei'; + + public const METHOD_CRYPTOCURRENCY = 'cryptocurrency'; + + public const METHOD_CUPON_DE_PAGOS = 'Cupon-de-pagos'; + + public const METHOD_CYBER_SOURCE = 'CyberSource'; + + public const METHOD_DIMOCO_PAY_SMART = 'Dimoco-pay-smart'; + + public const METHOD_DIRECTA24_CARD = 'Directa24Card'; + + public const METHOD_DOMESTIC_CARDS = 'domestic-cards'; + + public const METHOD_EFECTY = 'Efecty'; + + public const METHOD_ECHECK = 'echeck'; + + public const METHOD_ECO_PAYZ = 'ecoPayz'; + + public const METHOD_ECO_PAYZ_TURKEY = 'ecoPayzTurkey'; + + public const METHOD_ECO_VOUCHER = 'ecoVoucher'; + + public const METHOD_EPS = 'EPS'; + + public const METHOD_E_PAY_BG = 'ePay.bg'; + + public const METHOD_ETHEREUM = 'Ethereum'; + + public const METHOD_E_WALLET = 'e-wallet'; + + public const METHOD_EZY_EFT = 'ezyEFT'; + + public const METHOD_E_ZEE_WALLET = 'eZeeWallet'; + + public const METHOD_FASTER_PAY = 'FasterPay'; + + public const METHOD_FLEXEPIN = 'Flexepin'; + + public const METHOD_GIROPAY = 'Giropay'; + + public const METHOD_GOOGLE_PAY = 'Google Pay'; + + public const METHOD_GPAYSAFE = 'Gpaysafe'; + + public const METHOD_I_CASH_ONE_VOUCHER = 'iCashOne Voucher'; + + public const METHOD_I_DEBIT = 'iDebit'; + + public const METHOD_I_DEAL = 'iDEAL'; + + public const METHOD_ING_HOMEPAY = 'ING-homepay'; + + public const METHOD_INOVAPAY_PIN = 'INOVAPAY-pin'; + + public const METHOD_INOVAPAY_WALLET = 'INOVAPAY-wallet'; + + public const METHOD_INSTA_DEBIT = 'InstaDebit'; + + public const METHOD_INSTANT_PAYMENTS = 'InstantPayments'; + + public const METHOD_INSTANT_BANK_TRANSFER = 'instant-bank-transfer'; + + public const METHOD_INTERAC_ONLINE = 'Interac-online'; + + public const METHOD_INTERAC_E_TRANSFER = 'Interac-eTransfer'; + + public const METHOD_INTERAC_EXPRESS_CONNECT = 'Interac-express-connect'; + + public const METHOD_INTERAC = 'Interac'; + + public const METHOD_INVOICE = 'invoice'; + + public const METHOD_I_WALLET = 'iWallet'; + + public const METHOD_JETON = 'Jeton'; + + public const METHOD_JETON_CASH = 'JetonCash'; + + public const METHOD_JPAY = 'jpay'; + + public const METHOD_KAKAO_PAY = 'KakaoPay'; + + public const METHOD_KHELOCARD = 'Khelocard'; + + public const METHOD_KLARNA = 'Klarna'; + + public const METHOD_KNOT = 'KNOT'; + + public const METHOD_LITECOIN = 'Litecoin'; + + public const METHOD_LOONIE = 'loonie'; + + public const METHOD_LPG_ONLINE = 'LPG-online'; + + public const METHOD_LPG_PAYMENT_CARD = 'LPG-payment-card'; + + public const METHOD_MATRIX = 'Matrix'; + + public const METHOD_MAXI_CASH = 'MaxiCash'; + + public const METHOD_MEGAFON = 'Megafon'; + + public const METHOD_MERCADO_PAGO = 'MercadoPago'; + + public const METHOD_MI_FINITY_E_WALLET = 'MiFinity-eWallet'; + + public const METHOD_MISCELLANEOUS = 'miscellaneous'; + + public const METHOD_MOBILE_PAY = 'MobilePay'; + + public const METHOD_MOLLIE = 'Mollie'; + + public const METHOD_MULTIBANCO = 'Multibanco'; + + public const METHOD_BANCONTACT = 'Bancontact'; + + public const METHOD_BANCONTACT_MOBILE = 'Bancontact-mobile'; + + public const METHOD_MTS = 'MTS'; + + public const METHOD_MUCH_BETTER = 'MuchBetter'; + + public const METHOD_MUCH_BETTER_VOUCHER = 'MuchBetterVoucher'; + + public const METHOD_MY_FATOORAH = 'MyFatoorah'; + + public const METHOD_NEOSURF = 'Neosurf'; + + public const METHOD_NETBANKING = 'Netbanking'; + + public const METHOD_NETELLER = 'Neteller'; + + public const METHOD_NORDEA_SOLO = 'Nordea-Solo'; + + public const METHOD_NORDIK_COIN = 'NordikCoin'; + + public const METHOD_OCHA_PAY = 'OchaPay'; + + public const METHOD_ONLINE_BANK_TRANSFER = 'online-bank-transfer'; + + public const METHOD_ONLINEUEBERWEISEN = 'Onlineueberweisen'; + + public const METHOD_ORIENTAL_WALLET = 'oriental-wallet'; + + public const METHOD_OXXO = 'OXXO'; + + public const METHOD_P24 = 'P24'; + + public const METHOD_PAGADITO = 'Pagadito'; + + public const METHOD_PAGO_EFFECTIVO = 'PagoEffectivo'; + + public const METHOD_PAGSMILE_LOTTERY = 'Pagsmile-lottery'; + + public const METHOD_PAGSMILE_DEPOSIT_EXPRESS = 'Pagsmile-deposit-express'; + + public const METHOD_PAY_CASH = 'PayCash'; + + public const METHOD_PAYCO = 'Payco'; + + public const METHOD_PAYEER = 'Payeer'; + + public const METHOD_PAYMENT_ASIA_CRYPTO = 'PaymentAsia-crypto'; + + public const METHOD_PAYSAFECARD = 'Paysafecard'; + + public const METHOD_PAY_TABS = 'PayTabs'; + + public const METHOD_PAY4_FUN = 'Pay4Fun'; + + public const METHOD_PAYNOTE = 'Paynote'; + + public const METHOD_PAYMERO = 'Paymero'; + + public const METHOD_PAYMERO_QR = 'Paymero-QR'; + + public const METHOD_PAY_U = 'PayU'; + + public const METHOD_PAY_U_LATAM = 'PayULatam'; + + public const METHOD_PERFECT_MONEY = 'Perfect-money'; + + public const METHOD_PIASTRIX = 'Piastrix'; + + public const METHOD_PIX = 'PIX'; + + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + + public const METHOD_PIN_PAY = 'PinPay'; + + public const METHOD_PHONE = 'phone'; + + public const METHOD_PHONE_PE = 'PhonePe'; + + public const METHOD_PO_LI = 'POLi'; + + public const METHOD_POST_FINANCE_CARD = 'PostFinance-card'; + + public const METHOD_POST_FINANCE_E_FINANCE = 'PostFinance-e-finance'; + + public const METHOD_QIWI = 'QIWI'; + + public const METHOD_Q_PAY = 'QPay'; + + public const METHOD_QQ_PAY = 'QQPay'; + + public const METHOD_QUICKPAY = 'Quickpay'; + + public const METHOD_RAPYD_CHECKOUT = 'rapyd-checkout'; + + public const METHOD_REBILLY_HOSTED_PAYMENT_FORM = 'rebilly-hosted-payment-form'; + + public const METHOD_RESURS = 'Resurs'; + + public const METHOD_REVERSE_WITHDRAWAL = 'reverse-withdrawal'; + + public const METHOD_RIPPLE = 'Ripple'; + + public const METHOD_SAFETY_PAY = 'SafetyPay'; + + public const METHOD_SAMSUNG_PAY = 'Samsung Pay'; + + public const METHOD_SEPA = 'SEPA'; + + public const METHOD_SIIRTO = 'Siirto'; + + public const METHOD_SKRILL = 'Skrill'; + + public const METHOD_SKRILL_RAPID_TRANSFER = 'Skrill Rapid Transfer'; + + public const METHOD_SMS_VOUCHER = 'SMSVoucher'; + + public const METHOD_SOFORT = 'Sofort'; + + public const METHOD_SPARK_PAY = 'SparkPay'; + + public const METHOD_SPEI = 'SPEI'; + + public const METHOD_SWIFT_DBT = 'swift-dbt'; + + public const METHOD_TELE2 = 'Tele2'; + + public const METHOD_TELR = 'Telr'; + + public const METHOD_TERMINALY_RF = 'Terminaly-RF'; + + public const METHOD_TETHER = 'Tether'; + + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; + + public const METHOD_TRUSTLY = 'Trustly'; + + public const METHOD_TUPAY = 'Tupay'; + + public const METHOD_TWINT = 'TWINT'; + + public const METHOD_UNI_CRYPT = 'UniCrypt'; + + public const METHOD_U_PAY_CARD = 'UPayCard'; + + public const METHOD_UPI = 'UPI'; + + public const METHOD_USD_COIN = 'USD-coin'; + + public const METHOD_V_CREDITOS = 'VCreditos'; + + public const METHOD_VEGA_WALLET = 'VegaWallet'; + + public const METHOD_VENUS_POINT = 'VenusPoint'; + + public const METHOD_VIVA = 'Viva'; + + public const METHOD_VOUCHER = 'voucher'; + + public const METHOD_VOUCHER2 = 'voucher-2'; + + public const METHOD_VOUCHER3 = 'voucher-3'; + + public const METHOD_VOUCHER4 = 'voucher-4'; + + public const METHOD_WALLET88 = 'Wallet88'; + + public const METHOD_WEBMONEY = 'Webmoney'; + + public const METHOD_WEBPAY = 'Webpay'; + + public const METHOD_WEBPAY2 = 'Webpay-2'; + + public const METHOD_WEBPAY_CARD = 'Webpay Card'; + + public const METHOD_WE_CHAT_PAY = 'WeChat Pay'; + + public const METHOD_X_PAY_P2_P = 'XPay-P2P'; + + public const METHOD_X_PAY_QR = 'XPay-QR'; + + public const METHOD_YANDEX_MONEY = 'Yandex-money'; + + public const METHOD_ZOTAPAY = 'Zotapay'; + + public const METHOD_ZIMPLER = 'Zimpler'; + + public const METHOD_ZIP = 'Zip'; + + private array $fields = []; + + public function __construct(array $data = [], array $metadata = []) + { + if (array_key_exists('method', $data)) { + $this->setMethod($data['method']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getMethod(): string + { + return $this->fields['method']; + } + + public function setMethod(string $method): static + { + $this->fields['method'] = $method; + + return $this; + } + + public function getPaymentInstrumentId(): string + { + return $this->fields['paymentInstrumentId']; + } + + public function setPaymentInstrumentId(string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('method', $this->fields)) { + $data['method'] = $this->fields['method']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + + return $data; + } } diff --git a/src/Model/CustomerDefaultPaymentInstrumentFactory.php b/src/Model/CustomerDefaultPaymentInstrumentFactory.php deleted file mode 100644 index c31d14711..000000000 --- a/src/Model/CustomerDefaultPaymentInstrumentFactory.php +++ /dev/null @@ -1,226 +0,0 @@ - AlternativePaymentInstrument::from($data, $metadata), - 'Aera' => AlternativePaymentInstrument::from($data, $metadata), - 'Affirm' => AlternativePaymentInstrument::from($data, $metadata), - 'Afterpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Aircash' => AlternativePaymentInstrument::from($data, $metadata), - 'Airpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Alfa-click' => AlternativePaymentInstrument::from($data, $metadata), - 'Alipay' => AlternativePaymentInstrument::from($data, $metadata), - 'AmazonPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Apple Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'AstroPay Card' => AlternativePaymentInstrument::from($data, $metadata), - 'AstroPay-GO' => AlternativePaymentInstrument::from($data, $metadata), - 'Baloto' => AlternativePaymentInstrument::from($data, $metadata), - 'Bancontact' => AlternativePaymentInstrument::from($data, $metadata), - 'Bancontact-mobile' => AlternativePaymentInstrument::from($data, $metadata), - 'BankReferenced' => AlternativePaymentInstrument::from($data, $metadata), - 'BankSEND' => AlternativePaymentInstrument::from($data, $metadata), - 'Beeline' => AlternativePaymentInstrument::from($data, $metadata), - 'Belfius-direct-net' => AlternativePaymentInstrument::from($data, $metadata), - 'Bizum' => AlternativePaymentInstrument::from($data, $metadata), - 'Blik' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto-2' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto-3' => AlternativePaymentInstrument::from($data, $metadata), - 'CASHlib' => AlternativePaymentInstrument::from($data, $metadata), - 'CCAvenue' => AlternativePaymentInstrument::from($data, $metadata), - 'CODVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'CashToCode' => AlternativePaymentInstrument::from($data, $metadata), - 'China UnionPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Clearpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Cleo' => AlternativePaymentInstrument::from($data, $metadata), - 'Conekta-oxxo' => AlternativePaymentInstrument::from($data, $metadata), - 'Conekta-spei' => AlternativePaymentInstrument::from($data, $metadata), - 'Cupon-de-pagos' => AlternativePaymentInstrument::from($data, $metadata), - 'CyberSource' => AlternativePaymentInstrument::from($data, $metadata), - 'Dimoco-pay-smart' => AlternativePaymentInstrument::from($data, $metadata), - 'Directa24Card' => AlternativePaymentInstrument::from($data, $metadata), - 'EPS' => AlternativePaymentInstrument::from($data, $metadata), - 'Efecty' => AlternativePaymentInstrument::from($data, $metadata), - 'Ethereum' => AlternativePaymentInstrument::from($data, $metadata), - 'FasterPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Flexepin' => AlternativePaymentInstrument::from($data, $metadata), - 'Giropay' => AlternativePaymentInstrument::from($data, $metadata), - 'Google Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Gpaysafe' => AlternativePaymentInstrument::from($data, $metadata), - 'ING-homepay' => AlternativePaymentInstrument::from($data, $metadata), - 'INOVAPAY-pin' => AlternativePaymentInstrument::from($data, $metadata), - 'INOVAPAY-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'InstaDebit' => AlternativePaymentInstrument::from($data, $metadata), - 'InstantPayments' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-eTransfer' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-express-connect' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-online' => AlternativePaymentInstrument::from($data, $metadata), - 'Jeton' => AlternativePaymentInstrument::from($data, $metadata), - 'JetonCash' => AlternativePaymentInstrument::from($data, $metadata), - 'KNOT' => AlternativePaymentInstrument::from($data, $metadata), - 'KakaoPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Khelocard' => AlternativePaymentInstrument::from($data, $metadata), - 'Klarna' => AlternativePaymentInstrument::from($data, $metadata), - 'LPG-online' => AlternativePaymentInstrument::from($data, $metadata), - 'LPG-payment-card' => AlternativePaymentInstrument::from($data, $metadata), - 'Litecoin' => AlternativePaymentInstrument::from($data, $metadata), - 'MTS' => AlternativePaymentInstrument::from($data, $metadata), - 'Matrix' => AlternativePaymentInstrument::from($data, $metadata), - 'MaxiCash' => AlternativePaymentInstrument::from($data, $metadata), - 'Megafon' => AlternativePaymentInstrument::from($data, $metadata), - 'MercadoPago' => AlternativePaymentInstrument::from($data, $metadata), - 'MiFinity-eWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'MobilePay' => AlternativePaymentInstrument::from($data, $metadata), - 'Mollie' => AlternativePaymentInstrument::from($data, $metadata), - 'MuchBetter' => AlternativePaymentInstrument::from($data, $metadata), - 'MuchBetterVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'Multibanco' => AlternativePaymentInstrument::from($data, $metadata), - 'MyFatoorah' => AlternativePaymentInstrument::from($data, $metadata), - 'Neosurf' => AlternativePaymentInstrument::from($data, $metadata), - 'Netbanking' => AlternativePaymentInstrument::from($data, $metadata), - 'Neteller' => AlternativePaymentInstrument::from($data, $metadata), - 'Nordea-Solo' => AlternativePaymentInstrument::from($data, $metadata), - 'NordikCoin' => AlternativePaymentInstrument::from($data, $metadata), - 'OXXO' => AlternativePaymentInstrument::from($data, $metadata), - 'OchaPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Onlineueberweisen' => AlternativePaymentInstrument::from($data, $metadata), - 'P24' => AlternativePaymentInstrument::from($data, $metadata), - 'PIX' => AlternativePaymentInstrument::from($data, $metadata), - 'POLi' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagadito' => AlternativePaymentInstrument::from($data, $metadata), - 'PagoEffectivo' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagsmile-deposit-express' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagsmile-lottery' => AlternativePaymentInstrument::from($data, $metadata), - 'Pay4Fun' => AlternativePaymentInstrument::from($data, $metadata), - 'PayCash' => AlternativePaymentInstrument::from($data, $metadata), - 'PayTabs' => AlternativePaymentInstrument::from($data, $metadata), - 'PayU' => AlternativePaymentInstrument::from($data, $metadata), - 'PayULatam' => AlternativePaymentInstrument::from($data, $metadata), - 'Payco' => AlternativePaymentInstrument::from($data, $metadata), - 'Payeer' => AlternativePaymentInstrument::from($data, $metadata), - 'PaymentAsia-crypto' => AlternativePaymentInstrument::from($data, $metadata), - 'Paymero' => AlternativePaymentInstrument::from($data, $metadata), - 'Paymero-QR' => AlternativePaymentInstrument::from($data, $metadata), - 'Paynote' => AlternativePaymentInstrument::from($data, $metadata), - 'Paysafecard' => AlternativePaymentInstrument::from($data, $metadata), - 'Perfect-money' => AlternativePaymentInstrument::from($data, $metadata), - 'PhonePe' => AlternativePaymentInstrument::from($data, $metadata), - 'Piastrix' => AlternativePaymentInstrument::from($data, $metadata), - 'PinPay' => AlternativePaymentInstrument::from($data, $metadata), - 'PostFinance-card' => AlternativePaymentInstrument::from($data, $metadata), - 'PostFinance-e-finance' => AlternativePaymentInstrument::from($data, $metadata), - 'QIWI' => AlternativePaymentInstrument::from($data, $metadata), - 'QPay' => AlternativePaymentInstrument::from($data, $metadata), - 'QQPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Quickpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Resurs' => AlternativePaymentInstrument::from($data, $metadata), - 'Ripple' => AlternativePaymentInstrument::from($data, $metadata), - 'SEPA' => AlternativePaymentInstrument::from($data, $metadata), - 'SMSVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'SPEI' => AlternativePaymentInstrument::from($data, $metadata), - 'SafetyPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Samsung Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Siirto' => AlternativePaymentInstrument::from($data, $metadata), - 'Skrill' => AlternativePaymentInstrument::from($data, $metadata), - 'Skrill Rapid Transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'Sofort' => AlternativePaymentInstrument::from($data, $metadata), - 'SparkPay' => AlternativePaymentInstrument::from($data, $metadata), - 'TWINT' => AlternativePaymentInstrument::from($data, $metadata), - 'Tele2' => AlternativePaymentInstrument::from($data, $metadata), - 'Telr' => AlternativePaymentInstrument::from($data, $metadata), - 'Terminaly-RF' => AlternativePaymentInstrument::from($data, $metadata), - 'Tether' => AlternativePaymentInstrument::from($data, $metadata), - 'ToditoCash-card' => AlternativePaymentInstrument::from($data, $metadata), - 'Trustly' => AlternativePaymentInstrument::from($data, $metadata), - 'Tupay' => AlternativePaymentInstrument::from($data, $metadata), - 'UPI' => AlternativePaymentInstrument::from($data, $metadata), - 'UPayCard' => AlternativePaymentInstrument::from($data, $metadata), - 'USD-coin' => AlternativePaymentInstrument::from($data, $metadata), - 'UniCrypt' => AlternativePaymentInstrument::from($data, $metadata), - 'VCreditos' => AlternativePaymentInstrument::from($data, $metadata), - 'VegaWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'VenusPoint' => AlternativePaymentInstrument::from($data, $metadata), - 'Viva' => AlternativePaymentInstrument::from($data, $metadata), - 'Wallet88' => AlternativePaymentInstrument::from($data, $metadata), - 'WeChat Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Webmoney' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay Card' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay-2' => AlternativePaymentInstrument::from($data, $metadata), - 'XPay-P2P' => AlternativePaymentInstrument::from($data, $metadata), - 'XPay-QR' => AlternativePaymentInstrument::from($data, $metadata), - 'Yandex-money' => AlternativePaymentInstrument::from($data, $metadata), - 'Zimpler' => AlternativePaymentInstrument::from($data, $metadata), - 'Zip' => AlternativePaymentInstrument::from($data, $metadata), - 'Zotapay' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-2' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-3' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-4' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-5' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-6' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-7' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-8' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-9' => AlternativePaymentInstrument::from($data, $metadata), - 'bitcoin' => AlternativePaymentInstrument::from($data, $metadata), - 'cash-deposit' => AlternativePaymentInstrument::from($data, $metadata), - 'cryptocurrency' => AlternativePaymentInstrument::from($data, $metadata), - 'domestic-cards' => AlternativePaymentInstrument::from($data, $metadata), - 'e-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'ePay.bg' => AlternativePaymentInstrument::from($data, $metadata), - 'eZeeWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'echeck' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoPayz' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoPayzTurkey' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'ezyEFT' => AlternativePaymentInstrument::from($data, $metadata), - 'iCashOne Voucher' => AlternativePaymentInstrument::from($data, $metadata), - 'iDEAL' => AlternativePaymentInstrument::from($data, $metadata), - 'iDebit' => AlternativePaymentInstrument::from($data, $metadata), - 'iWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'instant-bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'invoice' => AlternativePaymentInstrument::from($data, $metadata), - 'jpay' => AlternativePaymentInstrument::from($data, $metadata), - 'loonie' => AlternativePaymentInstrument::from($data, $metadata), - 'miscellaneous' => AlternativePaymentInstrument::from($data, $metadata), - 'online-bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'oriental-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'phone' => AlternativePaymentInstrument::from($data, $metadata), - 'rapyd-checkout' => AlternativePaymentInstrument::from($data, $metadata), - 'rebilly-hosted-payment-form' => AlternativePaymentInstrument::from($data, $metadata), - 'reverse-withdrawal' => AlternativePaymentInstrument::from($data, $metadata), - 'swift-dbt' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-2' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-3' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-4' => AlternativePaymentInstrument::from($data, $metadata), - 'cash' => CashInstrument::from($data, $metadata), - 'check' => CheckInstrument::from($data, $metadata), - default => throw new UnknownDiscriminatorValueException(), - }; - } -} diff --git a/src/Model/CustomerTimeline.php b/src/Model/CustomerTimeline.php index c0b8395ff..23e9825ab 100644 --- a/src/Model/CustomerTimeline.php +++ b/src/Model/CustomerTimeline.php @@ -123,6 +123,12 @@ class CustomerTimeline implements JsonSerializable public const TYPE_ORDER_DOWNGRADED = 'order-downgraded'; + public const TYPE_ORDER_CHANGE_APPLIED = 'order-change-applied'; + + public const TYPE_ORDER_CHANGE_CANCELED = 'order-change-canceled'; + + public const TYPE_ORDER_CHANGE_CREATED = 'order-change-created'; + public const TYPE_ORDER_PAID_EARLY = 'order-paid-early'; public const TYPE_ORDER_REACTIVATED = 'order-reactivated'; @@ -165,6 +171,10 @@ class CustomerTimeline implements JsonSerializable public const TYPE_REFUND_WAS_REFLECTED_IN_INVOICES = 'refund-was-reflected-in-invoices'; + public const TYPE_SUBSCRIPTION_PAUSE_CREATED = 'subscription-pause-created'; + + public const TYPE_SUBSCRIPTION_PAUSE_REVOKED = 'subscription-pause-revoked'; + public const TYPE_SUBSCRIPTION_PAUSED = 'subscription-paused'; public const TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; @@ -187,12 +197,18 @@ class CustomerTimeline implements JsonSerializable public const TYPE_TRANSACTION_RECONCILED = 'transaction-reconciled'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; public const TYPE_TRANSACTION_VOIDED = 'transaction-voided'; public const TYPE_TRANSACTION_WAITING_GATEWAY = 'transaction-waiting-gateway'; + public const TYPE_WALLET_ADMIN_CREDITED = 'wallet-admin-credited'; + + public const TYPE_WALLET_ADMIN_DEBITED = 'wallet-admin-debited'; + public const TRIGGERED_BY_REBILLY = 'rebilly'; public const TRIGGERED_BY_APP = 'app'; diff --git a/src/Model/CustomersDataExport.php b/src/Model/CustomersDataExport.php index 32e7bc5d7..adfeb3194 100644 --- a/src/Model/CustomersDataExport.php +++ b/src/Model/CustomersDataExport.php @@ -40,6 +40,14 @@ class CustomersDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?CustomersDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/DashboardTab.php b/src/Model/DashboardTab.php index b6cda8cd0..14ca352c9 100644 --- a/src/Model/DashboardTab.php +++ b/src/Model/DashboardTab.php @@ -21,6 +21,12 @@ class DashboardTab implements JsonSerializable { use HasMetadata; + public const PRESET_PAYMENTS = 'Payments'; + + public const PRESET_BILLING = 'Billing'; + + public const PRESET_KYC = 'KYC'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -31,6 +37,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('tiles', $data)) { $this->setTiles($data['tiles']); } + if (array_key_exists('preset', $data)) { + $this->setPreset($data['preset']); + } $this->setMetadata($metadata); } @@ -74,6 +83,18 @@ public function setTiles(array $tiles): static return $this; } + public function getPreset(): ?string + { + return $this->fields['preset'] ?? null; + } + + public function setPreset(null|string $preset): static + { + $this->fields['preset'] = $preset; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -86,6 +107,9 @@ public function jsonSerialize(): array $this->fields['tiles'], ); } + if (array_key_exists('preset', $this->fields)) { + $data['preset'] = $this->fields['preset']; + } return $data; } diff --git a/src/Model/DashboardTile.php b/src/Model/DashboardTile.php index b87601c5b..bd45252a7 100644 --- a/src/Model/DashboardTile.php +++ b/src/Model/DashboardTile.php @@ -14,6 +14,8 @@ namespace Rebilly\Sdk\Model; +use DateTimeImmutable; +use DateTimeInterface; use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; @@ -28,12 +30,24 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('metric', $data)) { $this->setMetric($data['metric']); } + if (array_key_exists('title', $data)) { + $this->setTitle($data['title']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } if (array_key_exists('columnsWidth', $data)) { $this->setColumnsWidth($data['columnsWidth']); } + if (array_key_exists('periodStart', $data)) { + $this->setPeriodStart($data['periodStart']); + } + if (array_key_exists('periodEnd', $data)) { + $this->setPeriodEnd($data['periodEnd']); + } $this->setMetadata($metadata); } @@ -54,6 +68,30 @@ public function setMetric(string $metric): static return $this; } + public function getTitle(): ?string + { + return $this->fields['title'] ?? null; + } + + public function setTitle(null|string $title): static + { + $this->fields['title'] = $title; + + return $this; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + public function getDateRange(): ?string { return $this->fields['dateRange'] ?? null; @@ -78,19 +116,63 @@ public function setColumnsWidth(null|int $columnsWidth): static return $this; } + public function getPeriodStart(): ?DateTimeImmutable + { + return $this->fields['periodStart'] ?? null; + } + + public function getPeriodEnd(): ?DateTimeImmutable + { + return $this->fields['periodEnd'] ?? null; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('metric', $this->fields)) { $data['metric'] = $this->fields['metric']; } + if (array_key_exists('title', $this->fields)) { + $data['title'] = $this->fields['title']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']; } if (array_key_exists('columnsWidth', $this->fields)) { $data['columnsWidth'] = $this->fields['columnsWidth']; } + if (array_key_exists('periodStart', $this->fields)) { + $data['periodStart'] = $this->fields['periodStart']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('periodEnd', $this->fields)) { + $data['periodEnd'] = $this->fields['periodEnd']?->format(DateTimeInterface::RFC3339); + } return $data; } + + private function setPeriodStart(null|DateTimeImmutable|string $periodStart): static + { + if ($periodStart !== null && !($periodStart instanceof DateTimeImmutable)) { + $periodStart = new DateTimeImmutable($periodStart); + } + + $this->fields['periodStart'] = $periodStart; + + return $this; + } + + private function setPeriodEnd(null|DateTimeImmutable|string $periodEnd): static + { + if ($periodEnd !== null && !($periodEnd instanceof DateTimeImmutable)) { + $periodEnd = new DateTimeImmutable($periodEnd); + } + + $this->fields['periodEnd'] = $periodEnd; + + return $this; + } } diff --git a/src/Model/DataExport.php b/src/Model/DataExport.php index 34678bec1..183476215 100644 --- a/src/Model/DataExport.php +++ b/src/Model/DataExport.php @@ -73,7 +73,9 @@ public function getUpdatedTime(): ?DateTimeImmutable; public function getStatus(): ?string; - public function getDateRange(): null|AmlChecksDataExportDateRange|CustomersDataExportDateRange|DisputesDataExportDateRange|InvoiceItemsDataExportDateRange|InvoicesDataExportDateRange|JournalRecordsDataExportDateRange|PayoutRequestAllocationsDataExportDateRange|PayoutRequestsDataExportDateRange|SubscriptionsDataExportDateRange|TransactionsDataExportDateRange; + public function getFailureReason(): ?string; + + public function getDateRange(): null|AmlChecksDataExportDateRange|CustomersDataExportDateRange|DisputesDataExportDateRange|InvoiceItemsDataExportDateRange|InvoicesDataExportDateRange|JournalRecordsDataExportDateRange|PayoutRequestAllocationsDataExportDateRange|PayoutRequestsDataExportDateRange|SubscriptionsDataExportDateRange|TransactionsDataExportDateRange|UsersDataExportDateRange; public function setDateRange(null|array $dateRange): static; @@ -82,7 +84,7 @@ public function setDateRange(null|array $dateRange): static; */ public function getLinks(): ?array; - public function getEmbedded(): null|AmlChecksDataExportEmbedded|CustomersDataExportEmbedded|DisputesDataExportEmbedded|InvoiceItemsDataExportEmbedded|InvoicesDataExportEmbedded|JournalRecordsDataExportEmbedded|PayoutRequestAllocationsDataExportEmbedded|PayoutRequestsDataExportEmbedded|SubscriptionsDataExportEmbedded|TransactionsDataExportEmbedded; + public function getEmbedded(): null|AmlChecksDataExportEmbedded|CustomersDataExportEmbedded|DisputesDataExportEmbedded|InvoiceItemsDataExportEmbedded|InvoicesDataExportEmbedded|JournalRecordsDataExportEmbedded|PayoutRequestAllocationsDataExportEmbedded|PayoutRequestsDataExportEmbedded|SubscriptionsDataExportEmbedded|TransactionsDataExportEmbedded|UsersDataExportEmbedded; public function setEmbedded(null|array $embedded): static; } diff --git a/src/Model/DataExportFactory.php b/src/Model/DataExportFactory.php index af68afea1..8b030222b 100644 --- a/src/Model/DataExportFactory.php +++ b/src/Model/DataExportFactory.php @@ -31,6 +31,7 @@ public static function from(array $data = [], array $metadata = []): DataExport 'payoutRequests' => PayoutRequestsDataExport::from($data, $metadata), 'subscriptions' => SubscriptionsDataExport::from($data, $metadata), 'transactions' => TransactionsDataExport::from($data, $metadata), + 'users' => UsersDataExport::from($data, $metadata), default => throw new UnknownDiscriminatorValueException(), }; } diff --git a/src/Model/DepositRequest.php b/src/Model/DepositRequest.php index 6fdb4cca3..f8977c793 100644 --- a/src/Model/DepositRequest.php +++ b/src/Model/DepositRequest.php @@ -54,6 +54,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('coinPricing', $data)) { + $this->setCoinPricing($data['coinPricing']); + } if (array_key_exists('currency', $data)) { $this->setCurrency($data['currency']); } @@ -72,12 +75,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('expirationTime', $data)) { $this->setExpirationTime($data['expirationTime']); } - if (array_key_exists('propertiesSchema', $data)) { - $this->setPropertiesSchema($data['propertiesSchema']); - } - if (array_key_exists('properties', $data)) { - $this->setProperties($data['properties']); - } if (array_key_exists('notificationUrl', $data)) { $this->setNotificationUrl($data['notificationUrl']); } @@ -159,6 +156,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getCoinPricing(): ?CoinPricing + { + return $this->fields['coinPricing'] ?? null; + } + public function getCurrency(): string { return $this->fields['currency']; @@ -254,19 +256,6 @@ public function setExpirationTime(null|DateTimeImmutable|string $expirationTime) return $this; } - public function getPropertiesSchema(): ?array - { - return $this->fields['propertiesSchema'] ?? null; - } - - /** - * @return null|array - */ - public function getProperties(): ?array - { - return $this->fields['properties'] ?? null; - } - public function getNotificationUrl(): ?string { return $this->fields['notificationUrl'] ?? null; @@ -348,6 +337,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('coinPricing', $this->fields)) { + $data['coinPricing'] = $this->fields['coinPricing']?->jsonSerialize(); + } if (array_key_exists('currency', $this->fields)) { $data['currency'] = $this->fields['currency']; } @@ -366,14 +358,6 @@ public function jsonSerialize(): array if (array_key_exists('expirationTime', $this->fields)) { $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); } - if (array_key_exists('propertiesSchema', $this->fields)) { - $data['propertiesSchema'] = $this->fields['propertiesSchema']; - } - if (array_key_exists('properties', $this->fields)) { - $data['properties'] = $this->fields['properties'] !== null - ? (object) $this->fields['properties'] - : null; - } if (array_key_exists('notificationUrl', $this->fields)) { $data['notificationUrl'] = $this->fields['notificationUrl']; } @@ -418,19 +402,13 @@ private function setStatus(null|string $status): static return $this; } - private function setPropertiesSchema(null|array $propertiesSchema): static + private function setCoinPricing(null|CoinPricing|array $coinPricing): static { - $this->fields['propertiesSchema'] = $propertiesSchema; - - return $this; - } + if ($coinPricing !== null && !($coinPricing instanceof CoinPricing)) { + $coinPricing = CoinPricingFactory::from($coinPricing); + } - /** - * @param null|array $properties - */ - private function setProperties(null|array $properties): static - { - $this->fields['properties'] = $properties; + $this->fields['coinPricing'] = $coinPricing; return $this; } diff --git a/src/Model/DepositStrategy.php b/src/Model/DepositStrategy.php index 9fb2b829a..a770e53ac 100644 --- a/src/Model/DepositStrategy.php +++ b/src/Model/DepositStrategy.php @@ -48,6 +48,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isActive', $data)) { $this->setIsActive($data['isActive']); } + if (array_key_exists('coinPricing', $data)) { + $this->setCoinPricing($data['coinPricing']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -150,6 +153,22 @@ public function setIsActive(null|bool $isActive): static return $this; } + public function getCoinPricing(): ?CoinPricing + { + return $this->fields['coinPricing'] ?? null; + } + + public function setCoinPricing(null|CoinPricing|array $coinPricing): static + { + if ($coinPricing !== null && !($coinPricing instanceof CoinPricing)) { + $coinPricing = CoinPricingFactory::from($coinPricing); + } + + $this->fields['coinPricing'] = $coinPricing; + + return $this; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -192,6 +211,9 @@ public function jsonSerialize(): array if (array_key_exists('isActive', $this->fields)) { $data['isActive'] = $this->fields['isActive']; } + if (array_key_exists('coinPricing', $this->fields)) { + $data['coinPricing'] = $this->fields['coinPricing']?->jsonSerialize(); + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } diff --git a/src/Model/PayoutRequestSplit.php b/src/Model/DigitalWalletOnboardingApplePayDomains.php similarity index 55% rename from src/Model/PayoutRequestSplit.php rename to src/Model/DigitalWalletOnboardingApplePayDomains.php index 6e95c63ca..6093fb00d 100644 --- a/src/Model/PayoutRequestSplit.php +++ b/src/Model/DigitalWalletOnboardingApplePayDomains.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PayoutRequestSplit implements JsonSerializable +class DigitalWalletOnboardingApplePayDomains implements JsonSerializable { use HasMetadata; @@ -25,8 +25,8 @@ class PayoutRequestSplit implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('amounts', $data)) { - $this->setAmounts($data['amounts']); + if (array_key_exists('domains', $data)) { + $this->setDomains($data['domains']); } $this->setMetadata($metadata); } @@ -37,35 +37,30 @@ public static function from(array $data = [], array $metadata = []): self } /** - * @return float[] + * @return string[] */ - public function getAmounts(): array + public function getDomains(): array { - return $this->fields['amounts']; - } - - /** - * @param float[]|string[] $amounts - */ - public function setAmounts(array $amounts): static - { - $amounts = array_map( - fn ($value) => is_string($value) ? (float) $value : $value, - $amounts, - ); - - $this->fields['amounts'] = $amounts; - - return $this; + return $this->fields['domains']; } public function jsonSerialize(): array { $data = []; - if (array_key_exists('amounts', $this->fields)) { - $data['amounts'] = $this->fields['amounts']; + if (array_key_exists('domains', $this->fields)) { + $data['domains'] = $this->fields['domains']; } return $data; } + + /** + * @param string[] $domains + */ + private function setDomains(array $domains): static + { + $this->fields['domains'] = $domains; + + return $this; + } } diff --git a/src/Model/DisputesDataExport.php b/src/Model/DisputesDataExport.php index d51ffedb4..a1e5b69b7 100644 --- a/src/Model/DisputesDataExport.php +++ b/src/Model/DisputesDataExport.php @@ -38,6 +38,14 @@ class DisputesDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?DisputesDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/EmailNotification.php b/src/Model/EmailNotification.php index 7934ae02b..438345092 100644 --- a/src/Model/EmailNotification.php +++ b/src/Model/EmailNotification.php @@ -91,6 +91,14 @@ class EmailNotification implements JsonSerializable public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER = 'invoice-past-due-reminder'; + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER15_DAYS = 'invoice-past-due-reminder-15-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER30_DAYS = 'invoice-past-due-reminder-30-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER60_DAYS = 'invoice-past-due-reminder-60-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER90_DAYS = 'invoice-past-due-reminder-90-days'; + public const EVENT_TYPE_INVOICE_REFUNDED = 'invoice-refunded'; public const EVENT_TYPE_INVOICE_REVENUE_RECOGNIZED = 'invoice-revenue-recognized'; @@ -113,10 +121,22 @@ class EmailNotification implements JsonSerializable public const EVENT_TYPE_ORDER_COMPLETED = 'order-completed'; + public const EVENT_TYPE_ORDER_CHANGE_APPLIED = 'order-change-applied'; + + public const EVENT_TYPE_ORDER_CHANGE_CANCELED = 'order-change-canceled'; + + public const EVENT_TYPE_ORDER_CHANGE_CREATED = 'order-change-created'; + public const EVENT_TYPE_PAYMENT_CARD_CREATED = 'payment-card-created'; public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER = 'payment-card-expiration-reminder'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER1_DAY = 'payment-card-expiration-reminder-1-day'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER14_DAYS = 'payment-card-expiration-reminder-14-days'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER7_DAYS = 'payment-card-expiration-reminder-7-days'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; public const EVENT_TYPE_PAYMENT_INSTRUMENT_MODIFIED = 'payment-instrument-modified'; @@ -183,6 +203,12 @@ class EmailNotification implements JsonSerializable public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER = 'subscription-renewal-reminder'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER1_DAY = 'subscription-renewal-reminder-1-day'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER30_DAYS = 'subscription-renewal-reminder-30-days'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER7_DAYS = 'subscription-renewal-reminder-7-days'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWED = 'subscription-renewed'; public const EVENT_TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; diff --git a/src/Model/File.php b/src/Model/File.php index e24c4894a..bff466181 100644 --- a/src/Model/File.php +++ b/src/Model/File.php @@ -39,6 +39,8 @@ class File implements JsonSerializable public const MIME_IMAGE_GIF = 'image/gif'; + public const MIME_IMAGE_WEBP = 'image/webp'; + public const MIME_APPLICATION_PDF = 'application/pdf'; public const MIME_APPLICATION_JSON = 'application/json'; diff --git a/src/Model/FlexiblePlan.php b/src/Model/FlexiblePlan.php index e06c73811..14b06daa1 100644 --- a/src/Model/FlexiblePlan.php +++ b/src/Model/FlexiblePlan.php @@ -18,6 +18,10 @@ interface FlexiblePlan extends ConfigurablePlan { + public function getType(): ?string; + + public function setType(null|string $type): static; + public function getName(): ?string; public function setName(null|string $name): static; @@ -54,6 +58,10 @@ public function getSetup(): ?PlanSetup; public function setSetup(null|PlanSetup|array $setup): static; + public function getSetupFee(): ?float; + + public function setSetupFee(null|float|string $setupFee): static; + public function getCustomFields(): ?array; public function setCustomFields(null|array $customFields): static; @@ -66,6 +74,10 @@ public function getRevision(): ?int; public function getIsTrialOnly(): ?bool; + public function getRecurringInterval(): ?FlexiblePlanSubscriptionPlanRecurringInterval; + + public function getTrial(): null|FlexiblePlanTrialOnlyPlanTrial|PlanTrial; + public function getCreatedTime(): ?DateTimeImmutable; public function getUpdatedTime(): ?DateTimeImmutable; diff --git a/src/Model/FlexiblePlanOneTimeSalePlan.php b/src/Model/FlexiblePlanOneTimeSalePlan.php index a4aaaea5f..dd1b91e23 100644 --- a/src/Model/FlexiblePlanOneTimeSalePlan.php +++ b/src/Model/FlexiblePlanOneTimeSalePlan.php @@ -22,10 +22,15 @@ class FlexiblePlanOneTimeSalePlan implements FlexiblePlan { use HasMetadata; + public const TYPE_ONE_TIME_SALE = 'one-time-sale'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } if (array_key_exists('name', $data)) { $this->setName($data['name']); } @@ -53,6 +58,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -65,6 +73,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -85,6 +99,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -200,6 +226,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -234,6 +276,16 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): null + { + return $this->fields['trial'] ?? null; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -267,6 +319,9 @@ public function setId(string $id): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -296,6 +351,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -308,6 +366,12 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']; + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } @@ -350,6 +414,20 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setTrial(null $trial): static + { + $this->fields['trial'] = $trial; + + return $this; + } + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/FlexiblePlanSubscriptionPlan.php b/src/Model/FlexiblePlanSubscriptionPlan.php index 50b6b1f1d..789991a76 100644 --- a/src/Model/FlexiblePlanSubscriptionPlan.php +++ b/src/Model/FlexiblePlanSubscriptionPlan.php @@ -22,10 +22,15 @@ class FlexiblePlanSubscriptionPlan implements FlexiblePlan { use HasMetadata; + public const TYPE_SUBSCRIPTION = 'subscription'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } if (array_key_exists('name', $data)) { $this->setName($data['name']); } @@ -53,6 +58,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -97,6 +105,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -212,6 +232,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -246,14 +282,14 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getRecurringInterval(): ?FlexiblePlanSubscriptionPlanRecurringInterval + public function getRecurringInterval(): FlexiblePlanSubscriptionPlanRecurringInterval { - return $this->fields['recurringInterval'] ?? null; + return $this->fields['recurringInterval']; } - public function setRecurringInterval(null|FlexiblePlanSubscriptionPlanRecurringInterval|array $recurringInterval): static + public function setRecurringInterval(FlexiblePlanSubscriptionPlanRecurringInterval|array $recurringInterval): static { - if ($recurringInterval !== null && !($recurringInterval instanceof FlexiblePlanSubscriptionPlanRecurringInterval)) { + if (!($recurringInterval instanceof FlexiblePlanSubscriptionPlanRecurringInterval)) { $recurringInterval = FlexiblePlanSubscriptionPlanRecurringInterval::from($recurringInterval); } @@ -332,6 +368,9 @@ public function setId(string $id): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -361,6 +400,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -374,7 +416,7 @@ public function jsonSerialize(): array $data['isTrialOnly'] = $this->fields['isTrialOnly']; } if (array_key_exists('recurringInterval', $this->fields)) { - $data['recurringInterval'] = $this->fields['recurringInterval']?->jsonSerialize(); + $data['recurringInterval'] = $this->fields['recurringInterval']->jsonSerialize(); } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']?->jsonSerialize(); diff --git a/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php b/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php index 0bf5d87a8..72ebc611e 100644 --- a/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php +++ b/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php @@ -38,6 +38,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('max', $data)) { $this->setMax($data['max']); } + if (array_key_exists('sticky', $data)) { + $this->setSticky($data['sticky']); + } $this->setMetadata($metadata); } @@ -90,6 +93,18 @@ public function setMax(null|float|string $max): static return $this; } + public function getSticky(): ?bool + { + return $this->fields['sticky'] ?? null; + } + + public function setSticky(null|bool $sticky): static + { + $this->fields['sticky'] = $sticky; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -102,6 +117,9 @@ public function jsonSerialize(): array if (array_key_exists('max', $this->fields)) { $data['max'] = $this->fields['max']; } + if (array_key_exists('sticky', $this->fields)) { + $data['sticky'] = $this->fields['sticky']; + } return $data; } diff --git a/src/Model/FlexiblePlanTrialOnlyPlan.php b/src/Model/FlexiblePlanTrialOnlyPlan.php index db754f61a..a183f7659 100644 --- a/src/Model/FlexiblePlanTrialOnlyPlan.php +++ b/src/Model/FlexiblePlanTrialOnlyPlan.php @@ -22,10 +22,15 @@ class FlexiblePlanTrialOnlyPlan implements FlexiblePlan { use HasMetadata; + public const TYPE_TRIAL_ONLY = 'trial-only'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } if (array_key_exists('name', $data)) { $this->setName($data['name']); } @@ -50,6 +55,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -62,6 +70,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } if (array_key_exists('trial', $data)) { $this->setTrial($data['trial']); } @@ -88,6 +99,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -187,6 +210,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -221,15 +260,20 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getTrial(): PlanTrial + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): FlexiblePlanTrialOnlyPlanTrial { return $this->fields['trial']; } - public function setTrial(PlanTrial|array $trial): static + public function setTrial(FlexiblePlanTrialOnlyPlanTrial|array $trial): static { - if (!($trial instanceof PlanTrial)) { - $trial = PlanTrial::from($trial); + if (!($trial instanceof FlexiblePlanTrialOnlyPlanTrial)) { + $trial = FlexiblePlanTrialOnlyPlanTrial::from($trial); } $this->fields['trial'] = $trial; @@ -275,6 +319,9 @@ public function setId(string $id): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -301,6 +348,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -313,6 +363,9 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']->jsonSerialize(); } @@ -361,6 +414,13 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static { if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { diff --git a/src/Model/FlexiblePlanTrialOnlyPlanTrial.php b/src/Model/FlexiblePlanTrialOnlyPlanTrial.php new file mode 100644 index 000000000..2c74d8247 --- /dev/null +++ b/src/Model/FlexiblePlanTrialOnlyPlanTrial.php @@ -0,0 +1,86 @@ +setPrice($data['price']); + } + if (array_key_exists('period', $data)) { + $this->setPeriod($data['period']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPrice(): float + { + return $this->fields['price']; + } + + public function setPrice(float|string $price): static + { + if (is_string($price)) { + $price = (float) $price; + } + + $this->fields['price'] = $price; + + return $this; + } + + public function getPeriod(): FlexiblePlanTrialOnlyPlanTrialPeriod + { + return $this->fields['period']; + } + + public function setPeriod(FlexiblePlanTrialOnlyPlanTrialPeriod|array $period): static + { + if (!($period instanceof FlexiblePlanTrialOnlyPlanTrialPeriod)) { + $period = FlexiblePlanTrialOnlyPlanTrialPeriod::from($period); + } + + $this->fields['period'] = $period; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('price', $this->fields)) { + $data['price'] = $this->fields['price']; + } + if (array_key_exists('period', $this->fields)) { + $data['period'] = $this->fields['period']->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/FlexiblePlanTrialOnlyPlanTrialPeriod.php b/src/Model/FlexiblePlanTrialOnlyPlanTrialPeriod.php new file mode 100644 index 000000000..894024228 --- /dev/null +++ b/src/Model/FlexiblePlanTrialOnlyPlanTrialPeriod.php @@ -0,0 +1,86 @@ +setUnit($data['unit']); + } + if (array_key_exists('length', $data)) { + $this->setLength($data['length']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getUnit(): string + { + return $this->fields['unit']; + } + + public function setUnit(string $unit): static + { + $this->fields['unit'] = $unit; + + return $this; + } + + public function getLength(): int + { + return $this->fields['length']; + } + + public function setLength(int $length): static + { + $this->fields['length'] = $length; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('unit', $this->fields)) { + $data['unit'] = $this->fields['unit']; + } + if (array_key_exists('length', $this->fields)) { + $data['length'] = $this->fields['length']; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index 279b64753..e6b935c9f 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -206,6 +206,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -330,6 +332,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -434,6 +438,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const GATEWAY_NAME_THUNES = 'Thunes'; + public const GATEWAY_NAME_TODITO_CASH = 'ToditoCash'; public const GATEWAY_NAME_TRIPLE000 = 'Triple000'; @@ -768,6 +774,8 @@ abstract class GatewayAccount implements JsonSerializable public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; @@ -858,6 +866,8 @@ abstract class GatewayAccount implements JsonSerializable public const ACQUIRER_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const ACQUIRER_NAME_THUNES = 'Thunes'; + public const ACQUIRER_NAME_TODITO_CASH = 'ToditoCash'; public const ACQUIRER_NAME_TRIPLE000 = 'Triple000'; @@ -1174,6 +1184,8 @@ abstract class GatewayAccount implements JsonSerializable public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; @@ -1234,6 +1246,8 @@ abstract class GatewayAccount implements JsonSerializable public const METHOD_TETHER = 'Tether'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; @@ -1433,6 +1447,9 @@ protected function __construct(array $data = [], array $metadata = []) if (array_key_exists('readyToPayoutInstruction', $data)) { $this->setReadyToPayoutInstruction($data['readyToPayoutInstruction']); } + if (array_key_exists('payoutLimits', $data)) { + $this->setPayoutLimits($data['payoutLimits']); + } if (array_key_exists('transactionEmailAliasTemplate', $data)) { $this->setTransactionEmailAliasTemplate($data['transactionEmailAliasTemplate']); } @@ -1637,6 +1654,8 @@ public static function from(array $data = [], array $metadata = []): self return IDebit::from($data, $metadata); case 'Ilixium': return Ilixium::from($data, $metadata); + case 'IMerchant': + return IMerchant::from($data, $metadata); case 'Ingenico': return Ingenico::from($data, $metadata); case 'INOVAPAY': @@ -1761,6 +1780,8 @@ public static function from(array $data = [], array $metadata = []): self return Payeezy::from($data, $metadata); case 'Payflow': return Payflow::from($data, $metadata); + case 'PayGlocal': + return PayGlocal::from($data, $metadata); case 'PaymentAsia': return PaymentAsia::from($data, $metadata); case 'PaymenTechnologies': @@ -1865,6 +1886,8 @@ public static function from(array $data = [], array $metadata = []): self return Telr::from($data, $metadata); case 'TestProcessor': return TestProcessor::from($data, $metadata); + case 'Thunes': + return Thunes::from($data, $metadata); case 'ToditoCash': return ToditoCash::from($data, $metadata); case 'Triple000': @@ -2257,6 +2280,22 @@ public function setReadyToPayoutInstruction(null|string $readyToPayoutInstructio return $this; } + public function getPayoutLimits(): ?GatewayAccountPayoutLimits + { + return $this->fields['payoutLimits'] ?? null; + } + + public function setPayoutLimits(null|GatewayAccountPayoutLimits|array $payoutLimits): static + { + if ($payoutLimits !== null && !($payoutLimits instanceof GatewayAccountPayoutLimits)) { + $payoutLimits = GatewayAccountPayoutLimits::from($payoutLimits); + } + + $this->fields['payoutLimits'] = $payoutLimits; + + return $this; + } + public function getTransactionEmailAliasTemplate(): ?string { return $this->fields['transactionEmailAliasTemplate'] ?? null; @@ -2394,6 +2433,9 @@ public function jsonSerialize(): array if (array_key_exists('readyToPayoutInstruction', $this->fields)) { $data['readyToPayoutInstruction'] = $this->fields['readyToPayoutInstruction']; } + if (array_key_exists('payoutLimits', $this->fields)) { + $data['payoutLimits'] = $this->fields['payoutLimits']?->jsonSerialize(); + } if (array_key_exists('transactionEmailAliasTemplate', $this->fields)) { $data['transactionEmailAliasTemplate'] = $this->fields['transactionEmailAliasTemplate']; } diff --git a/src/Model/GatewayAccountDowntimeSchedule.php b/src/Model/GatewayAccountDowntimeSchedule.php index 120ee5a9e..a100d1ec4 100644 --- a/src/Model/GatewayAccountDowntimeSchedule.php +++ b/src/Model/GatewayAccountDowntimeSchedule.php @@ -35,6 +35,8 @@ class GatewayAccountDowntimeSchedule implements JsonSerializable public const REASON_MONTHLY_LIMIT_REACHED = 'monthly-limit-reached'; + public const REASON_GATEWAY_UNREACHABLE = 'gateway-unreachable'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) diff --git a/src/Model/GatewayAccountPayoutLimits.php b/src/Model/GatewayAccountPayoutLimits.php new file mode 100644 index 000000000..041e1738d --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimits.php @@ -0,0 +1,144 @@ +setMaxPerTransaction($data['maxPerTransaction']); + } + if (array_key_exists('minPerTransaction', $data)) { + $this->setMinPerTransaction($data['minPerTransaction']); + } + if (array_key_exists('maxPerPeriod', $data)) { + $this->setMaxPerPeriod($data['maxPerPeriod']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + /** + * @return null|GatewayAccountPayoutLimitsMaxPerTransaction[] + */ + public function getMaxPerTransaction(): ?array + { + return $this->fields['maxPerTransaction'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMaxPerTransaction[] $maxPerTransaction + */ + public function setMaxPerTransaction(null|array $maxPerTransaction): static + { + $maxPerTransaction = $maxPerTransaction !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMaxPerTransaction ? $value : GatewayAccountPayoutLimitsMaxPerTransaction::from($value), + $maxPerTransaction, + ) : null; + + $this->fields['maxPerTransaction'] = $maxPerTransaction; + + return $this; + } + + /** + * @return null|GatewayAccountPayoutLimitsMinPerTransaction[] + */ + public function getMinPerTransaction(): ?array + { + return $this->fields['minPerTransaction'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMinPerTransaction[] $minPerTransaction + */ + public function setMinPerTransaction(null|array $minPerTransaction): static + { + $minPerTransaction = $minPerTransaction !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMinPerTransaction ? $value : GatewayAccountPayoutLimitsMinPerTransaction::from($value), + $minPerTransaction, + ) : null; + + $this->fields['minPerTransaction'] = $minPerTransaction; + + return $this; + } + + /** + * @return null|GatewayAccountPayoutLimitsMaxPerPeriod[] + */ + public function getMaxPerPeriod(): ?array + { + return $this->fields['maxPerPeriod'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMaxPerPeriod[] $maxPerPeriod + */ + public function setMaxPerPeriod(null|array $maxPerPeriod): static + { + $maxPerPeriod = $maxPerPeriod !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMaxPerPeriod ? $value : GatewayAccountPayoutLimitsMaxPerPeriod::from($value), + $maxPerPeriod, + ) : null; + + $this->fields['maxPerPeriod'] = $maxPerPeriod; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('maxPerTransaction', $this->fields)) { + $data['maxPerTransaction'] = $this->fields['maxPerTransaction'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMaxPerTransaction $gatewayAccountPayoutLimitsMaxPerTransaction) => $gatewayAccountPayoutLimitsMaxPerTransaction->jsonSerialize(), + $this->fields['maxPerTransaction'], + ) + : null; + } + if (array_key_exists('minPerTransaction', $this->fields)) { + $data['minPerTransaction'] = $this->fields['minPerTransaction'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMinPerTransaction $gatewayAccountPayoutLimitsMinPerTransaction) => $gatewayAccountPayoutLimitsMinPerTransaction->jsonSerialize(), + $this->fields['minPerTransaction'], + ) + : null; + } + if (array_key_exists('maxPerPeriod', $this->fields)) { + $data['maxPerPeriod'] = $this->fields['maxPerPeriod'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMaxPerPeriod $gatewayAccountPayoutLimitsMaxPerPeriod) => $gatewayAccountPayoutLimitsMaxPerPeriod->jsonSerialize(), + $this->fields['maxPerPeriod'], + ) + : null; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php b/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php new file mode 100644 index 000000000..f71b5231d --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php @@ -0,0 +1,102 @@ +setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('period', $data)) { + $this->setPeriod($data['period']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getPeriod(): string + { + return $this->fields['period']; + } + + public function setPeriod(string $period): static + { + $this->fields['period'] = $period; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('period', $this->fields)) { + $data['period'] = $this->fields['period']; + } + + return $data; + } +} diff --git a/src/Model/GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php b/src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php similarity index 94% rename from src/Model/GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php rename to src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php index 65ed6f80a..c62b28519 100644 --- a/src/Model/GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php +++ b/src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency implements JsonSerializable +class GatewayAccountPayoutLimitsMaxPerTransaction implements JsonSerializable { use HasMetadata; @@ -25,12 +25,12 @@ class GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency implements JsonS public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('currency', $data)) { - $this->setCurrency($data['currency']); - } if (array_key_exists('amount', $data)) { $this->setAmount($data['amount']); } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } $this->setMetadata($metadata); } @@ -39,18 +39,6 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getCurrency(): string - { - return $this->fields['currency']; - } - - public function setCurrency(string $currency): static - { - $this->fields['currency'] = $currency; - - return $this; - } - public function getAmount(): float { return $this->fields['amount']; @@ -67,15 +55,27 @@ public function setAmount(float|string $amount): static return $this; } + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + public function jsonSerialize(): array { $data = []; - if (array_key_exists('currency', $this->fields)) { - $data['currency'] = $this->fields['currency']; - } if (array_key_exists('amount', $this->fields)) { $data['amount'] = $this->fields['amount']; } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } return $data; } diff --git a/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php b/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php new file mode 100644 index 000000000..7506e3c0b --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php @@ -0,0 +1,82 @@ +setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountTimeline.php b/src/Model/GatewayAccountTimeline.php index 2443348f6..459815eb0 100644 --- a/src/Model/GatewayAccountTimeline.php +++ b/src/Model/GatewayAccountTimeline.php @@ -45,6 +45,8 @@ class GatewayAccountTimeline implements JsonSerializable public const TYPE_ONBOARDING_FAILED = 'gateway-account-onboarding-failed'; + public const TYPE_CARDING_CIRCUIT_OPENED = 'gateway-account-carding-circuit-opened'; + public const TRIGGERED_BY_REBILLY = 'rebilly'; public const TRIGGERED_BY_APP = 'app'; diff --git a/src/Model/GetPayoutRequestAllocationCollectionResponse.php b/src/Model/GetPayoutRequestAllocationCollectionResponse.php deleted file mode 100644 index d45d56e2e..000000000 --- a/src/Model/GetPayoutRequestAllocationCollectionResponse.php +++ /dev/null @@ -1,856 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('payoutRequestId', $data)) { - $this->setPayoutRequestId($data['payoutRequestId']); - } - if (array_key_exists('batchId', $data)) { - $this->setBatchId($data['batchId']); - } - if (array_key_exists('paymentInstrumentId', $data)) { - $this->setPaymentInstrumentId($data['paymentInstrumentId']); - } - if (array_key_exists('paymentMethod', $data)) { - $this->setPaymentMethod($data['paymentMethod']); - } - if (array_key_exists('gatewayAccountId', $data)) { - $this->setGatewayAccountId($data['gatewayAccountId']); - } - if (array_key_exists('gatewayName', $data)) { - $this->setGatewayName($data['gatewayName']); - } - if (array_key_exists('gatewayPayoutInstruction', $data)) { - $this->setGatewayPayoutInstruction($data['gatewayPayoutInstruction']); - } - if (array_key_exists('amount', $data)) { - $this->setAmount($data['amount']); - } - if (array_key_exists('currency', $data)) { - $this->setCurrency($data['currency']); - } - if (array_key_exists('status', $data)) { - $this->setStatus($data['status']); - } - if (array_key_exists('transactionId', $data)) { - $this->setTransactionId($data['transactionId']); - } - if (array_key_exists('transactionResult', $data)) { - $this->setTransactionResult($data['transactionResult']); - } - if (array_key_exists('transactionStatus', $data)) { - $this->setTransactionStatus($data['transactionStatus']); - } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); - } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - if (array_key_exists('exposureAmount', $data)) { - $this->setExposureAmount($data['exposureAmount']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function getPayoutRequestId(): string - { - return $this->fields['payoutRequestId']; - } - - public function getBatchId(): ?string - { - return $this->fields['batchId'] ?? null; - } - - public function getPaymentInstrumentId(): string - { - return $this->fields['paymentInstrumentId']; - } - - public function setPaymentInstrumentId(string $paymentInstrumentId): static - { - $this->fields['paymentInstrumentId'] = $paymentInstrumentId; - - return $this; - } - - public function getPaymentMethod(): ?string - { - return $this->fields['paymentMethod'] ?? null; - } - - public function getGatewayAccountId(): string - { - return $this->fields['gatewayAccountId']; - } - - public function setGatewayAccountId(string $gatewayAccountId): static - { - $this->fields['gatewayAccountId'] = $gatewayAccountId; - - return $this; - } - - public function getGatewayName(): ?string - { - return $this->fields['gatewayName'] ?? null; - } - - public function setGatewayName(null|string $gatewayName): static - { - $this->fields['gatewayName'] = $gatewayName; - - return $this; - } - - public function getGatewayPayoutInstruction(): ?string - { - return $this->fields['gatewayPayoutInstruction'] ?? null; - } - - public function getAmount(): float - { - return $this->fields['amount']; - } - - public function setAmount(float|string $amount): static - { - if (is_string($amount)) { - $amount = (float) $amount; - } - - $this->fields['amount'] = $amount; - - return $this; - } - - public function getCurrency(): string - { - return $this->fields['currency']; - } - - public function setCurrency(string $currency): static - { - $this->fields['currency'] = $currency; - - return $this; - } - - public function getStatus(): ?string - { - return $this->fields['status'] ?? null; - } - - public function setStatus(null|string $status): static - { - $this->fields['status'] = $status; - - return $this; - } - - public function getTransactionId(): ?string - { - return $this->fields['transactionId'] ?? null; - } - - public function getTransactionResult(): ?string - { - return $this->fields['transactionResult'] ?? null; - } - - public function getTransactionStatus(): ?string - { - return $this->fields['transactionStatus'] ?? null; - } - - public function getCreatedTime(): ?DateTimeImmutable - { - return $this->fields['createdTime'] ?? null; - } - - public function getUpdatedTime(): ?DateTimeImmutable - { - return $this->fields['updatedTime'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function getExposureAmount(): ?float - { - return $this->fields['exposureAmount'] ?? null; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('payoutRequestId', $this->fields)) { - $data['payoutRequestId'] = $this->fields['payoutRequestId']; - } - if (array_key_exists('batchId', $this->fields)) { - $data['batchId'] = $this->fields['batchId']; - } - if (array_key_exists('paymentInstrumentId', $this->fields)) { - $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; - } - if (array_key_exists('paymentMethod', $this->fields)) { - $data['paymentMethod'] = $this->fields['paymentMethod']; - } - if (array_key_exists('gatewayAccountId', $this->fields)) { - $data['gatewayAccountId'] = $this->fields['gatewayAccountId']; - } - if (array_key_exists('gatewayName', $this->fields)) { - $data['gatewayName'] = $this->fields['gatewayName']; - } - if (array_key_exists('gatewayPayoutInstruction', $this->fields)) { - $data['gatewayPayoutInstruction'] = $this->fields['gatewayPayoutInstruction']; - } - if (array_key_exists('amount', $this->fields)) { - $data['amount'] = $this->fields['amount']; - } - if (array_key_exists('currency', $this->fields)) { - $data['currency'] = $this->fields['currency']; - } - if (array_key_exists('status', $this->fields)) { - $data['status'] = $this->fields['status']; - } - if (array_key_exists('transactionId', $this->fields)) { - $data['transactionId'] = $this->fields['transactionId']; - } - if (array_key_exists('transactionResult', $this->fields)) { - $data['transactionResult'] = $this->fields['transactionResult']; - } - if (array_key_exists('transactionStatus', $this->fields)) { - $data['transactionStatus'] = $this->fields['transactionStatus']; - } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - if (array_key_exists('exposureAmount', $this->fields)) { - $data['exposureAmount'] = $this->fields['exposureAmount']; - } - - return $data; - } - - private function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - private function setPayoutRequestId(string $payoutRequestId): static - { - $this->fields['payoutRequestId'] = $payoutRequestId; - - return $this; - } - - private function setBatchId(null|string $batchId): static - { - $this->fields['batchId'] = $batchId; - - return $this; - } - - private function setPaymentMethod(null|string $paymentMethod): static - { - $this->fields['paymentMethod'] = $paymentMethod; - - return $this; - } - - private function setGatewayPayoutInstruction(null|string $gatewayPayoutInstruction): static - { - $this->fields['gatewayPayoutInstruction'] = $gatewayPayoutInstruction; - - return $this; - } - - private function setTransactionId(null|string $transactionId): static - { - $this->fields['transactionId'] = $transactionId; - - return $this; - } - - private function setTransactionResult(null|string $transactionResult): static - { - $this->fields['transactionResult'] = $transactionResult; - - return $this; - } - - private function setTransactionStatus(null|string $transactionStatus): static - { - $this->fields['transactionStatus'] = $transactionStatus; - - return $this; - } - - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static - { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } - - $this->fields['createdTime'] = $createdTime; - - return $this; - } - - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static - { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); - } - - $this->fields['updatedTime'] = $updatedTime; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } - - private function setExposureAmount(null|float|string $exposureAmount): static - { - if (is_string($exposureAmount)) { - $exposureAmount = (float) $exposureAmount; - } - - $this->fields['exposureAmount'] = $exposureAmount; - - return $this; - } -} diff --git a/src/Model/GetPayoutRequestBatchPreviewResponse.php b/src/Model/GetPayoutRequestBatchPreviewResponse.php deleted file mode 100644 index 60d885e76..000000000 --- a/src/Model/GetPayoutRequestBatchPreviewResponse.php +++ /dev/null @@ -1,112 +0,0 @@ -setMatchingCount($data['matchingCount']); - } - if (array_key_exists('customerCount', $data)) { - $this->setCustomerCount($data['customerCount']); - } - if (array_key_exists('totalAmountByCurrency', $data)) { - $this->setTotalAmountByCurrency($data['totalAmountByCurrency']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getMatchingCount(): ?int - { - return $this->fields['matchingCount'] ?? null; - } - - public function setMatchingCount(null|int $matchingCount): static - { - $this->fields['matchingCount'] = $matchingCount; - - return $this; - } - - public function getCustomerCount(): ?int - { - return $this->fields['customerCount'] ?? null; - } - - public function setCustomerCount(null|int $customerCount): static - { - $this->fields['customerCount'] = $customerCount; - - return $this; - } - - /** - * @return null|GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency[] - */ - public function getTotalAmountByCurrency(): ?array - { - return $this->fields['totalAmountByCurrency'] ?? null; - } - - /** - * @param null|array[]|GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency[] $totalAmountByCurrency - */ - public function setTotalAmountByCurrency(null|array $totalAmountByCurrency): static - { - $totalAmountByCurrency = $totalAmountByCurrency !== null ? array_map( - fn ($value) => $value instanceof GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency ? $value : GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency::from($value), - $totalAmountByCurrency, - ) : null; - - $this->fields['totalAmountByCurrency'] = $totalAmountByCurrency; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('matchingCount', $this->fields)) { - $data['matchingCount'] = $this->fields['matchingCount']; - } - if (array_key_exists('customerCount', $this->fields)) { - $data['customerCount'] = $this->fields['customerCount']; - } - if (array_key_exists('totalAmountByCurrency', $this->fields)) { - $data['totalAmountByCurrency'] = $this->fields['totalAmountByCurrency'] !== null - ? array_map( - static fn (GetPayoutRequestBatchPreviewResponseTotalAmountByCurrency $getPayoutRequestBatchPreviewResponseTotalAmountByCurrency) => $getPayoutRequestBatchPreviewResponseTotalAmountByCurrency->jsonSerialize(), - $this->fields['totalAmountByCurrency'], - ) - : null; - } - - return $data; - } -} diff --git a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php index 49ad9e874..46e65a8f0 100644 --- a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php +++ b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php @@ -205,6 +205,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -329,6 +331,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -433,6 +437,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const GATEWAY_NAME_THUNES = 'Thunes'; + public const GATEWAY_NAME_TODITO_CASH = 'ToditoCash'; public const GATEWAY_NAME_TRIPLE000 = 'Triple000'; diff --git a/src/Model/GetReleaseFlagsResponse.php b/src/Model/GetReleaseFlagsResponse.php new file mode 100644 index 000000000..6c1febfe7 --- /dev/null +++ b/src/Model/GetReleaseFlagsResponse.php @@ -0,0 +1,66 @@ +setEnabled($data['enabled']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + /** + * @return string[] + */ + public function getEnabled(): array + { + return $this->fields['enabled']; + } + + /** + * @param string[] $enabled + */ + public function setEnabled(array $enabled): static + { + $this->fields['enabled'] = $enabled; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('enabled', $this->fields)) { + $data['enabled'] = $this->fields['enabled']; + } + + return $data; + } +} diff --git a/src/Model/GlobalWebhook.php b/src/Model/GlobalWebhook.php index 04f359f56..0bc18b932 100644 --- a/src/Model/GlobalWebhook.php +++ b/src/Model/GlobalWebhook.php @@ -23,146 +23,6 @@ class GlobalWebhook implements JsonSerializable { use HasMetadata; - public const EVENTS_FILTER_AML_LIST_POSSIBLY_MATCHED = 'aml-list-possibly-matched'; - - public const EVENTS_FILTER_AUTODEPOSIT_LOOKUP_PERFORMED = 'autodeposit-lookup-performed'; - - public const EVENTS_FILTER_COUPON_APPLICATION_REMOVED = 'coupon-application-removed'; - - public const EVENTS_FILTER_COUPON_APPLIED = 'coupon-applied'; - - public const EVENTS_FILTER_COUPON_EXPIRATION_MODIFIED = 'coupon-expiration-modified'; - - public const EVENTS_FILTER_COUPON_EXPIRED = 'coupon-expired'; - - public const EVENTS_FILTER_COUPON_ISSUED = 'coupon-issued'; - - public const EVENTS_FILTER_COUPON_MODIFIED = 'coupon-modified'; - - public const EVENTS_FILTER_COUPON_REDEEMED = 'coupon-redeemed'; - - public const EVENTS_FILTER_COUPON_REDEMPTION_CANCELED = 'coupon-redemption-canceled'; - - public const EVENTS_FILTER_CUSTOMER_CREATED = 'customer-created'; - - public const EVENTS_FILTER_CUSTOMER_MERGED = 'customer-merged'; - - public const EVENTS_FILTER_CUSTOMER_ONE_TIME_PASSWORD_REQUESTED = 'customer-one-time-password-requested'; - - public const EVENTS_FILTER_CUSTOMER_TAX_NUMBER_VALIDATED = 'customer-tax-number-validated'; - - public const EVENTS_FILTER_CUSTOMER_UPDATED = 'customer-updated'; - - public const EVENTS_FILTER_EXPERIAN_CHECK_PERFORMED = 'experian-check-performed'; - - public const EVENTS_FILTER_INVOICE_ABANDONED = 'invoice-abandoned'; - - public const EVENTS_FILTER_INVOICE_ISSUED = 'invoice-issued'; - - public const EVENTS_FILTER_INVOICE_PAID = 'invoice-paid'; - - public const EVENTS_FILTER_INVOICE_PARTIALLY_PAID = 'invoice-partially-paid'; - - public const EVENTS_FILTER_INVOICE_PARTIALLY_REFUNDED = 'invoice-partially-refunded'; - - public const EVENTS_FILTER_INVOICE_PAST_DUE = 'invoice-past-due'; - - public const EVENTS_FILTER_INVOICE_REFUNDED = 'invoice-refunded'; - - public const EVENTS_FILTER_INVOICE_REISSUED = 'invoice-reissued'; - - public const EVENTS_FILTER_INVOICE_VOIDED = 'invoice-voided'; - - public const EVENTS_FILTER_KYC_DOCUMENT_ACCEPTED = 'kyc-document-accepted'; - - public const EVENTS_FILTER_KYC_DOCUMENT_ARCHIVED = 'kyc-document-archived'; - - public const EVENTS_FILTER_KYC_DOCUMENT_CREATED = 'kyc-document-created'; - - public const EVENTS_FILTER_KYC_DOCUMENT_MODIFIED = 'kyc-document-modified'; - - public const EVENTS_FILTER_KYC_DOCUMENT_REJECTED = 'kyc-document-rejected'; - - public const EVENTS_FILTER_KYC_DOCUMENT_REVIEWED = 'kyc-document-reviewed'; - - public const EVENTS_FILTER_KYC_REQUEST_ATTEMPTED = 'kyc-request-attempted'; - - public const EVENTS_FILTER_KYC_REQUEST_FAILED = 'kyc-request-failed'; - - public const EVENTS_FILTER_KYC_REQUEST_FULFILLED = 'kyc-request-fulfilled'; - - public const EVENTS_FILTER_KYC_REQUEST_PARTIALLY_FULFILLED = 'kyc-request-partially-fulfilled'; - - public const EVENTS_FILTER_LEAD_SOURCE_CHANGED = 'lead-source-changed'; - - public const EVENTS_FILTER_ORDER_ABANDONED = 'order-abandoned'; - - public const EVENTS_FILTER_ORDER_COMPLETED = 'order-completed'; - - public const EVENTS_FILTER_ORDER_DELINQUENCY_REACHED = 'order-delinquency-reached'; - - public const EVENTS_FILTER_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; - - public const EVENTS_FILTER_PAYOUT_REQUEST_CANCELED = 'payout-request-canceled'; - - public const EVENTS_FILTER_PAYOUT_REQUEST_CREATED = 'payout-request-created'; - - public const EVENTS_FILTER_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; - - public const EVENTS_FILTER_PAYOUT_REQUEST_MODIFIED = 'payout-request-modified'; - - public const EVENTS_FILTER_QUOTE_ACCEPTED = 'quote-accepted'; - - public const EVENTS_FILTER_QUOTE_CANCELED = 'quote-canceled'; - - public const EVENTS_FILTER_QUOTE_CREATED = 'quote-created'; - - public const EVENTS_FILTER_QUOTE_EXPIRED = 'quote-expired'; - - public const EVENTS_FILTER_QUOTE_ISSUED = 'quote-issued'; - - public const EVENTS_FILTER_QUOTE_RECALLED = 'quote-recalled'; - - public const EVENTS_FILTER_QUOTE_REJECTED = 'quote-rejected'; - - public const EVENTS_FILTER_QUOTE_UPDATED = 'quote-updated'; - - public const EVENTS_FILTER_READY_TO_PAY_REQUESTED = 'ready-to-pay-requested'; - - public const EVENTS_FILTER_RENEWAL_INVOICE_ISSUED = 'renewal-invoice-issued'; - - public const EVENTS_FILTER_RENEWAL_INVOICE_PAYMENT_DECLINED = 'renewal-invoice-payment-declined'; - - public const EVENTS_FILTER_SUBSCRIPTION_ACTIVATED = 'subscription-activated'; - - public const EVENTS_FILTER_SUBSCRIPTION_CANCELED = 'subscription-canceled'; - - public const EVENTS_FILTER_SUBSCRIPTION_CHURNED = 'subscription-churned'; - - public const EVENTS_FILTER_SUBSCRIPTION_CREATED = 'subscription-created'; - - public const EVENTS_FILTER_SUBSCRIPTION_DOWNGRADED = 'subscription-downgraded'; - - public const EVENTS_FILTER_SUBSCRIPTION_PAUSED = 'subscription-paused'; - - public const EVENTS_FILTER_SUBSCRIPTION_REACTIVATED = 'subscription-reactivated'; - - public const EVENTS_FILTER_SUBSCRIPTION_RENEWED = 'subscription-renewed'; - - public const EVENTS_FILTER_SUBSCRIPTION_RESUMED = 'subscription-resumed'; - - public const EVENTS_FILTER_SUBSCRIPTION_UPGRADED = 'subscription-upgraded'; - - public const EVENTS_FILTER_TRANSACTION_AMOUNT_DISCREPANCY_FOUND = 'transaction-amount-discrepancy-found'; - - public const EVENTS_FILTER_TRANSACTION_DECLINED = 'transaction-declined'; - - public const EVENTS_FILTER_TRANSACTION_DISCREPANCY_FOUND = 'transaction-discrepancy-found'; - - public const EVENTS_FILTER_TRANSACTION_PROCESSED = 'transaction-processed'; - - public const EVENTS_FILTER_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; - public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; diff --git a/src/Model/IMerchant.php b/src/Model/IMerchant.php new file mode 100644 index 000000000..eca992d03 --- /dev/null +++ b/src/Model/IMerchant.php @@ -0,0 +1,89 @@ + 'IMerchant', + ] + $data, $metadata); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + if (array_key_exists('threeDSecureServer', $data)) { + $this->setThreeDSecureServer($data['threeDSecureServer']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCredentials(): IMerchantCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(IMerchantCredentials|array $credentials): static + { + if (!($credentials instanceof IMerchantCredentials)) { + $credentials = IMerchantCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + return $this; + } + + public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer + { + return $this->fields['threeDSecureServer'] ?? null; + } + + public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static + { + if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) { + $threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer); + } + + $this->fields['threeDSecureServer'] = $threeDSecureServer; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('credentials', $this->fields)) { + $data['credentials'] = $this->fields['credentials']->jsonSerialize(); + } + if (array_key_exists('threeDSecureServer', $this->fields)) { + $data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize(); + } + + return parent::jsonSerialize() + $data; + } +} diff --git a/src/Model/IMerchantCredentials.php b/src/Model/IMerchantCredentials.php new file mode 100644 index 000000000..554964e61 --- /dev/null +++ b/src/Model/IMerchantCredentials.php @@ -0,0 +1,60 @@ +setApiKey($data['apiKey']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + + return $data; + } +} diff --git a/src/Model/IntegrationConfigurations.php b/src/Model/IntegrationConfigurations.php index 4e8c8a062..7ede81bf8 100644 --- a/src/Model/IntegrationConfigurations.php +++ b/src/Model/IntegrationConfigurations.php @@ -91,6 +91,14 @@ class IntegrationConfigurations implements JsonSerializable public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER = 'invoice-past-due-reminder'; + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER15_DAYS = 'invoice-past-due-reminder-15-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER30_DAYS = 'invoice-past-due-reminder-30-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER60_DAYS = 'invoice-past-due-reminder-60-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER90_DAYS = 'invoice-past-due-reminder-90-days'; + public const EVENT_TYPE_INVOICE_REFUNDED = 'invoice-refunded'; public const EVENT_TYPE_INVOICE_REVENUE_RECOGNIZED = 'invoice-revenue-recognized'; @@ -113,10 +121,22 @@ class IntegrationConfigurations implements JsonSerializable public const EVENT_TYPE_ORDER_COMPLETED = 'order-completed'; + public const EVENT_TYPE_ORDER_CHANGE_APPLIED = 'order-change-applied'; + + public const EVENT_TYPE_ORDER_CHANGE_CANCELED = 'order-change-canceled'; + + public const EVENT_TYPE_ORDER_CHANGE_CREATED = 'order-change-created'; + public const EVENT_TYPE_PAYMENT_CARD_CREATED = 'payment-card-created'; public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER = 'payment-card-expiration-reminder'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER1_DAY = 'payment-card-expiration-reminder-1-day'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER14_DAYS = 'payment-card-expiration-reminder-14-days'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER7_DAYS = 'payment-card-expiration-reminder-7-days'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; public const EVENT_TYPE_PAYMENT_INSTRUMENT_MODIFIED = 'payment-instrument-modified'; @@ -183,6 +203,12 @@ class IntegrationConfigurations implements JsonSerializable public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER = 'subscription-renewal-reminder'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER1_DAY = 'subscription-renewal-reminder-1-day'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER30_DAYS = 'subscription-renewal-reminder-30-days'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER7_DAYS = 'subscription-renewal-reminder-7-days'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWED = 'subscription-renewed'; public const EVENT_TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; diff --git a/src/Model/InvoiceItem.php b/src/Model/InvoiceItem.php index 74ebc7332..c1e13a316 100644 --- a/src/Model/InvoiceItem.php +++ b/src/Model/InvoiceItem.php @@ -58,9 +58,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('subscriptionId', $data)) { $this->setSubscriptionId($data['subscriptionId']); } - if (array_key_exists('discountAmount', $data)) { - $this->setDiscountAmount($data['discountAmount']); - } if (array_key_exists('periodStartTime', $data)) { $this->setPeriodStartTime($data['periodStartTime']); } @@ -177,11 +174,6 @@ public function getSubscriptionId(): ?string return $this->fields['subscriptionId'] ?? null; } - public function getDiscountAmount(): ?float - { - return $this->fields['discountAmount'] ?? null; - } - public function getPeriodStartTime(): ?DateTimeImmutable { return $this->fields['periodStartTime'] ?? null; @@ -295,9 +287,6 @@ public function jsonSerialize(): array if (array_key_exists('subscriptionId', $this->fields)) { $data['subscriptionId'] = $this->fields['subscriptionId']; } - if (array_key_exists('discountAmount', $this->fields)) { - $data['discountAmount'] = $this->fields['discountAmount']; - } if (array_key_exists('periodStartTime', $this->fields)) { $data['periodStartTime'] = $this->fields['periodStartTime']?->format(DateTimeInterface::RFC3339); } @@ -363,17 +352,6 @@ private function setSubscriptionId(null|string $subscriptionId): static return $this; } - private function setDiscountAmount(null|float|string $discountAmount): static - { - if (is_string($discountAmount)) { - $discountAmount = (float) $discountAmount; - } - - $this->fields['discountAmount'] = $discountAmount; - - return $this; - } - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/InvoiceItemsDataExport.php b/src/Model/InvoiceItemsDataExport.php index 6b8dc3cad..a316852fa 100644 --- a/src/Model/InvoiceItemsDataExport.php +++ b/src/Model/InvoiceItemsDataExport.php @@ -40,6 +40,14 @@ class InvoiceItemsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?InvoiceItemsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/InvoiceTimeline.php b/src/Model/InvoiceTimeline.php index 252986030..f80f4dec8 100644 --- a/src/Model/InvoiceTimeline.php +++ b/src/Model/InvoiceTimeline.php @@ -47,6 +47,8 @@ class InvoiceTimeline implements JsonSerializable public const TYPE_INVOICE_RENEWAL_PAYMENT_DECLINED = 'invoice-renewal-payment-declined'; + public const TYPE_INVOICE_RESTORED = 'invoice-restored'; + public const TYPE_INVOICE_REVENUE_RECOGNIZED = 'invoice-revenue-recognized'; public const TYPE_INVOICE_TAX_CALCULATION_FAILED = 'invoice-tax-calculation-failed'; @@ -79,6 +81,8 @@ class InvoiceTimeline implements JsonSerializable public const TYPE_TRANSACTION_INITIATED = 'transaction-initiated'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; public const TYPE_TRANSACTION_VOIDED = 'transaction-voided'; diff --git a/src/Model/InvoicesDataExport.php b/src/Model/InvoicesDataExport.php index 0b92fb6c8..82845459c 100644 --- a/src/Model/InvoicesDataExport.php +++ b/src/Model/InvoicesDataExport.php @@ -42,6 +42,14 @@ class InvoicesDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -88,6 +96,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -242,6 +253,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?InvoicesDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -329,6 +345,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -415,6 +434,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/JournalRecordsDataExport.php b/src/Model/JournalRecordsDataExport.php index b83c9125d..7deada600 100644 --- a/src/Model/JournalRecordsDataExport.php +++ b/src/Model/JournalRecordsDataExport.php @@ -38,6 +38,14 @@ class JournalRecordsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?JournalRecordsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/KhelocardCard.php b/src/Model/KhelocardCard.php deleted file mode 100644 index d585903e5..000000000 --- a/src/Model/KhelocardCard.php +++ /dev/null @@ -1,436 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('customerId', $data)) { - $this->setCustomerId($data['customerId']); - } - if (array_key_exists('fingerprint', $data)) { - $this->setFingerprint($data['fingerprint']); - } - if (array_key_exists('number', $data)) { - $this->setNumber($data['number']); - } - if (array_key_exists('last4', $data)) { - $this->setLast4($data['last4']); - } - if (array_key_exists('expYear', $data)) { - $this->setExpYear($data['expYear']); - } - if (array_key_exists('expMonth', $data)) { - $this->setExpMonth($data['expMonth']); - } - if (array_key_exists('billingAddress', $data)) { - $this->setBillingAddress($data['billingAddress']); - } - if (array_key_exists('status', $data)) { - $this->setStatus($data['status']); - } - if (array_key_exists('useAsBackup', $data)) { - $this->setUseAsBackup($data['useAsBackup']); - } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); - } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); - } - if (array_key_exists('lastPaymentTime', $data)) { - $this->setLastPaymentTime($data['lastPaymentTime']); - } - if (array_key_exists('customFields', $data)) { - $this->setCustomFields($data['customFields']); - } - if (array_key_exists('stickyGatewayAccountId', $data)) { - $this->setStickyGatewayAccountId($data['stickyGatewayAccountId']); - } - if (array_key_exists('riskMetadata', $data)) { - $this->setRiskMetadata($data['riskMetadata']); - } - if (array_key_exists('revision', $data)) { - $this->setRevision($data['revision']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - if (array_key_exists('_embedded', $data)) { - $this->setEmbedded($data['_embedded']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getMethod(): string - { - return 'Khelocard'; - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function getCustomerId(): ?string - { - return $this->fields['customerId'] ?? null; - } - - public function setCustomerId(null|string $customerId): static - { - $this->fields['customerId'] = $customerId; - - return $this; - } - - public function getFingerprint(): ?string - { - return $this->fields['fingerprint'] ?? null; - } - - public function setFingerprint(null|string $fingerprint): static - { - $this->fields['fingerprint'] = $fingerprint; - - return $this; - } - - public function getNumber(): ?string - { - return $this->fields['number'] ?? null; - } - - public function setNumber(null|string $number): static - { - $this->fields['number'] = $number; - - return $this; - } - - public function getLast4(): ?string - { - return $this->fields['last4'] ?? null; - } - - public function setLast4(null|string $last4): static - { - $this->fields['last4'] = $last4; - - return $this; - } - - public function getExpYear(): ?int - { - return $this->fields['expYear'] ?? null; - } - - public function setExpYear(null|int $expYear): static - { - $this->fields['expYear'] = $expYear; - - return $this; - } - - public function getExpMonth(): ?int - { - return $this->fields['expMonth'] ?? null; - } - - public function setExpMonth(null|int $expMonth): static - { - $this->fields['expMonth'] = $expMonth; - - return $this; - } - - public function getBillingAddress(): ?ContactObject - { - return $this->fields['billingAddress'] ?? null; - } - - public function setBillingAddress(null|ContactObject|array $billingAddress): static - { - if ($billingAddress !== null && !($billingAddress instanceof ContactObject)) { - $billingAddress = ContactObject::from($billingAddress); - } - - $this->fields['billingAddress'] = $billingAddress; - - return $this; - } - - public function getStatus(): ?string - { - return $this->fields['status'] ?? null; - } - - public function setStatus(null|string $status): static - { - $this->fields['status'] = $status; - - return $this; - } - - public function getUseAsBackup(): ?bool - { - return $this->fields['useAsBackup'] ?? null; - } - - public function setUseAsBackup(null|bool $useAsBackup): static - { - $this->fields['useAsBackup'] = $useAsBackup; - - return $this; - } - - public function getCreatedTime(): ?DateTimeImmutable - { - return $this->fields['createdTime'] ?? null; - } - - public function getUpdatedTime(): ?DateTimeImmutable - { - return $this->fields['updatedTime'] ?? null; - } - - public function getLastPaymentTime(): ?DateTimeImmutable - { - return $this->fields['lastPaymentTime'] ?? null; - } - - public function getCustomFields(): ?array - { - return $this->fields['customFields'] ?? null; - } - - public function setCustomFields(null|array $customFields): static - { - $this->fields['customFields'] = $customFields; - - return $this; - } - - public function getStickyGatewayAccountId(): ?string - { - return $this->fields['stickyGatewayAccountId'] ?? null; - } - - public function getRiskMetadata(): ?RiskMetadata - { - return $this->fields['riskMetadata'] ?? null; - } - - public function setRiskMetadata(null|RiskMetadata|array $riskMetadata): static - { - if ($riskMetadata !== null && !($riskMetadata instanceof RiskMetadata)) { - $riskMetadata = RiskMetadata::from($riskMetadata); - } - - $this->fields['riskMetadata'] = $riskMetadata; - - return $this; - } - - public function getRevision(): ?int - { - return $this->fields['revision'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function getEmbedded(): ?KhelocardCardEmbedded - { - return $this->fields['_embedded'] ?? null; - } - - public function setEmbedded(null|KhelocardCardEmbedded|array $embedded): static - { - if ($embedded !== null && !($embedded instanceof KhelocardCardEmbedded)) { - $embedded = KhelocardCardEmbedded::from($embedded); - } - - $this->fields['_embedded'] = $embedded; - - return $this; - } - - public function jsonSerialize(): array - { - $data = [ - 'method' => 'Khelocard', - ]; - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('customerId', $this->fields)) { - $data['customerId'] = $this->fields['customerId']; - } - if (array_key_exists('fingerprint', $this->fields)) { - $data['fingerprint'] = $this->fields['fingerprint']; - } - if (array_key_exists('number', $this->fields)) { - $data['number'] = $this->fields['number']; - } - if (array_key_exists('last4', $this->fields)) { - $data['last4'] = $this->fields['last4']; - } - if (array_key_exists('expYear', $this->fields)) { - $data['expYear'] = $this->fields['expYear']; - } - if (array_key_exists('expMonth', $this->fields)) { - $data['expMonth'] = $this->fields['expMonth']; - } - if (array_key_exists('billingAddress', $this->fields)) { - $data['billingAddress'] = $this->fields['billingAddress']?->jsonSerialize(); - } - if (array_key_exists('status', $this->fields)) { - $data['status'] = $this->fields['status']; - } - if (array_key_exists('useAsBackup', $this->fields)) { - $data['useAsBackup'] = $this->fields['useAsBackup']; - } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('lastPaymentTime', $this->fields)) { - $data['lastPaymentTime'] = $this->fields['lastPaymentTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('customFields', $this->fields)) { - $data['customFields'] = $this->fields['customFields']; - } - if (array_key_exists('stickyGatewayAccountId', $this->fields)) { - $data['stickyGatewayAccountId'] = $this->fields['stickyGatewayAccountId']; - } - if (array_key_exists('riskMetadata', $this->fields)) { - $data['riskMetadata'] = $this->fields['riskMetadata']?->jsonSerialize(); - } - if (array_key_exists('revision', $this->fields)) { - $data['revision'] = $this->fields['revision']; - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - if (array_key_exists('_embedded', $this->fields)) { - $data['_embedded'] = $this->fields['_embedded']?->jsonSerialize(); - } - - return $data; - } - - private function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static - { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } - - $this->fields['createdTime'] = $createdTime; - - return $this; - } - - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static - { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); - } - - $this->fields['updatedTime'] = $updatedTime; - - return $this; - } - - private function setLastPaymentTime(null|DateTimeImmutable|string $lastPaymentTime): static - { - if ($lastPaymentTime !== null && !($lastPaymentTime instanceof DateTimeImmutable)) { - $lastPaymentTime = new DateTimeImmutable($lastPaymentTime); - } - - $this->fields['lastPaymentTime'] = $lastPaymentTime; - - return $this; - } - - private function setStickyGatewayAccountId(null|string $stickyGatewayAccountId): static - { - $this->fields['stickyGatewayAccountId'] = $stickyGatewayAccountId; - - return $this; - } - - private function setRevision(null|int $revision): static - { - $this->fields['revision'] = $revision; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } -} diff --git a/src/Model/KhelocardCardToken.php b/src/Model/KhelocardCardToken.php deleted file mode 100644 index b872d5b43..000000000 --- a/src/Model/KhelocardCardToken.php +++ /dev/null @@ -1,296 +0,0 @@ -setPaymentInstrument($data['paymentInstrument']); - } - if (array_key_exists('billingAddress', $data)) { - $this->setBillingAddress($data['billingAddress']); - } - if (array_key_exists('id', $data)) { - $this->setId($data['id']); - } - if (array_key_exists('isUsed', $data)) { - $this->setIsUsed($data['isUsed']); - } - if (array_key_exists('riskMetadata', $data)) { - $this->setRiskMetadata($data['riskMetadata']); - } - if (array_key_exists('leadSource', $data)) { - $this->setLeadSource($data['leadSource']); - } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); - } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); - } - if (array_key_exists('usageTime', $data)) { - $this->setUsageTime($data['usageTime']); - } - if (array_key_exists('expirationTime', $data)) { - $this->setExpirationTime($data['expirationTime']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getMethod(): string - { - return 'Khelocard'; - } - - public function getPaymentInstrument(): KhelocardCardTokenPaymentInstrument - { - return $this->fields['paymentInstrument']; - } - - public function setPaymentInstrument(KhelocardCardTokenPaymentInstrument|array $paymentInstrument): static - { - if (!($paymentInstrument instanceof KhelocardCardTokenPaymentInstrument)) { - $paymentInstrument = KhelocardCardTokenPaymentInstrument::from($paymentInstrument); - } - - $this->fields['paymentInstrument'] = $paymentInstrument; - - return $this; - } - - public function getBillingAddress(): ContactObject - { - return $this->fields['billingAddress']; - } - - public function setBillingAddress(ContactObject|array $billingAddress): static - { - if (!($billingAddress instanceof ContactObject)) { - $billingAddress = ContactObject::from($billingAddress); - } - - $this->fields['billingAddress'] = $billingAddress; - - return $this; - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function getIsUsed(): ?bool - { - return $this->fields['isUsed'] ?? null; - } - - public function getRiskMetadata(): ?RiskMetadata - { - return $this->fields['riskMetadata'] ?? null; - } - - public function setRiskMetadata(null|RiskMetadata|array $riskMetadata): static - { - if ($riskMetadata !== null && !($riskMetadata instanceof RiskMetadata)) { - $riskMetadata = RiskMetadata::from($riskMetadata); - } - - $this->fields['riskMetadata'] = $riskMetadata; - - return $this; - } - - public function getLeadSource(): ?LeadSource - { - return $this->fields['leadSource'] ?? null; - } - - public function setLeadSource(null|LeadSource|array $leadSource): static - { - if ($leadSource !== null && !($leadSource instanceof LeadSource)) { - $leadSource = LeadSource::from($leadSource); - } - - $this->fields['leadSource'] = $leadSource; - - return $this; - } - - public function getCreatedTime(): ?DateTimeImmutable - { - return $this->fields['createdTime'] ?? null; - } - - public function getUpdatedTime(): ?DateTimeImmutable - { - return $this->fields['updatedTime'] ?? null; - } - - public function getUsageTime(): ?DateTimeImmutable - { - return $this->fields['usageTime'] ?? null; - } - - public function getExpirationTime(): ?DateTimeImmutable - { - return $this->fields['expirationTime'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function jsonSerialize(): array - { - $data = [ - 'method' => 'Khelocard', - ]; - if (array_key_exists('paymentInstrument', $this->fields)) { - $data['paymentInstrument'] = $this->fields['paymentInstrument']->jsonSerialize(); - } - if (array_key_exists('billingAddress', $this->fields)) { - $data['billingAddress'] = $this->fields['billingAddress']->jsonSerialize(); - } - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('isUsed', $this->fields)) { - $data['isUsed'] = $this->fields['isUsed']; - } - if (array_key_exists('riskMetadata', $this->fields)) { - $data['riskMetadata'] = $this->fields['riskMetadata']?->jsonSerialize(); - } - if (array_key_exists('leadSource', $this->fields)) { - $data['leadSource'] = $this->fields['leadSource']?->jsonSerialize(); - } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('usageTime', $this->fields)) { - $data['usageTime'] = $this->fields['usageTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('expirationTime', $this->fields)) { - $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - - return $data; - } - - private function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - private function setIsUsed(null|bool $isUsed): static - { - $this->fields['isUsed'] = $isUsed; - - return $this; - } - - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static - { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } - - $this->fields['createdTime'] = $createdTime; - - return $this; - } - - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static - { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); - } - - $this->fields['updatedTime'] = $updatedTime; - - return $this; - } - - private function setUsageTime(null|DateTimeImmutable|string $usageTime): static - { - if ($usageTime !== null && !($usageTime instanceof DateTimeImmutable)) { - $usageTime = new DateTimeImmutable($usageTime); - } - - $this->fields['usageTime'] = $usageTime; - - return $this; - } - - private function setExpirationTime(null|DateTimeImmutable|string $expirationTime): static - { - if ($expirationTime !== null && !($expirationTime instanceof DateTimeImmutable)) { - $expirationTime = new DateTimeImmutable($expirationTime); - } - - $this->fields['expirationTime'] = $expirationTime; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } -} diff --git a/src/Model/KhelocardCardTokenPaymentInstrument.php b/src/Model/KhelocardCardTokenPaymentInstrument.php deleted file mode 100644 index 6713c34ab..000000000 --- a/src/Model/KhelocardCardTokenPaymentInstrument.php +++ /dev/null @@ -1,132 +0,0 @@ -setNumber($data['number']); - } - if (array_key_exists('cvv', $data)) { - $this->setCvv($data['cvv']); - } - if (array_key_exists('last4', $data)) { - $this->setLast4($data['last4']); - } - if (array_key_exists('expMonth', $data)) { - $this->setExpMonth($data['expMonth']); - } - if (array_key_exists('expYear', $data)) { - $this->setExpYear($data['expYear']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getNumber(): string - { - return $this->fields['number']; - } - - public function setNumber(string $number): static - { - $this->fields['number'] = $number; - - return $this; - } - - public function getCvv(): string - { - return $this->fields['cvv']; - } - - public function setCvv(string $cvv): static - { - $this->fields['cvv'] = $cvv; - - return $this; - } - - public function getLast4(): ?string - { - return $this->fields['last4'] ?? null; - } - - public function getExpMonth(): int - { - return $this->fields['expMonth']; - } - - public function setExpMonth(int $expMonth): static - { - $this->fields['expMonth'] = $expMonth; - - return $this; - } - - public function getExpYear(): int - { - return $this->fields['expYear']; - } - - public function setExpYear(int $expYear): static - { - $this->fields['expYear'] = $expYear; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('number', $this->fields)) { - $data['number'] = $this->fields['number']; - } - if (array_key_exists('cvv', $this->fields)) { - $data['cvv'] = $this->fields['cvv']; - } - if (array_key_exists('last4', $this->fields)) { - $data['last4'] = $this->fields['last4']; - } - if (array_key_exists('expMonth', $this->fields)) { - $data['expMonth'] = $this->fields['expMonth']; - } - if (array_key_exists('expYear', $this->fields)) { - $data['expYear'] = $this->fields['expYear']; - } - - return $data; - } - - private function setLast4(null|string $last4): static - { - $this->fields['last4'] = $last4; - - return $this; - } -} diff --git a/src/Model/KycAddressMatches.php b/src/Model/KycAddressMatches.php index 941388b1f..de79f000a 100644 --- a/src/Model/KycAddressMatches.php +++ b/src/Model/KycAddressMatches.php @@ -15,9 +15,11 @@ namespace Rebilly\Sdk\Model; use DateTimeImmutable; +use DateTimeInterface; +use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class KycAddressMatches implements PostKycDocumentMatchesRequest +class KycAddressMatches implements JsonSerializable { use HasMetadata; @@ -299,7 +301,7 @@ public function jsonSerialize(): array $data['uniqueWords'] = $this->fields['uniqueWords']; } if (array_key_exists('date', $this->fields)) { - $data['date'] = $this->fields['date']?->format('Y-m-d'); + $data['date'] = $this->fields['date']?->format(DateTimeInterface::RFC3339); } if (array_key_exists('phone', $this->fields)) { $data['phone'] = $this->fields['phone']; diff --git a/src/Model/KycAddressMatchesOverwrite.php b/src/Model/KycAddressMatchesOverwrite.php new file mode 100644 index 000000000..85c33a5f9 --- /dev/null +++ b/src/Model/KycAddressMatchesOverwrite.php @@ -0,0 +1,324 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('line1', $data)) { + $this->setLine1($data['line1']); + } + if (array_key_exists('city', $data)) { + $this->setCity($data['city']); + } + if (array_key_exists('region', $data)) { + $this->setRegion($data['region']); + } + if (array_key_exists('postalCode', $data)) { + $this->setPostalCode($data['postalCode']); + } + if (array_key_exists('wordCount', $data)) { + $this->setWordCount($data['wordCount']); + } + if (array_key_exists('uniqueWords', $data)) { + $this->setUniqueWords($data['uniqueWords']); + } + if (array_key_exists('date', $data)) { + $this->setDate($data['date']); + } + if (array_key_exists('phone', $data)) { + $this->setPhone($data['phone']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + if (array_key_exists('isTampered', $data)) { + $this->setIsTampered($data['isTampered']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'address-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getLine1(): ?string + { + return $this->fields['line1'] ?? null; + } + + public function setLine1(null|string $line1): static + { + $this->fields['line1'] = $line1; + + return $this; + } + + public function getCity(): ?string + { + return $this->fields['city'] ?? null; + } + + public function setCity(null|string $city): static + { + $this->fields['city'] = $city; + + return $this; + } + + public function getRegion(): ?string + { + return $this->fields['region'] ?? null; + } + + public function setRegion(null|string $region): static + { + $this->fields['region'] = $region; + + return $this; + } + + public function getPostalCode(): ?string + { + return $this->fields['postalCode'] ?? null; + } + + public function setPostalCode(null|string $postalCode): static + { + $this->fields['postalCode'] = $postalCode; + + return $this; + } + + public function getWordCount(): ?int + { + return $this->fields['wordCount'] ?? null; + } + + public function setWordCount(null|int $wordCount): static + { + $this->fields['wordCount'] = $wordCount; + + return $this; + } + + public function getUniqueWords(): ?int + { + return $this->fields['uniqueWords'] ?? null; + } + + public function setUniqueWords(null|int $uniqueWords): static + { + $this->fields['uniqueWords'] = $uniqueWords; + + return $this; + } + + public function getDate(): ?DateTimeImmutable + { + return $this->fields['date'] ?? null; + } + + public function setDate(null|DateTimeImmutable|string $date): static + { + if ($date !== null && !($date instanceof DateTimeImmutable)) { + $date = new DateTimeImmutable($date); + } + + $this->fields['date'] = $date; + + return $this; + } + + public function getPhone(): ?string + { + return $this->fields['phone'] ?? null; + } + + public function setPhone(null|string $phone): static + { + $this->fields['phone'] = $phone; + + return $this; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function getIsTampered(): ?bool + { + return $this->fields['isTampered'] ?? null; + } + + public function setIsTampered(null|bool $isTampered): static + { + $this->fields['isTampered'] = $isTampered; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'address-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('line1', $this->fields)) { + $data['line1'] = $this->fields['line1']; + } + if (array_key_exists('city', $this->fields)) { + $data['city'] = $this->fields['city']; + } + if (array_key_exists('region', $this->fields)) { + $data['region'] = $this->fields['region']; + } + if (array_key_exists('postalCode', $this->fields)) { + $data['postalCode'] = $this->fields['postalCode']; + } + if (array_key_exists('wordCount', $this->fields)) { + $data['wordCount'] = $this->fields['wordCount']; + } + if (array_key_exists('uniqueWords', $this->fields)) { + $data['uniqueWords'] = $this->fields['uniqueWords']; + } + if (array_key_exists('date', $this->fields)) { + $data['date'] = $this->fields['date']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('phone', $this->fields)) { + $data['phone'] = $this->fields['phone']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + if (array_key_exists('isTampered', $this->fields)) { + $data['isTampered'] = $this->fields['isTampered']; + } + + return $data; + } +} diff --git a/src/Model/KycDocument.php b/src/Model/KycDocument.php index 375d57216..603818daa 100644 --- a/src/Model/KycDocument.php +++ b/src/Model/KycDocument.php @@ -86,6 +86,10 @@ public function getDocumentMatches(): null|ProofOfAddressKycDocumentDocumentMatc public function setDocumentMatches(null|array $documentMatches): static; + public function getParsedData(): null|ProofOfAddressKycDocumentParsedData|ProofOfCreditFileKycDocumentParsedData|ProofOfFundsKycDocumentParsedData|ProofOfIdentityKycDocumentParsedData|ProofOfPurchaseKycDocumentParsedData; + + public function setParsedData(null|array $parsedData): static; + public function getSettings(): null|KycSettingsAddress|KycSettingsIdentity|array; /** diff --git a/src/Model/KycDocumentCheck.php b/src/Model/KycDocumentCheck.php index 56551a5fa..8cb09dea7 100644 --- a/src/Model/KycDocumentCheck.php +++ b/src/Model/KycDocumentCheck.php @@ -33,6 +33,8 @@ class KycDocumentCheck implements JsonSerializable public const NAME_DECISION = 'decision'; + public const NAME_DOCUMENT_NUMBER = 'documentNumber'; + public const NAME_DOCUMENT_SUBTYPE = 'documentSubtype'; public const NAME_EXPIRATION_DATE = 'expirationDate'; @@ -49,6 +51,10 @@ class KycDocumentCheck implements JsonSerializable public const NAME_IS_TAMPERED = 'isTampered'; + public const NAME_ISSUANCE_COUNTRY = 'issuanceCountry'; + + public const NAME_ISSUANCE_REGION = 'issuanceRegion'; + public const NAME_ISSUE_DATE = 'issueDate'; public const NAME_LAST_NAME = 'lastName'; diff --git a/src/Model/KycDocumentRejection.php b/src/Model/KycDocumentRejection.php index bc477f554..6a6d6334c 100644 --- a/src/Model/KycDocumentRejection.php +++ b/src/Model/KycDocumentRejection.php @@ -25,6 +25,8 @@ class KycDocumentRejection implements JsonSerializable public const TYPE_DOCUMENT_EXPIRED = 'document-expired'; + public const TYPE_DOCUMENT_WAS_VALID_BUT_EXPIRED = 'document-was-valid-but-expired'; + public const TYPE_DOCUMENT_NOT_MATCHING = 'document-not-matching'; public const TYPE_DOCUMENT_DUPLICATE = 'document-duplicate'; @@ -47,12 +49,16 @@ class KycDocumentRejection implements JsonSerializable public const TYPE_NAME_MISMATCH = 'name-mismatch'; + public const TYPE_NAME_AND_DOB_MISMATCH = 'name-and-dob-mismatch'; + public const TYPE_CRITICAL_INFO_MISSING = 'critical-info-missing'; public const TYPE_OLD_ADDRESS_ON_ID = 'old-address-on-id'; public const TYPE_TAMPERED_DOCUMENT = 'tampered-document'; + public const TYPE_NO_DOCUMENT_DATA_DETECTED = 'no-document-data-detected'; + public const TYPE_OTHER = 'other'; private array $fields = []; diff --git a/src/Model/KycFundsMatchesOverwrite.php b/src/Model/KycFundsMatchesOverwrite.php new file mode 100644 index 000000000..028cde94e --- /dev/null +++ b/src/Model/KycFundsMatchesOverwrite.php @@ -0,0 +1,156 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'funds-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'funds-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + + return $data; + } +} diff --git a/src/Model/KycIdentityMatches.php b/src/Model/KycIdentityMatches.php index bb0524903..e00b05cad 100644 --- a/src/Model/KycIdentityMatches.php +++ b/src/Model/KycIdentityMatches.php @@ -16,9 +16,10 @@ use DateTimeImmutable; use DateTimeInterface; +use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class KycIdentityMatches implements PostKycDocumentMatchesRequest +class KycIdentityMatches implements JsonSerializable { use HasMetadata; @@ -146,6 +147,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('hasCompletedFaceLiveness', $data)) { $this->setHasCompletedFaceLiveness($data['hasCompletedFaceLiveness']); } + if (array_key_exists('faceProofBrightness', $data)) { + $this->setFaceProofBrightness($data['faceProofBrightness']); + } if (array_key_exists('expiryDate', $data)) { $this->setExpiryDate($data['expiryDate']); } @@ -408,6 +412,11 @@ public function getHasCompletedFaceLiveness(): ?bool return $this->fields['hasCompletedFaceLiveness'] ?? null; } + public function getFaceProofBrightness(): ?float + { + return $this->fields['faceProofBrightness'] ?? null; + } + public function getExpiryDate(): ?DateTimeImmutable { return $this->fields['expiryDate'] ?? null; @@ -493,6 +502,9 @@ public function jsonSerialize(): array if (array_key_exists('hasCompletedFaceLiveness', $this->fields)) { $data['hasCompletedFaceLiveness'] = $this->fields['hasCompletedFaceLiveness']; } + if (array_key_exists('faceProofBrightness', $this->fields)) { + $data['faceProofBrightness'] = $this->fields['faceProofBrightness']; + } if (array_key_exists('expiryDate', $this->fields)) { $data['expiryDate'] = $this->fields['expiryDate']?->format(DateTimeInterface::RFC3339); } @@ -530,4 +542,15 @@ private function setHasCompletedFaceLiveness(null|bool $hasCompletedFaceLiveness return $this; } + + private function setFaceProofBrightness(null|float|string $faceProofBrightness): static + { + if (is_string($faceProofBrightness)) { + $faceProofBrightness = (float) $faceProofBrightness; + } + + $this->fields['faceProofBrightness'] = $faceProofBrightness; + + return $this; + } } diff --git a/src/Model/KycIdentityMatchesOverwrite.php b/src/Model/KycIdentityMatchesOverwrite.php new file mode 100644 index 000000000..1a556986a --- /dev/null +++ b/src/Model/KycIdentityMatchesOverwrite.php @@ -0,0 +1,562 @@ +setContainsImage($data['containsImage']); + } + if (array_key_exists('isIdentityDocument', $data)) { + $this->setIsIdentityDocument($data['isIdentityDocument']); + } + if (array_key_exists('isPublishedOnline', $data)) { + $this->setIsPublishedOnline($data['isPublishedOnline']); + } + if (array_key_exists('matchingImages', $data)) { + $this->setMatchingImages($data['matchingImages']); + } + if (array_key_exists('firstName', $data)) { + $this->setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('dateOfBirth', $data)) { + $this->setDateOfBirth($data['dateOfBirth']); + } + if (array_key_exists('expirationDate', $data)) { + $this->setExpirationDate($data['expirationDate']); + } + if (array_key_exists('issueDate', $data)) { + $this->setIssueDate($data['issueDate']); + } + if (array_key_exists('hasMinimalAge', $data)) { + $this->setHasMinimalAge($data['hasMinimalAge']); + } + if (array_key_exists('nationality', $data)) { + $this->setNationality($data['nationality']); + } + if (array_key_exists('issuanceCountry', $data)) { + $this->setIssuanceCountry($data['issuanceCountry']); + } + if (array_key_exists('issuanceRegion', $data)) { + $this->setIssuanceRegion($data['issuanceRegion']); + } + if (array_key_exists('documentNumber', $data)) { + $this->setDocumentNumber($data['documentNumber']); + } + if (array_key_exists('sex', $data)) { + $this->setSex($data['sex']); + } + if (array_key_exists('mrzChecksumValid', $data)) { + $this->setMrzChecksumValid($data['mrzChecksumValid']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + if (array_key_exists('hasMatchingFaceProof', $data)) { + $this->setHasMatchingFaceProof($data['hasMatchingFaceProof']); + } + if (array_key_exists('isTampered', $data)) { + $this->setIsTampered($data['isTampered']); + } + if (array_key_exists('isDigitallyTampered', $data)) { + $this->setIsDigitallyTampered($data['isDigitallyTampered']); + } + if (array_key_exists('isPhotocopy', $data)) { + $this->setIsPhotocopy($data['isPhotocopy']); + } + if (array_key_exists('hasCompletedFaceLiveness', $data)) { + $this->setHasCompletedFaceLiveness($data['hasCompletedFaceLiveness']); + } + if (array_key_exists('faceProofBrightness', $data)) { + $this->setFaceProofBrightness($data['faceProofBrightness']); + } + if (array_key_exists('expiryDate', $data)) { + $this->setExpiryDate($data['expiryDate']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'identity-proof'; + } + + public function getContainsImage(): ?bool + { + return $this->fields['containsImage'] ?? null; + } + + public function setContainsImage(null|bool $containsImage): static + { + $this->fields['containsImage'] = $containsImage; + + return $this; + } + + public function getIsIdentityDocument(): ?bool + { + return $this->fields['isIdentityDocument'] ?? null; + } + + public function setIsIdentityDocument(null|bool $isIdentityDocument): static + { + $this->fields['isIdentityDocument'] = $isIdentityDocument; + + return $this; + } + + public function getIsPublishedOnline(): ?bool + { + return $this->fields['isPublishedOnline'] ?? null; + } + + public function setIsPublishedOnline(null|bool $isPublishedOnline): static + { + $this->fields['isPublishedOnline'] = $isPublishedOnline; + + return $this; + } + + /** + * @return null|string[] + */ + public function getMatchingImages(): ?array + { + return $this->fields['matchingImages'] ?? null; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getDateOfBirth(): ?DateTimeImmutable + { + return $this->fields['dateOfBirth'] ?? null; + } + + public function setDateOfBirth(null|DateTimeImmutable|string $dateOfBirth): static + { + if ($dateOfBirth !== null && !($dateOfBirth instanceof DateTimeImmutable)) { + $dateOfBirth = new DateTimeImmutable($dateOfBirth); + } + + $this->fields['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + public function getExpirationDate(): ?DateTimeImmutable + { + return $this->fields['expirationDate'] ?? null; + } + + public function setExpirationDate(null|DateTimeImmutable|string $expirationDate): static + { + if ($expirationDate !== null && !($expirationDate instanceof DateTimeImmutable)) { + $expirationDate = new DateTimeImmutable($expirationDate); + } + + $this->fields['expirationDate'] = $expirationDate; + + return $this; + } + + public function getIssueDate(): ?DateTimeImmutable + { + return $this->fields['issueDate'] ?? null; + } + + public function setIssueDate(null|DateTimeImmutable|string $issueDate): static + { + if ($issueDate !== null && !($issueDate instanceof DateTimeImmutable)) { + $issueDate = new DateTimeImmutable($issueDate); + } + + $this->fields['issueDate'] = $issueDate; + + return $this; + } + + public function getHasMinimalAge(): ?bool + { + return $this->fields['hasMinimalAge'] ?? null; + } + + public function getNationality(): ?string + { + return $this->fields['nationality'] ?? null; + } + + public function setNationality(null|string $nationality): static + { + $this->fields['nationality'] = $nationality; + + return $this; + } + + public function getIssuanceCountry(): ?string + { + return $this->fields['issuanceCountry'] ?? null; + } + + public function setIssuanceCountry(null|string $issuanceCountry): static + { + $this->fields['issuanceCountry'] = $issuanceCountry; + + return $this; + } + + public function getIssuanceRegion(): ?string + { + return $this->fields['issuanceRegion'] ?? null; + } + + public function setIssuanceRegion(null|string $issuanceRegion): static + { + $this->fields['issuanceRegion'] = $issuanceRegion; + + return $this; + } + + public function getDocumentNumber(): ?string + { + return $this->fields['documentNumber'] ?? null; + } + + public function setDocumentNumber(null|string $documentNumber): static + { + $this->fields['documentNumber'] = $documentNumber; + + return $this; + } + + public function getSex(): ?string + { + return $this->fields['sex'] ?? null; + } + + public function setSex(null|string $sex): static + { + $this->fields['sex'] = $sex; + + return $this; + } + + public function getMrzChecksumValid(): ?bool + { + return $this->fields['mrzChecksumValid'] ?? null; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function getHasMatchingFaceProof(): ?bool + { + return $this->fields['hasMatchingFaceProof'] ?? null; + } + + public function setHasMatchingFaceProof(null|bool $hasMatchingFaceProof): static + { + $this->fields['hasMatchingFaceProof'] = $hasMatchingFaceProof; + + return $this; + } + + public function getIsTampered(): ?bool + { + return $this->fields['isTampered'] ?? null; + } + + public function setIsTampered(null|bool $isTampered): static + { + $this->fields['isTampered'] = $isTampered; + + return $this; + } + + public function getIsDigitallyTampered(): ?bool + { + return $this->fields['isDigitallyTampered'] ?? null; + } + + public function setIsDigitallyTampered(null|bool $isDigitallyTampered): static + { + $this->fields['isDigitallyTampered'] = $isDigitallyTampered; + + return $this; + } + + public function getIsPhotocopy(): ?bool + { + return $this->fields['isPhotocopy'] ?? null; + } + + public function setIsPhotocopy(null|bool $isPhotocopy): static + { + $this->fields['isPhotocopy'] = $isPhotocopy; + + return $this; + } + + public function getHasCompletedFaceLiveness(): ?bool + { + return $this->fields['hasCompletedFaceLiveness'] ?? null; + } + + public function getFaceProofBrightness(): ?float + { + return $this->fields['faceProofBrightness'] ?? null; + } + + public function getExpiryDate(): ?DateTimeImmutable + { + return $this->fields['expiryDate'] ?? null; + } + + public function setExpiryDate(null|DateTimeImmutable|string $expiryDate): static + { + if ($expiryDate !== null && !($expiryDate instanceof DateTimeImmutable)) { + $expiryDate = new DateTimeImmutable($expiryDate); + } + + $this->fields['expiryDate'] = $expiryDate; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'identity-proof', + ]; + if (array_key_exists('containsImage', $this->fields)) { + $data['containsImage'] = $this->fields['containsImage']; + } + if (array_key_exists('isIdentityDocument', $this->fields)) { + $data['isIdentityDocument'] = $this->fields['isIdentityDocument']; + } + if (array_key_exists('isPublishedOnline', $this->fields)) { + $data['isPublishedOnline'] = $this->fields['isPublishedOnline']; + } + if (array_key_exists('matchingImages', $this->fields)) { + $data['matchingImages'] = $this->fields['matchingImages']; + } + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('dateOfBirth', $this->fields)) { + $data['dateOfBirth'] = $this->fields['dateOfBirth']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('expirationDate', $this->fields)) { + $data['expirationDate'] = $this->fields['expirationDate']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('issueDate', $this->fields)) { + $data['issueDate'] = $this->fields['issueDate']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('hasMinimalAge', $this->fields)) { + $data['hasMinimalAge'] = $this->fields['hasMinimalAge']; + } + if (array_key_exists('nationality', $this->fields)) { + $data['nationality'] = $this->fields['nationality']; + } + if (array_key_exists('issuanceCountry', $this->fields)) { + $data['issuanceCountry'] = $this->fields['issuanceCountry']; + } + if (array_key_exists('issuanceRegion', $this->fields)) { + $data['issuanceRegion'] = $this->fields['issuanceRegion']; + } + if (array_key_exists('documentNumber', $this->fields)) { + $data['documentNumber'] = $this->fields['documentNumber']; + } + if (array_key_exists('sex', $this->fields)) { + $data['sex'] = $this->fields['sex']; + } + if (array_key_exists('mrzChecksumValid', $this->fields)) { + $data['mrzChecksumValid'] = $this->fields['mrzChecksumValid']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + if (array_key_exists('hasMatchingFaceProof', $this->fields)) { + $data['hasMatchingFaceProof'] = $this->fields['hasMatchingFaceProof']; + } + if (array_key_exists('isTampered', $this->fields)) { + $data['isTampered'] = $this->fields['isTampered']; + } + if (array_key_exists('isDigitallyTampered', $this->fields)) { + $data['isDigitallyTampered'] = $this->fields['isDigitallyTampered']; + } + if (array_key_exists('isPhotocopy', $this->fields)) { + $data['isPhotocopy'] = $this->fields['isPhotocopy']; + } + if (array_key_exists('hasCompletedFaceLiveness', $this->fields)) { + $data['hasCompletedFaceLiveness'] = $this->fields['hasCompletedFaceLiveness']; + } + if (array_key_exists('faceProofBrightness', $this->fields)) { + $data['faceProofBrightness'] = $this->fields['faceProofBrightness']; + } + if (array_key_exists('expiryDate', $this->fields)) { + $data['expiryDate'] = $this->fields['expiryDate']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } + + /** + * @param null|string[] $matchingImages + */ + private function setMatchingImages(null|array $matchingImages): static + { + $this->fields['matchingImages'] = $matchingImages; + + return $this; + } + + private function setHasMinimalAge(null|bool $hasMinimalAge): static + { + $this->fields['hasMinimalAge'] = $hasMinimalAge; + + return $this; + } + + private function setMrzChecksumValid(null|bool $mrzChecksumValid): static + { + $this->fields['mrzChecksumValid'] = $mrzChecksumValid; + + return $this; + } + + private function setHasCompletedFaceLiveness(null|bool $hasCompletedFaceLiveness): static + { + $this->fields['hasCompletedFaceLiveness'] = $hasCompletedFaceLiveness; + + return $this; + } + + private function setFaceProofBrightness(null|float|string $faceProofBrightness): static + { + if (is_string($faceProofBrightness)) { + $faceProofBrightness = (float) $faceProofBrightness; + } + + $this->fields['faceProofBrightness'] = $faceProofBrightness; + + return $this; + } +} diff --git a/src/Model/KycPurchaseMatchesOverwrite.php b/src/Model/KycPurchaseMatchesOverwrite.php new file mode 100644 index 000000000..aa99ed92e --- /dev/null +++ b/src/Model/KycPurchaseMatchesOverwrite.php @@ -0,0 +1,174 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'purchase-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getPaymentInstrumentId(): ?string + { + return $this->fields['paymentInstrumentId'] ?? null; + } + + public function setPaymentInstrumentId(null|string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'purchase-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + + return $data; + } +} diff --git a/src/Model/KycSettingsIdentity.php b/src/Model/KycSettingsIdentity.php index d466b55a8..2f1a045f8 100644 --- a/src/Model/KycSettingsIdentity.php +++ b/src/Model/KycSettingsIdentity.php @@ -34,6 +34,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('minimumAgeSettings', $data)) { $this->setMinimumAgeSettings($data['minimumAgeSettings']); } + if (array_key_exists('faceProofSettings', $data)) { + $this->setFaceProofSettings($data['faceProofSettings']); + } $this->setMetadata($metadata); } @@ -90,6 +93,22 @@ public function setMinimumAgeSettings(null|KycSettingsIdentityMinimumAgeSettings return $this; } + public function getFaceProofSettings(): ?KycSettingsIdentityFaceProofSettings + { + return $this->fields['faceProofSettings'] ?? null; + } + + public function setFaceProofSettings(null|KycSettingsIdentityFaceProofSettings|array $faceProofSettings): static + { + if ($faceProofSettings !== null && !($faceProofSettings instanceof KycSettingsIdentityFaceProofSettings)) { + $faceProofSettings = KycSettingsIdentityFaceProofSettings::from($faceProofSettings); + } + + $this->fields['faceProofSettings'] = $faceProofSettings; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -102,6 +121,9 @@ public function jsonSerialize(): array if (array_key_exists('minimumAgeSettings', $this->fields)) { $data['minimumAgeSettings'] = $this->fields['minimumAgeSettings']?->jsonSerialize(); } + if (array_key_exists('faceProofSettings', $this->fields)) { + $data['faceProofSettings'] = $this->fields['faceProofSettings']?->jsonSerialize(); + } return $data; } diff --git a/src/Model/KhelocardCardEmbedded.php b/src/Model/KycSettingsIdentityFaceProofSettings.php similarity index 54% rename from src/Model/KhelocardCardEmbedded.php rename to src/Model/KycSettingsIdentityFaceProofSettings.php index abb5f3d7e..21e357f6f 100644 --- a/src/Model/KhelocardCardEmbedded.php +++ b/src/Model/KycSettingsIdentityFaceProofSettings.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class KhelocardCardEmbedded implements JsonSerializable +class KycSettingsIdentityFaceProofSettings implements JsonSerializable { use HasMetadata; @@ -25,8 +25,8 @@ class KhelocardCardEmbedded implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('customer', $data)) { - $this->setCustomer($data['customer']); + if (array_key_exists('minimumBrightness', $data)) { + $this->setMinimumBrightness($data['minimumBrightness']); } $this->setMetadata($metadata); } @@ -36,18 +36,14 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getCustomer(): ?Customer + public function getMinimumBrightness(): ?int { - return $this->fields['customer'] ?? null; + return $this->fields['minimumBrightness'] ?? null; } - public function setCustomer(null|Customer|array $customer): static + public function setMinimumBrightness(null|int $minimumBrightness): static { - if ($customer !== null && !($customer instanceof Customer)) { - $customer = Customer::from($customer); - } - - $this->fields['customer'] = $customer; + $this->fields['minimumBrightness'] = $minimumBrightness; return $this; } @@ -55,8 +51,8 @@ public function setCustomer(null|Customer|array $customer): static public function jsonSerialize(): array { $data = []; - if (array_key_exists('customer', $this->fields)) { - $data['customer'] = $this->fields['customer']?->jsonSerialize(); + if (array_key_exists('minimumBrightness', $this->fields)) { + $data['minimumBrightness'] = $this->fields['minimumBrightness']; } return $data; diff --git a/src/Model/KycSettingsIdentityWeights.php b/src/Model/KycSettingsIdentityWeights.php index cb3990f7c..c64bbbf3b 100644 --- a/src/Model/KycSettingsIdentityWeights.php +++ b/src/Model/KycSettingsIdentityWeights.php @@ -70,6 +70,15 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('mrzChecksum', $data)) { $this->setMrzChecksum($data['mrzChecksum']); } + if (array_key_exists('documentNumber', $data)) { + $this->setDocumentNumber($data['documentNumber']); + } + if (array_key_exists('issuanceCountry', $data)) { + $this->setIssuanceCountry($data['issuanceCountry']); + } + if (array_key_exists('issuanceRegion', $data)) { + $this->setIssuanceRegion($data['issuanceRegion']); + } $this->setMetadata($metadata); } @@ -258,6 +267,42 @@ public function setMrzChecksum(null|int $mrzChecksum): static return $this; } + public function getDocumentNumber(): ?int + { + return $this->fields['documentNumber'] ?? null; + } + + public function setDocumentNumber(null|int $documentNumber): static + { + $this->fields['documentNumber'] = $documentNumber; + + return $this; + } + + public function getIssuanceCountry(): ?int + { + return $this->fields['issuanceCountry'] ?? null; + } + + public function setIssuanceCountry(null|int $issuanceCountry): static + { + $this->fields['issuanceCountry'] = $issuanceCountry; + + return $this; + } + + public function getIssuanceRegion(): ?int + { + return $this->fields['issuanceRegion'] ?? null; + } + + public function setIssuanceRegion(null|int $issuanceRegion): static + { + $this->fields['issuanceRegion'] = $issuanceRegion; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -306,6 +351,15 @@ public function jsonSerialize(): array if (array_key_exists('mrzChecksum', $this->fields)) { $data['mrzChecksum'] = $this->fields['mrzChecksum']; } + if (array_key_exists('documentNumber', $this->fields)) { + $data['documentNumber'] = $this->fields['documentNumber']; + } + if (array_key_exists('issuanceCountry', $this->fields)) { + $data['issuanceCountry'] = $this->fields['issuanceCountry']; + } + if (array_key_exists('issuanceRegion', $this->fields)) { + $data['issuanceRegion'] = $this->fields['issuanceRegion']; + } return $data; } diff --git a/src/Model/Membership.php b/src/Model/Membership.php deleted file mode 100644 index 8de8656e4..000000000 --- a/src/Model/Membership.php +++ /dev/null @@ -1,284 +0,0 @@ -setOrganization($data['organization']); - } - if (array_key_exists('user', $data)) { - $this->setUser($data['user']); - } - if (array_key_exists('allowedIps', $data)) { - $this->setAllowedIps($data['allowedIps']); - } - if (array_key_exists('permissions', $data)) { - $this->setPermissions($data['permissions']); - } - if (array_key_exists('isOwner', $data)) { - $this->setIsOwner($data['isOwner']); - } - if (array_key_exists('isDefault', $data)) { - $this->setIsDefault($data['isDefault']); - } - if (array_key_exists('roleIds', $data)) { - $this->setRoleIds($data['roleIds']); - } - if (array_key_exists('acl', $data)) { - $this->setAcl($data['acl']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - if (array_key_exists('_embedded', $data)) { - $this->setEmbedded($data['_embedded']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getOrganization(): MembershipOrganization - { - return $this->fields['organization']; - } - - public function setOrganization(MembershipOrganization|array $organization): static - { - if (!($organization instanceof MembershipOrganization)) { - $organization = MembershipOrganization::from($organization); - } - - $this->fields['organization'] = $organization; - - return $this; - } - - public function getUser(): MembershipUser - { - return $this->fields['user']; - } - - public function setUser(MembershipUser|array $user): static - { - if (!($user instanceof MembershipUser)) { - $user = MembershipUser::from($user); - } - - $this->fields['user'] = $user; - - return $this; - } - - /** - * @return null|string[] - */ - public function getAllowedIps(): ?array - { - return $this->fields['allowedIps'] ?? null; - } - - /** - * @param null|string[] $allowedIps - */ - public function setAllowedIps(null|array $allowedIps): static - { - $this->fields['allowedIps'] = $allowedIps; - - return $this; - } - - /** - * @return null|string[] - */ - public function getPermissions(): ?array - { - return $this->fields['permissions'] ?? null; - } - - /** - * @param null|string[] $permissions - */ - public function setPermissions(null|array $permissions): static - { - $this->fields['permissions'] = $permissions; - - return $this; - } - - public function getIsOwner(): ?bool - { - return $this->fields['isOwner'] ?? null; - } - - public function setIsOwner(null|bool $isOwner): static - { - $this->fields['isOwner'] = $isOwner; - - return $this; - } - - public function getIsDefault(): ?bool - { - return $this->fields['isDefault'] ?? null; - } - - /** - * @return null|string[] - */ - public function getRoleIds(): ?array - { - return $this->fields['roleIds'] ?? null; - } - - /** - * @param null|string[] $roleIds - */ - public function setRoleIds(null|array $roleIds): static - { - $this->fields['roleIds'] = $roleIds; - - return $this; - } - - /** - * @return null|Acl[] - */ - public function getAcl(): ?array - { - return $this->fields['acl'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function getEmbedded(): ?MembershipEmbedded - { - return $this->fields['_embedded'] ?? null; - } - - public function setEmbedded(null|MembershipEmbedded|array $embedded): static - { - if ($embedded !== null && !($embedded instanceof MembershipEmbedded)) { - $embedded = MembershipEmbedded::from($embedded); - } - - $this->fields['_embedded'] = $embedded; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('organization', $this->fields)) { - $data['organization'] = $this->fields['organization']->jsonSerialize(); - } - if (array_key_exists('user', $this->fields)) { - $data['user'] = $this->fields['user']->jsonSerialize(); - } - if (array_key_exists('allowedIps', $this->fields)) { - $data['allowedIps'] = $this->fields['allowedIps']; - } - if (array_key_exists('permissions', $this->fields)) { - $data['permissions'] = $this->fields['permissions']; - } - if (array_key_exists('isOwner', $this->fields)) { - $data['isOwner'] = $this->fields['isOwner']; - } - if (array_key_exists('isDefault', $this->fields)) { - $data['isDefault'] = $this->fields['isDefault']; - } - if (array_key_exists('roleIds', $this->fields)) { - $data['roleIds'] = $this->fields['roleIds']; - } - if (array_key_exists('acl', $this->fields)) { - $data['acl'] = $this->fields['acl'] !== null - ? array_map( - static fn (Acl $acl) => $acl->jsonSerialize(), - $this->fields['acl'], - ) - : null; - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - if (array_key_exists('_embedded', $this->fields)) { - $data['_embedded'] = $this->fields['_embedded']?->jsonSerialize(); - } - - return $data; - } - - private function setIsDefault(null|bool $isDefault): static - { - $this->fields['isDefault'] = $isDefault; - - return $this; - } - - /** - * @param null|Acl[]|array[] $acl - */ - private function setAcl(null|array $acl): static - { - $acl = $acl !== null ? array_map( - fn ($value) => $value instanceof Acl ? $value : Acl::from($value), - $acl, - ) : null; - - $this->fields['acl'] = $acl; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } -} diff --git a/src/Model/MembershipEmbedded.php b/src/Model/MembershipEmbedded.php deleted file mode 100644 index 233c9cdbe..000000000 --- a/src/Model/MembershipEmbedded.php +++ /dev/null @@ -1,76 +0,0 @@ -setRoles($data['roles']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - /** - * @return null|Role[] - */ - public function getRoles(): ?array - { - return $this->fields['roles'] ?? null; - } - - /** - * @param null|array[]|Role[] $roles - */ - public function setRoles(null|array $roles): static - { - $roles = $roles !== null ? array_map( - fn ($value) => $value instanceof Role ? $value : Role::from($value), - $roles, - ) : null; - - $this->fields['roles'] = $roles; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('roles', $this->fields)) { - $data['roles'] = $this->fields['roles'] !== null - ? array_map( - static fn (Role $role) => $role->jsonSerialize(), - $this->fields['roles'], - ) - : null; - } - - return $data; - } -} diff --git a/src/Model/MembershipOrganization.php b/src/Model/MembershipOrganization.php deleted file mode 100644 index a7d0dd610..000000000 --- a/src/Model/MembershipOrganization.php +++ /dev/null @@ -1,124 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('name', $data)) { - $this->setName($data['name']); - } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); - } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - public function getName(): ?string - { - return $this->fields['name'] ?? null; - } - - public function setName(null|string $name): static - { - $this->fields['name'] = $name; - - return $this; - } - - public function getCreatedTime(): ?DateTimeImmutable - { - return $this->fields['createdTime'] ?? null; - } - - public function getUpdatedTime(): ?DateTimeImmutable - { - return $this->fields['updatedTime'] ?? null; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('name', $this->fields)) { - $data['name'] = $this->fields['name']; - } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); - } - - return $data; - } - - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static - { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } - - $this->fields['createdTime'] = $createdTime; - - return $this; - } - - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static - { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); - } - - $this->fields['updatedTime'] = $updatedTime; - - return $this; - } -} diff --git a/src/Model/MembershipUser.php b/src/Model/MembershipUser.php deleted file mode 100644 index bc0b53233..000000000 --- a/src/Model/MembershipUser.php +++ /dev/null @@ -1,96 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('name', $data)) { - $this->setName($data['name']); - } - if (array_key_exists('email', $data)) { - $this->setEmail($data['email']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function setId(null|string $id): static - { - $this->fields['id'] = $id; - - return $this; - } - - public function getName(): ?string - { - return $this->fields['name'] ?? null; - } - - public function setName(null|string $name): static - { - $this->fields['name'] = $name; - - return $this; - } - - public function getEmail(): ?string - { - return $this->fields['email'] ?? null; - } - - public function setEmail(null|string $email): static - { - $this->fields['email'] = $email; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('id', $this->fields)) { - $data['id'] = $this->fields['id']; - } - if (array_key_exists('name', $this->fields)) { - $data['name'] = $this->fields['name']; - } - if (array_key_exists('email', $this->fields)) { - $data['email'] = $this->fields['email']; - } - - return $data; - } -} diff --git a/src/Model/OneTimeSaleItem.php b/src/Model/OneTimeSaleItem.php index ed31383bd..e1d8f6b18 100644 --- a/src/Model/OneTimeSaleItem.php +++ b/src/Model/OneTimeSaleItem.php @@ -29,9 +29,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('id', $data)) { $this->setId($data['id']); } - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } if (array_key_exists('productId', $data)) { $this->setProductId($data['productId']); } @@ -68,18 +65,6 @@ public function getId(): ?string return $this->fields['id'] ?? null; } - public function getPlanId(): ?string - { - return $this->fields['planId'] ?? null; - } - - public function setPlanId(null|string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - public function getProductId(): ?string { return $this->fields['productId'] ?? null; @@ -136,9 +121,6 @@ public function jsonSerialize(): array if (array_key_exists('id', $this->fields)) { $data['id'] = $this->fields['id']; } - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } if (array_key_exists('productId', $this->fields)) { $data['productId'] = $this->fields['productId']; } diff --git a/src/Model/OneTimeSalePlan.php b/src/Model/OneTimeSalePlan.php new file mode 100644 index 000000000..f6d85bdef --- /dev/null +++ b/src/Model/OneTimeSalePlan.php @@ -0,0 +1,449 @@ +setType($data['type']); + } + if (array_key_exists('name', $data)) { + $this->setName($data['name']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } + if (array_key_exists('richDescription', $data)) { + $this->setRichDescription($data['richDescription']); + } + if (array_key_exists('productId', $data)) { + $this->setProductId($data['productId']); + } + if (array_key_exists('productOptions', $data)) { + $this->setProductOptions($data['productOptions']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('currencySign', $data)) { + $this->setCurrencySign($data['currencySign']); + } + if (array_key_exists('pricing', $data)) { + $this->setPricing($data['pricing']); + } + if (array_key_exists('setup', $data)) { + $this->setSetup($data['setup']); + } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } + if (array_key_exists('customFields', $data)) { + $this->setCustomFields($data['customFields']); + } + if (array_key_exists('isActive', $data)) { + $this->setIsActive($data['isActive']); + } + if (array_key_exists('revision', $data)) { + $this->setRevision($data['revision']); + } + if (array_key_exists('isTrialOnly', $data)) { + $this->setIsTrialOnly($data['isTrialOnly']); + } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + public function getName(): string + { + return $this->fields['name']; + } + + public function setName(string $name): static + { + $this->fields['name'] = $name; + + return $this; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + + public function getRichDescription(): ?string + { + return $this->fields['richDescription'] ?? null; + } + + public function setRichDescription(null|string $richDescription): static + { + $this->fields['richDescription'] = $richDescription; + + return $this; + } + + public function getProductId(): string + { + return $this->fields['productId']; + } + + public function setProductId(string $productId): static + { + $this->fields['productId'] = $productId; + + return $this; + } + + /** + * @return null|array + */ + public function getProductOptions(): ?array + { + return $this->fields['productOptions'] ?? null; + } + + /** + * @param null|array $productOptions + */ + public function setProductOptions(null|array $productOptions): static + { + $this->fields['productOptions'] = $productOptions; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getCurrencySign(): ?string + { + return $this->fields['currencySign'] ?? null; + } + + public function getPricing(): PlanPriceFormula + { + return $this->fields['pricing']; + } + + public function setPricing(PlanPriceFormula|array $pricing): static + { + if (!($pricing instanceof PlanPriceFormula)) { + $pricing = PlanPriceFormulaFactory::from($pricing); + } + + $this->fields['pricing'] = $pricing; + + return $this; + } + + public function getSetup(): ?PlanSetup + { + return $this->fields['setup'] ?? null; + } + + public function setSetup(null|PlanSetup|array $setup): static + { + if ($setup !== null && !($setup instanceof PlanSetup)) { + $setup = PlanSetup::from($setup); + } + + $this->fields['setup'] = $setup; + + return $this; + } + + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + + public function getCustomFields(): ?array + { + return $this->fields['customFields'] ?? null; + } + + public function setCustomFields(null|array $customFields): static + { + $this->fields['customFields'] = $customFields; + + return $this; + } + + public function getIsActive(): ?bool + { + return $this->fields['isActive'] ?? null; + } + + public function setIsActive(null|bool $isActive): static + { + $this->fields['isActive'] = $isActive; + + return $this; + } + + public function getRevision(): ?int + { + return $this->fields['revision'] ?? null; + } + + public function getIsTrialOnly(): ?bool + { + return $this->fields['isTrialOnly'] ?? null; + } + + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): null + { + return $this->fields['trial'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('name', $this->fields)) { + $data['name'] = $this->fields['name']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } + if (array_key_exists('richDescription', $this->fields)) { + $data['richDescription'] = $this->fields['richDescription']; + } + if (array_key_exists('productId', $this->fields)) { + $data['productId'] = $this->fields['productId']; + } + if (array_key_exists('productOptions', $this->fields)) { + $data['productOptions'] = $this->fields['productOptions'] !== null + ? (object) $this->fields['productOptions'] + : null; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('currencySign', $this->fields)) { + $data['currencySign'] = $this->fields['currencySign']; + } + if (array_key_exists('pricing', $this->fields)) { + $data['pricing'] = $this->fields['pricing']->jsonSerialize(); + } + if (array_key_exists('setup', $this->fields)) { + $data['setup'] = $this->fields['setup']?->jsonSerialize(); + } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } + if (array_key_exists('customFields', $this->fields)) { + $data['customFields'] = $this->fields['customFields']; + } + if (array_key_exists('isActive', $this->fields)) { + $data['isActive'] = $this->fields['isActive']; + } + if (array_key_exists('revision', $this->fields)) { + $data['revision'] = $this->fields['revision']; + } + if (array_key_exists('isTrialOnly', $this->fields)) { + $data['isTrialOnly'] = $this->fields['isTrialOnly']; + } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']; + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setCurrencySign(null|string $currencySign): static + { + $this->fields['currencySign'] = $currencySign; + + return $this; + } + + private function setRevision(null|int $revision): static + { + $this->fields['revision'] = $revision; + + return $this; + } + + private function setIsTrialOnly(null|bool $isTrialOnly): static + { + $this->fields['isTrialOnly'] = $isTrialOnly; + + return $this; + } + + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setTrial(null $trial): static + { + $this->fields['trial'] = $trial; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PlanOneTimeSalePlan.php b/src/Model/OneTimeSalePlanDetails.php similarity index 84% rename from src/Model/PlanOneTimeSalePlan.php rename to src/Model/OneTimeSalePlanDetails.php index 72a397b62..c9de591ff 100644 --- a/src/Model/PlanOneTimeSalePlan.php +++ b/src/Model/OneTimeSalePlanDetails.php @@ -18,7 +18,7 @@ use DateTimeInterface; use Rebilly\Sdk\Trait\HasMetadata; -class PlanOneTimeSalePlan implements Plan +class OneTimeSalePlanDetails implements Plan { use HasMetadata; @@ -53,6 +53,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -65,6 +68,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -85,6 +94,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'one-time-sale'; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -151,12 +165,12 @@ public function setProductOptions(null|array $productOptions): static return $this; } - public function getCurrency(): string + public function getCurrency(): ?string { - return $this->fields['currency']; + return $this->fields['currency'] ?? null; } - public function setCurrency(string $currency): static + public function setCurrency(null|string $currency): static { $this->fields['currency'] = $currency; @@ -200,6 +214,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -234,6 +264,16 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): null + { + return $this->fields['trial'] ?? null; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -259,7 +299,9 @@ public function getId(): string public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'one-time-sale', + ]; if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -289,6 +331,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -301,6 +346,12 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']; + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } @@ -343,6 +394,20 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setTrial(null $trial): static + { + $this->fields['trial'] = $trial; + + return $this; + } + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/OrderChange.php b/src/Model/OrderChange.php index 5e9466917..05fc0c3e0 100644 --- a/src/Model/OrderChange.php +++ b/src/Model/OrderChange.php @@ -23,14 +23,54 @@ class OrderChange implements JsonSerializable { use HasMetadata; - public const RENEWAL_POLICY_RESET = 'reset'; + public const STATUS_PENDING = 'pending'; - public const RENEWAL_POLICY_RETAIN = 'retain'; + public const STATUS_APPLIED = 'applied'; + + public const STATUS_CANCELED = 'canceled'; + + public const STATUS_SUPERSEDED = 'superseded'; + + public const APPLY_AT_NOW = 'now'; + + public const APPLY_AT_NEXT_RENEWAL = 'nextRenewal'; + + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_ONLY = 'retainTrialOnly'; private array $fields = []; public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('id', $data)) { + $this->setId($data['id']); + } + if (array_key_exists('orderId', $data)) { + $this->setOrderId($data['orderId']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('applyAt', $data)) { + $this->setApplyAt($data['applyAt']); + } + if (array_key_exists('effectiveTime', $data)) { + $this->setEffectiveTime($data['effectiveTime']); + } + if (array_key_exists('lockedTime', $data)) { + $this->setLockedTime($data['lockedTime']); + } + if (array_key_exists('appliedTime', $data)) { + $this->setAppliedTime($data['appliedTime']); + } + if (array_key_exists('quoteId', $data)) { + $this->setQuoteId($data['quoteId']); + } if (array_key_exists('items', $data)) { $this->setItems($data['items']); } @@ -40,17 +80,14 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('prorated', $data)) { $this->setProrated($data['prorated']); } - if (array_key_exists('effectiveTime', $data)) { - $this->setEffectiveTime($data['effectiveTime']); - } - if (array_key_exists('preview', $data)) { - $this->setPreview($data['preview']); + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); } - if (array_key_exists('keepTrial', $data)) { - $this->setKeepTrial($data['keepTrial']); + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); } - if (array_key_exists('ignoreRecurring', $data)) { - $this->setIgnoreRecurring($data['ignoreRecurring']); + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); } $this->setMetadata($metadata); } @@ -60,49 +97,36 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - /** - * @return OrderChangeItems[] - */ - public function getItems(): array + public function getId(): ?string { - return $this->fields['items']; + return $this->fields['id'] ?? null; } - /** - * @param array[]|OrderChangeItems[] $items - */ - public function setItems(array $items): static + public function getOrderId(): string { - $items = array_map( - fn ($value) => $value instanceof OrderChangeItems ? $value : OrderChangeItems::from($value), - $items, - ); - - $this->fields['items'] = $items; - - return $this; + return $this->fields['orderId']; } - public function getRenewalPolicy(): string + public function setOrderId(string $orderId): static { - return $this->fields['renewalPolicy']; + $this->fields['orderId'] = $orderId; + + return $this; } - public function setRenewalPolicy(string $renewalPolicy): static + public function getStatus(): ?string { - $this->fields['renewalPolicy'] = $renewalPolicy; - - return $this; + return $this->fields['status'] ?? null; } - public function getProrated(): bool + public function getApplyAt(): ?string { - return $this->fields['prorated']; + return $this->fields['applyAt'] ?? null; } - public function setProrated(bool $prorated): static + public function setApplyAt(null|string $applyAt): static { - $this->fields['prorated'] = $prorated; + $this->fields['applyAt'] = $applyAt; return $this; } @@ -123,45 +147,113 @@ public function setEffectiveTime(null|DateTimeImmutable|string $effectiveTime): return $this; } - public function getPreview(): ?bool + public function getLockedTime(): ?DateTimeImmutable + { + return $this->fields['lockedTime'] ?? null; + } + + public function getAppliedTime(): ?DateTimeImmutable + { + return $this->fields['appliedTime'] ?? null; + } + + public function getQuoteId(): ?string + { + return $this->fields['quoteId'] ?? null; + } + + /** + * @return OrderChangeItems[] + */ + public function getItems(): array { - return $this->fields['preview'] ?? null; + return $this->fields['items']; } - public function setPreview(null|bool $preview): static + /** + * @param array[]|OrderChangeItems[] $items + */ + public function setItems(array $items): static { - $this->fields['preview'] = $preview; + $items = array_map( + fn ($value) => $value instanceof OrderChangeItems ? $value : OrderChangeItems::from($value), + $items, + ); + + $this->fields['items'] = $items; return $this; } - public function getKeepTrial(): ?bool + public function getRenewalPolicy(): ?string { - return $this->fields['keepTrial'] ?? null; + return $this->fields['renewalPolicy'] ?? null; } - public function setKeepTrial(null|bool $keepTrial): static + public function setRenewalPolicy(null|string $renewalPolicy): static { - $this->fields['keepTrial'] = $keepTrial; + $this->fields['renewalPolicy'] = $renewalPolicy; return $this; } - public function getIgnoreRecurring(): ?bool + public function getProrated(): ?bool { - return $this->fields['ignoreRecurring'] ?? null; + return $this->fields['prorated'] ?? null; } - public function setIgnoreRecurring(null|bool $ignoreRecurring): static + public function setProrated(null|bool $prorated): static { - $this->fields['ignoreRecurring'] = $ignoreRecurring; + $this->fields['prorated'] = $prorated; return $this; } + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + public function jsonSerialize(): array { $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('orderId', $this->fields)) { + $data['orderId'] = $this->fields['orderId']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('applyAt', $this->fields)) { + $data['applyAt'] = $this->fields['applyAt']; + } + if (array_key_exists('effectiveTime', $this->fields)) { + $data['effectiveTime'] = $this->fields['effectiveTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('lockedTime', $this->fields)) { + $data['lockedTime'] = $this->fields['lockedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('appliedTime', $this->fields)) { + $data['appliedTime'] = $this->fields['appliedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('quoteId', $this->fields)) { + $data['quoteId'] = $this->fields['quoteId']; + } if (array_key_exists('items', $this->fields)) { $data['items'] = array_map( static fn (OrderChangeItems $orderChangeItems) => $orderChangeItems->jsonSerialize(), @@ -174,19 +266,101 @@ public function jsonSerialize(): array if (array_key_exists('prorated', $this->fields)) { $data['prorated'] = $this->fields['prorated']; } - if (array_key_exists('effectiveTime', $this->fields)) { - $data['effectiveTime'] = $this->fields['effectiveTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('preview', $this->fields)) { - $data['preview'] = $this->fields['preview']; + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } - if (array_key_exists('keepTrial', $this->fields)) { - $data['keepTrial'] = $this->fields['keepTrial']; + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); } - if (array_key_exists('ignoreRecurring', $this->fields)) { - $data['ignoreRecurring'] = $this->fields['ignoreRecurring']; + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; } return $data; } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setLockedTime(null|DateTimeImmutable|string $lockedTime): static + { + if ($lockedTime !== null && !($lockedTime instanceof DateTimeImmutable)) { + $lockedTime = new DateTimeImmutable($lockedTime); + } + + $this->fields['lockedTime'] = $lockedTime; + + return $this; + } + + private function setAppliedTime(null|DateTimeImmutable|string $appliedTime): static + { + if ($appliedTime !== null && !($appliedTime instanceof DateTimeImmutable)) { + $appliedTime = new DateTimeImmutable($appliedTime); + } + + $this->fields['appliedTime'] = $appliedTime; + + return $this; + } + + private function setQuoteId(null|string $quoteId): static + { + $this->fields['quoteId'] = $quoteId; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } } diff --git a/src/Model/OrderChangeItems.php b/src/Model/OrderChangeItems.php index 07cc9d1b0..2daee45c0 100644 --- a/src/Model/OrderChangeItems.php +++ b/src/Model/OrderChangeItems.php @@ -34,6 +34,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('usageLimits', $data)) { $this->setUsageLimits($data['usageLimits']); } + if (array_key_exists('excludeFromMrr', $data)) { + $this->setExcludeFromMrr($data['excludeFromMrr']); + } $this->setMetadata($metadata); } @@ -86,6 +89,18 @@ public function setUsageLimits(null|UsageLimits|array $usageLimits): static return $this; } + public function getExcludeFromMrr(): ?bool + { + return $this->fields['excludeFromMrr'] ?? null; + } + + public function setExcludeFromMrr(null|bool $excludeFromMrr): static + { + $this->fields['excludeFromMrr'] = $excludeFromMrr; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -98,6 +113,9 @@ public function jsonSerialize(): array if (array_key_exists('usageLimits', $this->fields)) { $data['usageLimits'] = $this->fields['usageLimits']?->jsonSerialize(); } + if (array_key_exists('excludeFromMrr', $this->fields)) { + $data['excludeFromMrr'] = $this->fields['excludeFromMrr']; + } return $data; } diff --git a/src/Model/OrderItemsChange.php b/src/Model/OrderItemsChange.php new file mode 100644 index 000000000..ba827f035 --- /dev/null +++ b/src/Model/OrderItemsChange.php @@ -0,0 +1,200 @@ +setItems($data['items']); + } + if (array_key_exists('renewalPolicy', $data)) { + $this->setRenewalPolicy($data['renewalPolicy']); + } + if (array_key_exists('prorated', $data)) { + $this->setProrated($data['prorated']); + } + if (array_key_exists('effectiveTime', $data)) { + $this->setEffectiveTime($data['effectiveTime']); + } + if (array_key_exists('preview', $data)) { + $this->setPreview($data['preview']); + } + if (array_key_exists('keepTrial', $data)) { + $this->setKeepTrial($data['keepTrial']); + } + if (array_key_exists('ignoreRecurring', $data)) { + $this->setIgnoreRecurring($data['ignoreRecurring']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + /** + * @return OrderItemsChangeItems[] + */ + public function getItems(): array + { + return $this->fields['items']; + } + + /** + * @param array[]|OrderItemsChangeItems[] $items + */ + public function setItems(array $items): static + { + $items = array_map( + fn ($value) => $value instanceof OrderItemsChangeItems ? $value : OrderItemsChangeItems::from($value), + $items, + ); + + $this->fields['items'] = $items; + + return $this; + } + + public function getRenewalPolicy(): string + { + return $this->fields['renewalPolicy']; + } + + public function setRenewalPolicy(string $renewalPolicy): static + { + $this->fields['renewalPolicy'] = $renewalPolicy; + + return $this; + } + + public function getProrated(): bool + { + return $this->fields['prorated']; + } + + public function setProrated(bool $prorated): static + { + $this->fields['prorated'] = $prorated; + + return $this; + } + + public function getEffectiveTime(): ?DateTimeImmutable + { + return $this->fields['effectiveTime'] ?? null; + } + + public function setEffectiveTime(null|DateTimeImmutable|string $effectiveTime): static + { + if ($effectiveTime !== null && !($effectiveTime instanceof DateTimeImmutable)) { + $effectiveTime = new DateTimeImmutable($effectiveTime); + } + + $this->fields['effectiveTime'] = $effectiveTime; + + return $this; + } + + public function getPreview(): ?bool + { + return $this->fields['preview'] ?? null; + } + + public function setPreview(null|bool $preview): static + { + $this->fields['preview'] = $preview; + + return $this; + } + + public function getKeepTrial(): ?bool + { + return $this->fields['keepTrial'] ?? null; + } + + public function setKeepTrial(null|bool $keepTrial): static + { + $this->fields['keepTrial'] = $keepTrial; + + return $this; + } + + public function getIgnoreRecurring(): ?bool + { + return $this->fields['ignoreRecurring'] ?? null; + } + + public function setIgnoreRecurring(null|bool $ignoreRecurring): static + { + $this->fields['ignoreRecurring'] = $ignoreRecurring; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('items', $this->fields)) { + $data['items'] = array_map( + static fn (OrderItemsChangeItems $orderItemsChangeItems) => $orderItemsChangeItems->jsonSerialize(), + $this->fields['items'], + ); + } + if (array_key_exists('renewalPolicy', $this->fields)) { + $data['renewalPolicy'] = $this->fields['renewalPolicy']; + } + if (array_key_exists('prorated', $this->fields)) { + $data['prorated'] = $this->fields['prorated']; + } + if (array_key_exists('effectiveTime', $this->fields)) { + $data['effectiveTime'] = $this->fields['effectiveTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('preview', $this->fields)) { + $data['preview'] = $this->fields['preview']; + } + if (array_key_exists('keepTrial', $this->fields)) { + $data['keepTrial'] = $this->fields['keepTrial']; + } + if (array_key_exists('ignoreRecurring', $this->fields)) { + $data['ignoreRecurring'] = $this->fields['ignoreRecurring']; + } + + return $data; + } +} diff --git a/src/Model/OrderItemsChangeItems.php b/src/Model/OrderItemsChangeItems.php new file mode 100644 index 000000000..5340cb8c1 --- /dev/null +++ b/src/Model/OrderItemsChangeItems.php @@ -0,0 +1,104 @@ +setPlan($data['plan']); + } + if (array_key_exists('quantity', $data)) { + $this->setQuantity($data['quantity']); + } + if (array_key_exists('usageLimits', $data)) { + $this->setUsageLimits($data['usageLimits']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlan(): ConfigurablePlan + { + return $this->fields['plan']; + } + + public function setPlan(ConfigurablePlan|array $plan): static + { + if (!($plan instanceof ConfigurablePlan)) { + $plan = ConfigurablePlanFactory::from($plan); + } + + $this->fields['plan'] = $plan; + + return $this; + } + + public function getQuantity(): ?int + { + return $this->fields['quantity'] ?? null; + } + + public function setQuantity(null|int $quantity): static + { + $this->fields['quantity'] = $quantity; + + return $this; + } + + public function getUsageLimits(): ?UsageLimits + { + return $this->fields['usageLimits'] ?? null; + } + + public function setUsageLimits(null|UsageLimits|array $usageLimits): static + { + if ($usageLimits !== null && !($usageLimits instanceof UsageLimits)) { + $usageLimits = UsageLimits::from($usageLimits); + } + + $this->fields['usageLimits'] = $usageLimits; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('plan', $this->fields)) { + $data['plan'] = $this->fields['plan']->jsonSerialize(); + } + if (array_key_exists('quantity', $this->fields)) { + $data['quantity'] = $this->fields['quantity']; + } + if (array_key_exists('usageLimits', $this->fields)) { + $data['usageLimits'] = $this->fields['usageLimits']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/OrderPreview.php b/src/Model/OrderPreview.php index 059d16fa0..b6362a629 100644 --- a/src/Model/OrderPreview.php +++ b/src/Model/OrderPreview.php @@ -113,7 +113,7 @@ public function getItems(): array public function setItems(array $items): static { $items = array_map( - fn ($value) => $value instanceof OrderPreviewItems ? $value : OrderPreviewItems::from($value), + fn ($value) => $value instanceof OrderPreviewItems ? $value : OrderPreviewItemsFactory::from($value), $items, ); diff --git a/src/Model/OrderPreviewItems.php b/src/Model/OrderPreviewItems.php index 387422b15..102b0d50d 100644 --- a/src/Model/OrderPreviewItems.php +++ b/src/Model/OrderPreviewItems.php @@ -15,64 +15,7 @@ namespace Rebilly\Sdk\Model; use JsonSerializable; -use Rebilly\Sdk\Trait\HasMetadata; -class OrderPreviewItems implements JsonSerializable +interface OrderPreviewItems extends JsonSerializable { - use HasMetadata; - - private array $fields = []; - - public function __construct(array $data = [], array $metadata = []) - { - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } - if (array_key_exists('quantity', $data)) { - $this->setQuantity($data['quantity']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getPlanId(): string - { - return $this->fields['planId']; - } - - public function setPlanId(string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - - public function getQuantity(): ?int - { - return $this->fields['quantity'] ?? null; - } - - public function setQuantity(null|int $quantity): static - { - $this->fields['quantity'] = $quantity; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } - if (array_key_exists('quantity', $this->fields)) { - $data['quantity'] = $this->fields['quantity']; - } - - return $data; - } } diff --git a/src/Model/WebsiteSettingsDepositForm.php b/src/Model/OrderPreviewItems0.php similarity index 51% rename from src/Model/WebsiteSettingsDepositForm.php rename to src/Model/OrderPreviewItems0.php index 2ea8ac6cd..e3b74e6b9 100644 --- a/src/Model/WebsiteSettingsDepositForm.php +++ b/src/Model/OrderPreviewItems0.php @@ -14,10 +14,9 @@ namespace Rebilly\Sdk\Model; -use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class WebsiteSettingsDepositForm implements JsonSerializable +class OrderPreviewItems0 implements OrderPreviewItems { use HasMetadata; @@ -25,8 +24,8 @@ class WebsiteSettingsDepositForm implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('theme', $data)) { - $this->setTheme($data['theme']); + if (array_key_exists('planId', $data)) { + $this->setPlanId($data['planId']); } $this->setMetadata($metadata); } @@ -36,18 +35,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getTheme(): ?WebsiteSettingsDepositFormTheme + public function getPlanId(): ?OrderPreviewItems0PlanId { - return $this->fields['theme'] ?? null; + return $this->fields['planId'] ?? null; } - public function setTheme(null|WebsiteSettingsDepositFormTheme|array $theme): static + public function setPlanId(null|OrderPreviewItems0PlanId|array $planId): static { - if ($theme !== null && !($theme instanceof WebsiteSettingsDepositFormTheme)) { - $theme = WebsiteSettingsDepositFormTheme::from($theme); + if ($planId !== null && !($planId instanceof OrderPreviewItems0PlanId)) { + $planId = OrderPreviewItems0PlanId::from($planId); } - $this->fields['theme'] = $theme; + $this->fields['planId'] = $planId; return $this; } @@ -55,8 +54,8 @@ public function setTheme(null|WebsiteSettingsDepositFormTheme|array $theme): sta public function jsonSerialize(): array { $data = []; - if (array_key_exists('theme', $this->fields)) { - $data['theme'] = $this->fields['theme']?->jsonSerialize(); + if (array_key_exists('planId', $this->fields)) { + $data['planId'] = $this->fields['planId']?->jsonSerialize(); } return $data; diff --git a/src/Model/OrderPreviewItems0PlanId.php b/src/Model/OrderPreviewItems0PlanId.php new file mode 100644 index 000000000..8748703ca --- /dev/null +++ b/src/Model/OrderPreviewItems0PlanId.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems1.php b/src/Model/OrderPreviewItems1.php new file mode 100644 index 000000000..e129344e4 --- /dev/null +++ b/src/Model/OrderPreviewItems1.php @@ -0,0 +1,63 @@ +setPlan($data['plan']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlan(): ?OrderPreviewItems1Plan + { + return $this->fields['plan'] ?? null; + } + + public function setPlan(null|OrderPreviewItems1Plan|array $plan): static + { + if ($plan !== null && !($plan instanceof OrderPreviewItems1Plan)) { + $plan = OrderPreviewItems1Plan::from($plan); + } + + $this->fields['plan'] = $plan; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('plan', $this->fields)) { + $data['plan'] = $this->fields['plan']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems1Plan.php b/src/Model/OrderPreviewItems1Plan.php new file mode 100644 index 000000000..58f8e5abf --- /dev/null +++ b/src/Model/OrderPreviewItems1Plan.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems2.php b/src/Model/OrderPreviewItems2.php new file mode 100644 index 000000000..a6e792427 --- /dev/null +++ b/src/Model/OrderPreviewItems2.php @@ -0,0 +1,99 @@ +setPlanId($data['planId']); + } + if (array_key_exists('plan', $data)) { + $this->setPlan($data['plan']); + } + if (array_key_exists('quantity', $data)) { + $this->setQuantity($data['quantity']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlanId(): string + { + return $this->fields['planId']; + } + + public function setPlanId(string $planId): static + { + $this->fields['planId'] = $planId; + + return $this; + } + + public function getPlan(): ConfigurablePlan + { + return $this->fields['plan']; + } + + public function setPlan(ConfigurablePlan|array $plan): static + { + if (!($plan instanceof ConfigurablePlan)) { + $plan = ConfigurablePlanFactory::from($plan); + } + + $this->fields['plan'] = $plan; + + return $this; + } + + public function getQuantity(): ?int + { + return $this->fields['quantity'] ?? null; + } + + public function setQuantity(null|int $quantity): static + { + $this->fields['quantity'] = $quantity; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('planId', $this->fields)) { + $data['planId'] = $this->fields['planId']; + } + if (array_key_exists('plan', $this->fields)) { + $data['plan'] = $this->fields['plan']->jsonSerialize(); + } + if (array_key_exists('quantity', $this->fields)) { + $data['quantity'] = $this->fields['quantity']; + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewItemsFactory.php b/src/Model/OrderPreviewItemsFactory.php new file mode 100644 index 000000000..4f558a2d1 --- /dev/null +++ b/src/Model/OrderPreviewItemsFactory.php @@ -0,0 +1,23 @@ +setTaxDescriptor($data['taxDescriptor']); } + if (array_key_exists('regulatorOperatorId', $data)) { + $this->setRegulatorOperatorId($data['regulatorOperatorId']); + } if (array_key_exists('invoiceTimeZone', $data)) { $this->setInvoiceTimeZone($data['invoiceTimeZone']); } @@ -257,6 +260,18 @@ public function setTaxDescriptor(null|string $taxDescriptor): static return $this; } + public function getRegulatorOperatorId(): ?string + { + return $this->fields['regulatorOperatorId'] ?? null; + } + + public function setRegulatorOperatorId(null|string $regulatorOperatorId): static + { + $this->fields['regulatorOperatorId'] = $regulatorOperatorId; + + return $this; + } + public function getInvoiceTimeZone(): ?string { return $this->fields['invoiceTimeZone'] ?? null; @@ -411,6 +426,9 @@ public function jsonSerialize(): array if (array_key_exists('taxDescriptor', $this->fields)) { $data['taxDescriptor'] = $this->fields['taxDescriptor']; } + if (array_key_exists('regulatorOperatorId', $this->fields)) { + $data['regulatorOperatorId'] = $this->fields['regulatorOperatorId']; + } if (array_key_exists('invoiceTimeZone', $this->fields)) { $data['invoiceTimeZone'] = $this->fields['invoiceTimeZone']; } diff --git a/src/Model/OrganizationSettings.php b/src/Model/OrganizationSettings.php index 71648916e..ce147e0d2 100644 --- a/src/Model/OrganizationSettings.php +++ b/src/Model/OrganizationSettings.php @@ -37,6 +37,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('notifications', $data)) { $this->setNotifications($data['notifications']); } + if (array_key_exists('annualComplianceScreening', $data)) { + $this->setAnnualComplianceScreening($data['annualComplianceScreening']); + } if (array_key_exists('payoutRequestAllocationOrder', $data)) { $this->setPayoutRequestAllocationOrder($data['payoutRequestAllocationOrder']); } @@ -119,6 +122,22 @@ public function setNotifications(null|OrganizationSettingsNotifications|array $n return $this; } + public function getAnnualComplianceScreening(): ?OrganizationSettingsAnnualComplianceScreening + { + return $this->fields['annualComplianceScreening'] ?? null; + } + + public function setAnnualComplianceScreening(null|OrganizationSettingsAnnualComplianceScreening|array $annualComplianceScreening): static + { + if ($annualComplianceScreening !== null && !($annualComplianceScreening instanceof OrganizationSettingsAnnualComplianceScreening)) { + $annualComplianceScreening = OrganizationSettingsAnnualComplianceScreening::from($annualComplianceScreening); + } + + $this->fields['annualComplianceScreening'] = $annualComplianceScreening; + + return $this; + } + /** * @return null|string[] */ @@ -157,6 +176,9 @@ public function jsonSerialize(): array if (array_key_exists('notifications', $this->fields)) { $data['notifications'] = $this->fields['notifications']?->jsonSerialize(); } + if (array_key_exists('annualComplianceScreening', $this->fields)) { + $data['annualComplianceScreening'] = $this->fields['annualComplianceScreening']?->jsonSerialize(); + } if (array_key_exists('payoutRequestAllocationOrder', $this->fields)) { $data['payoutRequestAllocationOrder'] = $this->fields['payoutRequestAllocationOrder']; } diff --git a/src/Model/OrganizationSettingsAnnualComplianceScreening.php b/src/Model/OrganizationSettingsAnnualComplianceScreening.php new file mode 100644 index 000000000..4aae411bd --- /dev/null +++ b/src/Model/OrganizationSettingsAnnualComplianceScreening.php @@ -0,0 +1,78 @@ +setEnabled($data['enabled']); + } + if (array_key_exists('monthDay', $data)) { + $this->setMonthDay($data['monthDay']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getEnabled(): ?bool + { + return $this->fields['enabled'] ?? null; + } + + public function setEnabled(null|bool $enabled): static + { + $this->fields['enabled'] = $enabled; + + return $this; + } + + public function getMonthDay(): ?string + { + return $this->fields['monthDay'] ?? null; + } + + public function setMonthDay(null|string $monthDay): static + { + $this->fields['monthDay'] = $monthDay; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('enabled', $this->fields)) { + $data['enabled'] = $this->fields['enabled']; + } + if (array_key_exists('monthDay', $this->fields)) { + $data['monthDay'] = $this->fields['monthDay']; + } + + return $data; + } +} diff --git a/src/Model/PatchOrganizationRequest.php b/src/Model/PatchOrganizationRequest.php index 83033e3ef..76d18c6eb 100644 --- a/src/Model/PatchOrganizationRequest.php +++ b/src/Model/PatchOrganizationRequest.php @@ -63,6 +63,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('taxDescriptor', $data)) { $this->setTaxDescriptor($data['taxDescriptor']); } + if (array_key_exists('regulatorOperatorId', $data)) { + $this->setRegulatorOperatorId($data['regulatorOperatorId']); + } if (array_key_exists('invoiceTimeZone', $data)) { $this->setInvoiceTimeZone($data['invoiceTimeZone']); } @@ -250,6 +253,18 @@ public function setTaxDescriptor(null|string $taxDescriptor): static return $this; } + public function getRegulatorOperatorId(): ?string + { + return $this->fields['regulatorOperatorId'] ?? null; + } + + public function setRegulatorOperatorId(null|string $regulatorOperatorId): static + { + $this->fields['regulatorOperatorId'] = $regulatorOperatorId; + + return $this; + } + public function getInvoiceTimeZone(): ?string { return $this->fields['invoiceTimeZone'] ?? null; @@ -397,6 +412,9 @@ public function jsonSerialize(): array if (array_key_exists('taxDescriptor', $this->fields)) { $data['taxDescriptor'] = $this->fields['taxDescriptor']; } + if (array_key_exists('regulatorOperatorId', $this->fields)) { + $data['regulatorOperatorId'] = $this->fields['regulatorOperatorId']; + } if (array_key_exists('invoiceTimeZone', $this->fields)) { $data['invoiceTimeZone'] = $this->fields['invoiceTimeZone']; } diff --git a/src/Model/PatchPlaidCredential.php b/src/Model/PatchPlaidCredential.php index c581228c2..bfd2ce520 100644 --- a/src/Model/PatchPlaidCredential.php +++ b/src/Model/PatchPlaidCredential.php @@ -53,6 +53,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'plaid'; + } + public function getStatus(): ?string { return $this->fields['status'] ?? null; @@ -115,7 +120,9 @@ public function setUseStripe(null|bool $useStripe): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'plaid', + ]; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } diff --git a/src/Model/PatchServiceCredential.php b/src/Model/PatchServiceCredential.php index 3ddb51170..75404266e 100644 --- a/src/Model/PatchServiceCredential.php +++ b/src/Model/PatchServiceCredential.php @@ -26,6 +26,24 @@ class PatchServiceCredential implements PatchServiceCredentialRequest public const STATUS_DEACTIVATED = 'deactivated'; + public const TYPE_SMTP = 'smtp'; + + public const TYPE_WEBHOOK = 'webhook'; + + public const TYPE_MAILGUN = 'mailgun'; + + public const TYPE_SENDGRID = 'sendgrid'; + + public const TYPE_AWS_SES = 'aws-ses'; + + public const TYPE_OAUTH2 = 'oauth2'; + + public const TYPE_POSTMARK = 'postmark'; + + public const TYPE_EXPERIAN = 'experian'; + + public const TYPE_AVALARA = 'avalara'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -33,6 +51,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } $this->setMetadata($metadata); } @@ -53,12 +74,27 @@ public function setStatus(string $status): static return $this; } + public function getType(): string + { + return $this->fields['type']; + } + + public function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } return $data; } diff --git a/src/Model/PatchServiceCredentialRequest.php b/src/Model/PatchServiceCredentialRequest.php index 305f3c384..08508e2b0 100644 --- a/src/Model/PatchServiceCredentialRequest.php +++ b/src/Model/PatchServiceCredentialRequest.php @@ -18,6 +18,8 @@ interface PatchServiceCredentialRequest extends JsonSerializable { + public function getType(): string; + public function getStatus(): ?string; public function setStatus(string $status): static; diff --git a/src/Model/PatchServiceCredentialRequestFactory.php b/src/Model/PatchServiceCredentialRequestFactory.php new file mode 100644 index 000000000..35e76b081 --- /dev/null +++ b/src/Model/PatchServiceCredentialRequestFactory.php @@ -0,0 +1,38 @@ + PatchPlaidCredential::from($data, $metadata), + 'avalara' => PatchServiceCredential::from($data, $metadata), + 'aws-ses' => PatchServiceCredential::from($data, $metadata), + 'experian' => PatchServiceCredential::from($data, $metadata), + 'mailgun' => PatchServiceCredential::from($data, $metadata), + 'oauth2' => PatchServiceCredential::from($data, $metadata), + 'postmark' => PatchServiceCredential::from($data, $metadata), + 'sendgrid' => PatchServiceCredential::from($data, $metadata), + 'smtp' => PatchServiceCredential::from($data, $metadata), + 'webhook' => PatchServiceCredential::from($data, $metadata), + 'taxjar' => PatchTaxJarCredential::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PatchTaxJarCredential.php b/src/Model/PatchTaxJarCredential.php index af8a97d3a..c2c9e3a88 100644 --- a/src/Model/PatchTaxJarCredential.php +++ b/src/Model/PatchTaxJarCredential.php @@ -44,6 +44,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'taxjar'; + } + public function getStatus(): string { return $this->fields['status']; @@ -70,7 +75,9 @@ public function setOmitFromAddress(null|bool $omitFromAddress): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'taxjar', + ]; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } diff --git a/src/Model/PayGlocal.php b/src/Model/PayGlocal.php new file mode 100644 index 000000000..0e9c4b197 --- /dev/null +++ b/src/Model/PayGlocal.php @@ -0,0 +1,67 @@ + 'PayGlocal', + ] + $data, $metadata); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCredentials(): PayGlocalCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(PayGlocalCredentials|array $credentials): static + { + if (!($credentials instanceof PayGlocalCredentials)) { + $credentials = PayGlocalCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('credentials', $this->fields)) { + $data['credentials'] = $this->fields['credentials']->jsonSerialize(); + } + + return parent::jsonSerialize() + $data; + } +} diff --git a/src/Model/PayGlocalCredentials.php b/src/Model/PayGlocalCredentials.php new file mode 100644 index 000000000..7f3cc38fb --- /dev/null +++ b/src/Model/PayGlocalCredentials.php @@ -0,0 +1,132 @@ +setMerchantId($data['merchantId']); + } + if (array_key_exists('privateKeyId', $data)) { + $this->setPrivateKeyId($data['privateKeyId']); + } + if (array_key_exists('publicKeyId', $data)) { + $this->setPublicKeyId($data['publicKeyId']); + } + if (array_key_exists('publicKey', $data)) { + $this->setPublicKey($data['publicKey']); + } + if (array_key_exists('privateKey', $data)) { + $this->setPrivateKey($data['privateKey']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getMerchantId(): string + { + return $this->fields['merchantId']; + } + + public function setMerchantId(string $merchantId): static + { + $this->fields['merchantId'] = $merchantId; + + return $this; + } + + public function getPrivateKeyId(): string + { + return $this->fields['privateKeyId']; + } + + public function setPrivateKeyId(string $privateKeyId): static + { + $this->fields['privateKeyId'] = $privateKeyId; + + return $this; + } + + public function getPublicKeyId(): string + { + return $this->fields['publicKeyId']; + } + + public function setPublicKeyId(string $publicKeyId): static + { + $this->fields['publicKeyId'] = $publicKeyId; + + return $this; + } + + public function getPublicKey(): string + { + return $this->fields['publicKey']; + } + + public function setPublicKey(string $publicKey): static + { + $this->fields['publicKey'] = $publicKey; + + return $this; + } + + public function getPrivateKey(): string + { + return $this->fields['privateKey']; + } + + public function setPrivateKey(string $privateKey): static + { + $this->fields['privateKey'] = $privateKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('merchantId', $this->fields)) { + $data['merchantId'] = $this->fields['merchantId']; + } + if (array_key_exists('privateKeyId', $this->fields)) { + $data['privateKeyId'] = $this->fields['privateKeyId']; + } + if (array_key_exists('publicKeyId', $this->fields)) { + $data['publicKeyId'] = $this->fields['publicKeyId']; + } + if (array_key_exists('publicKey', $this->fields)) { + $data['publicKey'] = $this->fields['publicKey']; + } + if (array_key_exists('privateKey', $this->fields)) { + $data['privateKey'] = $this->fields['privateKey']; + } + + return $data; + } +} diff --git a/src/Model/PaybiltCredentials.php b/src/Model/PaybiltCredentials.php index 75a15f726..f89b830b1 100644 --- a/src/Model/PaybiltCredentials.php +++ b/src/Model/PaybiltCredentials.php @@ -34,6 +34,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('apiKey', $data)) { $this->setApiKey($data['apiKey']); } + if (array_key_exists('hmacKey', $data)) { + $this->setHmacKey($data['hmacKey']); + } $this->setMetadata($metadata); } @@ -78,6 +81,18 @@ public function setApiKey(string $apiKey): static return $this; } + public function getHmacKey(): ?string + { + return $this->fields['hmacKey'] ?? null; + } + + public function setHmacKey(null|string $hmacKey): static + { + $this->fields['hmacKey'] = $hmacKey; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -90,6 +105,9 @@ public function jsonSerialize(): array if (array_key_exists('apiKey', $this->fields)) { $data['apiKey'] = $this->fields['apiKey']; } + if (array_key_exists('hmacKey', $this->fields)) { + $data['hmacKey'] = $this->fields['hmacKey']; + } return $data; } diff --git a/src/Model/PaymentCard.php b/src/Model/PaymentCard.php index 1a0854ceb..4acfa17f2 100644 --- a/src/Model/PaymentCard.php +++ b/src/Model/PaymentCard.php @@ -114,6 +114,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('bankName', $data)) { $this->setBankName($data['bankName']); } + if (array_key_exists('isPayoutable', $data)) { + $this->setIsPayoutable($data['isPayoutable']); + } if (array_key_exists('billingAddress', $data)) { $this->setBillingAddress($data['billingAddress']); } @@ -287,6 +290,11 @@ public function getBankName(): ?string return $this->fields['bankName'] ?? null; } + public function getIsPayoutable(): ?bool + { + return $this->fields['isPayoutable'] ?? null; + } + public function getBillingAddress(): ?ContactObject { return $this->fields['billingAddress'] ?? null; @@ -477,6 +485,9 @@ public function jsonSerialize(): array if (array_key_exists('bankName', $this->fields)) { $data['bankName'] = $this->fields['bankName']; } + if (array_key_exists('isPayoutable', $this->fields)) { + $data['isPayoutable'] = $this->fields['isPayoutable']; + } if (array_key_exists('billingAddress', $this->fields)) { $data['billingAddress'] = $this->fields['billingAddress']?->jsonSerialize(); } @@ -592,6 +603,13 @@ private function setBankName(null|string $bankName): static return $this; } + private function setIsPayoutable(null|bool $isPayoutable): static + { + $this->fields['isPayoutable'] = $isPayoutable; + + return $this; + } + private function setBillingPortalUrl(null|string $billingPortalUrl): static { $this->fields['billingPortalUrl'] = $billingPortalUrl; diff --git a/src/Model/PaymentInstructionMethods.php b/src/Model/PaymentInstructionMethods.php index 02628d4cb..8ae0153ab 100644 --- a/src/Model/PaymentInstructionMethods.php +++ b/src/Model/PaymentInstructionMethods.php @@ -290,6 +290,8 @@ class PaymentInstructionMethods implements PaymentInstruction public const METHODS_PIX = 'PIX'; + public const METHODS_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHODS_PIN_PAY = 'PinPay'; public const METHODS_PHONE = 'phone'; @@ -350,6 +352,8 @@ class PaymentInstructionMethods implements PaymentInstruction public const METHODS_TETHER = 'Tether'; + public const METHODS_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHODS_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHODS_TRUSTLY = 'Trustly'; diff --git a/src/Model/PaymentInstrument.php b/src/Model/PaymentInstrument.php index 4dd5156b2..645aa6197 100644 --- a/src/Model/PaymentInstrument.php +++ b/src/Model/PaymentInstrument.php @@ -60,7 +60,7 @@ public function getRevision(): ?int; */ public function getLinks(): ?array; - public function getEmbedded(): null|AlternativeInstrumentEmbedded|BankAccountEmbedded|KhelocardCardEmbedded|PayPalAccountEmbedded|PaymentCardEmbedded; + public function getEmbedded(): null|AlternativeInstrumentEmbedded|BankAccountEmbedded|PayPalAccountEmbedded|PaymentCardEmbedded; public function setEmbedded(null|array $embedded): static; } diff --git a/src/Model/PaymentInstrumentFactory.php b/src/Model/PaymentInstrumentFactory.php index 49175d748..a70f99998 100644 --- a/src/Model/PaymentInstrumentFactory.php +++ b/src/Model/PaymentInstrumentFactory.php @@ -58,6 +58,7 @@ public static function from(array $data = [], array $metadata = []): PaymentInst 'Interac-online' => AlternativeInstrument::from($data, $metadata), 'Jeton' => AlternativeInstrument::from($data, $metadata), 'KNOT' => AlternativeInstrument::from($data, $metadata), + 'Khelocard' => AlternativeInstrument::from($data, $metadata), 'Klarna' => AlternativeInstrument::from($data, $metadata), 'MTS' => AlternativeInstrument::from($data, $metadata), 'Matrix' => AlternativeInstrument::from($data, $metadata), @@ -107,6 +108,7 @@ public static function from(array $data = [], array $metadata = []): PaymentInst 'SparkPay' => AlternativeInstrument::from($data, $metadata), 'Tele2' => AlternativeInstrument::from($data, $metadata), 'Terminaly-RF' => AlternativeInstrument::from($data, $metadata), + 'Thunes-Checkout' => AlternativeInstrument::from($data, $metadata), 'ToditoCash-card' => AlternativeInstrument::from($data, $metadata), 'Trustly' => AlternativeInstrument::from($data, $metadata), 'UPI' => AlternativeInstrument::from($data, $metadata), @@ -162,7 +164,6 @@ public static function from(array $data = [], array $metadata = []): PaymentInst 'voucher-3' => AlternativeInstrument::from($data, $metadata), 'voucher-4' => AlternativeInstrument::from($data, $metadata), 'ach' => BankAccount::from($data, $metadata), - 'Khelocard' => KhelocardCard::from($data, $metadata), 'payment-card' => PaymentCard::from($data, $metadata), 'paypal' => PayPalAccount::from($data, $metadata), default => throw new UnknownDiscriminatorValueException(), diff --git a/src/Model/PayoutRequest.php b/src/Model/PayoutRequest.php index c399e8ac1..7d45afa5d 100644 --- a/src/Model/PayoutRequest.php +++ b/src/Model/PayoutRequest.php @@ -82,6 +82,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('blockReason', $data)) { $this->setBlockReason($data['blockReason']); } + if (array_key_exists('splitReason', $data)) { + $this->setSplitReason($data['splitReason']); + } if (array_key_exists('batchId', $data)) { $this->setBatchId($data['batchId']); } @@ -239,6 +242,18 @@ public function setBlockReason(null|string $blockReason): static return $this; } + public function getSplitReason(): ?string + { + return $this->fields['splitReason'] ?? null; + } + + public function setSplitReason(null|string $splitReason): static + { + $this->fields['splitReason'] = $splitReason; + + return $this; + } + public function getBatchId(): ?string { return $this->fields['batchId'] ?? null; @@ -345,6 +360,9 @@ public function jsonSerialize(): array if (array_key_exists('blockReason', $this->fields)) { $data['blockReason'] = $this->fields['blockReason']; } + if (array_key_exists('splitReason', $this->fields)) { + $data['splitReason'] = $this->fields['splitReason']; + } if (array_key_exists('batchId', $this->fields)) { $data['batchId'] = $this->fields['batchId']; } diff --git a/src/Model/PayoutRequestAllocation.php b/src/Model/PayoutRequestAllocation.php index fdc766941..ffe93cfe4 100644 --- a/src/Model/PayoutRequestAllocation.php +++ b/src/Model/PayoutRequestAllocation.php @@ -293,6 +293,8 @@ class PayoutRequestAllocation implements JsonSerializable public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PIN_PAY = 'PinPay'; public const PAYMENT_METHOD_PHONE = 'phone'; @@ -353,6 +355,8 @@ class PayoutRequestAllocation implements JsonSerializable public const PAYMENT_METHOD_TETHER = 'Tether'; + public const PAYMENT_METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const PAYMENT_METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const PAYMENT_METHOD_TRUSTLY = 'Trustly'; @@ -510,6 +514,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('amount', $data)) { $this->setAmount($data['amount']); } + if (array_key_exists('exposureAmount', $data)) { + $this->setExposureAmount($data['exposureAmount']); + } if (array_key_exists('currency', $data)) { $this->setCurrency($data['currency']); } @@ -619,6 +626,11 @@ public function setAmount(float|string $amount): static return $this; } + public function getExposureAmount(): ?float + { + return $this->fields['exposureAmount'] ?? null; + } + public function getCurrency(): string { return $this->fields['currency']; @@ -706,6 +718,9 @@ public function jsonSerialize(): array if (array_key_exists('amount', $this->fields)) { $data['amount'] = $this->fields['amount']; } + if (array_key_exists('exposureAmount', $this->fields)) { + $data['exposureAmount'] = $this->fields['exposureAmount']; + } if (array_key_exists('currency', $this->fields)) { $data['currency'] = $this->fields['currency']; } @@ -774,6 +789,17 @@ private function setGatewayPayoutInstruction(null|string $gatewayPayoutInstructi return $this; } + private function setExposureAmount(null|float|string $exposureAmount): static + { + if (is_string($exposureAmount)) { + $exposureAmount = (float) $exposureAmount; + } + + $this->fields['exposureAmount'] = $exposureAmount; + + return $this; + } + private function setTransactionId(null|string $transactionId): static { $this->fields['transactionId'] = $transactionId; diff --git a/src/Model/PayoutRequestAllocationOperation.php b/src/Model/PayoutRequestAllocationOperation.php new file mode 100644 index 000000000..65b954e7c --- /dev/null +++ b/src/Model/PayoutRequestAllocationOperation.php @@ -0,0 +1,106 @@ +setType($data['type']); + } + if (array_key_exists('allocationIds', $data)) { + $this->setAllocationIds($data['allocationIds']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return $this->fields['type']; + } + + /** + * @return string[] + */ + public function getAllocationIds(): array + { + return $this->fields['allocationIds']; + } + + public function getStatus(): string + { + return $this->fields['status']; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('allocationIds', $this->fields)) { + $data['allocationIds'] = $this->fields['allocationIds']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + + return $data; + } + + private function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + /** + * @param string[] $allocationIds + */ + private function setAllocationIds(array $allocationIds): static + { + $this->fields['allocationIds'] = $allocationIds; + + return $this; + } + + private function setStatus(string $status): static + { + $this->fields['status'] = $status; + + return $this; + } +} diff --git a/src/Model/PayoutRequestAllocationOperationRequest.php b/src/Model/PayoutRequestAllocationOperationRequest.php new file mode 100644 index 000000000..d56586557 --- /dev/null +++ b/src/Model/PayoutRequestAllocationOperationRequest.php @@ -0,0 +1,32 @@ + ProcessPayoutRequestAllocationOperation::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PayoutRequestAllocationsDataExport.php b/src/Model/PayoutRequestAllocationsDataExport.php index 93a24ce7b..8af0ba9ec 100644 --- a/src/Model/PayoutRequestAllocationsDataExport.php +++ b/src/Model/PayoutRequestAllocationsDataExport.php @@ -38,6 +38,14 @@ class PayoutRequestAllocationsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?PayoutRequestAllocationsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/PayoutRequestBatch.php b/src/Model/PayoutRequestBatch.php index bd1ac515d..5a3cd0353 100644 --- a/src/Model/PayoutRequestBatch.php +++ b/src/Model/PayoutRequestBatch.php @@ -36,12 +36,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('totalCount', $data)) { $this->setTotalCount($data['totalCount']); } - if (array_key_exists('successCount', $data)) { - $this->setSuccessCount($data['successCount']); - } - if (array_key_exists('failureCount', $data)) { - $this->setFailureCount($data['failureCount']); - } if (array_key_exists('customerCount', $data)) { $this->setCustomerCount($data['customerCount']); } @@ -86,16 +80,6 @@ public function getTotalCount(): ?int return $this->fields['totalCount'] ?? null; } - public function getSuccessCount(): ?int - { - return $this->fields['successCount'] ?? null; - } - - public function getFailureCount(): ?int - { - return $this->fields['failureCount'] ?? null; - } - public function getCustomerCount(): ?int { return $this->fields['customerCount'] ?? null; @@ -169,12 +153,6 @@ public function jsonSerialize(): array if (array_key_exists('totalCount', $this->fields)) { $data['totalCount'] = $this->fields['totalCount']; } - if (array_key_exists('successCount', $this->fields)) { - $data['successCount'] = $this->fields['successCount']; - } - if (array_key_exists('failureCount', $this->fields)) { - $data['failureCount'] = $this->fields['failureCount']; - } if (array_key_exists('customerCount', $this->fields)) { $data['customerCount'] = $this->fields['customerCount']; } @@ -231,20 +209,6 @@ private function setTotalCount(null|int $totalCount): static return $this; } - private function setSuccessCount(null|int $successCount): static - { - $this->fields['successCount'] = $successCount; - - return $this; - } - - private function setFailureCount(null|int $failureCount): static - { - $this->fields['failureCount'] = $failureCount; - - return $this; - } - private function setCustomerCount(null|int $customerCount): static { $this->fields['customerCount'] = $customerCount; diff --git a/src/Model/PayoutRequestBatchOperation.php b/src/Model/PayoutRequestBatchOperation.php new file mode 100644 index 000000000..a9492d7dc --- /dev/null +++ b/src/Model/PayoutRequestBatchOperation.php @@ -0,0 +1,112 @@ +setType($data['type']); + } + if (array_key_exists('batchId', $data)) { + $this->setBatchId($data['batchId']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return $this->fields['type']; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function getStatus(): string + { + return $this->fields['status']; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + + return $data; + } + + private function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + private function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + private function setStatus(string $status): static + { + $this->fields['status'] = $status; + + return $this; + } +} diff --git a/src/Model/PayoutRequestBatchOperationRequest.php b/src/Model/PayoutRequestBatchOperationRequest.php new file mode 100644 index 000000000..752b971de --- /dev/null +++ b/src/Model/PayoutRequestBatchOperationRequest.php @@ -0,0 +1,26 @@ + AddPayoutRequestBatchOperationFactory::from($data, $metadata), + 'approve' => ApprovePayoutRequestBatchOperation::from($data, $metadata), + 'auto-allocate' => AutoAllocatePayoutRequestBatchOperation::from($data, $metadata), + 'block' => BlockPayoutRequestBatchOperation::from($data, $metadata), + 'process' => ProcessPayoutRequestBatchOperation::from($data, $metadata), + 'remove' => RemovePayoutRequestBatchOperation::from($data, $metadata), + 'unblock' => UnblockPayoutRequestBatchOperation::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PayoutRequestTimelineMessage.php b/src/Model/PayoutRequestTimelineMessage.php index e972ca342..384d33c0c 100644 --- a/src/Model/PayoutRequestTimelineMessage.php +++ b/src/Model/PayoutRequestTimelineMessage.php @@ -49,6 +49,10 @@ class PayoutRequestTimelineMessage implements JsonSerializable public const TYPE_PAYOUT_REQUEST_UNBLOCKED = 'payout-request-unblocked'; + public const TYPE_PAYOUT_REQUEST_ADDED_TO_BATCH = 'payout-request-added-to-batch'; + + public const TYPE_PAYOUT_REQUEST_REMOVED_FROM_BATCH = 'payout-request-removed-from-batch'; + public const TRIGGERED_BY_REBILLY = 'rebilly'; public const TRIGGERED_BY_APP = 'app'; diff --git a/src/Model/PayoutRequestsDataExport.php b/src/Model/PayoutRequestsDataExport.php index e25d9c729..24da032b5 100644 --- a/src/Model/PayoutRequestsDataExport.php +++ b/src/Model/PayoutRequestsDataExport.php @@ -38,6 +38,14 @@ class PayoutRequestsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?PayoutRequestsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php index aca4d88f8..d35c109cd 100644 --- a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php +++ b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php @@ -203,6 +203,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -327,6 +329,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -431,6 +435,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const GATEWAY_NAME_THUNES = 'Thunes'; + public const GATEWAY_NAME_TODITO_CASH = 'ToditoCash'; public const GATEWAY_NAME_TRIPLE000 = 'Triple000'; @@ -765,6 +771,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; @@ -855,6 +863,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const ACQUIRER_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const ACQUIRER_NAME_THUNES = 'Thunes'; + public const ACQUIRER_NAME_TODITO_CASH = 'ToditoCash'; public const ACQUIRER_NAME_TRIPLE000 = 'Triple000'; diff --git a/src/Model/Plan.php b/src/Model/Plan.php index 568c3f25d..e7f4922ea 100644 --- a/src/Model/Plan.php +++ b/src/Model/Plan.php @@ -19,6 +19,8 @@ interface Plan extends JsonSerializable { + public function getType(): string; + public function getName(): ?string; public function setName(null|string $name): static; @@ -45,9 +47,9 @@ public function getProductOptions(): ?array; */ public function setProductOptions(null|array $productOptions): static; - public function getCurrency(): string; + public function getCurrency(): ?string; - public function setCurrency(string $currency): static; + public function setCurrency(null|string $currency): static; public function getCurrencySign(): ?string; @@ -55,6 +57,10 @@ public function getSetup(): ?PlanSetup; public function setSetup(null|PlanSetup|array $setup): static; + public function getSetupFee(): ?float; + + public function setSetupFee(null|float|string $setupFee): static; + public function getCustomFields(): ?array; public function setCustomFields(null|array $customFields): static; @@ -67,6 +73,10 @@ public function getRevision(): ?int; public function getIsTrialOnly(): ?bool; + public function getRecurringInterval(): ?SubscriptionPlanDetailsRecurringInterval; + + public function getTrial(): null|PlanTrial|TrialOnlyPlanDetailsTrial; + public function getCreatedTime(): ?DateTimeImmutable; public function getUpdatedTime(): ?DateTimeImmutable; diff --git a/src/Model/PlanRequest.php b/src/Model/PlanRequest.php new file mode 100644 index 000000000..2b08222e0 --- /dev/null +++ b/src/Model/PlanRequest.php @@ -0,0 +1,90 @@ + + */ + public function getProductOptions(): ?array; + + /** + * @param null|array $productOptions + */ + public function setProductOptions(null|array $productOptions): static; + + public function getCurrency(): string; + + public function setCurrency(string $currency): static; + + public function getCurrencySign(): ?string; + + public function getSetup(): ?PlanSetup; + + public function setSetup(null|PlanSetup|array $setup): static; + + public function getSetupFee(): ?float; + + public function setSetupFee(null|float|string $setupFee): static; + + public function getCustomFields(): ?array; + + public function setCustomFields(null|array $customFields): static; + + public function getIsActive(): ?bool; + + public function setIsActive(null|bool $isActive): static; + + public function getRevision(): ?int; + + public function getIsTrialOnly(): ?bool; + + public function getRecurringInterval(): ?SubscriptionPlanRecurringInterval; + + public function getTrial(): null|PlanTrial|TrialOnlyPlanTrial; + + public function getCreatedTime(): ?DateTimeImmutable; + + public function getUpdatedTime(): ?DateTimeImmutable; + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array; +} diff --git a/src/Model/PostAvalaraCredential.php b/src/Model/PostAvalaraCredential.php new file mode 100644 index 000000000..c1994f2eb --- /dev/null +++ b/src/Model/PostAvalaraCredential.php @@ -0,0 +1,202 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('licenseKey', $data)) { + $this->setLicenseKey($data['licenseKey']); + } + if (array_key_exists('accountId', $data)) { + $this->setAccountId($data['accountId']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'avalara'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getLicenseKey(): ?string + { + return $this->fields['licenseKey'] ?? null; + } + + public function setLicenseKey(null|string $licenseKey): static + { + $this->fields['licenseKey'] = $licenseKey; + + return $this; + } + + public function getAccountId(): string + { + return $this->fields['accountId']; + } + + public function setAccountId(string $accountId): static + { + $this->fields['accountId'] = $accountId; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'avalara', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('licenseKey', $this->fields)) { + $data['licenseKey'] = $this->fields['licenseKey']; + } + if (array_key_exists('accountId', $this->fields)) { + $data['accountId'] = $this->fields['accountId']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostAwsSesCredential.php b/src/Model/PostAwsSesCredential.php new file mode 100644 index 000000000..39bd5f05c --- /dev/null +++ b/src/Model/PostAwsSesCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('key', $data)) { + $this->setKey($data['key']); + } + if (array_key_exists('secret', $data)) { + $this->setSecret($data['secret']); + } + if (array_key_exists('region', $data)) { + $this->setRegion($data['region']); + } + if (array_key_exists('configurationSetName', $data)) { + $this->setConfigurationSetName($data['configurationSetName']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'aws-ses'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getKey(): ?string + { + return $this->fields['key'] ?? null; + } + + public function setKey(null|string $key): static + { + $this->fields['key'] = $key; + + return $this; + } + + public function getSecret(): string + { + return $this->fields['secret']; + } + + public function setSecret(string $secret): static + { + $this->fields['secret'] = $secret; + + return $this; + } + + public function getRegion(): string + { + return $this->fields['region']; + } + + public function setRegion(string $region): static + { + $this->fields['region'] = $region; + + return $this; + } + + public function getConfigurationSetName(): ?string + { + return $this->fields['configurationSetName'] ?? null; + } + + public function setConfigurationSetName(null|string $configurationSetName): static + { + $this->fields['configurationSetName'] = $configurationSetName; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'aws-ses', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('key', $this->fields)) { + $data['key'] = $this->fields['key']; + } + if (array_key_exists('secret', $this->fields)) { + $data['secret'] = $this->fields['secret']; + } + if (array_key_exists('region', $this->fields)) { + $data['region'] = $this->fields['region']; + } + if (array_key_exists('configurationSetName', $this->fields)) { + $data['configurationSetName'] = $this->fields['configurationSetName']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostCashier.php b/src/Model/PostCashier.php index d70d04608..545044a08 100644 --- a/src/Model/PostCashier.php +++ b/src/Model/PostCashier.php @@ -37,21 +37,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('redirectUrl', $data)) { $this->setRedirectUrl($data['redirectUrl']); } - if (array_key_exists('balance', $data)) { - $this->setBalance($data['balance']); - } - if (array_key_exists('bonusBalance', $data)) { - $this->setBonusBalance($data['bonusBalance']); - } if (array_key_exists('depositLimits', $data)) { $this->setDepositLimits($data['depositLimits']); } if (array_key_exists('notificationUrl', $data)) { $this->setNotificationUrl($data['notificationUrl']); } - if (array_key_exists('pendingPayoutTotal', $data)) { - $this->setPendingPayoutTotal($data['pendingPayoutTotal']); - } $this->setMetadata($metadata); } @@ -108,38 +99,6 @@ public function setRedirectUrl(null|string $redirectUrl): static return $this; } - public function getBalance(): ?float - { - return $this->fields['balance'] ?? null; - } - - public function setBalance(null|float|string $balance): static - { - if (is_string($balance)) { - $balance = (float) $balance; - } - - $this->fields['balance'] = $balance; - - return $this; - } - - public function getBonusBalance(): ?float - { - return $this->fields['bonusBalance'] ?? null; - } - - public function setBonusBalance(null|float|string $bonusBalance): static - { - if (is_string($bonusBalance)) { - $bonusBalance = (float) $bonusBalance; - } - - $this->fields['bonusBalance'] = $bonusBalance; - - return $this; - } - public function getDepositLimits(): ?PostCashierDepositLimits { return $this->fields['depositLimits'] ?? null; @@ -168,22 +127,6 @@ public function setNotificationUrl(null|string $notificationUrl): static return $this; } - public function getPendingPayoutTotal(): ?float - { - return $this->fields['pendingPayoutTotal'] ?? null; - } - - public function setPendingPayoutTotal(null|float|string $pendingPayoutTotal): static - { - if (is_string($pendingPayoutTotal)) { - $pendingPayoutTotal = (float) $pendingPayoutTotal; - } - - $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; - - return $this; - } - public function jsonSerialize(): array { $data = []; @@ -199,21 +142,12 @@ public function jsonSerialize(): array if (array_key_exists('redirectUrl', $this->fields)) { $data['redirectUrl'] = $this->fields['redirectUrl']; } - if (array_key_exists('balance', $this->fields)) { - $data['balance'] = $this->fields['balance']; - } - if (array_key_exists('bonusBalance', $this->fields)) { - $data['bonusBalance'] = $this->fields['bonusBalance']; - } if (array_key_exists('depositLimits', $this->fields)) { $data['depositLimits'] = $this->fields['depositLimits']?->jsonSerialize(); } if (array_key_exists('notificationUrl', $this->fields)) { $data['notificationUrl'] = $this->fields['notificationUrl']; } - if (array_key_exists('pendingPayoutTotal', $this->fields)) { - $data['pendingPayoutTotal'] = $this->fields['pendingPayoutTotal']; - } return $data; } diff --git a/src/Model/PostDepositRequest.php b/src/Model/PostDepositRequest.php index 600f8e89a..33ee65637 100644 --- a/src/Model/PostDepositRequest.php +++ b/src/Model/PostDepositRequest.php @@ -54,9 +54,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('expirationTime', $data)) { $this->setExpirationTime($data['expirationTime']); } - if (array_key_exists('customPropertySetId', $data)) { - $this->setCustomPropertySetId($data['customPropertySetId']); - } if (array_key_exists('notificationUrl', $data)) { $this->setNotificationUrl($data['notificationUrl']); } @@ -199,18 +196,6 @@ public function setExpirationTime(null|DateTimeImmutable|string $expirationTime) return $this; } - public function getCustomPropertySetId(): ?string - { - return $this->fields['customPropertySetId'] ?? null; - } - - public function setCustomPropertySetId(null|string $customPropertySetId): static - { - $this->fields['customPropertySetId'] = $customPropertySetId; - - return $this; - } - public function getNotificationUrl(): ?string { return $this->fields['notificationUrl'] ?? null; @@ -253,9 +238,6 @@ public function jsonSerialize(): array if (array_key_exists('expirationTime', $this->fields)) { $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); } - if (array_key_exists('customPropertySetId', $this->fields)) { - $data['customPropertySetId'] = $this->fields['customPropertySetId']; - } if (array_key_exists('notificationUrl', $this->fields)) { $data['notificationUrl'] = $this->fields['notificationUrl']; } diff --git a/src/Model/PostExperianCredential.php b/src/Model/PostExperianCredential.php new file mode 100644 index 000000000..7195c9c87 --- /dev/null +++ b/src/Model/PostExperianCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('username', $data)) { + $this->setUsername($data['username']); + } + if (array_key_exists('password', $data)) { + $this->setPassword($data['password']); + } + if (array_key_exists('hmacKey', $data)) { + $this->setHmacKey($data['hmacKey']); + } + if (array_key_exists('publicKey', $data)) { + $this->setPublicKey($data['publicKey']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'experian'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getUsername(): ?string + { + return $this->fields['username'] ?? null; + } + + public function setUsername(null|string $username): static + { + $this->fields['username'] = $username; + + return $this; + } + + public function getPassword(): string + { + return $this->fields['password']; + } + + public function setPassword(string $password): static + { + $this->fields['password'] = $password; + + return $this; + } + + public function getHmacKey(): string + { + return $this->fields['hmacKey']; + } + + public function setHmacKey(string $hmacKey): static + { + $this->fields['hmacKey'] = $hmacKey; + + return $this; + } + + public function getPublicKey(): string + { + return $this->fields['publicKey']; + } + + public function setPublicKey(string $publicKey): static + { + $this->fields['publicKey'] = $publicKey; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'experian', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('username', $this->fields)) { + $data['username'] = $this->fields['username']; + } + if (array_key_exists('password', $this->fields)) { + $data['password'] = $this->fields['password']; + } + if (array_key_exists('hmacKey', $this->fields)) { + $data['hmacKey'] = $this->fields['hmacKey']; + } + if (array_key_exists('publicKey', $this->fields)) { + $data['publicKey'] = $this->fields['publicKey']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostKycDocumentMatchesRequest.php b/src/Model/PostKycDocumentMatchesRequest.php index 47ca2bbc1..ab7e561b5 100644 --- a/src/Model/PostKycDocumentMatchesRequest.php +++ b/src/Model/PostKycDocumentMatchesRequest.php @@ -18,6 +18,8 @@ interface PostKycDocumentMatchesRequest extends JsonSerializable { + public function getType(): string; + public function getFirstName(): ?string; public function setFirstName(null|string $firstName): static; @@ -29,8 +31,4 @@ public function setLastName(null|string $lastName): static; public function getDocumentSubtype(): ?string; public function setDocumentSubtype(null|string $documentSubtype): static; - - public function getIsTampered(): ?bool; - - public function setIsTampered(null|bool $isTampered): static; } diff --git a/src/Model/PostKycDocumentMatchesRequestFactory.php b/src/Model/PostKycDocumentMatchesRequestFactory.php new file mode 100644 index 000000000..fc3b948c3 --- /dev/null +++ b/src/Model/PostKycDocumentMatchesRequestFactory.php @@ -0,0 +1,31 @@ + KycAddressMatchesOverwrite::from($data, $metadata), + 'funds-proof' => KycFundsMatchesOverwrite::from($data, $metadata), + 'identity-proof' => KycIdentityMatchesOverwrite::from($data, $metadata), + 'purchase-proof' => KycPurchaseMatchesOverwrite::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PostMailgunCredential.php b/src/Model/PostMailgunCredential.php new file mode 100644 index 000000000..9ef32b562 --- /dev/null +++ b/src/Model/PostMailgunCredential.php @@ -0,0 +1,220 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('emailFrom', $data)) { + $this->setEmailFrom($data['emailFrom']); + } + if (array_key_exists('apiKey', $data)) { + $this->setApiKey($data['apiKey']); + } + if (array_key_exists('domain', $data)) { + $this->setDomain($data['domain']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'mailgun'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getEmailFrom(): ?string + { + return $this->fields['emailFrom'] ?? null; + } + + public function setEmailFrom(null|string $emailFrom): static + { + $this->fields['emailFrom'] = $emailFrom; + + return $this; + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function getDomain(): string + { + return $this->fields['domain']; + } + + public function setDomain(string $domain): static + { + $this->fields['domain'] = $domain; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'mailgun', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('emailFrom', $this->fields)) { + $data['emailFrom'] = $this->fields['emailFrom']; + } + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + if (array_key_exists('domain', $this->fields)) { + $data['domain'] = $this->fields['domain']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostOAuth2Credential.php b/src/Model/PostOAuth2Credential.php new file mode 100644 index 000000000..81cdd57a1 --- /dev/null +++ b/src/Model/PostOAuth2Credential.php @@ -0,0 +1,288 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('service', $data)) { + $this->setService($data['service']); + } + if (array_key_exists('code', $data)) { + $this->setCode($data['code']); + } + if (array_key_exists('accessToken', $data)) { + $this->setAccessToken($data['accessToken']); + } + if (array_key_exists('refreshToken', $data)) { + $this->setRefreshToken($data['refreshToken']); + } + if (array_key_exists('expirationTime', $data)) { + $this->setExpirationTime($data['expirationTime']); + } + if (array_key_exists('scopes', $data)) { + $this->setScopes($data['scopes']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'oauth2'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getService(): string + { + return $this->fields['service']; + } + + public function setService(string $service): static + { + $this->fields['service'] = $service; + + return $this; + } + + public function getCode(): ?string + { + return $this->fields['code'] ?? null; + } + + public function setCode(null|string $code): static + { + $this->fields['code'] = $code; + + return $this; + } + + public function getAccessToken(): ?string + { + return $this->fields['accessToken'] ?? null; + } + + public function getRefreshToken(): ?string + { + return $this->fields['refreshToken'] ?? null; + } + + public function getExpirationTime(): ?DateTimeImmutable + { + return $this->fields['expirationTime'] ?? null; + } + + /** + * @return string[] + */ + public function getScopes(): array + { + return $this->fields['scopes']; + } + + /** + * @param string[] $scopes + */ + public function setScopes(array $scopes): static + { + $this->fields['scopes'] = $scopes; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'oauth2', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('service', $this->fields)) { + $data['service'] = $this->fields['service']; + } + if (array_key_exists('code', $this->fields)) { + $data['code'] = $this->fields['code']; + } + if (array_key_exists('accessToken', $this->fields)) { + $data['accessToken'] = $this->fields['accessToken']; + } + if (array_key_exists('refreshToken', $this->fields)) { + $data['refreshToken'] = $this->fields['refreshToken']; + } + if (array_key_exists('expirationTime', $this->fields)) { + $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('scopes', $this->fields)) { + $data['scopes'] = $this->fields['scopes']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + private function setAccessToken(null|string $accessToken): static + { + $this->fields['accessToken'] = $accessToken; + + return $this; + } + + private function setRefreshToken(null|string $refreshToken): static + { + $this->fields['refreshToken'] = $refreshToken; + + return $this; + } + + private function setExpirationTime(null|DateTimeImmutable|string $expirationTime): static + { + if ($expirationTime !== null && !($expirationTime instanceof DateTimeImmutable)) { + $expirationTime = new DateTimeImmutable($expirationTime); + } + + $this->fields['expirationTime'] = $expirationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostOrganizationRequest.php b/src/Model/PostOrganizationRequest.php index 0e29aef4e..9e2f08039 100644 --- a/src/Model/PostOrganizationRequest.php +++ b/src/Model/PostOrganizationRequest.php @@ -63,6 +63,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('taxDescriptor', $data)) { $this->setTaxDescriptor($data['taxDescriptor']); } + if (array_key_exists('regulatorOperatorId', $data)) { + $this->setRegulatorOperatorId($data['regulatorOperatorId']); + } if (array_key_exists('invoiceTimeZone', $data)) { $this->setInvoiceTimeZone($data['invoiceTimeZone']); } @@ -257,6 +260,18 @@ public function setTaxDescriptor(null|string $taxDescriptor): static return $this; } + public function getRegulatorOperatorId(): ?string + { + return $this->fields['regulatorOperatorId'] ?? null; + } + + public function setRegulatorOperatorId(null|string $regulatorOperatorId): static + { + $this->fields['regulatorOperatorId'] = $regulatorOperatorId; + + return $this; + } + public function getInvoiceTimeZone(): ?string { return $this->fields['invoiceTimeZone'] ?? null; @@ -411,6 +426,9 @@ public function jsonSerialize(): array if (array_key_exists('taxDescriptor', $this->fields)) { $data['taxDescriptor'] = $this->fields['taxDescriptor']; } + if (array_key_exists('regulatorOperatorId', $this->fields)) { + $data['regulatorOperatorId'] = $this->fields['regulatorOperatorId']; + } if (array_key_exists('invoiceTimeZone', $this->fields)) { $data['invoiceTimeZone'] = $this->fields['invoiceTimeZone']; } diff --git a/src/Model/PostPaymentInstrumentRequestFactory.php b/src/Model/PostPaymentInstrumentRequestFactory.php index 898309041..9b5c5007d 100644 --- a/src/Model/PostPaymentInstrumentRequestFactory.php +++ b/src/Model/PostPaymentInstrumentRequestFactory.php @@ -70,6 +70,7 @@ public static function from(array $data = [], array $metadata = []): PostPayment 'JetonCash' => AlternativeInstrument::from($data, $metadata), 'KNOT' => AlternativeInstrument::from($data, $metadata), 'KakaoPay' => AlternativeInstrument::from($data, $metadata), + 'Khelocard' => AlternativeInstrument::from($data, $metadata), 'Klarna' => AlternativeInstrument::from($data, $metadata), 'MTS' => AlternativeInstrument::from($data, $metadata), 'Matrix' => AlternativeInstrument::from($data, $metadata), @@ -91,6 +92,7 @@ public static function from(array $data = [], array $metadata = []): PostPayment 'Onlineueberweisen' => AlternativeInstrument::from($data, $metadata), 'P24' => AlternativeInstrument::from($data, $metadata), 'PIX' => AlternativeInstrument::from($data, $metadata), + 'PIX-Automatico' => AlternativeInstrument::from($data, $metadata), 'POLi' => AlternativeInstrument::from($data, $metadata), 'Pagadito' => AlternativeInstrument::from($data, $metadata), 'PagoEffectivo' => AlternativeInstrument::from($data, $metadata), @@ -127,6 +129,7 @@ public static function from(array $data = [], array $metadata = []): PostPayment 'SparkPay' => AlternativeInstrument::from($data, $metadata), 'Tele2' => AlternativeInstrument::from($data, $metadata), 'Terminaly-RF' => AlternativeInstrument::from($data, $metadata), + 'Thunes-Checkout' => AlternativeInstrument::from($data, $metadata), 'ToditoCash-card' => AlternativeInstrument::from($data, $metadata), 'Trustly' => AlternativeInstrument::from($data, $metadata), 'Tupay' => AlternativeInstrument::from($data, $metadata), diff --git a/src/Model/PostPayoutRequestAutoAllocationRequest.php b/src/Model/PostPayoutRequestAutoAllocationsRequest.php similarity index 94% rename from src/Model/PostPayoutRequestAutoAllocationRequest.php rename to src/Model/PostPayoutRequestAutoAllocationsRequest.php index 2ec32ecc1..0ee9689a4 100644 --- a/src/Model/PostPayoutRequestAutoAllocationRequest.php +++ b/src/Model/PostPayoutRequestAutoAllocationsRequest.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PostPayoutRequestAutoAllocationRequest implements JsonSerializable +class PostPayoutRequestAutoAllocationsRequest implements JsonSerializable { use HasMetadata; diff --git a/src/Model/PostPayoutRequestBatchPreviewRequest.php b/src/Model/PostPayoutRequestBatchPreviewRequest.php new file mode 100644 index 000000000..8abbe3b5d --- /dev/null +++ b/src/Model/PostPayoutRequestBatchPreviewRequest.php @@ -0,0 +1,78 @@ +setFilter($data['filter']); + } + if (array_key_exists('batchId', $data)) { + $this->setBatchId($data['batchId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFilter(): string + { + return $this->fields['filter']; + } + + public function setFilter(string $filter): static + { + $this->fields['filter'] = $filter; + + return $this; + } + + public function getBatchId(): ?string + { + return $this->fields['batchId'] ?? null; + } + + public function setBatchId(null|string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('filter', $this->fields)) { + $data['filter'] = $this->fields['filter']; + } + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + + return $data; + } +} diff --git a/src/Model/PostPayoutRequestBatchPreviewResponse.php b/src/Model/PostPayoutRequestBatchPreviewResponse.php new file mode 100644 index 000000000..695290e4b --- /dev/null +++ b/src/Model/PostPayoutRequestBatchPreviewResponse.php @@ -0,0 +1,128 @@ +setMatchingCount($data['matchingCount']); + } + if (array_key_exists('selectedCount', $data)) { + $this->setSelectedCount($data['selectedCount']); + } + if (array_key_exists('customerCount', $data)) { + $this->setCustomerCount($data['customerCount']); + } + if (array_key_exists('totalAmountByCurrency', $data)) { + $this->setTotalAmountByCurrency($data['totalAmountByCurrency']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getMatchingCount(): int + { + return $this->fields['matchingCount']; + } + + public function setMatchingCount(int $matchingCount): static + { + $this->fields['matchingCount'] = $matchingCount; + + return $this; + } + + public function getSelectedCount(): int + { + return $this->fields['selectedCount']; + } + + public function setSelectedCount(int $selectedCount): static + { + $this->fields['selectedCount'] = $selectedCount; + + return $this; + } + + public function getCustomerCount(): int + { + return $this->fields['customerCount']; + } + + public function setCustomerCount(int $customerCount): static + { + $this->fields['customerCount'] = $customerCount; + + return $this; + } + + /** + * @return PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency[] + */ + public function getTotalAmountByCurrency(): array + { + return $this->fields['totalAmountByCurrency']; + } + + /** + * @param array[]|PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency[] $totalAmountByCurrency + */ + public function setTotalAmountByCurrency(array $totalAmountByCurrency): static + { + $totalAmountByCurrency = array_map( + fn ($value) => $value instanceof PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency ? $value : PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency::from($value), + $totalAmountByCurrency, + ); + + $this->fields['totalAmountByCurrency'] = $totalAmountByCurrency; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('matchingCount', $this->fields)) { + $data['matchingCount'] = $this->fields['matchingCount']; + } + if (array_key_exists('selectedCount', $this->fields)) { + $data['selectedCount'] = $this->fields['selectedCount']; + } + if (array_key_exists('customerCount', $this->fields)) { + $data['customerCount'] = $this->fields['customerCount']; + } + if (array_key_exists('totalAmountByCurrency', $this->fields)) { + $data['totalAmountByCurrency'] = array_map( + static fn (PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency $postPayoutRequestBatchPreviewResponseTotalAmountByCurrency) => $postPayoutRequestBatchPreviewResponseTotalAmountByCurrency->jsonSerialize(), + $this->fields['totalAmountByCurrency'], + ); + } + + return $data; + } +} diff --git a/src/Model/PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php b/src/Model/PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php new file mode 100644 index 000000000..635ec018f --- /dev/null +++ b/src/Model/PostPayoutRequestBatchPreviewResponseTotalAmountByCurrency.php @@ -0,0 +1,82 @@ +setCurrency($data['currency']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + + return $data; + } +} diff --git a/src/Model/PostPayoutRequestSplitRequest.php b/src/Model/PostPayoutRequestSplitRequest.php new file mode 100644 index 000000000..41323b848 --- /dev/null +++ b/src/Model/PostPayoutRequestSplitRequest.php @@ -0,0 +1,139 @@ +setPayoutRequestId($data['payoutRequestId']); + } + if (array_key_exists('amounts', $data)) { + $this->setAmounts($data['amounts']); + } + if (array_key_exists('splitReason', $data)) { + $this->setSplitReason($data['splitReason']); + } + if (array_key_exists('splitDescription', $data)) { + $this->setSplitDescription($data['splitDescription']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPayoutRequestId(): string + { + return $this->fields['payoutRequestId']; + } + + public function setPayoutRequestId(string $payoutRequestId): static + { + $this->fields['payoutRequestId'] = $payoutRequestId; + + return $this; + } + + /** + * @return float[] + */ + public function getAmounts(): array + { + return $this->fields['amounts']; + } + + /** + * @param float[]|string[] $amounts + */ + public function setAmounts(array $amounts): static + { + $amounts = array_map( + fn ($value) => is_string($value) ? (float) $value : $value, + $amounts, + ); + + $this->fields['amounts'] = $amounts; + + return $this; + } + + public function getSplitReason(): string + { + return $this->fields['splitReason']; + } + + public function setSplitReason(string $splitReason): static + { + $this->fields['splitReason'] = $splitReason; + + return $this; + } + + public function getSplitDescription(): ?string + { + return $this->fields['splitDescription'] ?? null; + } + + public function setSplitDescription(null|string $splitDescription): static + { + $this->fields['splitDescription'] = $splitDescription; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('payoutRequestId', $this->fields)) { + $data['payoutRequestId'] = $this->fields['payoutRequestId']; + } + if (array_key_exists('amounts', $this->fields)) { + $data['amounts'] = $this->fields['amounts']; + } + if (array_key_exists('splitReason', $this->fields)) { + $data['splitReason'] = $this->fields['splitReason']; + } + if (array_key_exists('splitDescription', $this->fields)) { + $data['splitDescription'] = $this->fields['splitDescription']; + } + + return $data; + } +} diff --git a/src/Model/PostPlaidCredential.php b/src/Model/PostPlaidCredential.php new file mode 100644 index 000000000..9b324afec --- /dev/null +++ b/src/Model/PostPlaidCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + if (array_key_exists('clientId', $data)) { + $this->setClientId($data['clientId']); + } + if (array_key_exists('secretToken', $data)) { + $this->setSecretToken($data['secretToken']); + } + if (array_key_exists('useStripe', $data)) { + $this->setUseStripe($data['useStripe']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'plaid'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getWebsiteId(): ?string + { + return $this->fields['websiteId'] ?? null; + } + + public function setWebsiteId(null|string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + public function getClientId(): ?string + { + return $this->fields['clientId'] ?? null; + } + + public function setClientId(null|string $clientId): static + { + $this->fields['clientId'] = $clientId; + + return $this; + } + + public function getSecretToken(): string + { + return $this->fields['secretToken']; + } + + public function setSecretToken(string $secretToken): static + { + $this->fields['secretToken'] = $secretToken; + + return $this; + } + + public function getUseStripe(): ?bool + { + return $this->fields['useStripe'] ?? null; + } + + public function setUseStripe(null|bool $useStripe): static + { + $this->fields['useStripe'] = $useStripe; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'plaid', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; + } + if (array_key_exists('clientId', $this->fields)) { + $data['clientId'] = $this->fields['clientId']; + } + if (array_key_exists('secretToken', $this->fields)) { + $data['secretToken'] = $this->fields['secretToken']; + } + if (array_key_exists('useStripe', $this->fields)) { + $data['useStripe'] = $this->fields['useStripe']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostPostmarkCredential.php b/src/Model/PostPostmarkCredential.php new file mode 100644 index 000000000..29d29553a --- /dev/null +++ b/src/Model/PostPostmarkCredential.php @@ -0,0 +1,184 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('serverApiToken', $data)) { + $this->setServerApiToken($data['serverApiToken']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'postmark'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getServerApiToken(): ?string + { + return $this->fields['serverApiToken'] ?? null; + } + + public function setServerApiToken(null|string $serverApiToken): static + { + $this->fields['serverApiToken'] = $serverApiToken; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'postmark', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('serverApiToken', $this->fields)) { + $data['serverApiToken'] = $this->fields['serverApiToken']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/DepositCustomPropertySet.php b/src/Model/PostSendGridCredential.php similarity index 51% rename from src/Model/DepositCustomPropertySet.php rename to src/Model/PostSendGridCredential.php index ca65ff20c..ff9dec23b 100644 --- a/src/Model/DepositCustomPropertySet.php +++ b/src/Model/PostSendGridCredential.php @@ -16,13 +16,18 @@ use DateTimeImmutable; use DateTimeInterface; -use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class DepositCustomPropertySet implements JsonSerializable +class PostSendGridCredential implements PostServiceCredentialRequest { use HasMetadata; + public const STATUS_ACTIVE = 'active'; + + public const STATUS_INACTIVE = 'inactive'; + + public const STATUS_DEACTIVATED = 'deactivated'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -30,17 +35,17 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('id', $data)) { $this->setId($data['id']); } - if (array_key_exists('name', $data)) { - $this->setName($data['name']); + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); } - if (array_key_exists('properties', $data)) { - $this->setProperties($data['properties']); + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); } - if (array_key_exists('createdTime', $data)) { - $this->setCreatedTime($data['createdTime']); + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); } - if (array_key_exists('updatedTime', $data)) { - $this->setUpdatedTime($data['updatedTime']); + if (array_key_exists('apiKey', $data)) { + $this->setApiKey($data['apiKey']); } if (array_key_exists('_links', $data)) { $this->setLinks($data['_links']); @@ -53,43 +58,41 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getId(): ?string + public function getType(): string { - return $this->fields['id'] ?? null; + return 'sendgrid'; } - public function getName(): string + public function getId(): ?string { - return $this->fields['name']; + return $this->fields['id'] ?? null; } - public function setName(string $name): static + public function getHash(): ?string { - $this->fields['name'] = $name; - - return $this; + return $this->fields['hash'] ?? null; } - public function getProperties(): array + public function getStatus(): ?string { - return $this->fields['properties']; + return $this->fields['status'] ?? null; } - public function setProperties(array $properties): static + public function getDeactivationTime(): ?DateTimeImmutable { - $this->fields['properties'] = $properties; - - return $this; + return $this->fields['deactivationTime'] ?? null; } - public function getCreatedTime(): ?DateTimeImmutable + public function getApiKey(): ?string { - return $this->fields['createdTime'] ?? null; + return $this->fields['apiKey'] ?? null; } - public function getUpdatedTime(): ?DateTimeImmutable + public function setApiKey(null|string $apiKey): static { - return $this->fields['updatedTime'] ?? null; + $this->fields['apiKey'] = $apiKey; + + return $this; } /** @@ -102,21 +105,23 @@ public function getLinks(): ?array public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'sendgrid', + ]; if (array_key_exists('id', $this->fields)) { $data['id'] = $this->fields['id']; } - if (array_key_exists('name', $this->fields)) { - $data['name'] = $this->fields['name']; + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; } - if (array_key_exists('properties', $this->fields)) { - $data['properties'] = $this->fields['properties']; + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; } - if (array_key_exists('createdTime', $this->fields)) { - $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); } - if (array_key_exists('updatedTime', $this->fields)) { - $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; } if (array_key_exists('_links', $this->fields)) { $data['_links'] = $this->fields['_links'] !== null @@ -137,24 +142,27 @@ private function setId(null|string $id): static return $this; } - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + private function setHash(null|string $hash): static { - if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { - $createdTime = new DateTimeImmutable($createdTime); - } + $this->fields['hash'] = $hash; - $this->fields['createdTime'] = $createdTime; + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; return $this; } - private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static { - if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { - $updatedTime = new DateTimeImmutable($updatedTime); + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); } - $this->fields['updatedTime'] = $updatedTime; + $this->fields['deactivationTime'] = $deactivationTime; return $this; } diff --git a/src/Model/PostServiceCredentialRequest.php b/src/Model/PostServiceCredentialRequest.php new file mode 100644 index 000000000..f6eb185dd --- /dev/null +++ b/src/Model/PostServiceCredentialRequest.php @@ -0,0 +1,31 @@ + PostAvalaraCredential::from($data, $metadata), + 'aws-ses' => PostAwsSesCredential::from($data, $metadata), + 'experian' => PostExperianCredential::from($data, $metadata), + 'mailgun' => PostMailgunCredential::from($data, $metadata), + 'oauth2' => PostOAuth2Credential::from($data, $metadata), + 'plaid' => PostPlaidCredential::from($data, $metadata), + 'postmark' => PostPostmarkCredential::from($data, $metadata), + 'sendgrid' => PostSendGridCredential::from($data, $metadata), + 'smtp' => PostSmtpCredential::from($data, $metadata), + 'taxjar' => PostTaxJarCredential::from($data, $metadata), + 'webhook' => PostWebhookCredential::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PostSmtpCredential.php b/src/Model/PostSmtpCredential.php new file mode 100644 index 000000000..a8ab7144c --- /dev/null +++ b/src/Model/PostSmtpCredential.php @@ -0,0 +1,248 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('host', $data)) { + $this->setHost($data['host']); + } + if (array_key_exists('port', $data)) { + $this->setPort($data['port']); + } + if (array_key_exists('encryption', $data)) { + $this->setEncryption($data['encryption']); + } + if (array_key_exists('auth', $data)) { + $this->setAuth($data['auth']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'smtp'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getHost(): ?string + { + return $this->fields['host'] ?? null; + } + + public function setHost(null|string $host): static + { + $this->fields['host'] = $host; + + return $this; + } + + public function getPort(): ?int + { + return $this->fields['port'] ?? null; + } + + public function setPort(null|int $port): static + { + $this->fields['port'] = $port; + + return $this; + } + + public function getEncryption(): ?string + { + return $this->fields['encryption'] ?? null; + } + + public function setEncryption(null|string $encryption): static + { + $this->fields['encryption'] = $encryption; + + return $this; + } + + public function getAuth(): ?SmtpAuthorization + { + return $this->fields['auth'] ?? null; + } + + public function setAuth(null|SmtpAuthorization|array $auth): static + { + if ($auth !== null && !($auth instanceof SmtpAuthorization)) { + $auth = SmtpAuthorizationFactory::from($auth); + } + + $this->fields['auth'] = $auth; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'smtp', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('host', $this->fields)) { + $data['host'] = $this->fields['host']; + } + if (array_key_exists('port', $this->fields)) { + $data['port'] = $this->fields['port']; + } + if (array_key_exists('encryption', $this->fields)) { + $data['encryption'] = $this->fields['encryption']; + } + if (array_key_exists('auth', $this->fields)) { + $data['auth'] = $this->fields['auth']?->jsonSerialize(); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostTaxJarCredential.php b/src/Model/PostTaxJarCredential.php new file mode 100644 index 000000000..212deb1ae --- /dev/null +++ b/src/Model/PostTaxJarCredential.php @@ -0,0 +1,202 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('apiToken', $data)) { + $this->setApiToken($data['apiToken']); + } + if (array_key_exists('omitFromAddress', $data)) { + $this->setOmitFromAddress($data['omitFromAddress']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'taxjar'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getApiToken(): ?string + { + return $this->fields['apiToken'] ?? null; + } + + public function setApiToken(null|string $apiToken): static + { + $this->fields['apiToken'] = $apiToken; + + return $this; + } + + public function getOmitFromAddress(): ?bool + { + return $this->fields['omitFromAddress'] ?? null; + } + + public function setOmitFromAddress(null|bool $omitFromAddress): static + { + $this->fields['omitFromAddress'] = $omitFromAddress; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'taxjar', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('apiToken', $this->fields)) { + $data['apiToken'] = $this->fields['apiToken']; + } + if (array_key_exists('omitFromAddress', $this->fields)) { + $data['omitFromAddress'] = $this->fields['omitFromAddress']; + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PostWebhookCredential.php b/src/Model/PostWebhookCredential.php new file mode 100644 index 000000000..c0d315bb3 --- /dev/null +++ b/src/Model/PostWebhookCredential.php @@ -0,0 +1,172 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('host', $data)) { + $this->setHost($data['host']); + } + if (array_key_exists('auth', $data)) { + $this->setAuth($data['auth']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'webhook'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getHost(): ?string + { + return $this->fields['host'] ?? null; + } + + public function setHost(null|string $host): static + { + $this->fields['host'] = $host; + + return $this; + } + + public function getAuth(): ?WebhookAuthorization + { + return $this->fields['auth'] ?? null; + } + + public function setAuth(null|WebhookAuthorization|array $auth): static + { + if ($auth !== null && !($auth instanceof WebhookAuthorization)) { + $auth = WebhookAuthorizationFactory::from($auth); + } + + $this->fields['auth'] = $auth; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'webhook', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('host', $this->fields)) { + $data['host'] = $this->fields['host']; + } + if (array_key_exists('auth', $this->fields)) { + $data['auth'] = $this->fields['auth']?->jsonSerialize(); + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } +} diff --git a/src/Model/PostPayoutRequestAllocationsProcessRequest.php b/src/Model/ProcessPayoutRequestAllocationOperation.php similarity index 84% rename from src/Model/PostPayoutRequestAllocationsProcessRequest.php rename to src/Model/ProcessPayoutRequestAllocationOperation.php index f90dea506..453964885 100644 --- a/src/Model/PostPayoutRequestAllocationsProcessRequest.php +++ b/src/Model/ProcessPayoutRequestAllocationOperation.php @@ -14,10 +14,9 @@ namespace Rebilly\Sdk\Model; -use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PostPayoutRequestAllocationsProcessRequest implements JsonSerializable +class ProcessPayoutRequestAllocationOperation implements PayoutRequestAllocationOperationRequest { use HasMetadata; @@ -36,6 +35,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'process'; + } + /** * @return string[] */ @@ -56,7 +60,9 @@ public function setAllocationIds(array $allocationIds): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'process', + ]; if (array_key_exists('allocationIds', $this->fields)) { $data['allocationIds'] = $this->fields['allocationIds']; } diff --git a/src/Model/ProcessPayoutRequestBatchOperation.php b/src/Model/ProcessPayoutRequestBatchOperation.php new file mode 100644 index 000000000..e222caf7b --- /dev/null +++ b/src/Model/ProcessPayoutRequestBatchOperation.php @@ -0,0 +1,66 @@ +setBatchId($data['batchId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'process'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'process', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + + return $data; + } +} diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 23f7e27e9..9ab98ff38 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -87,6 +87,18 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('hash', $data)) { $this->setHash($data['hash']); } + if (array_key_exists('requiresCardOnFile', $data)) { + $this->setRequiresCardOnFile($data['requiresCardOnFile']); + } + if (array_key_exists('hasCardOnFile', $data)) { + $this->setHasCardOnFile($data['hasCardOnFile']); + } + if (array_key_exists('billingManagementToken', $data)) { + $this->setBillingManagementToken($data['billingManagementToken']); + } + if (array_key_exists('pastDueInvoice', $data)) { + $this->setPastDueInvoice($data['pastDueInvoice']); + } if (array_key_exists('_links', $data)) { $this->setLinks($data['_links']); } @@ -201,6 +213,37 @@ public function getHash(): ?string return $this->fields['hash'] ?? null; } + public function getRequiresCardOnFile(): ?bool + { + return $this->fields['requiresCardOnFile'] ?? null; + } + + public function getHasCardOnFile(): ?bool + { + return $this->fields['hasCardOnFile'] ?? null; + } + + public function getBillingManagementToken(): ?string + { + return $this->fields['billingManagementToken'] ?? null; + } + + public function getPastDueInvoice(): ?ProfilePastDueInvoice + { + return $this->fields['pastDueInvoice'] ?? null; + } + + public function setPastDueInvoice(null|ProfilePastDueInvoice|array $pastDueInvoice): static + { + if ($pastDueInvoice !== null && !($pastDueInvoice instanceof ProfilePastDueInvoice)) { + $pastDueInvoice = ProfilePastDueInvoice::from($pastDueInvoice); + } + + $this->fields['pastDueInvoice'] = $pastDueInvoice; + + return $this; + } + /** * @return null|ResourceLink[] */ @@ -266,6 +309,18 @@ public function jsonSerialize(): array if (array_key_exists('hash', $this->fields)) { $data['hash'] = $this->fields['hash']; } + if (array_key_exists('requiresCardOnFile', $this->fields)) { + $data['requiresCardOnFile'] = $this->fields['requiresCardOnFile']; + } + if (array_key_exists('hasCardOnFile', $this->fields)) { + $data['hasCardOnFile'] = $this->fields['hasCardOnFile']; + } + if (array_key_exists('billingManagementToken', $this->fields)) { + $data['billingManagementToken'] = $this->fields['billingManagementToken']; + } + if (array_key_exists('pastDueInvoice', $this->fields)) { + $data['pastDueInvoice'] = $this->fields['pastDueInvoice']?->jsonSerialize(); + } if (array_key_exists('_links', $this->fields)) { $data['_links'] = $this->fields['_links'] !== null ? array_map( @@ -415,6 +470,27 @@ private function setHash(null|string $hash): static return $this; } + private function setRequiresCardOnFile(null|bool $requiresCardOnFile): static + { + $this->fields['requiresCardOnFile'] = $requiresCardOnFile; + + return $this; + } + + private function setHasCardOnFile(null|bool $hasCardOnFile): static + { + $this->fields['hasCardOnFile'] = $hasCardOnFile; + + return $this; + } + + private function setBillingManagementToken(null|string $billingManagementToken): static + { + $this->fields['billingManagementToken'] = $billingManagementToken; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/ProfileMfa.php b/src/Model/ProfileMfa.php deleted file mode 100644 index 98dd373b8..000000000 --- a/src/Model/ProfileMfa.php +++ /dev/null @@ -1,146 +0,0 @@ -setStatus($data['status']); - } - if (array_key_exists('type', $data)) { - $this->setType($data['type']); - } - if (array_key_exists('lastAuthTime', $data)) { - $this->setLastAuthTime($data['lastAuthTime']); - } - if (array_key_exists('_links', $data)) { - $this->setLinks($data['_links']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getStatus(): ?string - { - return $this->fields['status'] ?? null; - } - - public function setStatus(null|string $status): static - { - $this->fields['status'] = $status; - - return $this; - } - - public function getType(): ?string - { - return $this->fields['type'] ?? null; - } - - public function setType(null|string $type): static - { - $this->fields['type'] = $type; - - return $this; - } - - public function getLastAuthTime(): ?DateTimeImmutable - { - return $this->fields['lastAuthTime'] ?? null; - } - - /** - * @return null|ResourceLink[] - */ - public function getLinks(): ?array - { - return $this->fields['_links'] ?? null; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('status', $this->fields)) { - $data['status'] = $this->fields['status']; - } - if (array_key_exists('type', $this->fields)) { - $data['type'] = $this->fields['type']; - } - if (array_key_exists('lastAuthTime', $this->fields)) { - $data['lastAuthTime'] = $this->fields['lastAuthTime']?->format(DateTimeInterface::RFC3339); - } - if (array_key_exists('_links', $this->fields)) { - $data['_links'] = $this->fields['_links'] !== null - ? array_map( - static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), - $this->fields['_links'], - ) - : null; - } - - return $data; - } - - private function setLastAuthTime(null|DateTimeImmutable|string $lastAuthTime): static - { - if ($lastAuthTime !== null && !($lastAuthTime instanceof DateTimeImmutable)) { - $lastAuthTime = new DateTimeImmutable($lastAuthTime); - } - - $this->fields['lastAuthTime'] = $lastAuthTime; - - return $this; - } - - /** - * @param null|array[]|ResourceLink[] $links - */ - private function setLinks(null|array $links): static - { - $links = $links !== null ? array_map( - fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), - $links, - ) : null; - - $this->fields['_links'] = $links; - - return $this; - } -} diff --git a/src/Model/ProfilePastDueInvoice.php b/src/Model/ProfilePastDueInvoice.php new file mode 100644 index 000000000..d33a7cff3 --- /dev/null +++ b/src/Model/ProfilePastDueInvoice.php @@ -0,0 +1,96 @@ +setInvoiceId($data['invoiceId']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + if (array_key_exists('token', $data)) { + $this->setToken($data['token']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getInvoiceId(): string + { + return $this->fields['invoiceId']; + } + + public function getWebsiteId(): string + { + return $this->fields['websiteId']; + } + + public function getToken(): ?string + { + return $this->fields['token'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('invoiceId', $this->fields)) { + $data['invoiceId'] = $this->fields['invoiceId']; + } + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; + } + if (array_key_exists('token', $this->fields)) { + $data['token'] = $this->fields['token']; + } + + return $data; + } + + private function setInvoiceId(string $invoiceId): static + { + $this->fields['invoiceId'] = $invoiceId; + + return $this; + } + + private function setWebsiteId(string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + private function setToken(null|string $token): static + { + $this->fields['token'] = $token; + + return $this; + } +} diff --git a/src/Model/ProofOfAddressKycDocumentDocumentMatches.php b/src/Model/ProofOfAddressKycDocumentDocumentMatches.php index 9c03cb880..ac2630970 100644 --- a/src/Model/ProofOfAddressKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfAddressKycDocumentDocumentMatches.php @@ -25,6 +25,9 @@ class ProofOfAddressKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycAddressMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfAddressKycDocumentParsedData.php b/src/Model/ProofOfAddressKycDocumentParsedData.php index 376a9c8b4..bd25cb132 100644 --- a/src/Model/ProofOfAddressKycDocumentParsedData.php +++ b/src/Model/ProofOfAddressKycDocumentParsedData.php @@ -25,6 +25,9 @@ class ProofOfAddressKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycAddressMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfCreditFileKycDocument.php b/src/Model/ProofOfCreditFileKycDocument.php index 9e2fa8934..2409dd937 100644 --- a/src/Model/ProofOfCreditFileKycDocument.php +++ b/src/Model/ProofOfCreditFileKycDocument.php @@ -159,6 +159,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('documentMatches', $data)) { $this->setDocumentMatches($data['documentMatches']); } + if (array_key_exists('parsedData', $data)) { + $this->setParsedData($data['parsedData']); + } if (array_key_exists('_links', $data)) { $this->setLinks($data['_links']); } @@ -363,6 +366,22 @@ public function setDocumentMatches(null|ProofOfCreditFileKycDocumentDocumentMatc return $this; } + public function getParsedData(): ?ProofOfCreditFileKycDocumentParsedData + { + return $this->fields['parsedData'] ?? null; + } + + public function setParsedData(null|ProofOfCreditFileKycDocumentParsedData|array $parsedData): static + { + if ($parsedData !== null && !($parsedData instanceof ProofOfCreditFileKycDocumentParsedData)) { + $parsedData = ProofOfCreditFileKycDocumentParsedData::from($parsedData); + } + + $this->fields['parsedData'] = $parsedData; + + return $this; + } + /** * @return null|ResourceLink[] */ @@ -460,6 +479,9 @@ public function jsonSerialize(): array if (array_key_exists('documentMatches', $this->fields)) { $data['documentMatches'] = $this->fields['documentMatches']?->jsonSerialize(); } + if (array_key_exists('parsedData', $this->fields)) { + $data['parsedData'] = $this->fields['parsedData']?->jsonSerialize(); + } if (array_key_exists('_links', $this->fields)) { $data['_links'] = $this->fields['_links'] !== null ? array_map( diff --git a/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php b/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php index 4a5d65fcc..055eb0510 100644 --- a/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php @@ -25,12 +25,18 @@ class ProofOfCreditFileKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('data', $data)) { - $this->setData($data['data']); + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); } if (array_key_exists('checkList', $data)) { $this->setCheckList($data['checkList']); } + if (array_key_exists('data', $data)) { + $this->setData($data['data']); + } $this->setMetadata($metadata); } @@ -39,18 +45,19 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getData(): ?CreditFileMatches + public function getVersion(): ?string { - return $this->fields['data'] ?? null; + return $this->fields['version'] ?? null; } - public function setData(null|CreditFileMatches|array $data): static + public function getScore(): ?int { - if ($data !== null && !($data instanceof CreditFileMatches)) { - $data = CreditFileMatches::from($data); - } + return $this->fields['score'] ?? null; + } - $this->fields['data'] = $data; + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; return $this; } @@ -78,11 +85,30 @@ public function setCheckList(null|array $checkList): static return $this; } + public function getData(): ?CreditFileMatches + { + return $this->fields['data'] ?? null; + } + + public function setData(null|CreditFileMatches|array $data): static + { + if ($data !== null && !($data instanceof CreditFileMatches)) { + $data = CreditFileMatches::from($data); + } + + $this->fields['data'] = $data; + + return $this; + } + public function jsonSerialize(): array { $data = []; - if (array_key_exists('data', $this->fields)) { - $data['data'] = $this->fields['data']?->jsonSerialize(); + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; } if (array_key_exists('checkList', $this->fields)) { $data['checkList'] = $this->fields['checkList'] !== null @@ -92,7 +118,17 @@ public function jsonSerialize(): array ) : null; } + if (array_key_exists('data', $this->fields)) { + $data['data'] = $this->fields['data']?->jsonSerialize(); + } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfCreditFileKycDocumentParsedData.php b/src/Model/ProofOfCreditFileKycDocumentParsedData.php new file mode 100644 index 000000000..1a9ed9b71 --- /dev/null +++ b/src/Model/ProofOfCreditFileKycDocumentParsedData.php @@ -0,0 +1,134 @@ +setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } + if (array_key_exists('data', $data)) { + $this->setData($data['data']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + + public function getData(): ?CreditFileMatches + { + return $this->fields['data'] ?? null; + } + + public function setData(null|CreditFileMatches|array $data): static + { + if ($data !== null && !($data instanceof CreditFileMatches)) { + $data = CreditFileMatches::from($data); + } + + $this->fields['data'] = $data; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } + if (array_key_exists('data', $this->fields)) { + $data['data'] = $this->fields['data']?->jsonSerialize(); + } + + return $data; + } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } +} diff --git a/src/Model/ProofOfFundsKycDocumentDocumentMatches.php b/src/Model/ProofOfFundsKycDocumentDocumentMatches.php index b7c74bfff..8ca60337d 100644 --- a/src/Model/ProofOfFundsKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfFundsKycDocumentDocumentMatches.php @@ -25,6 +25,15 @@ class ProofOfFundsKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?FundsMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|FundsMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfFundsKycDocumentParsedData.php b/src/Model/ProofOfFundsKycDocumentParsedData.php index 7ee337b56..aaffb5842 100644 --- a/src/Model/ProofOfFundsKycDocumentParsedData.php +++ b/src/Model/ProofOfFundsKycDocumentParsedData.php @@ -25,6 +25,15 @@ class ProofOfFundsKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?FundsMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|FundsMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php b/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php index 83c1239c3..7fb694ac9 100644 --- a/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php @@ -25,6 +25,9 @@ class ProofOfIdentityKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycIdentityMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfIdentityKycDocumentParsedData.php b/src/Model/ProofOfIdentityKycDocumentParsedData.php index df60ffd10..30292f0eb 100644 --- a/src/Model/ProofOfIdentityKycDocumentParsedData.php +++ b/src/Model/ProofOfIdentityKycDocumentParsedData.php @@ -25,6 +25,9 @@ class ProofOfIdentityKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycIdentityMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php b/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php index 0433170ff..be60d3501 100644 --- a/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php @@ -25,6 +25,15 @@ class ProofOfPurchaseKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?PurchaseMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|PurchaseMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfPurchaseKycDocumentParsedData.php b/src/Model/ProofOfPurchaseKycDocumentParsedData.php index a69891092..60257afdb 100644 --- a/src/Model/ProofOfPurchaseKycDocumentParsedData.php +++ b/src/Model/ProofOfPurchaseKycDocumentParsedData.php @@ -25,6 +25,15 @@ class ProofOfPurchaseKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?PurchaseMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|PurchaseMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/QuickpayCredentials.php b/src/Model/QuickpayCredentials.php index fd3cbf912..8a59ec1d4 100644 --- a/src/Model/QuickpayCredentials.php +++ b/src/Model/QuickpayCredentials.php @@ -28,6 +28,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('apiKey', $data)) { $this->setApiKey($data['apiKey']); } + if (array_key_exists('privateKey', $data)) { + $this->setPrivateKey($data['privateKey']); + } $this->setMetadata($metadata); } @@ -48,12 +51,27 @@ public function setApiKey(string $apiKey): static return $this; } + public function getPrivateKey(): string + { + return $this->fields['privateKey']; + } + + public function setPrivateKey(string $privateKey): static + { + $this->fields['privateKey'] = $privateKey; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('apiKey', $this->fields)) { $data['apiKey'] = $this->fields['apiKey']; } + if (array_key_exists('privateKey', $this->fields)) { + $data['privateKey'] = $this->fields['privateKey']; + } return $data; } diff --git a/src/Model/QuoteReissue.php b/src/Model/QuoteReissue.php new file mode 100644 index 000000000..885dbf2ef --- /dev/null +++ b/src/Model/QuoteReissue.php @@ -0,0 +1,66 @@ +setExpirationTime($data['expirationTime']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getExpirationTime(): ?DateTimeImmutable + { + return $this->fields['expirationTime'] ?? null; + } + + public function setExpirationTime(null|DateTimeImmutable|string $expirationTime): static + { + if ($expirationTime !== null && !($expirationTime instanceof DateTimeImmutable)) { + $expirationTime = new DateTimeImmutable($expirationTime); + } + + $this->fields['expirationTime'] = $expirationTime; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('expirationTime', $this->fields)) { + $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } +} diff --git a/src/Model/QuoteSubscriptionItem.php b/src/Model/QuoteSubscriptionItem.php index 0fde35dca..acbb3f515 100644 --- a/src/Model/QuoteSubscriptionItem.php +++ b/src/Model/QuoteSubscriptionItem.php @@ -32,6 +32,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('quantity', $data)) { $this->setQuantity($data['quantity']); } + if (array_key_exists('quantityFilled', $data)) { + $this->setQuantityFilled($data['quantityFilled']); + } if (array_key_exists('plan', $data)) { $this->setPlan($data['plan']); } @@ -80,6 +83,22 @@ public function setQuantity(null|int $quantity): static return $this; } + public function getQuantityFilled(): ?float + { + return $this->fields['quantityFilled'] ?? null; + } + + public function setQuantityFilled(null|float|string $quantityFilled): static + { + if (is_string($quantityFilled)) { + $quantityFilled = (float) $quantityFilled; + } + + $this->fields['quantityFilled'] = $quantityFilled; + + return $this; + } + public function getPlan(): ConfigurablePlan { return $this->fields['plan']; @@ -157,6 +176,9 @@ public function jsonSerialize(): array if (array_key_exists('quantity', $this->fields)) { $data['quantity'] = $this->fields['quantity']; } + if (array_key_exists('quantityFilled', $this->fields)) { + $data['quantityFilled'] = $this->fields['quantityFilled']; + } if (array_key_exists('plan', $this->fields)) { $data['plan'] = $this->fields['plan']->jsonSerialize(); } diff --git a/src/Model/QuoteTimeline.php b/src/Model/QuoteTimeline.php index 0088087c7..7533e75ce 100644 --- a/src/Model/QuoteTimeline.php +++ b/src/Model/QuoteTimeline.php @@ -23,23 +23,25 @@ class QuoteTimeline implements JsonSerializable { use HasMetadata; - public const TYPE_CREATED = 'quote-created'; + public const TYPE_QUOTE_CREATED = 'quote-created'; - public const TYPE_ISSUED = 'quote-issued'; + public const TYPE_QUOTE_ISSUED = 'quote-issued'; - public const TYPE_ACCEPTED = 'quote-accepted'; + public const TYPE_QUOTE_ACCEPTED = 'quote-accepted'; - public const TYPE_REJECTED = 'quote-rejected'; + public const TYPE_QUOTE_REJECTED = 'quote-rejected'; - public const TYPE_CANCELED = 'quote-canceled'; + public const TYPE_QUOTE_CANCELED = 'quote-canceled'; - public const TYPE_RECALLED = 'quote-recalled'; + public const TYPE_QUOTE_RECALLED = 'quote-recalled'; - public const TYPE_UPDATED = 'quote-updated'; + public const TYPE_QUOTE_UPDATED = 'quote-updated'; - public const TYPE_EXPIRED = 'quote-expired'; + public const TYPE_QUOTE_EXPIRED = 'quote-expired'; - public const TYPE_ORDER_ATTACHED = 'quote-order-attached'; + public const TYPE_QUOTE_ORDER_ATTACHED = 'quote-order-attached'; + + public const TYPE_TIMELINE_COMMENT_CREATED = 'timeline-comment-created'; public const TRIGGERED_BY_REBILLY = 'rebilly'; diff --git a/src/Model/ReactivationQuoteOrder.php b/src/Model/ReactivationQuoteOrder.php index 3b89323ee..d408bd03c 100644 --- a/src/Model/ReactivationQuoteOrder.php +++ b/src/Model/ReactivationQuoteOrder.php @@ -45,6 +45,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('autopay', $data)) { $this->setAutopay($data['autopay']); } + if (array_key_exists('includeUnpaidInvoices', $data)) { + $this->setIncludeUnpaidInvoices($data['includeUnpaidInvoices']); + } if (array_key_exists('shipping', $data)) { $this->setShipping($data['shipping']); } @@ -153,15 +156,27 @@ public function setAutopay(null|bool $autopay): static return $this; } - public function getShipping(): ?Shipping + public function getIncludeUnpaidInvoices(): ?bool + { + return $this->fields['includeUnpaidInvoices'] ?? null; + } + + public function setIncludeUnpaidInvoices(null|bool $includeUnpaidInvoices): static + { + $this->fields['includeUnpaidInvoices'] = $includeUnpaidInvoices; + + return $this; + } + + public function getShipping(): ?ReactivationQuoteOrderShipping { return $this->fields['shipping'] ?? null; } - public function setShipping(null|Shipping|array $shipping): static + public function setShipping(null|ReactivationQuoteOrderShipping|array $shipping): static { - if ($shipping !== null && !($shipping instanceof Shipping)) { - $shipping = ShippingFactory::from($shipping); + if ($shipping !== null && !($shipping instanceof ReactivationQuoteOrderShipping)) { + $shipping = ReactivationQuoteOrderShipping::from($shipping); } $this->fields['shipping'] = $shipping; @@ -225,6 +240,9 @@ public function jsonSerialize(): array if (array_key_exists('autopay', $this->fields)) { $data['autopay'] = $this->fields['autopay']; } + if (array_key_exists('includeUnpaidInvoices', $this->fields)) { + $data['includeUnpaidInvoices'] = $this->fields['includeUnpaidInvoices']; + } if (array_key_exists('shipping', $this->fields)) { $data['shipping'] = $this->fields['shipping']?->jsonSerialize(); } diff --git a/src/Model/ReactivationQuoteOrderShipping.php b/src/Model/ReactivationQuoteOrderShipping.php new file mode 100644 index 000000000..c337635a9 --- /dev/null +++ b/src/Model/ReactivationQuoteOrderShipping.php @@ -0,0 +1,35 @@ + '', + ] + $data, $metadata); + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } +} diff --git a/src/Model/ReadyToPayGenericMethod.php b/src/Model/ReadyToPayGenericMethod.php index 9545b6ccc..62c439201 100644 --- a/src/Model/ReadyToPayGenericMethod.php +++ b/src/Model/ReadyToPayGenericMethod.php @@ -154,6 +154,8 @@ class ReadyToPayGenericMethod implements ReadyToPayMethods public const METHOD_KAKAO_PAY = 'KakaoPay'; + public const METHOD_KHELOCARD = 'Khelocard'; + public const METHOD_KNOT = 'KNOT'; public const METHOD_LOONIE = 'loonie'; @@ -230,6 +232,8 @@ class ReadyToPayGenericMethod implements ReadyToPayMethods public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PAY_TABS = 'PayTabs'; public const METHOD_PAYSAFECARD = 'Paysafecard'; @@ -286,6 +290,8 @@ class ReadyToPayGenericMethod implements ReadyToPayMethods public const METHOD_TERMINALY_RF = 'Terminaly-RF'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; diff --git a/src/Model/ReadyToPayMethodsFactory.php b/src/Model/ReadyToPayMethodsFactory.php index 86dac5c01..386bb8b22 100644 --- a/src/Model/ReadyToPayMethodsFactory.php +++ b/src/Model/ReadyToPayMethodsFactory.php @@ -108,6 +108,7 @@ public static function from(array $data = [], array $metadata = []): ReadyToPayM 'SparkPay' => ReadyToPayGenericMethod::from($data, $metadata), 'Tele2' => ReadyToPayGenericMethod::from($data, $metadata), 'Terminaly-RF' => ReadyToPayGenericMethod::from($data, $metadata), + 'Thunes-Checkout' => ReadyToPayGenericMethod::from($data, $metadata), 'ToditoCash-card' => ReadyToPayGenericMethod::from($data, $metadata), 'Trustly' => ReadyToPayGenericMethod::from($data, $metadata), 'UPI' => ReadyToPayGenericMethod::from($data, $metadata), diff --git a/src/Model/RecurringOrderItems.php b/src/Model/RecurringOrderItems.php index bb1e0a8bf..a15a0bd75 100644 --- a/src/Model/RecurringOrderItems.php +++ b/src/Model/RecurringOrderItems.php @@ -23,10 +23,6 @@ public function getType(): string; public function getId(): ?string; - public function getPlanId(): ?string; - - public function setPlanId(null|string $planId): static; - public function getProductId(): ?string; public function getPlan(): ConfigurablePlan; diff --git a/src/Model/RegistrationField.php b/src/Model/RegistrationField.php deleted file mode 100644 index aa94d57b8..000000000 --- a/src/Model/RegistrationField.php +++ /dev/null @@ -1,372 +0,0 @@ -setAttribute($data['attribute']); - } - if (array_key_exists('displayName', $data)) { - $this->setDisplayName($data['displayName']); - } - if (array_key_exists('requirementLevel', $data)) { - $this->setRequirementLevel($data['requirementLevel']); - } - if (array_key_exists('validationType', $data)) { - $this->setValidationType($data['validationType']); - } - if (array_key_exists('validationPattern', $data)) { - $this->setValidationPattern($data['validationPattern']); - } - if (array_key_exists('minLength', $data)) { - $this->setMinLength($data['minLength']); - } - if (array_key_exists('maxLength', $data)) { - $this->setMaxLength($data['maxLength']); - } - if (array_key_exists('helpText', $data)) { - $this->setHelpText($data['helpText']); - } - if (array_key_exists('minimumAge', $data)) { - $this->setMinimumAge($data['minimumAge']); - } - if (array_key_exists('inputType', $data)) { - $this->setInputType($data['inputType']); - } - if (array_key_exists('placeholder', $data)) { - $this->setPlaceholder($data['placeholder']); - } - if (array_key_exists('contentBlock', $data)) { - $this->setContentBlock($data['contentBlock']); - } - if (array_key_exists('order', $data)) { - $this->setOrder($data['order']); - } - if (array_key_exists('step', $data)) { - $this->setStep($data['step']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getAttribute(): string - { - return $this->fields['attribute']; - } - - public function setAttribute(string $attribute): static - { - $this->fields['attribute'] = $attribute; - - return $this; - } - - public function getDisplayName(): string - { - return $this->fields['displayName']; - } - - public function setDisplayName(string $displayName): static - { - $this->fields['displayName'] = $displayName; - - return $this; - } - - public function getRequirementLevel(): string - { - return $this->fields['requirementLevel']; - } - - public function setRequirementLevel(string $requirementLevel): static - { - $this->fields['requirementLevel'] = $requirementLevel; - - return $this; - } - - public function getValidationType(): string - { - return $this->fields['validationType']; - } - - public function setValidationType(string $validationType): static - { - $this->fields['validationType'] = $validationType; - - return $this; - } - - public function getValidationPattern(): ?string - { - return $this->fields['validationPattern'] ?? null; - } - - public function setValidationPattern(null|string $validationPattern): static - { - $this->fields['validationPattern'] = $validationPattern; - - return $this; - } - - public function getMinLength(): ?int - { - return $this->fields['minLength'] ?? null; - } - - public function setMinLength(null|int $minLength): static - { - $this->fields['minLength'] = $minLength; - - return $this; - } - - public function getMaxLength(): ?int - { - return $this->fields['maxLength'] ?? null; - } - - public function setMaxLength(null|int $maxLength): static - { - $this->fields['maxLength'] = $maxLength; - - return $this; - } - - public function getHelpText(): ?string - { - return $this->fields['helpText'] ?? null; - } - - public function setHelpText(null|string $helpText): static - { - $this->fields['helpText'] = $helpText; - - return $this; - } - - public function getMinimumAge(): ?int - { - return $this->fields['minimumAge'] ?? null; - } - - public function setMinimumAge(null|int $minimumAge): static - { - $this->fields['minimumAge'] = $minimumAge; - - return $this; - } - - public function getInputType(): ?string - { - return $this->fields['inputType'] ?? null; - } - - public function setInputType(null|string $inputType): static - { - $this->fields['inputType'] = $inputType; - - return $this; - } - - public function getPlaceholder(): ?string - { - return $this->fields['placeholder'] ?? null; - } - - public function setPlaceholder(null|string $placeholder): static - { - $this->fields['placeholder'] = $placeholder; - - return $this; - } - - public function getContentBlock(): ?string - { - return $this->fields['contentBlock'] ?? null; - } - - public function setContentBlock(null|string $contentBlock): static - { - $this->fields['contentBlock'] = $contentBlock; - - return $this; - } - - public function getOrder(): int - { - return $this->fields['order']; - } - - public function setOrder(int $order): static - { - $this->fields['order'] = $order; - - return $this; - } - - public function getStep(): RegistrationFieldStep - { - return $this->fields['step']; - } - - public function setStep(RegistrationFieldStep|array $step): static - { - if (!($step instanceof RegistrationFieldStep)) { - $step = RegistrationFieldStep::from($step); - } - - $this->fields['step'] = $step; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('attribute', $this->fields)) { - $data['attribute'] = $this->fields['attribute']; - } - if (array_key_exists('displayName', $this->fields)) { - $data['displayName'] = $this->fields['displayName']; - } - if (array_key_exists('requirementLevel', $this->fields)) { - $data['requirementLevel'] = $this->fields['requirementLevel']; - } - if (array_key_exists('validationType', $this->fields)) { - $data['validationType'] = $this->fields['validationType']; - } - if (array_key_exists('validationPattern', $this->fields)) { - $data['validationPattern'] = $this->fields['validationPattern']; - } - if (array_key_exists('minLength', $this->fields)) { - $data['minLength'] = $this->fields['minLength']; - } - if (array_key_exists('maxLength', $this->fields)) { - $data['maxLength'] = $this->fields['maxLength']; - } - if (array_key_exists('helpText', $this->fields)) { - $data['helpText'] = $this->fields['helpText']; - } - if (array_key_exists('minimumAge', $this->fields)) { - $data['minimumAge'] = $this->fields['minimumAge']; - } - if (array_key_exists('inputType', $this->fields)) { - $data['inputType'] = $this->fields['inputType']; - } - if (array_key_exists('placeholder', $this->fields)) { - $data['placeholder'] = $this->fields['placeholder']; - } - if (array_key_exists('contentBlock', $this->fields)) { - $data['contentBlock'] = $this->fields['contentBlock']; - } - if (array_key_exists('order', $this->fields)) { - $data['order'] = $this->fields['order']; - } - if (array_key_exists('step', $this->fields)) { - $data['step'] = $this->fields['step']->jsonSerialize(); - } - - return $data; - } -} diff --git a/src/Model/RemovePayoutRequestBatchOperation.php b/src/Model/RemovePayoutRequestBatchOperation.php new file mode 100644 index 000000000..0c697b8ae --- /dev/null +++ b/src/Model/RemovePayoutRequestBatchOperation.php @@ -0,0 +1,90 @@ +setBatchId($data['batchId']); + } + if (array_key_exists('payoutRequestIds', $data)) { + $this->setPayoutRequestIds($data['payoutRequestIds']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'remove'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + /** + * @return string[] + */ + public function getPayoutRequestIds(): array + { + return $this->fields['payoutRequestIds']; + } + + /** + * @param string[] $payoutRequestIds + */ + public function setPayoutRequestIds(array $payoutRequestIds): static + { + $this->fields['payoutRequestIds'] = $payoutRequestIds; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'remove', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + if (array_key_exists('payoutRequestIds', $this->fields)) { + $data['payoutRequestIds'] = $this->fields['payoutRequestIds']; + } + + return $data; + } +} diff --git a/src/Model/ReportAmlAuditReport.php b/src/Model/ReportAmlAuditReport.php new file mode 100644 index 000000000..d612f432a --- /dev/null +++ b/src/Model/ReportAmlAuditReport.php @@ -0,0 +1,266 @@ +setPersonId($data['personId']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('linkedCustomers', $data)) { + $this->setLinkedCustomers($data['linkedCustomers']); + } + if (array_key_exists('summary', $data)) { + $this->setSummary($data['summary']); + } + if (array_key_exists('screeningHistory', $data)) { + $this->setScreeningHistory($data['screeningHistory']); + } + if (array_key_exists('transactions', $data)) { + $this->setTransactions($data['transactions']); + } + if (array_key_exists('periodStart', $data)) { + $this->setPeriodStart($data['periodStart']); + } + if (array_key_exists('periodEnd', $data)) { + $this->setPeriodEnd($data['periodEnd']); + } + if (array_key_exists('truncated', $data)) { + $this->setTruncated($data['truncated']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPersonId(): string + { + return $this->fields['personId']; + } + + public function setPersonId(string $personId): static + { + $this->fields['personId'] = $personId; + + return $this; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + /** + * @return ReportAmlAuditReportLinkedCustomers[] + */ + public function getLinkedCustomers(): array + { + return $this->fields['linkedCustomers']; + } + + /** + * @param array[]|ReportAmlAuditReportLinkedCustomers[] $linkedCustomers + */ + public function setLinkedCustomers(array $linkedCustomers): static + { + $linkedCustomers = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportLinkedCustomers ? $value : ReportAmlAuditReportLinkedCustomers::from($value), + $linkedCustomers, + ); + + $this->fields['linkedCustomers'] = $linkedCustomers; + + return $this; + } + + public function getSummary(): ReportAmlAuditReportSummary + { + return $this->fields['summary']; + } + + public function setSummary(ReportAmlAuditReportSummary|array $summary): static + { + if (!($summary instanceof ReportAmlAuditReportSummary)) { + $summary = ReportAmlAuditReportSummary::from($summary); + } + + $this->fields['summary'] = $summary; + + return $this; + } + + /** + * @return ReportAmlAuditReportScreeningHistory[] + */ + public function getScreeningHistory(): array + { + return $this->fields['screeningHistory']; + } + + /** + * @param array[]|ReportAmlAuditReportScreeningHistory[] $screeningHistory + */ + public function setScreeningHistory(array $screeningHistory): static + { + $screeningHistory = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportScreeningHistory ? $value : ReportAmlAuditReportScreeningHistory::from($value), + $screeningHistory, + ); + + $this->fields['screeningHistory'] = $screeningHistory; + + return $this; + } + + /** + * @return ReportAmlAuditReportTransactions[] + */ + public function getTransactions(): array + { + return $this->fields['transactions']; + } + + /** + * @param array[]|ReportAmlAuditReportTransactions[] $transactions + */ + public function setTransactions(array $transactions): static + { + $transactions = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportTransactions ? $value : ReportAmlAuditReportTransactions::from($value), + $transactions, + ); + + $this->fields['transactions'] = $transactions; + + return $this; + } + + public function getPeriodStart(): DateTimeImmutable + { + return $this->fields['periodStart']; + } + + public function setPeriodStart(DateTimeImmutable|string $periodStart): static + { + if (!($periodStart instanceof DateTimeImmutable)) { + $periodStart = new DateTimeImmutable($periodStart); + } + + $this->fields['periodStart'] = $periodStart; + + return $this; + } + + public function getPeriodEnd(): DateTimeImmutable + { + return $this->fields['periodEnd']; + } + + public function setPeriodEnd(DateTimeImmutable|string $periodEnd): static + { + if (!($periodEnd instanceof DateTimeImmutable)) { + $periodEnd = new DateTimeImmutable($periodEnd); + } + + $this->fields['periodEnd'] = $periodEnd; + + return $this; + } + + public function getTruncated(): bool + { + return $this->fields['truncated']; + } + + public function setTruncated(bool $truncated): static + { + $this->fields['truncated'] = $truncated; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('personId', $this->fields)) { + $data['personId'] = $this->fields['personId']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('linkedCustomers', $this->fields)) { + $data['linkedCustomers'] = array_map( + static fn (ReportAmlAuditReportLinkedCustomers $reportAmlAuditReportLinkedCustomers) => $reportAmlAuditReportLinkedCustomers->jsonSerialize(), + $this->fields['linkedCustomers'], + ); + } + if (array_key_exists('summary', $this->fields)) { + $data['summary'] = $this->fields['summary']->jsonSerialize(); + } + if (array_key_exists('screeningHistory', $this->fields)) { + $data['screeningHistory'] = array_map( + static fn (ReportAmlAuditReportScreeningHistory $reportAmlAuditReportScreeningHistory) => $reportAmlAuditReportScreeningHistory->jsonSerialize(), + $this->fields['screeningHistory'], + ); + } + if (array_key_exists('transactions', $this->fields)) { + $data['transactions'] = array_map( + static fn (ReportAmlAuditReportTransactions $reportAmlAuditReportTransactions) => $reportAmlAuditReportTransactions->jsonSerialize(), + $this->fields['transactions'], + ); + } + if (array_key_exists('periodStart', $this->fields)) { + $data['periodStart'] = $this->fields['periodStart']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('periodEnd', $this->fields)) { + $data['periodEnd'] = $this->fields['periodEnd']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('truncated', $this->fields)) { + $data['truncated'] = $this->fields['truncated']; + } + + return $data; + } +} diff --git a/src/Model/RegistrationFieldStep.php b/src/Model/ReportAmlAuditReportLinkedCustomers.php similarity index 69% rename from src/Model/RegistrationFieldStep.php rename to src/Model/ReportAmlAuditReportLinkedCustomers.php index 7d21fd025..b4e71b4bb 100644 --- a/src/Model/RegistrationFieldStep.php +++ b/src/Model/ReportAmlAuditReportLinkedCustomers.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class RegistrationFieldStep implements JsonSerializable +class ReportAmlAuditReportLinkedCustomers implements JsonSerializable { use HasMetadata; @@ -28,8 +28,8 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('id', $data)) { $this->setId($data['id']); } - if (array_key_exists('displayHeader', $data)) { - $this->setDisplayHeader($data['displayHeader']); + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); } $this->setMetadata($metadata); } @@ -51,14 +51,14 @@ public function setId(string $id): static return $this; } - public function getDisplayHeader(): string + public function getWebsiteId(): string { - return $this->fields['displayHeader']; + return $this->fields['websiteId']; } - public function setDisplayHeader(string $displayHeader): static + public function setWebsiteId(string $websiteId): static { - $this->fields['displayHeader'] = $displayHeader; + $this->fields['websiteId'] = $websiteId; return $this; } @@ -69,8 +69,8 @@ public function jsonSerialize(): array if (array_key_exists('id', $this->fields)) { $data['id'] = $this->fields['id']; } - if (array_key_exists('displayHeader', $this->fields)) { - $data['displayHeader'] = $this->fields['displayHeader']; + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; } return $data; diff --git a/src/Model/ReportAmlAuditReportScreeningHistory.php b/src/Model/ReportAmlAuditReportScreeningHistory.php new file mode 100644 index 000000000..0a9a375d7 --- /dev/null +++ b/src/Model/ReportAmlAuditReportScreeningHistory.php @@ -0,0 +1,208 @@ +setId($data['id']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('source', $data)) { + $this->setSource($data['source']); + } + if (array_key_exists('hitSources', $data)) { + $this->setHitSources($data['hitSources']); + } + if (array_key_exists('result', $data)) { + $this->setResult($data['result']); + } + if (array_key_exists('reviewer', $data)) { + $this->setReviewer($data['reviewer']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getId(): string + { + return $this->fields['id']; + } + + public function setId(string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + public function getCreatedTime(): DateTimeImmutable + { + return $this->fields['createdTime']; + } + + public function getUpdatedTime(): DateTimeImmutable + { + return $this->fields['updatedTime']; + } + + public function getCustomerId(): string + { + return $this->fields['customerId']; + } + + public function setCustomerId(string $customerId): static + { + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getSource(): string + { + return $this->fields['source']; + } + + public function setSource(string $source): static + { + $this->fields['source'] = $source; + + return $this; + } + + public function getHitSources(): ?string + { + return $this->fields['hitSources'] ?? null; + } + + public function setHitSources(null|string $hitSources): static + { + $this->fields['hitSources'] = $hitSources; + + return $this; + } + + public function getResult(): string + { + return $this->fields['result']; + } + + public function setResult(string $result): static + { + $this->fields['result'] = $result; + + return $this; + } + + public function getReviewer(): ?string + { + return $this->fields['reviewer'] ?? null; + } + + public function setReviewer(null|string $reviewer): static + { + $this->fields['reviewer'] = $reviewer; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']; + } + if (array_key_exists('source', $this->fields)) { + $data['source'] = $this->fields['source']; + } + if (array_key_exists('hitSources', $this->fields)) { + $data['hitSources'] = $this->fields['hitSources']; + } + if (array_key_exists('result', $this->fields)) { + $data['result'] = $this->fields['result']; + } + if (array_key_exists('reviewer', $this->fields)) { + $data['reviewer'] = $this->fields['reviewer']; + } + + return $data; + } + + private function setCreatedTime(DateTimeImmutable|string $createdTime): static + { + if (!($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(DateTimeImmutable|string $updatedTime): static + { + if (!($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } +} diff --git a/src/Model/ReportAmlAuditReportSummary.php b/src/Model/ReportAmlAuditReportSummary.php new file mode 100644 index 000000000..59315923f --- /dev/null +++ b/src/Model/ReportAmlAuditReportSummary.php @@ -0,0 +1,102 @@ +setTotalChecks($data['totalChecks']); + } + if (array_key_exists('hitCount', $data)) { + $this->setHitCount($data['hitCount']); + } + if (array_key_exists('lastCheckTime', $data)) { + $this->setLastCheckTime($data['lastCheckTime']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getTotalChecks(): int + { + return $this->fields['totalChecks']; + } + + public function setTotalChecks(int $totalChecks): static + { + $this->fields['totalChecks'] = $totalChecks; + + return $this; + } + + public function getHitCount(): int + { + return $this->fields['hitCount']; + } + + public function setHitCount(int $hitCount): static + { + $this->fields['hitCount'] = $hitCount; + + return $this; + } + + public function getLastCheckTime(): ?DateTimeImmutable + { + return $this->fields['lastCheckTime'] ?? null; + } + + public function setLastCheckTime(null|DateTimeImmutable|string $lastCheckTime): static + { + if ($lastCheckTime !== null && !($lastCheckTime instanceof DateTimeImmutable)) { + $lastCheckTime = new DateTimeImmutable($lastCheckTime); + } + + $this->fields['lastCheckTime'] = $lastCheckTime; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('totalChecks', $this->fields)) { + $data['totalChecks'] = $this->fields['totalChecks']; + } + if (array_key_exists('hitCount', $this->fields)) { + $data['hitCount'] = $this->fields['hitCount']; + } + if (array_key_exists('lastCheckTime', $this->fields)) { + $data['lastCheckTime'] = $this->fields['lastCheckTime']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } +} diff --git a/src/Model/ReportAmlAuditReportTransactions.php b/src/Model/ReportAmlAuditReportTransactions.php new file mode 100644 index 000000000..2a83c44e3 --- /dev/null +++ b/src/Model/ReportAmlAuditReportTransactions.php @@ -0,0 +1,272 @@ +setId($data['id']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('result', $data)) { + $this->setResult($data['result']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getId(): string + { + return $this->fields['id']; + } + + public function setId(string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + public function getCustomerId(): string + { + return $this->fields['customerId']; + } + + public function setCustomerId(string $customerId): static + { + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getCreatedTime(): DateTimeImmutable + { + return $this->fields['createdTime']; + } + + public function getUpdatedTime(): DateTimeImmutable + { + return $this->fields['updatedTime']; + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getType(): string + { + return $this->fields['type']; + } + + public function getStatus(): string + { + return $this->fields['status']; + } + + public function getResult(): string + { + return $this->fields['result']; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']; + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('result', $this->fields)) { + $data['result'] = $this->fields['result']; + } + + return $data; + } + + private function setCreatedTime(DateTimeImmutable|string $createdTime): static + { + if (!($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(DateTimeImmutable|string $updatedTime): static + { + if (!($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + private function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + private function setStatus(string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setResult(string $result): static + { + $this->fields['result'] = $result; + + return $this; + } +} diff --git a/src/Model/ReportKycRejectionsDataRejectionReasons.php b/src/Model/ReportKycRejectionsDataRejectionReasons.php index 4e545b7b4..e406e30a3 100644 --- a/src/Model/ReportKycRejectionsDataRejectionReasons.php +++ b/src/Model/ReportKycRejectionsDataRejectionReasons.php @@ -25,6 +25,8 @@ class ReportKycRejectionsDataRejectionReasons implements JsonSerializable public const REJECTION_REASON_DOCUMENT_EXPIRED = 'document-expired'; + public const REJECTION_REASON_DOCUMENT_WAS_VALID_BUT_EXPIRED = 'document-was-valid-but-expired'; + public const REJECTION_REASON_DOCUMENT_NOT_MATCHING = 'document-not-matching'; public const REJECTION_REASON_DOCUMENT_DUPLICATE = 'document-duplicate'; @@ -47,12 +49,16 @@ class ReportKycRejectionsDataRejectionReasons implements JsonSerializable public const REJECTION_REASON_NAME_MISMATCH = 'name-mismatch'; + public const REJECTION_REASON_NAME_AND_DOB_MISMATCH = 'name-and-dob-mismatch'; + public const REJECTION_REASON_CRITICAL_INFO_MISSING = 'critical-info-missing'; public const REJECTION_REASON_OLD_ADDRESS_ON_ID = 'old-address-on-id'; public const REJECTION_REASON_TAMPERED_DOCUMENT = 'tampered-document'; + public const REJECTION_REASON_NO_DOCUMENT_DATA_DETECTED = 'no-document-data-detected'; + public const REJECTION_REASON_OTHER = 'other'; private array $fields = []; diff --git a/src/Model/RiskScoreBracketBrackets.php b/src/Model/RiskScoreBracketBrackets.php index 3fc44cf24..a45580f55 100644 --- a/src/Model/RiskScoreBracketBrackets.php +++ b/src/Model/RiskScoreBracketBrackets.php @@ -18,15 +18,4 @@ interface RiskScoreBracketBrackets extends JsonSerializable { - public function getStart(): ?int; - - public function setStart(null|int $start): static; - - public function getEnd(): ?int; - - public function setEnd(null|int $end): static; - - public function getValue(): ?int; - - public function setValue(null|int $value): static; } diff --git a/src/Model/RiskScoreBracketBrackets0.php b/src/Model/RiskScoreBracketBrackets0.php index 07d380bc2..84a3a3d48 100644 --- a/src/Model/RiskScoreBracketBrackets0.php +++ b/src/Model/RiskScoreBracketBrackets0.php @@ -24,15 +24,9 @@ class RiskScoreBracketBrackets0 implements RiskScoreBracketBrackets public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('start', $data)) { - $this->setStart($data['start']); - } if (array_key_exists('end', $data)) { $this->setEnd($data['end']); } - if (array_key_exists('value', $data)) { - $this->setValue($data['value']); - } $this->setMetadata($metadata); } @@ -41,38 +35,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getStart(): ?int - { - return $this->fields['start'] ?? null; - } - - public function setStart(null|int $start): static - { - $this->fields['start'] = $start; - - return $this; - } - - public function getEnd(): ?int + public function getEnd(): ?RiskScoreBracketBrackets0End { return $this->fields['end'] ?? null; } - public function setEnd(null|int $end): static - { - $this->fields['end'] = $end; - - return $this; - } - - public function getValue(): ?int + public function setEnd(null|RiskScoreBracketBrackets0End|array $end): static { - return $this->fields['value'] ?? null; - } + if ($end !== null && !($end instanceof RiskScoreBracketBrackets0End)) { + $end = RiskScoreBracketBrackets0End::from($end); + } - public function setValue(null|int $value): static - { - $this->fields['value'] = $value; + $this->fields['end'] = $end; return $this; } @@ -80,14 +54,8 @@ public function setValue(null|int $value): static public function jsonSerialize(): array { $data = []; - if (array_key_exists('start', $this->fields)) { - $data['start'] = $this->fields['start']; - } if (array_key_exists('end', $this->fields)) { - $data['end'] = $this->fields['end']; - } - if (array_key_exists('value', $this->fields)) { - $data['value'] = $this->fields['value']; + $data['end'] = $this->fields['end']?->jsonSerialize(); } return $data; diff --git a/src/Model/RiskScoreBracketBrackets0End.php b/src/Model/RiskScoreBracketBrackets0End.php new file mode 100644 index 000000000..f3b65780d --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets0End.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/RiskScoreBracketBrackets1.php b/src/Model/RiskScoreBracketBrackets1.php index a6f2bfc4e..7a34ccf16 100644 --- a/src/Model/RiskScoreBracketBrackets1.php +++ b/src/Model/RiskScoreBracketBrackets1.php @@ -27,12 +27,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('start', $data)) { $this->setStart($data['start']); } - if (array_key_exists('end', $data)) { - $this->setEnd($data['end']); - } - if (array_key_exists('value', $data)) { - $this->setValue($data['value']); - } $this->setMetadata($metadata); } @@ -41,38 +35,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getStart(): ?int + public function getStart(): ?RiskScoreBracketBrackets1Start { return $this->fields['start'] ?? null; } - public function setStart(null|int $start): static - { - $this->fields['start'] = $start; - - return $this; - } - - public function getEnd(): ?int - { - return $this->fields['end'] ?? null; - } - - public function setEnd(null|int $end): static + public function setStart(null|RiskScoreBracketBrackets1Start|array $start): static { - $this->fields['end'] = $end; - - return $this; - } - - public function getValue(): ?int - { - return $this->fields['value'] ?? null; - } + if ($start !== null && !($start instanceof RiskScoreBracketBrackets1Start)) { + $start = RiskScoreBracketBrackets1Start::from($start); + } - public function setValue(null|int $value): static - { - $this->fields['value'] = $value; + $this->fields['start'] = $start; return $this; } @@ -81,13 +55,7 @@ public function jsonSerialize(): array { $data = []; if (array_key_exists('start', $this->fields)) { - $data['start'] = $this->fields['start']; - } - if (array_key_exists('end', $this->fields)) { - $data['end'] = $this->fields['end']; - } - if (array_key_exists('value', $this->fields)) { - $data['value'] = $this->fields['value']; + $data['start'] = $this->fields['start']?->jsonSerialize(); } return $data; diff --git a/src/Model/RiskScoreBracketBrackets1Start.php b/src/Model/RiskScoreBracketBrackets1Start.php new file mode 100644 index 000000000..8c230cb5e --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets1Start.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/RiskScoreBracketBrackets2.php b/src/Model/RiskScoreBracketBrackets2.php new file mode 100644 index 000000000..b88ccb4e0 --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets2.php @@ -0,0 +1,95 @@ +setStart($data['start']); + } + if (array_key_exists('end', $data)) { + $this->setEnd($data['end']); + } + if (array_key_exists('value', $data)) { + $this->setValue($data['value']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getStart(): ?int + { + return $this->fields['start'] ?? null; + } + + public function setStart(null|int $start): static + { + $this->fields['start'] = $start; + + return $this; + } + + public function getEnd(): ?int + { + return $this->fields['end'] ?? null; + } + + public function setEnd(null|int $end): static + { + $this->fields['end'] = $end; + + return $this; + } + + public function getValue(): ?int + { + return $this->fields['value'] ?? null; + } + + public function setValue(null|int $value): static + { + $this->fields['value'] = $value; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('start', $this->fields)) { + $data['start'] = $this->fields['start']; + } + if (array_key_exists('end', $this->fields)) { + $data['end'] = $this->fields['end']; + } + if (array_key_exists('value', $this->fields)) { + $data['value'] = $this->fields['value']; + } + + return $data; + } +} diff --git a/src/Model/SendThroughAttribution.php b/src/Model/SendThroughAttribution.php index d1c4255d3..7ad9076a0 100644 --- a/src/Model/SendThroughAttribution.php +++ b/src/Model/SendThroughAttribution.php @@ -91,6 +91,14 @@ class SendThroughAttribution implements JsonSerializable public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER = 'invoice-past-due-reminder'; + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER15_DAYS = 'invoice-past-due-reminder-15-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER30_DAYS = 'invoice-past-due-reminder-30-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER60_DAYS = 'invoice-past-due-reminder-60-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER90_DAYS = 'invoice-past-due-reminder-90-days'; + public const EVENT_TYPE_INVOICE_REFUNDED = 'invoice-refunded'; public const EVENT_TYPE_INVOICE_REVENUE_RECOGNIZED = 'invoice-revenue-recognized'; @@ -113,10 +121,22 @@ class SendThroughAttribution implements JsonSerializable public const EVENT_TYPE_ORDER_COMPLETED = 'order-completed'; + public const EVENT_TYPE_ORDER_CHANGE_APPLIED = 'order-change-applied'; + + public const EVENT_TYPE_ORDER_CHANGE_CANCELED = 'order-change-canceled'; + + public const EVENT_TYPE_ORDER_CHANGE_CREATED = 'order-change-created'; + public const EVENT_TYPE_PAYMENT_CARD_CREATED = 'payment-card-created'; public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER = 'payment-card-expiration-reminder'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER1_DAY = 'payment-card-expiration-reminder-1-day'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER14_DAYS = 'payment-card-expiration-reminder-14-days'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER7_DAYS = 'payment-card-expiration-reminder-7-days'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; public const EVENT_TYPE_PAYMENT_INSTRUMENT_MODIFIED = 'payment-instrument-modified'; @@ -183,6 +203,12 @@ class SendThroughAttribution implements JsonSerializable public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER = 'subscription-renewal-reminder'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER1_DAY = 'subscription-renewal-reminder-1-day'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER30_DAYS = 'subscription-renewal-reminder-30-days'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER7_DAYS = 'subscription-renewal-reminder-7-days'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWED = 'subscription-renewed'; public const EVENT_TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index 79ede6dec..6f0c56845 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -141,9 +141,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('invoiceTimeShift', $data)) { $this->setInvoiceTimeShift($data['invoiceTimeShift']); } - if (array_key_exists('recurringInterval', $data)) { - $this->setRecurringInterval($data['recurringInterval']); - } if (array_key_exists('autopay', $data)) { $this->setAutopay($data['autopay']); } @@ -375,22 +372,6 @@ public function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShif return $this; } - public function getRecurringInterval(): ?SubscriptionRecurringInterval - { - return $this->fields['recurringInterval'] ?? null; - } - - public function setRecurringInterval(null|SubscriptionRecurringInterval|array $recurringInterval): static - { - if ($recurringInterval !== null && !($recurringInterval instanceof SubscriptionRecurringInterval)) { - $recurringInterval = SubscriptionRecurringInterval::from($recurringInterval); - } - - $this->fields['recurringInterval'] = $recurringInterval; - - return $this; - } - public function getAutopay(): ?bool { return $this->fields['autopay'] ?? null; @@ -815,9 +796,6 @@ public function jsonSerialize(): array if (array_key_exists('invoiceTimeShift', $this->fields)) { $data['invoiceTimeShift'] = $this->fields['invoiceTimeShift']?->jsonSerialize(); } - if (array_key_exists('recurringInterval', $this->fields)) { - $data['recurringInterval'] = $this->fields['recurringInterval']?->jsonSerialize(); - } if (array_key_exists('autopay', $this->fields)) { $data['autopay'] = $this->fields['autopay']; } diff --git a/src/Model/SubscriptionChange.php b/src/Model/SubscriptionChange.php index 4e5180855..35096249f 100644 --- a/src/Model/SubscriptionChange.php +++ b/src/Model/SubscriptionChange.php @@ -23,6 +23,14 @@ class SubscriptionChange implements JsonSerializable { use HasMetadata; + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_ONLY = 'retainTrialOnly'; + public const RENEWAL_POLICY_RESET = 'reset'; public const RENEWAL_POLICY_RETAIN = 'retain'; diff --git a/src/Model/SubscriptionItem.php b/src/Model/SubscriptionItem.php index d4c64f288..7868dc50d 100644 --- a/src/Model/SubscriptionItem.php +++ b/src/Model/SubscriptionItem.php @@ -50,9 +50,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('rebillNumber', $data)) { $this->setRebillNumber($data['rebillNumber']); } - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } if (array_key_exists('productId', $data)) { $this->setProductId($data['productId']); } @@ -158,18 +155,6 @@ public function getRebillNumber(): ?int return $this->fields['rebillNumber'] ?? null; } - public function getPlanId(): ?string - { - return $this->fields['planId'] ?? null; - } - - public function setPlanId(null|string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - public function getProductId(): ?string { return $this->fields['productId'] ?? null; @@ -307,9 +292,6 @@ public function jsonSerialize(): array if (array_key_exists('rebillNumber', $this->fields)) { $data['rebillNumber'] = $this->fields['rebillNumber']; } - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } if (array_key_exists('productId', $this->fields)) { $data['productId'] = $this->fields['productId']; } diff --git a/src/Model/SubscriptionPlan.php b/src/Model/SubscriptionPlan.php new file mode 100644 index 000000000..915ce1f42 --- /dev/null +++ b/src/Model/SubscriptionPlan.php @@ -0,0 +1,501 @@ +setType($data['type']); + } + if (array_key_exists('name', $data)) { + $this->setName($data['name']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } + if (array_key_exists('richDescription', $data)) { + $this->setRichDescription($data['richDescription']); + } + if (array_key_exists('productId', $data)) { + $this->setProductId($data['productId']); + } + if (array_key_exists('productOptions', $data)) { + $this->setProductOptions($data['productOptions']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('currencySign', $data)) { + $this->setCurrencySign($data['currencySign']); + } + if (array_key_exists('pricing', $data)) { + $this->setPricing($data['pricing']); + } + if (array_key_exists('setup', $data)) { + $this->setSetup($data['setup']); + } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } + if (array_key_exists('customFields', $data)) { + $this->setCustomFields($data['customFields']); + } + if (array_key_exists('isActive', $data)) { + $this->setIsActive($data['isActive']); + } + if (array_key_exists('revision', $data)) { + $this->setRevision($data['revision']); + } + if (array_key_exists('isTrialOnly', $data)) { + $this->setIsTrialOnly($data['isTrialOnly']); + } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } + if (array_key_exists('meteredBilling', $data)) { + $this->setMeteredBilling($data['meteredBilling']); + } + if (array_key_exists('invoiceTimeShift', $data)) { + $this->setInvoiceTimeShift($data['invoiceTimeShift']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + public function getName(): string + { + return $this->fields['name']; + } + + public function setName(string $name): static + { + $this->fields['name'] = $name; + + return $this; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + + public function getRichDescription(): ?string + { + return $this->fields['richDescription'] ?? null; + } + + public function setRichDescription(null|string $richDescription): static + { + $this->fields['richDescription'] = $richDescription; + + return $this; + } + + public function getProductId(): string + { + return $this->fields['productId']; + } + + public function setProductId(string $productId): static + { + $this->fields['productId'] = $productId; + + return $this; + } + + /** + * @return null|array + */ + public function getProductOptions(): ?array + { + return $this->fields['productOptions'] ?? null; + } + + /** + * @param null|array $productOptions + */ + public function setProductOptions(null|array $productOptions): static + { + $this->fields['productOptions'] = $productOptions; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getCurrencySign(): ?string + { + return $this->fields['currencySign'] ?? null; + } + + public function getPricing(): PlanPriceFormula + { + return $this->fields['pricing']; + } + + public function setPricing(PlanPriceFormula|array $pricing): static + { + if (!($pricing instanceof PlanPriceFormula)) { + $pricing = PlanPriceFormulaFactory::from($pricing); + } + + $this->fields['pricing'] = $pricing; + + return $this; + } + + public function getSetup(): ?PlanSetup + { + return $this->fields['setup'] ?? null; + } + + public function setSetup(null|PlanSetup|array $setup): static + { + if ($setup !== null && !($setup instanceof PlanSetup)) { + $setup = PlanSetup::from($setup); + } + + $this->fields['setup'] = $setup; + + return $this; + } + + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + + public function getCustomFields(): ?array + { + return $this->fields['customFields'] ?? null; + } + + public function setCustomFields(null|array $customFields): static + { + $this->fields['customFields'] = $customFields; + + return $this; + } + + public function getIsActive(): ?bool + { + return $this->fields['isActive'] ?? null; + } + + public function setIsActive(null|bool $isActive): static + { + $this->fields['isActive'] = $isActive; + + return $this; + } + + public function getRevision(): ?int + { + return $this->fields['revision'] ?? null; + } + + public function getIsTrialOnly(): ?bool + { + return $this->fields['isTrialOnly'] ?? null; + } + + public function getRecurringInterval(): SubscriptionPlanRecurringInterval + { + return $this->fields['recurringInterval']; + } + + public function setRecurringInterval(SubscriptionPlanRecurringInterval|array $recurringInterval): static + { + if (!($recurringInterval instanceof SubscriptionPlanRecurringInterval)) { + $recurringInterval = SubscriptionPlanRecurringInterval::from($recurringInterval); + } + + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + public function getTrial(): ?PlanTrial + { + return $this->fields['trial'] ?? null; + } + + public function setTrial(null|PlanTrial|array $trial): static + { + if ($trial !== null && !($trial instanceof PlanTrial)) { + $trial = PlanTrial::from($trial); + } + + $this->fields['trial'] = $trial; + + return $this; + } + + public function getMeteredBilling(): ?SubscriptionPlanMeteredBilling + { + return $this->fields['meteredBilling'] ?? null; + } + + public function setMeteredBilling(null|SubscriptionPlanMeteredBilling|array $meteredBilling): static + { + if ($meteredBilling !== null && !($meteredBilling instanceof SubscriptionPlanMeteredBilling)) { + $meteredBilling = SubscriptionPlanMeteredBilling::from($meteredBilling); + } + + $this->fields['meteredBilling'] = $meteredBilling; + + return $this; + } + + public function getInvoiceTimeShift(): ?InvoiceTimeShift + { + return $this->fields['invoiceTimeShift'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('name', $this->fields)) { + $data['name'] = $this->fields['name']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } + if (array_key_exists('richDescription', $this->fields)) { + $data['richDescription'] = $this->fields['richDescription']; + } + if (array_key_exists('productId', $this->fields)) { + $data['productId'] = $this->fields['productId']; + } + if (array_key_exists('productOptions', $this->fields)) { + $data['productOptions'] = $this->fields['productOptions'] !== null + ? (object) $this->fields['productOptions'] + : null; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('currencySign', $this->fields)) { + $data['currencySign'] = $this->fields['currencySign']; + } + if (array_key_exists('pricing', $this->fields)) { + $data['pricing'] = $this->fields['pricing']->jsonSerialize(); + } + if (array_key_exists('setup', $this->fields)) { + $data['setup'] = $this->fields['setup']?->jsonSerialize(); + } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } + if (array_key_exists('customFields', $this->fields)) { + $data['customFields'] = $this->fields['customFields']; + } + if (array_key_exists('isActive', $this->fields)) { + $data['isActive'] = $this->fields['isActive']; + } + if (array_key_exists('revision', $this->fields)) { + $data['revision'] = $this->fields['revision']; + } + if (array_key_exists('isTrialOnly', $this->fields)) { + $data['isTrialOnly'] = $this->fields['isTrialOnly']; + } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']->jsonSerialize(); + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']?->jsonSerialize(); + } + if (array_key_exists('meteredBilling', $this->fields)) { + $data['meteredBilling'] = $this->fields['meteredBilling']?->jsonSerialize(); + } + if (array_key_exists('invoiceTimeShift', $this->fields)) { + $data['invoiceTimeShift'] = $this->fields['invoiceTimeShift']?->jsonSerialize(); + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setCurrencySign(null|string $currencySign): static + { + $this->fields['currencySign'] = $currencySign; + + return $this; + } + + private function setRevision(null|int $revision): static + { + $this->fields['revision'] = $revision; + + return $this; + } + + private function setIsTrialOnly(null|bool $isTrialOnly): static + { + $this->fields['isTrialOnly'] = $isTrialOnly; + + return $this; + } + + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static + { + if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { + $invoiceTimeShift = InvoiceTimeShift::from($invoiceTimeShift); + } + + $this->fields['invoiceTimeShift'] = $invoiceTimeShift; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PlanSubscriptionPlan.php b/src/Model/SubscriptionPlanDetails.php similarity index 88% rename from src/Model/PlanSubscriptionPlan.php rename to src/Model/SubscriptionPlanDetails.php index 847486c44..32f9dc8ad 100644 --- a/src/Model/PlanSubscriptionPlan.php +++ b/src/Model/SubscriptionPlanDetails.php @@ -18,7 +18,7 @@ use DateTimeInterface; use Rebilly\Sdk\Trait\HasMetadata; -class PlanSubscriptionPlan implements Plan +class SubscriptionPlanDetails implements Plan { use HasMetadata; @@ -53,6 +53,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -97,6 +100,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'subscription'; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -163,12 +171,12 @@ public function setProductOptions(null|array $productOptions): static return $this; } - public function getCurrency(): string + public function getCurrency(): ?string { - return $this->fields['currency']; + return $this->fields['currency'] ?? null; } - public function setCurrency(string $currency): static + public function setCurrency(null|string $currency): static { $this->fields['currency'] = $currency; @@ -212,6 +220,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -246,15 +270,15 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getRecurringInterval(): ?PlanSubscriptionPlanRecurringInterval + public function getRecurringInterval(): SubscriptionPlanDetailsRecurringInterval { - return $this->fields['recurringInterval'] ?? null; + return $this->fields['recurringInterval']; } - public function setRecurringInterval(null|PlanSubscriptionPlanRecurringInterval|array $recurringInterval): static + public function setRecurringInterval(SubscriptionPlanDetailsRecurringInterval|array $recurringInterval): static { - if ($recurringInterval !== null && !($recurringInterval instanceof PlanSubscriptionPlanRecurringInterval)) { - $recurringInterval = PlanSubscriptionPlanRecurringInterval::from($recurringInterval); + if (!($recurringInterval instanceof SubscriptionPlanDetailsRecurringInterval)) { + $recurringInterval = SubscriptionPlanDetailsRecurringInterval::from($recurringInterval); } $this->fields['recurringInterval'] = $recurringInterval; @@ -278,15 +302,15 @@ public function setTrial(null|PlanTrial|array $trial): static return $this; } - public function getMeteredBilling(): ?PlanSubscriptionPlanMeteredBilling + public function getMeteredBilling(): ?SubscriptionPlanDetailsMeteredBilling { return $this->fields['meteredBilling'] ?? null; } - public function setMeteredBilling(null|PlanSubscriptionPlanMeteredBilling|array $meteredBilling): static + public function setMeteredBilling(null|SubscriptionPlanDetailsMeteredBilling|array $meteredBilling): static { - if ($meteredBilling !== null && !($meteredBilling instanceof PlanSubscriptionPlanMeteredBilling)) { - $meteredBilling = PlanSubscriptionPlanMeteredBilling::from($meteredBilling); + if ($meteredBilling !== null && !($meteredBilling instanceof SubscriptionPlanDetailsMeteredBilling)) { + $meteredBilling = SubscriptionPlanDetailsMeteredBilling::from($meteredBilling); } $this->fields['meteredBilling'] = $meteredBilling; @@ -324,7 +348,9 @@ public function getId(): string public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'subscription', + ]; if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -354,6 +380,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -367,7 +396,7 @@ public function jsonSerialize(): array $data['isTrialOnly'] = $this->fields['isTrialOnly']; } if (array_key_exists('recurringInterval', $this->fields)) { - $data['recurringInterval'] = $this->fields['recurringInterval']?->jsonSerialize(); + $data['recurringInterval'] = $this->fields['recurringInterval']->jsonSerialize(); } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']?->jsonSerialize(); diff --git a/src/Model/SubscriptionPlanDetailsMeteredBilling.php b/src/Model/SubscriptionPlanDetailsMeteredBilling.php new file mode 100644 index 000000000..ab3349650 --- /dev/null +++ b/src/Model/SubscriptionPlanDetailsMeteredBilling.php @@ -0,0 +1,126 @@ +setStrategy($data['strategy']); + } + if (array_key_exists('min', $data)) { + $this->setMin($data['min']); + } + if (array_key_exists('max', $data)) { + $this->setMax($data['max']); + } + if (array_key_exists('sticky', $data)) { + $this->setSticky($data['sticky']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getStrategy(): string + { + return $this->fields['strategy']; + } + + public function setStrategy(string $strategy): static + { + $this->fields['strategy'] = $strategy; + + return $this; + } + + public function getMin(): ?float + { + return $this->fields['min'] ?? null; + } + + public function setMin(null|float|string $min): static + { + if (is_string($min)) { + $min = (float) $min; + } + + $this->fields['min'] = $min; + + return $this; + } + + public function getMax(): ?float + { + return $this->fields['max'] ?? null; + } + + public function setMax(null|float|string $max): static + { + if (is_string($max)) { + $max = (float) $max; + } + + $this->fields['max'] = $max; + + return $this; + } + + public function getSticky(): ?bool + { + return $this->fields['sticky'] ?? null; + } + + public function setSticky(null|bool $sticky): static + { + $this->fields['sticky'] = $sticky; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('strategy', $this->fields)) { + $data['strategy'] = $this->fields['strategy']; + } + if (array_key_exists('min', $this->fields)) { + $data['min'] = $this->fields['min']; + } + if (array_key_exists('max', $this->fields)) { + $data['max'] = $this->fields['max']; + } + if (array_key_exists('sticky', $this->fields)) { + $data['sticky'] = $this->fields['sticky']; + } + + return $data; + } +} diff --git a/src/Model/SubscriptionPlanDetailsRecurringInterval.php b/src/Model/SubscriptionPlanDetailsRecurringInterval.php new file mode 100644 index 000000000..b3b1a62ba --- /dev/null +++ b/src/Model/SubscriptionPlanDetailsRecurringInterval.php @@ -0,0 +1,148 @@ +setPeriodAnchorInstruction($data['periodAnchorInstruction']); + } + if (array_key_exists('unit', $data)) { + $this->setUnit($data['unit']); + } + if (array_key_exists('length', $data)) { + $this->setLength($data['length']); + } + if (array_key_exists('limit', $data)) { + $this->setLimit($data['limit']); + } + if (array_key_exists('billingTiming', $data)) { + $this->setBillingTiming($data['billingTiming']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPeriodAnchorInstruction(): ?ServicePeriodAnchorInstruction + { + return $this->fields['periodAnchorInstruction'] ?? null; + } + + public function setPeriodAnchorInstruction(null|ServicePeriodAnchorInstruction|array $periodAnchorInstruction): static + { + if ($periodAnchorInstruction !== null && !($periodAnchorInstruction instanceof ServicePeriodAnchorInstruction)) { + $periodAnchorInstruction = ServicePeriodAnchorInstructionFactory::from($periodAnchorInstruction); + } + + $this->fields['periodAnchorInstruction'] = $periodAnchorInstruction; + + return $this; + } + + public function getUnit(): string + { + return $this->fields['unit']; + } + + public function setUnit(string $unit): static + { + $this->fields['unit'] = $unit; + + return $this; + } + + public function getLength(): int + { + return $this->fields['length']; + } + + public function setLength(int $length): static + { + $this->fields['length'] = $length; + + return $this; + } + + public function getLimit(): ?int + { + return $this->fields['limit'] ?? null; + } + + public function setLimit(null|int $limit): static + { + $this->fields['limit'] = $limit; + + return $this; + } + + public function getBillingTiming(): ?string + { + return $this->fields['billingTiming'] ?? null; + } + + public function setBillingTiming(null|string $billingTiming): static + { + $this->fields['billingTiming'] = $billingTiming; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('periodAnchorInstruction', $this->fields)) { + $data['periodAnchorInstruction'] = $this->fields['periodAnchorInstruction']?->jsonSerialize(); + } + if (array_key_exists('unit', $this->fields)) { + $data['unit'] = $this->fields['unit']; + } + if (array_key_exists('length', $this->fields)) { + $data['length'] = $this->fields['length']; + } + if (array_key_exists('limit', $this->fields)) { + $data['limit'] = $this->fields['limit']; + } + if (array_key_exists('billingTiming', $this->fields)) { + $data['billingTiming'] = $this->fields['billingTiming']; + } + + return $data; + } +} diff --git a/src/Model/PlanSubscriptionPlanMeteredBilling.php b/src/Model/SubscriptionPlanMeteredBilling.php similarity index 81% rename from src/Model/PlanSubscriptionPlanMeteredBilling.php rename to src/Model/SubscriptionPlanMeteredBilling.php index f31163e72..0cb184684 100644 --- a/src/Model/PlanSubscriptionPlanMeteredBilling.php +++ b/src/Model/SubscriptionPlanMeteredBilling.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PlanSubscriptionPlanMeteredBilling implements JsonSerializable +class SubscriptionPlanMeteredBilling implements JsonSerializable { use HasMetadata; @@ -38,6 +38,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('max', $data)) { $this->setMax($data['max']); } + if (array_key_exists('sticky', $data)) { + $this->setSticky($data['sticky']); + } $this->setMetadata($metadata); } @@ -90,6 +93,18 @@ public function setMax(null|float|string $max): static return $this; } + public function getSticky(): ?bool + { + return $this->fields['sticky'] ?? null; + } + + public function setSticky(null|bool $sticky): static + { + $this->fields['sticky'] = $sticky; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -102,6 +117,9 @@ public function jsonSerialize(): array if (array_key_exists('max', $this->fields)) { $data['max'] = $this->fields['max']; } + if (array_key_exists('sticky', $this->fields)) { + $data['sticky'] = $this->fields['sticky']; + } return $data; } diff --git a/src/Model/PlanSubscriptionPlanRecurringInterval.php b/src/Model/SubscriptionPlanRecurringInterval.php similarity index 98% rename from src/Model/PlanSubscriptionPlanRecurringInterval.php rename to src/Model/SubscriptionPlanRecurringInterval.php index 6dad79419..c70252cc7 100644 --- a/src/Model/PlanSubscriptionPlanRecurringInterval.php +++ b/src/Model/SubscriptionPlanRecurringInterval.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PlanSubscriptionPlanRecurringInterval implements JsonSerializable +class SubscriptionPlanRecurringInterval implements JsonSerializable { use HasMetadata; diff --git a/src/Model/SubscriptionRecurringInterval.php b/src/Model/SubscriptionRecurringInterval.php deleted file mode 100644 index 1fe219571..000000000 --- a/src/Model/SubscriptionRecurringInterval.php +++ /dev/null @@ -1,64 +0,0 @@ -setPeriodAnchorInstruction($data['periodAnchorInstruction']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getPeriodAnchorInstruction(): ?ServicePeriodAnchorInstruction - { - return $this->fields['periodAnchorInstruction'] ?? null; - } - - public function setPeriodAnchorInstruction(null|ServicePeriodAnchorInstruction|array $periodAnchorInstruction): static - { - if ($periodAnchorInstruction !== null && !($periodAnchorInstruction instanceof ServicePeriodAnchorInstruction)) { - $periodAnchorInstruction = ServicePeriodAnchorInstructionFactory::from($periodAnchorInstruction); - } - - $this->fields['periodAnchorInstruction'] = $periodAnchorInstruction; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('periodAnchorInstruction', $this->fields)) { - $data['periodAnchorInstruction'] = $this->fields['periodAnchorInstruction']?->jsonSerialize(); - } - - return $data; - } -} diff --git a/src/Model/SubscriptionSummaryMetrics.php b/src/Model/SubscriptionSummaryMetrics.php index 570c0a83e..82a84bd78 100644 --- a/src/Model/SubscriptionSummaryMetrics.php +++ b/src/Model/SubscriptionSummaryMetrics.php @@ -45,24 +45,24 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getCurrency(): ?string + public function getCurrency(): string { - return $this->fields['currency'] ?? null; + return $this->fields['currency']; } - public function getInvoicedAmount(): ?float + public function getInvoicedAmount(): float { - return $this->fields['invoicedAmount'] ?? null; + return $this->fields['invoicedAmount']; } - public function getCollectedAmount(): ?float + public function getCollectedAmount(): float { - return $this->fields['collectedAmount'] ?? null; + return $this->fields['collectedAmount']; } - public function getInvoiceCount(): ?int + public function getInvoiceCount(): int { - return $this->fields['invoiceCount'] ?? null; + return $this->fields['invoiceCount']; } public function jsonSerialize(): array @@ -84,14 +84,14 @@ public function jsonSerialize(): array return $data; } - private function setCurrency(null|string $currency): static + private function setCurrency(string $currency): static { $this->fields['currency'] = $currency; return $this; } - private function setInvoicedAmount(null|float|string $invoicedAmount): static + private function setInvoicedAmount(float|string $invoicedAmount): static { if (is_string($invoicedAmount)) { $invoicedAmount = (float) $invoicedAmount; @@ -102,7 +102,7 @@ private function setInvoicedAmount(null|float|string $invoicedAmount): static return $this; } - private function setCollectedAmount(null|float|string $collectedAmount): static + private function setCollectedAmount(float|string $collectedAmount): static { if (is_string($collectedAmount)) { $collectedAmount = (float) $collectedAmount; @@ -113,7 +113,7 @@ private function setCollectedAmount(null|float|string $collectedAmount): static return $this; } - private function setInvoiceCount(null|int $invoiceCount): static + private function setInvoiceCount(int $invoiceCount): static { $this->fields['invoiceCount'] = $invoiceCount; diff --git a/src/Model/SubscriptionsDataExport.php b/src/Model/SubscriptionsDataExport.php index 4e0a4d1a9..372036b8f 100644 --- a/src/Model/SubscriptionsDataExport.php +++ b/src/Model/SubscriptionsDataExport.php @@ -40,6 +40,14 @@ class SubscriptionsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?SubscriptionsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/SystemEvent.php b/src/Model/SystemEvent.php index 1080c765a..809f3ec6d 100644 --- a/src/Model/SystemEvent.php +++ b/src/Model/SystemEvent.php @@ -91,6 +91,14 @@ class SystemEvent implements JsonSerializable public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER = 'invoice-past-due-reminder'; + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER15_DAYS = 'invoice-past-due-reminder-15-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER30_DAYS = 'invoice-past-due-reminder-30-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER60_DAYS = 'invoice-past-due-reminder-60-days'; + + public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER90_DAYS = 'invoice-past-due-reminder-90-days'; + public const EVENT_TYPE_INVOICE_REFUNDED = 'invoice-refunded'; public const EVENT_TYPE_INVOICE_REVENUE_RECOGNIZED = 'invoice-revenue-recognized'; @@ -113,10 +121,22 @@ class SystemEvent implements JsonSerializable public const EVENT_TYPE_ORDER_COMPLETED = 'order-completed'; + public const EVENT_TYPE_ORDER_CHANGE_APPLIED = 'order-change-applied'; + + public const EVENT_TYPE_ORDER_CHANGE_CANCELED = 'order-change-canceled'; + + public const EVENT_TYPE_ORDER_CHANGE_CREATED = 'order-change-created'; + public const EVENT_TYPE_PAYMENT_CARD_CREATED = 'payment-card-created'; public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER = 'payment-card-expiration-reminder'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER1_DAY = 'payment-card-expiration-reminder-1-day'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER14_DAYS = 'payment-card-expiration-reminder-14-days'; + + public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER7_DAYS = 'payment-card-expiration-reminder-7-days'; + public const EVENT_TYPE_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; public const EVENT_TYPE_PAYMENT_INSTRUMENT_MODIFIED = 'payment-instrument-modified'; @@ -183,6 +203,12 @@ class SystemEvent implements JsonSerializable public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER = 'subscription-renewal-reminder'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER1_DAY = 'subscription-renewal-reminder-1-day'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER30_DAYS = 'subscription-renewal-reminder-30-days'; + + public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER7_DAYS = 'subscription-renewal-reminder-7-days'; + public const EVENT_TYPE_SUBSCRIPTION_RENEWED = 'subscription-renewed'; public const EVENT_TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; diff --git a/src/Model/TagUntagRule.php b/src/Model/TagUntagRule.php index 97f8a69a3..92efb0f00 100644 --- a/src/Model/TagUntagRule.php +++ b/src/Model/TagUntagRule.php @@ -105,6 +105,8 @@ class TagUntagRule implements JsonSerializable public const EVENT_TYPE_PAYOUT_REQUEST_CANCELED = 'payout-request-canceled'; + public const EVENT_TYPE_PAYOUT_REQUEST_CHANGED = 'payout-request-changed'; + public const EVENT_TYPE_PAYOUT_REQUEST_CREATED = 'payout-request-created'; public const EVENT_TYPE_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; @@ -161,6 +163,12 @@ class TagUntagRule implements JsonSerializable public const EVENT_TYPE_TRANSACTION_PROCESSED = 'transaction-processed'; + public const EVENT_TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + + public const EVENT_TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; + + public const EVENT_TYPE_TRANSACTION_VOIDED = 'transaction-voided'; + public const EVENT_TYPE_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; public const STATUS_ACTIVE = 'active'; diff --git a/src/Model/Thunes.php b/src/Model/Thunes.php new file mode 100644 index 000000000..515accfb4 --- /dev/null +++ b/src/Model/Thunes.php @@ -0,0 +1,89 @@ + 'Thunes', + ] + $data, $metadata); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + if (array_key_exists('settings', $data)) { + $this->setSettings($data['settings']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCredentials(): ThunesCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(ThunesCredentials|array $credentials): static + { + if (!($credentials instanceof ThunesCredentials)) { + $credentials = ThunesCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + return $this; + } + + public function getSettings(): ThunesSettings + { + return $this->fields['settings']; + } + + public function setSettings(ThunesSettings|array $settings): static + { + if (!($settings instanceof ThunesSettings)) { + $settings = ThunesSettings::from($settings); + } + + $this->fields['settings'] = $settings; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('credentials', $this->fields)) { + $data['credentials'] = $this->fields['credentials']->jsonSerialize(); + } + if (array_key_exists('settings', $this->fields)) { + $data['settings'] = $this->fields['settings']->jsonSerialize(); + } + + return parent::jsonSerialize() + $data; + } +} diff --git a/src/Model/ThunesCredentials.php b/src/Model/ThunesCredentials.php new file mode 100644 index 000000000..151fc169d --- /dev/null +++ b/src/Model/ThunesCredentials.php @@ -0,0 +1,114 @@ +setApiKey($data['apiKey']); + } + if (array_key_exists('apiSecret', $data)) { + $this->setApiSecret($data['apiSecret']); + } + if (array_key_exists('merchantId', $data)) { + $this->setMerchantId($data['merchantId']); + } + if (array_key_exists('paymentPageId', $data)) { + $this->setPaymentPageId($data['paymentPageId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function getApiSecret(): string + { + return $this->fields['apiSecret']; + } + + public function setApiSecret(string $apiSecret): static + { + $this->fields['apiSecret'] = $apiSecret; + + return $this; + } + + public function getMerchantId(): string + { + return $this->fields['merchantId']; + } + + public function setMerchantId(string $merchantId): static + { + $this->fields['merchantId'] = $merchantId; + + return $this; + } + + public function getPaymentPageId(): string + { + return $this->fields['paymentPageId']; + } + + public function setPaymentPageId(string $paymentPageId): static + { + $this->fields['paymentPageId'] = $paymentPageId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + if (array_key_exists('apiSecret', $this->fields)) { + $data['apiSecret'] = $this->fields['apiSecret']; + } + if (array_key_exists('merchantId', $this->fields)) { + $data['merchantId'] = $this->fields['merchantId']; + } + if (array_key_exists('paymentPageId', $this->fields)) { + $data['paymentPageId'] = $this->fields['paymentPageId']; + } + + return $data; + } +} diff --git a/src/Model/ThunesSettings.php b/src/Model/ThunesSettings.php new file mode 100644 index 000000000..69cf98b00 --- /dev/null +++ b/src/Model/ThunesSettings.php @@ -0,0 +1,64 @@ +setTransactionType($data['transactionType']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getTransactionType(): string + { + return $this->fields['transactionType']; + } + + public function setTransactionType(string $transactionType): static + { + $this->fields['transactionType'] = $transactionType; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('transactionType', $this->fields)) { + $data['transactionType'] = $this->fields['transactionType']; + } + + return $data; + } +} diff --git a/src/Model/TimeSeriesTransactionData.php b/src/Model/TimeSeriesTransactionData.php index f4fcc75b3..3a3bf3173 100644 --- a/src/Model/TimeSeriesTransactionData.php +++ b/src/Model/TimeSeriesTransactionData.php @@ -70,16 +70,23 @@ public function setTotal(null|float|string $total): static return $this; } - public function getSubaggregates(): ?TimeSeriesTransactionDataSubaggregates + /** + * @return null|TimeSeriesTransactionDataSubaggregates[] + */ + public function getSubaggregates(): ?array { return $this->fields['subaggregates'] ?? null; } - public function setSubaggregates(null|TimeSeriesTransactionDataSubaggregates|array $subaggregates): static + /** + * @param null|array[]|TimeSeriesTransactionDataSubaggregates[] $subaggregates + */ + public function setSubaggregates(null|array $subaggregates): static { - if ($subaggregates !== null && !($subaggregates instanceof TimeSeriesTransactionDataSubaggregates)) { - $subaggregates = TimeSeriesTransactionDataSubaggregates::from($subaggregates); - } + $subaggregates = $subaggregates !== null ? array_map( + fn ($value) => $value instanceof TimeSeriesTransactionDataSubaggregates ? $value : TimeSeriesTransactionDataSubaggregates::from($value), + $subaggregates, + ) : null; $this->fields['subaggregates'] = $subaggregates; @@ -96,7 +103,12 @@ public function jsonSerialize(): array $data['total'] = $this->fields['total']; } if (array_key_exists('subaggregates', $this->fields)) { - $data['subaggregates'] = $this->fields['subaggregates']?->jsonSerialize(); + $data['subaggregates'] = $this->fields['subaggregates'] !== null + ? array_map( + static fn (TimeSeriesTransactionDataSubaggregates $timeSeriesTransactionDataSubaggregates) => $timeSeriesTransactionDataSubaggregates->jsonSerialize(), + $this->fields['subaggregates'], + ) + : null; } return $data; diff --git a/src/Model/TimelineExtraDataLinks.php b/src/Model/TimelineExtraDataLinks.php index df0029a24..0dba7fa91 100644 --- a/src/Model/TimelineExtraDataLinks.php +++ b/src/Model/TimelineExtraDataLinks.php @@ -37,6 +37,8 @@ class TimelineExtraDataLinks implements JsonSerializable public const RESOURCE_TYPE_EXTERNAL = 'external'; + public const RESOURCE_TYPE_PAYOUT_REQUEST_BATCH = 'payout-request-batch'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 8c77c8d43..5ead4aa6b 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -261,6 +261,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -385,6 +387,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -489,6 +493,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const GATEWAY_NAME_THUNES = 'Thunes'; + public const GATEWAY_NAME_TODITO_CASH = 'ToditoCash'; public const GATEWAY_NAME_TRIPLE000 = 'Triple000'; @@ -823,6 +829,8 @@ class Transaction implements JsonSerializable public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; @@ -913,6 +921,8 @@ class Transaction implements JsonSerializable public const ACQUIRER_NAME_TEST_PROCESSOR = 'TestProcessor'; + public const ACQUIRER_NAME_THUNES = 'Thunes'; + public const ACQUIRER_NAME_TODITO_CASH = 'ToditoCash'; public const ACQUIRER_NAME_TRIPLE000 = 'Triple000'; @@ -959,6 +969,16 @@ class Transaction implements JsonSerializable public const ACQUIRER_NAME_ZOTAPAY = 'Zotapay'; + public const METHOD_PAYMENT_CARD = 'payment-card'; + + public const METHOD_ACH = 'ach'; + + public const METHOD_CASH = 'cash'; + + public const METHOD_CHECK = 'check'; + + public const METHOD_PAYPAL = 'paypal'; + public const METHOD_ADV_CASH = 'AdvCash'; public const METHOD_AERA = 'Aera'; @@ -1229,6 +1249,8 @@ class Transaction implements JsonSerializable public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; @@ -1289,6 +1311,8 @@ class Transaction implements JsonSerializable public const METHOD_TETHER = 'Tether'; + public const METHOD_THUNES_CHECKOUT = 'Thunes-Checkout'; + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; public const METHOD_TRUSTLY = 'Trustly'; @@ -1492,6 +1516,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('bin', $data)) { $this->setBin($data['bin']); } + if (array_key_exists('paymentInstrumentFingerprint', $data)) { + $this->setPaymentInstrumentFingerprint($data['paymentInstrumentFingerprint']); + } if (array_key_exists('paymentInstrument', $data)) { $this->setPaymentInstrument($data['paymentInstrument']); } @@ -1897,6 +1924,11 @@ public function getBin(): ?string return $this->fields['bin'] ?? null; } + public function getPaymentInstrumentFingerprint(): ?string + { + return $this->fields['paymentInstrumentFingerprint'] ?? null; + } + public function getPaymentInstrument(): ?TransactionPaymentInstrument { return $this->fields['paymentInstrument'] ?? null; @@ -2247,6 +2279,9 @@ public function jsonSerialize(): array if (array_key_exists('bin', $this->fields)) { $data['bin'] = $this->fields['bin']; } + if (array_key_exists('paymentInstrumentFingerprint', $this->fields)) { + $data['paymentInstrumentFingerprint'] = $this->fields['paymentInstrumentFingerprint']; + } if (array_key_exists('paymentInstrument', $this->fields)) { $data['paymentInstrument'] = $this->fields['paymentInstrument']?->jsonSerialize(); } @@ -2597,6 +2632,13 @@ private function setBin(null|string $bin): static return $this; } + private function setPaymentInstrumentFingerprint(null|string $paymentInstrumentFingerprint): static + { + $this->fields['paymentInstrumentFingerprint'] = $paymentInstrumentFingerprint; + + return $this; + } + private function setHasDcc(null|bool $hasDcc): static { $this->fields['hasDcc'] = $hasDcc; diff --git a/src/Model/TransactionPaymentInstrumentFactory.php b/src/Model/TransactionPaymentInstrumentFactory.php index 7155816f3..717d5e90c 100644 --- a/src/Model/TransactionPaymentInstrumentFactory.php +++ b/src/Model/TransactionPaymentInstrumentFactory.php @@ -110,6 +110,7 @@ public static function from(array $data = [], array $metadata = []): Transaction 'Onlineueberweisen' => AlternativePaymentInstrument::from($data, $metadata), 'P24' => AlternativePaymentInstrument::from($data, $metadata), 'PIX' => AlternativePaymentInstrument::from($data, $metadata), + 'PIX-Automatico' => AlternativePaymentInstrument::from($data, $metadata), 'POLi' => AlternativePaymentInstrument::from($data, $metadata), 'Pagadito' => AlternativePaymentInstrument::from($data, $metadata), 'PagoEffectivo' => AlternativePaymentInstrument::from($data, $metadata), @@ -154,6 +155,7 @@ public static function from(array $data = [], array $metadata = []): Transaction 'Telr' => AlternativePaymentInstrument::from($data, $metadata), 'Terminaly-RF' => AlternativePaymentInstrument::from($data, $metadata), 'Tether' => AlternativePaymentInstrument::from($data, $metadata), + 'Thunes-Checkout' => AlternativePaymentInstrument::from($data, $metadata), 'ToditoCash-card' => AlternativePaymentInstrument::from($data, $metadata), 'Trustly' => AlternativePaymentInstrument::from($data, $metadata), 'Tupay' => AlternativePaymentInstrument::from($data, $metadata), diff --git a/src/Model/TransactionTimeline.php b/src/Model/TransactionTimeline.php index 59208a8cc..8dd905419 100644 --- a/src/Model/TransactionTimeline.php +++ b/src/Model/TransactionTimeline.php @@ -97,6 +97,8 @@ class TransactionTimeline implements JsonSerializable public const TYPE_TRANSACTION_PAYMENT_METHOD_CHANGED = 'transaction-payment-method-changed'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_PROCESS_REQUESTED = 'transaction-process-requested'; public const TYPE_TRANSACTION_PROCESSED = 'transaction-processed'; diff --git a/src/Model/TransactionsDataExport.php b/src/Model/TransactionsDataExport.php index aa2f3c955..17e05a50b 100644 --- a/src/Model/TransactionsDataExport.php +++ b/src/Model/TransactionsDataExport.php @@ -40,6 +40,14 @@ class TransactionsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?TransactionsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/TrialOnlyPlan.php b/src/Model/TrialOnlyPlan.php new file mode 100644 index 000000000..5c9fad430 --- /dev/null +++ b/src/Model/TrialOnlyPlan.php @@ -0,0 +1,453 @@ +setType($data['type']); + } + if (array_key_exists('name', $data)) { + $this->setName($data['name']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } + if (array_key_exists('richDescription', $data)) { + $this->setRichDescription($data['richDescription']); + } + if (array_key_exists('productId', $data)) { + $this->setProductId($data['productId']); + } + if (array_key_exists('productOptions', $data)) { + $this->setProductOptions($data['productOptions']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('currencySign', $data)) { + $this->setCurrencySign($data['currencySign']); + } + if (array_key_exists('setup', $data)) { + $this->setSetup($data['setup']); + } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } + if (array_key_exists('customFields', $data)) { + $this->setCustomFields($data['customFields']); + } + if (array_key_exists('isActive', $data)) { + $this->setIsActive($data['isActive']); + } + if (array_key_exists('revision', $data)) { + $this->setRevision($data['revision']); + } + if (array_key_exists('isTrialOnly', $data)) { + $this->setIsTrialOnly($data['isTrialOnly']); + } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } + if (array_key_exists('invoiceTimeShift', $data)) { + $this->setInvoiceTimeShift($data['invoiceTimeShift']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): ?string + { + return $this->fields['type'] ?? null; + } + + public function setType(null|string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + public function getName(): string + { + return $this->fields['name']; + } + + public function setName(string $name): static + { + $this->fields['name'] = $name; + + return $this; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + + public function getRichDescription(): ?string + { + return $this->fields['richDescription'] ?? null; + } + + public function setRichDescription(null|string $richDescription): static + { + $this->fields['richDescription'] = $richDescription; + + return $this; + } + + public function getProductId(): string + { + return $this->fields['productId']; + } + + public function setProductId(string $productId): static + { + $this->fields['productId'] = $productId; + + return $this; + } + + /** + * @return null|array + */ + public function getProductOptions(): ?array + { + return $this->fields['productOptions'] ?? null; + } + + /** + * @param null|array $productOptions + */ + public function setProductOptions(null|array $productOptions): static + { + $this->fields['productOptions'] = $productOptions; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getCurrencySign(): ?string + { + return $this->fields['currencySign'] ?? null; + } + + public function getSetup(): ?PlanSetup + { + return $this->fields['setup'] ?? null; + } + + public function setSetup(null|PlanSetup|array $setup): static + { + if ($setup !== null && !($setup instanceof PlanSetup)) { + $setup = PlanSetup::from($setup); + } + + $this->fields['setup'] = $setup; + + return $this; + } + + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + + public function getCustomFields(): ?array + { + return $this->fields['customFields'] ?? null; + } + + public function setCustomFields(null|array $customFields): static + { + $this->fields['customFields'] = $customFields; + + return $this; + } + + public function getIsActive(): ?bool + { + return $this->fields['isActive'] ?? null; + } + + public function setIsActive(null|bool $isActive): static + { + $this->fields['isActive'] = $isActive; + + return $this; + } + + public function getRevision(): ?int + { + return $this->fields['revision'] ?? null; + } + + public function getIsTrialOnly(): ?bool + { + return $this->fields['isTrialOnly'] ?? null; + } + + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): TrialOnlyPlanTrial + { + return $this->fields['trial']; + } + + public function setTrial(TrialOnlyPlanTrial|array $trial): static + { + if (!($trial instanceof TrialOnlyPlanTrial)) { + $trial = TrialOnlyPlanTrial::from($trial); + } + + $this->fields['trial'] = $trial; + + return $this; + } + + public function getInvoiceTimeShift(): ?InvoiceTimeShift + { + return $this->fields['invoiceTimeShift'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('name', $this->fields)) { + $data['name'] = $this->fields['name']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } + if (array_key_exists('richDescription', $this->fields)) { + $data['richDescription'] = $this->fields['richDescription']; + } + if (array_key_exists('productId', $this->fields)) { + $data['productId'] = $this->fields['productId']; + } + if (array_key_exists('productOptions', $this->fields)) { + $data['productOptions'] = $this->fields['productOptions'] !== null + ? (object) $this->fields['productOptions'] + : null; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('currencySign', $this->fields)) { + $data['currencySign'] = $this->fields['currencySign']; + } + if (array_key_exists('setup', $this->fields)) { + $data['setup'] = $this->fields['setup']?->jsonSerialize(); + } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } + if (array_key_exists('customFields', $this->fields)) { + $data['customFields'] = $this->fields['customFields']; + } + if (array_key_exists('isActive', $this->fields)) { + $data['isActive'] = $this->fields['isActive']; + } + if (array_key_exists('revision', $this->fields)) { + $data['revision'] = $this->fields['revision']; + } + if (array_key_exists('isTrialOnly', $this->fields)) { + $data['isTrialOnly'] = $this->fields['isTrialOnly']; + } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']->jsonSerialize(); + } + if (array_key_exists('invoiceTimeShift', $this->fields)) { + $data['invoiceTimeShift'] = $this->fields['invoiceTimeShift']?->jsonSerialize(); + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setCurrencySign(null|string $currencySign): static + { + $this->fields['currencySign'] = $currencySign; + + return $this; + } + + private function setRevision(null|int $revision): static + { + $this->fields['revision'] = $revision; + + return $this; + } + + private function setIsTrialOnly(null|bool $isTrialOnly): static + { + $this->fields['isTrialOnly'] = $isTrialOnly; + + return $this; + } + + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static + { + if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { + $invoiceTimeShift = InvoiceTimeShift::from($invoiceTimeShift); + } + + $this->fields['invoiceTimeShift'] = $invoiceTimeShift; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PlanTrialOnlyPlan.php b/src/Model/TrialOnlyPlanDetails.php similarity index 86% rename from src/Model/PlanTrialOnlyPlan.php rename to src/Model/TrialOnlyPlanDetails.php index 406d3d18f..ce96b8a91 100644 --- a/src/Model/PlanTrialOnlyPlan.php +++ b/src/Model/TrialOnlyPlanDetails.php @@ -18,7 +18,7 @@ use DateTimeInterface; use Rebilly\Sdk\Trait\HasMetadata; -class PlanTrialOnlyPlan implements Plan +class TrialOnlyPlanDetails implements Plan { use HasMetadata; @@ -50,6 +50,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('setup', $data)) { $this->setSetup($data['setup']); } + if (array_key_exists('setupFee', $data)) { + $this->setSetupFee($data['setupFee']); + } if (array_key_exists('customFields', $data)) { $this->setCustomFields($data['customFields']); } @@ -62,6 +65,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } if (array_key_exists('trial', $data)) { $this->setTrial($data['trial']); } @@ -88,6 +94,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'trial-only'; + } + public function getName(): ?string { return $this->fields['name'] ?? null; @@ -154,12 +165,12 @@ public function setProductOptions(null|array $productOptions): static return $this; } - public function getCurrency(): string + public function getCurrency(): ?string { - return $this->fields['currency']; + return $this->fields['currency'] ?? null; } - public function setCurrency(string $currency): static + public function setCurrency(null|string $currency): static { $this->fields['currency'] = $currency; @@ -187,6 +198,22 @@ public function setSetup(null|PlanSetup|array $setup): static return $this; } + public function getSetupFee(): ?float + { + return $this->fields['setupFee'] ?? null; + } + + public function setSetupFee(null|float|string $setupFee): static + { + if (is_string($setupFee)) { + $setupFee = (float) $setupFee; + } + + $this->fields['setupFee'] = $setupFee; + + return $this; + } + public function getCustomFields(): ?array { return $this->fields['customFields'] ?? null; @@ -221,15 +248,20 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getTrial(): PlanTrial + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): TrialOnlyPlanDetailsTrial { return $this->fields['trial']; } - public function setTrial(PlanTrial|array $trial): static + public function setTrial(TrialOnlyPlanDetailsTrial|array $trial): static { - if (!($trial instanceof PlanTrial)) { - $trial = PlanTrial::from($trial); + if (!($trial instanceof TrialOnlyPlanDetailsTrial)) { + $trial = TrialOnlyPlanDetailsTrial::from($trial); } $this->fields['trial'] = $trial; @@ -267,7 +299,9 @@ public function getId(): string public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'trial-only', + ]; if (array_key_exists('name', $this->fields)) { $data['name'] = $this->fields['name']; } @@ -294,6 +328,9 @@ public function jsonSerialize(): array if (array_key_exists('setup', $this->fields)) { $data['setup'] = $this->fields['setup']?->jsonSerialize(); } + if (array_key_exists('setupFee', $this->fields)) { + $data['setupFee'] = $this->fields['setupFee']; + } if (array_key_exists('customFields', $this->fields)) { $data['customFields'] = $this->fields['customFields']; } @@ -306,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']->jsonSerialize(); } @@ -354,6 +394,13 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static { if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { diff --git a/src/Model/TrialOnlyPlanDetailsTrial.php b/src/Model/TrialOnlyPlanDetailsTrial.php new file mode 100644 index 000000000..a23f9037f --- /dev/null +++ b/src/Model/TrialOnlyPlanDetailsTrial.php @@ -0,0 +1,86 @@ +setPrice($data['price']); + } + if (array_key_exists('period', $data)) { + $this->setPeriod($data['period']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPrice(): float + { + return $this->fields['price']; + } + + public function setPrice(float|string $price): static + { + if (is_string($price)) { + $price = (float) $price; + } + + $this->fields['price'] = $price; + + return $this; + } + + public function getPeriod(): TrialOnlyPlanDetailsTrialPeriod + { + return $this->fields['period']; + } + + public function setPeriod(TrialOnlyPlanDetailsTrialPeriod|array $period): static + { + if (!($period instanceof TrialOnlyPlanDetailsTrialPeriod)) { + $period = TrialOnlyPlanDetailsTrialPeriod::from($period); + } + + $this->fields['period'] = $period; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('price', $this->fields)) { + $data['price'] = $this->fields['price']; + } + if (array_key_exists('period', $this->fields)) { + $data['period'] = $this->fields['period']->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/TrialOnlyPlanDetailsTrialPeriod.php b/src/Model/TrialOnlyPlanDetailsTrialPeriod.php new file mode 100644 index 000000000..a2fa9a294 --- /dev/null +++ b/src/Model/TrialOnlyPlanDetailsTrialPeriod.php @@ -0,0 +1,86 @@ +setUnit($data['unit']); + } + if (array_key_exists('length', $data)) { + $this->setLength($data['length']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getUnit(): string + { + return $this->fields['unit']; + } + + public function setUnit(string $unit): static + { + $this->fields['unit'] = $unit; + + return $this; + } + + public function getLength(): int + { + return $this->fields['length']; + } + + public function setLength(int $length): static + { + $this->fields['length'] = $length; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('unit', $this->fields)) { + $data['unit'] = $this->fields['unit']; + } + if (array_key_exists('length', $this->fields)) { + $data['length'] = $this->fields['length']; + } + + return $data; + } +} diff --git a/src/Model/TrialOnlyPlanTrial.php b/src/Model/TrialOnlyPlanTrial.php new file mode 100644 index 000000000..5bc1dbffa --- /dev/null +++ b/src/Model/TrialOnlyPlanTrial.php @@ -0,0 +1,86 @@ +setPrice($data['price']); + } + if (array_key_exists('period', $data)) { + $this->setPeriod($data['period']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPrice(): float + { + return $this->fields['price']; + } + + public function setPrice(float|string $price): static + { + if (is_string($price)) { + $price = (float) $price; + } + + $this->fields['price'] = $price; + + return $this; + } + + public function getPeriod(): TrialOnlyPlanTrialPeriod + { + return $this->fields['period']; + } + + public function setPeriod(TrialOnlyPlanTrialPeriod|array $period): static + { + if (!($period instanceof TrialOnlyPlanTrialPeriod)) { + $period = TrialOnlyPlanTrialPeriod::from($period); + } + + $this->fields['period'] = $period; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('price', $this->fields)) { + $data['price'] = $this->fields['price']; + } + if (array_key_exists('period', $this->fields)) { + $data['period'] = $this->fields['period']->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/TrialOnlyPlanTrialPeriod.php b/src/Model/TrialOnlyPlanTrialPeriod.php new file mode 100644 index 000000000..dcf544798 --- /dev/null +++ b/src/Model/TrialOnlyPlanTrialPeriod.php @@ -0,0 +1,86 @@ +setUnit($data['unit']); + } + if (array_key_exists('length', $data)) { + $this->setLength($data['length']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getUnit(): string + { + return $this->fields['unit']; + } + + public function setUnit(string $unit): static + { + $this->fields['unit'] = $unit; + + return $this; + } + + public function getLength(): int + { + return $this->fields['length']; + } + + public function setLength(int $length): static + { + $this->fields['length'] = $length; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('unit', $this->fields)) { + $data['unit'] = $this->fields['unit']; + } + if (array_key_exists('length', $this->fields)) { + $data['length'] = $this->fields['length']; + } + + return $data; + } +} diff --git a/src/Model/UnblockPayoutRequestBatchOperation.php b/src/Model/UnblockPayoutRequestBatchOperation.php new file mode 100644 index 000000000..57d35128e --- /dev/null +++ b/src/Model/UnblockPayoutRequestBatchOperation.php @@ -0,0 +1,66 @@ +setBatchId($data['batchId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'unblock'; + } + + public function getBatchId(): string + { + return $this->fields['batchId']; + } + + public function setBatchId(string $batchId): static + { + $this->fields['batchId'] = $batchId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'unblock', + ]; + if (array_key_exists('batchId', $this->fields)) { + $data['batchId'] = $this->fields['batchId']; + } + + return $data; + } +} diff --git a/src/Model/Unlimit.php b/src/Model/Unlimit.php index 640bc6ac5..cafc305e6 100644 --- a/src/Model/Unlimit.php +++ b/src/Model/Unlimit.php @@ -31,6 +31,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('credentials', $data)) { $this->setCredentials($data['credentials']); } + if (array_key_exists('threeDSecureServer', $data)) { + $this->setThreeDSecureServer($data['threeDSecureServer']); + } $this->setMetadata($metadata); } @@ -55,12 +58,31 @@ public function setCredentials(UnlimitCredentials|array $credentials): static return $this; } + public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer + { + return $this->fields['threeDSecureServer'] ?? null; + } + + public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static + { + if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) { + $threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer); + } + + $this->fields['threeDSecureServer'] = $threeDSecureServer; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('credentials', $this->fields)) { $data['credentials'] = $this->fields['credentials']->jsonSerialize(); } + if (array_key_exists('threeDSecureServer', $this->fields)) { + $data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize(); + } return parent::jsonSerialize() + $data; } diff --git a/src/Model/UsersDataExport.php b/src/Model/UsersDataExport.php new file mode 100644 index 000000000..d6b8d3a1f --- /dev/null +++ b/src/Model/UsersDataExport.php @@ -0,0 +1,450 @@ +setId($data['id']); + } + if (array_key_exists('name', $data)) { + $this->setName($data['name']); + } + if (array_key_exists('format', $data)) { + $this->setFormat($data['format']); + } + if (array_key_exists('arguments', $data)) { + $this->setArguments($data['arguments']); + } + if (array_key_exists('emailNotification', $data)) { + $this->setEmailNotification($data['emailNotification']); + } + if (array_key_exists('fields', $data)) { + $this->setFields($data['fields']); + } + if (array_key_exists('recurring', $data)) { + $this->setRecurring($data['recurring']); + } + if (array_key_exists('userId', $data)) { + $this->setUserId($data['userId']); + } + if (array_key_exists('fileId', $data)) { + $this->setFileId($data['fileId']); + } + if (array_key_exists('recordCount', $data)) { + $this->setRecordCount($data['recordCount']); + } + if (array_key_exists('scheduledTime', $data)) { + $this->setScheduledTime($data['scheduledTime']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } + if (array_key_exists('dateRange', $data)) { + $this->setDateRange($data['dateRange']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + if (array_key_exists('_embedded', $data)) { + $this->setEmbedded($data['_embedded']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getResource(): string + { + return 'users'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getName(): string + { + return $this->fields['name']; + } + + public function setName(string $name): static + { + $this->fields['name'] = $name; + + return $this; + } + + public function getFormat(): string + { + return $this->fields['format']; + } + + public function setFormat(string $format): static + { + $this->fields['format'] = $format; + + return $this; + } + + public function getArguments(): ?DataExportArguments + { + return $this->fields['arguments'] ?? null; + } + + public function setArguments(null|DataExportArguments|array $arguments): static + { + if ($arguments !== null && !($arguments instanceof DataExportArguments)) { + $arguments = DataExportArguments::from($arguments); + } + + $this->fields['arguments'] = $arguments; + + return $this; + } + + /** + * @return null|string[] + */ + public function getEmailNotification(): ?array + { + return $this->fields['emailNotification'] ?? null; + } + + /** + * @param null|string[] $emailNotification + */ + public function setEmailNotification(null|array $emailNotification): static + { + $this->fields['emailNotification'] = $emailNotification; + + return $this; + } + + /** + * @return null|string[] + */ + public function getFields(): ?array + { + return $this->fields['fields'] ?? null; + } + + /** + * @param null|string[] $fields + */ + public function setFields(null|array $fields): static + { + $this->fields['fields'] = $fields; + + return $this; + } + + public function getRecurring(): ?DataExportRecurring + { + return $this->fields['recurring'] ?? null; + } + + public function setRecurring(null|DataExportRecurring|array $recurring): static + { + if ($recurring !== null && !($recurring instanceof DataExportRecurring)) { + $recurring = DataExportRecurring::from($recurring); + } + + $this->fields['recurring'] = $recurring; + + return $this; + } + + public function getUserId(): ?string + { + return $this->fields['userId'] ?? null; + } + + public function getFileId(): ?string + { + return $this->fields['fileId'] ?? null; + } + + public function getRecordCount(): ?int + { + return $this->fields['recordCount'] ?? null; + } + + public function getScheduledTime(): ?DateTimeImmutable + { + return $this->fields['scheduledTime'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + + public function getDateRange(): ?UsersDataExportDateRange + { + return $this->fields['dateRange'] ?? null; + } + + public function setDateRange(null|UsersDataExportDateRange|array $dateRange): static + { + if ($dateRange !== null && !($dateRange instanceof UsersDataExportDateRange)) { + $dateRange = UsersDataExportDateRange::from($dateRange); + } + + $this->fields['dateRange'] = $dateRange; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function getEmbedded(): ?UsersDataExportEmbedded + { + return $this->fields['_embedded'] ?? null; + } + + public function setEmbedded(null|UsersDataExportEmbedded|array $embedded): static + { + if ($embedded !== null && !($embedded instanceof UsersDataExportEmbedded)) { + $embedded = UsersDataExportEmbedded::from($embedded); + } + + $this->fields['_embedded'] = $embedded; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'resource' => 'users', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('name', $this->fields)) { + $data['name'] = $this->fields['name']; + } + if (array_key_exists('format', $this->fields)) { + $data['format'] = $this->fields['format']; + } + if (array_key_exists('arguments', $this->fields)) { + $data['arguments'] = $this->fields['arguments']?->jsonSerialize(); + } + if (array_key_exists('emailNotification', $this->fields)) { + $data['emailNotification'] = $this->fields['emailNotification']; + } + if (array_key_exists('fields', $this->fields)) { + $data['fields'] = $this->fields['fields']; + } + if (array_key_exists('recurring', $this->fields)) { + $data['recurring'] = $this->fields['recurring']?->jsonSerialize(); + } + if (array_key_exists('userId', $this->fields)) { + $data['userId'] = $this->fields['userId']; + } + if (array_key_exists('fileId', $this->fields)) { + $data['fileId'] = $this->fields['fileId']; + } + if (array_key_exists('recordCount', $this->fields)) { + $data['recordCount'] = $this->fields['recordCount']; + } + if (array_key_exists('scheduledTime', $this->fields)) { + $data['scheduledTime'] = $this->fields['scheduledTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } + if (array_key_exists('dateRange', $this->fields)) { + $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + if (array_key_exists('_embedded', $this->fields)) { + $data['_embedded'] = $this->fields['_embedded']?->jsonSerialize(); + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setUserId(null|string $userId): static + { + $this->fields['userId'] = $userId; + + return $this; + } + + private function setFileId(null|string $fileId): static + { + $this->fields['fileId'] = $fileId; + + return $this; + } + + private function setRecordCount(null|int $recordCount): static + { + $this->fields['recordCount'] = $recordCount; + + return $this; + } + + private function setScheduledTime(null|DateTimeImmutable|string $scheduledTime): static + { + if ($scheduledTime !== null && !($scheduledTime instanceof DateTimeImmutable)) { + $scheduledTime = new DateTimeImmutable($scheduledTime); + } + + $this->fields['scheduledTime'] = $scheduledTime; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/UsersDataExportDateRange.php b/src/Model/UsersDataExportDateRange.php new file mode 100644 index 000000000..51532f008 --- /dev/null +++ b/src/Model/UsersDataExportDateRange.php @@ -0,0 +1,96 @@ +setStart($data['start']); + } + if (array_key_exists('end', $data)) { + $this->setEnd($data['end']); + } + if (array_key_exists('field', $data)) { + $this->setField($data['field']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getStart(): string + { + return $this->fields['start']; + } + + public function setStart(string $start): static + { + $this->fields['start'] = $start; + + return $this; + } + + public function getEnd(): string + { + return $this->fields['end']; + } + + public function setEnd(string $end): static + { + $this->fields['end'] = $end; + + return $this; + } + + public function getField(): ?string + { + return $this->fields['field'] ?? null; + } + + public function setField(null|string $field): static + { + $this->fields['field'] = $field; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('start', $this->fields)) { + $data['start'] = $this->fields['start']; + } + if (array_key_exists('end', $this->fields)) { + $data['end'] = $this->fields['end']; + } + if (array_key_exists('field', $this->fields)) { + $data['field'] = $this->fields['field']; + } + + return $data; + } +} diff --git a/src/Model/UsersDataExportEmbedded.php b/src/Model/UsersDataExportEmbedded.php new file mode 100644 index 000000000..95c6c67e0 --- /dev/null +++ b/src/Model/UsersDataExportEmbedded.php @@ -0,0 +1,86 @@ +setFile($data['file']); + } + if (array_key_exists('user', $data)) { + $this->setUser($data['user']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFile(): ?File + { + return $this->fields['file'] ?? null; + } + + public function setFile(null|File|array $file): static + { + if ($file !== null && !($file instanceof File)) { + $file = File::from($file); + } + + $this->fields['file'] = $file; + + return $this; + } + + public function getUser(): ?User + { + return $this->fields['user'] ?? null; + } + + public function setUser(null|User|array $user): static + { + if ($user !== null && !($user instanceof User)) { + $user = User::from($user); + } + + $this->fields['user'] = $user; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('file', $this->fields)) { + $data['file'] = $this->fields['file']?->jsonSerialize(); + } + if (array_key_exists('user', $this->fields)) { + $data['user'] = $this->fields['user']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/VaultedInstrument.php b/src/Model/VaultedInstrument.php index 26e1bb0c2..c7ba7ae84 100644 --- a/src/Model/VaultedInstrument.php +++ b/src/Model/VaultedInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class VaultedInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class VaultedInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/VivaCredentials.php b/src/Model/VivaCredentials.php index 5497c243b..14901c733 100644 --- a/src/Model/VivaCredentials.php +++ b/src/Model/VivaCredentials.php @@ -37,6 +37,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('apiKey', $data)) { $this->setApiKey($data['apiKey']); } + if (array_key_exists('ipnKey', $data)) { + $this->setIpnKey($data['ipnKey']); + } $this->setMetadata($metadata); } @@ -93,6 +96,18 @@ public function setApiKey(string $apiKey): static return $this; } + public function getIpnKey(): string + { + return $this->fields['ipnKey']; + } + + public function setIpnKey(string $ipnKey): static + { + $this->fields['ipnKey'] = $ipnKey; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -108,6 +123,9 @@ public function jsonSerialize(): array if (array_key_exists('apiKey', $this->fields)) { $data['apiKey'] = $this->fields['apiKey']; } + if (array_key_exists('ipnKey', $this->fields)) { + $data['ipnKey'] = $this->fields['ipnKey']; + } return $data; } diff --git a/src/Model/WebhookEvent.php b/src/Model/WebhookEvent.php new file mode 100644 index 000000000..b5075c872 --- /dev/null +++ b/src/Model/WebhookEvent.php @@ -0,0 +1,82 @@ +setEventType($data['eventType']); + } + if (array_key_exists('product', $data)) { + $this->setProduct($data['product']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getEventType(): string + { + return $this->fields['eventType']; + } + + public function getProduct(): string + { + return $this->fields['product']; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('eventType', $this->fields)) { + $data['eventType'] = $this->fields['eventType']; + } + if (array_key_exists('product', $this->fields)) { + $data['product'] = $this->fields['product']; + } + + return $data; + } + + private function setEventType(string $eventType): static + { + $this->fields['eventType'] = $eventType; + + return $this; + } + + private function setProduct(string $product): static + { + $this->fields['product'] = $product; + + return $this; + } +} diff --git a/src/Model/WebhookTracking.php b/src/Model/WebhookTracking.php index 3e7b61778..522548b67 100644 --- a/src/Model/WebhookTracking.php +++ b/src/Model/WebhookTracking.php @@ -23,240 +23,6 @@ class WebhookTracking implements JsonSerializable { use HasMetadata; - public const EVENT_TYPE_AML_LIST_POSSIBLY_MATCHED = 'aml-list-possibly-matched'; - - public const EVENT_TYPE_APPLICATION_INSTANCE_DISABLED = 'application-instance-disabled'; - - public const EVENT_TYPE_APPLICATION_INSTANCE_ENABLED = 'application-instance-enabled'; - - public const EVENT_TYPE_AUTODEPOSIT_LOOKUP_PERFORMED = 'autodeposit-lookup-performed'; - - public const EVENT_TYPE_BALANCE_TRANSACTION_SETTLED = 'balance-transaction-settled'; - - public const EVENT_TYPE_COUPON_APPLICATION_REMOVED = 'coupon-application-removed'; - - public const EVENT_TYPE_COUPON_APPLIED = 'coupon-applied'; - - public const EVENT_TYPE_COUPON_EXPIRATION_MODIFIED = 'coupon-expiration-modified'; - - public const EVENT_TYPE_COUPON_EXPIRED = 'coupon-expired'; - - public const EVENT_TYPE_COUPON_ISSUED = 'coupon-issued'; - - public const EVENT_TYPE_COUPON_MODIFIED = 'coupon-modified'; - - public const EVENT_TYPE_COUPON_REDEEMED = 'coupon-redeemed'; - - public const EVENT_TYPE_COUPON_REDEMPTION_CANCELED = 'coupon-redemption-canceled'; - - public const EVENT_TYPE_CREDIT_MEMO_APPLIED = 'credit-memo-applied'; - - public const EVENT_TYPE_CREDIT_MEMO_CREATED = 'credit-memo-created'; - - public const EVENT_TYPE_CREDIT_MEMO_MODIFIED = 'credit-memo-modified'; - - public const EVENT_TYPE_CREDIT_MEMO_PARTIALLY_APPLIED = 'credit-memo-partially-applied'; - - public const EVENT_TYPE_CREDIT_MEMO_VOIDED = 'credit-memo-voided'; - - public const EVENT_TYPE_CUSTOMER_CREATED = 'customer-created'; - - public const EVENT_TYPE_CUSTOMER_MERGED = 'customer-merged'; - - public const EVENT_TYPE_CUSTOMER_ONE_TIME_PASSWORD_REQUESTED = 'customer-one-time-password-requested'; - - public const EVENT_TYPE_CUSTOMER_REDIRECTED_OFFSITE = 'customer-redirected-offsite'; - - public const EVENT_TYPE_CUSTOMER_RETURNED = 'customer-returned'; - - public const EVENT_TYPE_CUSTOMER_TAX_NUMBER_VALIDATED = 'customer-tax-number-validated'; - - public const EVENT_TYPE_CUSTOMER_UPDATED = 'customer-updated'; - - public const EVENT_TYPE_DATA_EXPORT_COMPLETED = 'data-export-completed'; - - public const EVENT_TYPE_DISPUTE_CREATED = 'dispute-created'; - - public const EVENT_TYPE_DISPUTE_MODIFIED = 'dispute-modified'; - - public const EVENT_TYPE_EXPERIAN_CHECK_PERFORMED = 'experian-check-performed'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_DOWNTIME_ENDED = 'gateway-account-downtime-ended'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_DOWNTIME_STARTED = 'gateway-account-downtime-started'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_LIMIT_REACHED = 'gateway-account-limit-reached'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_ONBOARDING_COMPLETED = 'gateway-account-onboarding-completed'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_ONBOARDING_FAILED = 'gateway-account-onboarding-failed'; - - public const EVENT_TYPE_GATEWAY_ACCOUNT_REQUESTED = 'gateway-account-requested'; - - public const EVENT_TYPE_HARD_USAGE_LIMIT_REACHED = 'hard-usage-limit-reached'; - - public const EVENT_TYPE_INVOICE_ABANDONED = 'invoice-abandoned'; - - public const EVENT_TYPE_INVOICE_CREATED = 'invoice-created'; - - public const EVENT_TYPE_INVOICE_ISSUED = 'invoice-issued'; - - public const EVENT_TYPE_INVOICE_MODIFIED = 'invoice-modified'; - - public const EVENT_TYPE_INVOICE_PAID = 'invoice-paid'; - - public const EVENT_TYPE_INVOICE_PARTIALLY_PAID = 'invoice-partially-paid'; - - public const EVENT_TYPE_INVOICE_PARTIALLY_REFUNDED = 'invoice-partially-refunded'; - - public const EVENT_TYPE_INVOICE_PAST_DUE = 'invoice-past-due'; - - public const EVENT_TYPE_INVOICE_PAST_DUE_REMINDER = 'invoice-past-due-reminder'; - - public const EVENT_TYPE_INVOICE_REFUNDED = 'invoice-refunded'; - - public const EVENT_TYPE_INVOICE_REISSUED = 'invoice-reissued'; - - public const EVENT_TYPE_INVOICE_TAX_CALCULATION_FAILED = 'invoice-tax-calculation-failed'; - - public const EVENT_TYPE_INVOICE_VOIDED = 'invoice-voided'; - - public const EVENT_TYPE_KYC_DOCUMENT_ACCEPTED = 'kyc-document-accepted'; - - public const EVENT_TYPE_KYC_DOCUMENT_ARCHIVED = 'kyc-document-archived'; - - public const EVENT_TYPE_KYC_DOCUMENT_CREATED = 'kyc-document-created'; - - public const EVENT_TYPE_KYC_DOCUMENT_MODIFIED = 'kyc-document-modified'; - - public const EVENT_TYPE_KYC_DOCUMENT_REJECTED = 'kyc-document-rejected'; - - public const EVENT_TYPE_KYC_DOCUMENT_REVIEWED = 'kyc-document-reviewed'; - - public const EVENT_TYPE_KYC_REQUEST_ATTEMPTED = 'kyc-request-attempted'; - - public const EVENT_TYPE_KYC_REQUEST_FAILED = 'kyc-request-failed'; - - public const EVENT_TYPE_KYC_REQUEST_FULFILLED = 'kyc-request-fulfilled'; - - public const EVENT_TYPE_KYC_REQUEST_PARTIALLY_FULFILLED = 'kyc-request-partially-fulfilled'; - - public const EVENT_TYPE_LEAD_SOURCE_CHANGED = 'lead-source-changed'; - - public const EVENT_TYPE_OFFSITE_PAYMENT_COMPLETED = 'offsite-payment-completed'; - - public const EVENT_TYPE_ORDER_ABANDON_REMINDER = 'order-abandon-reminder'; - - public const EVENT_TYPE_ORDER_ABANDONED = 'order-abandoned'; - - public const EVENT_TYPE_ORDER_COMPLETED = 'order-completed'; - - public const EVENT_TYPE_ORDER_DELINQUENCY_REACHED = 'order-delinquency-reached'; - - public const EVENT_TYPE_ORGANIZATION_TAX_NUMBER_VALIDATED = 'organization-tax-number-validated'; - - public const EVENT_TYPE_PAYMENT_CARD_CREATED = 'payment-card-created'; - - public const EVENT_TYPE_PAYMENT_CARD_EXPIRATION_REMINDER = 'payment-card-expiration-reminder'; - - public const EVENT_TYPE_PAYMENT_CARD_EXPIRED = 'payment-card-expired'; - - public const EVENT_TYPE_PAYMENT_INSTRUMENT_MODIFIED = 'payment-instrument-modified'; - - public const EVENT_TYPE_PAYOUT_REQUEST_CANCELED = 'payout-request-canceled'; - - public const EVENT_TYPE_PAYOUT_REQUEST_CREATED = 'payout-request-created'; - - public const EVENT_TYPE_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; - - public const EVENT_TYPE_PAYOUT_REQUEST_MODIFIED = 'payout-request-modified'; - - public const EVENT_TYPE_QUOTE_ACCEPTED = 'quote-accepted'; - - public const EVENT_TYPE_QUOTE_CANCELED = 'quote-canceled'; - - public const EVENT_TYPE_QUOTE_CREATED = 'quote-created'; - - public const EVENT_TYPE_QUOTE_EXPIRED = 'quote-expired'; - - public const EVENT_TYPE_QUOTE_ISSUED = 'quote-issued'; - - public const EVENT_TYPE_QUOTE_RECALLED = 'quote-recalled'; - - public const EVENT_TYPE_QUOTE_REJECTED = 'quote-rejected'; - - public const EVENT_TYPE_QUOTE_UPDATED = 'quote-updated'; - - public const EVENT_TYPE_READY_TO_PAY_REQUESTED = 'ready-to-pay-requested'; - - public const EVENT_TYPE_RENEWAL_INVOICE_ISSUED = 'renewal-invoice-issued'; - - public const EVENT_TYPE_RENEWAL_INVOICE_PAYMENT_CANCELED = 'renewal-invoice-payment-canceled'; - - public const EVENT_TYPE_RENEWAL_INVOICE_PAYMENT_DECLINED = 'renewal-invoice-payment-declined'; - - public const EVENT_TYPE_RISK_SCORE_CHANGED = 'risk-score-changed'; - - public const EVENT_TYPE_SOFT_USAGE_LIMIT_REACHED = 'soft-usage-limit-reached'; - - public const EVENT_TYPE_SUBSCRIPTION_ACTIVATED = 'subscription-activated'; - - public const EVENT_TYPE_SUBSCRIPTION_CANCELED = 'subscription-canceled'; - - public const EVENT_TYPE_SUBSCRIPTION_CHURNED = 'subscription-churned'; - - public const EVENT_TYPE_SUBSCRIPTION_CREATED = 'subscription-created'; - - public const EVENT_TYPE_SUBSCRIPTION_DOWNGRADED = 'subscription-downgraded'; - - public const EVENT_TYPE_SUBSCRIPTION_ITEMS_CHANGED = 'subscription-items-changed'; - - public const EVENT_TYPE_SUBSCRIPTION_MODIFIED = 'subscription-modified'; - - public const EVENT_TYPE_SUBSCRIPTION_PAUSE_CREATED = 'subscription-pause-created'; - - public const EVENT_TYPE_SUBSCRIPTION_PAUSE_MODIFIED = 'subscription-pause-modified'; - - public const EVENT_TYPE_SUBSCRIPTION_PAUSE_REVOKED = 'subscription-pause-revoked'; - - public const EVENT_TYPE_SUBSCRIPTION_PAUSED = 'subscription-paused'; - - public const EVENT_TYPE_SUBSCRIPTION_QUANTITY_FILLED_LIMIT_REACHED = 'subscription-quantity-filled-limit-reached'; - - public const EVENT_TYPE_SUBSCRIPTION_REACTIVATED = 'subscription-reactivated'; - - public const EVENT_TYPE_SUBSCRIPTION_RENEWAL_REMINDER = 'subscription-renewal-reminder'; - - public const EVENT_TYPE_SUBSCRIPTION_RENEWED = 'subscription-renewed'; - - public const EVENT_TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; - - public const EVENT_TYPE_SUBSCRIPTION_TRIAL_CONVERTED = 'subscription-trial-converted'; - - public const EVENT_TYPE_SUBSCRIPTION_TRIAL_END_REMINDER = 'subscription-trial-end-reminder'; - - public const EVENT_TYPE_SUBSCRIPTION_TRIAL_ENDED = 'subscription-trial-ended'; - - public const EVENT_TYPE_SUBSCRIPTION_UPGRADED = 'subscription-upgraded'; - - public const EVENT_TYPE_TRANSACTION_AMOUNT_DISCREPANCY_FOUND = 'transaction-amount-discrepancy-found'; - - public const EVENT_TYPE_TRANSACTION_DECLINED = 'transaction-declined'; - - public const EVENT_TYPE_TRANSACTION_DISCREPANCY_FOUND = 'transaction-discrepancy-found'; - - public const EVENT_TYPE_TRANSACTION_PROCESS_REQUESTED = 'transaction-process-requested'; - - public const EVENT_TYPE_TRANSACTION_PROCESSED = 'transaction-processed'; - - public const EVENT_TYPE_TRANSACTION_RECONCILED = 'transaction-reconciled'; - - public const EVENT_TYPE_TRANSACTION_TIMEOUT_RESOLVED = 'transaction-timeout-resolved'; - - public const EVENT_TYPE_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; - - public const EVENT_TYPE_WAITING_GATEWAY_TRANSACTION_COMPLETED = 'waiting-gateway-transaction-completed'; - public const SOURCE_WEBHOOKS = 'webhooks'; public const SOURCE_RULES = 'rules'; diff --git a/src/Model/Website.php b/src/Model/Website.php index 947009ea5..a396124b7 100644 --- a/src/Model/Website.php +++ b/src/Model/Website.php @@ -42,6 +42,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('serviceEmail', $data)) { $this->setServiceEmail($data['serviceEmail']); } + if (array_key_exists('regulatorSiteId', $data)) { + $this->setRegulatorSiteId($data['regulatorSiteId']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -127,6 +130,18 @@ public function setServiceEmail(string $serviceEmail): static return $this; } + public function getRegulatorSiteId(): ?string + { + return $this->fields['regulatorSiteId'] ?? null; + } + + public function setRegulatorSiteId(null|string $regulatorSiteId): static + { + $this->fields['regulatorSiteId'] = $regulatorSiteId; + + return $this; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -213,6 +228,9 @@ public function jsonSerialize(): array if (array_key_exists('serviceEmail', $this->fields)) { $data['serviceEmail'] = $this->fields['serviceEmail']; } + if (array_key_exists('regulatorSiteId', $this->fields)) { + $data['regulatorSiteId'] = $this->fields['regulatorSiteId']; + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } diff --git a/src/Model/WebsiteSettings.php b/src/Model/WebsiteSettings.php index 0a1bd7c2d..239b06995 100644 --- a/src/Model/WebsiteSettings.php +++ b/src/Model/WebsiteSettings.php @@ -25,9 +25,6 @@ class WebsiteSettings implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('depositForm', $data)) { - $this->setDepositForm($data['depositForm']); - } if (array_key_exists('paymentForm', $data)) { $this->setPaymentForm($data['paymentForm']); } @@ -45,22 +42,6 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getDepositForm(): ?WebsiteSettingsDepositForm - { - return $this->fields['depositForm'] ?? null; - } - - public function setDepositForm(null|WebsiteSettingsDepositForm|array $depositForm): static - { - if ($depositForm !== null && !($depositForm instanceof WebsiteSettingsDepositForm)) { - $depositForm = WebsiteSettingsDepositForm::from($depositForm); - } - - $this->fields['depositForm'] = $depositForm; - - return $this; - } - public function getPaymentForm(): ?WebsiteSettingsPaymentForm { return $this->fields['paymentForm'] ?? null; @@ -112,9 +93,6 @@ public function setPayoutRequest(null|WebsiteSettingsPayoutRequest|array $payout public function jsonSerialize(): array { $data = []; - if (array_key_exists('depositForm', $this->fields)) { - $data['depositForm'] = $this->fields['depositForm']?->jsonSerialize(); - } if (array_key_exists('paymentForm', $this->fields)) { $data['paymentForm'] = $this->fields['paymentForm']?->jsonSerialize(); } diff --git a/src/Model/WebsiteSettingsDepositFormTheme.php b/src/Model/WebsiteSettingsDepositFormTheme.php deleted file mode 100644 index 8b5b48cfa..000000000 --- a/src/Model/WebsiteSettingsDepositFormTheme.php +++ /dev/null @@ -1,96 +0,0 @@ -setColorPrimary($data['colorPrimary']); - } - if (array_key_exists('colorSecondary', $data)) { - $this->setColorSecondary($data['colorSecondary']); - } - if (array_key_exists('buttonTemplate', $data)) { - $this->setButtonTemplate($data['buttonTemplate']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getColorPrimary(): ?string - { - return $this->fields['colorPrimary'] ?? null; - } - - public function setColorPrimary(null|string $colorPrimary): static - { - $this->fields['colorPrimary'] = $colorPrimary; - - return $this; - } - - public function getColorSecondary(): ?string - { - return $this->fields['colorSecondary'] ?? null; - } - - public function setColorSecondary(null|string $colorSecondary): static - { - $this->fields['colorSecondary'] = $colorSecondary; - - return $this; - } - - public function getButtonTemplate(): ?string - { - return $this->fields['buttonTemplate'] ?? null; - } - - public function setButtonTemplate(null|string $buttonTemplate): static - { - $this->fields['buttonTemplate'] = $buttonTemplate; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('colorPrimary', $this->fields)) { - $data['colorPrimary'] = $this->fields['colorPrimary']; - } - if (array_key_exists('colorSecondary', $this->fields)) { - $data['colorSecondary'] = $this->fields['colorSecondary']; - } - if (array_key_exists('buttonTemplate', $this->fields)) { - $data['buttonTemplate'] = $this->fields['buttonTemplate']; - } - - return $data; - } -} diff --git a/src/Model/WebsiteSettingsPayoutRequest.php b/src/Model/WebsiteSettingsPayoutRequest.php index 3889f0e82..5f5e702fb 100644 --- a/src/Model/WebsiteSettingsPayoutRequest.php +++ b/src/Model/WebsiteSettingsPayoutRequest.php @@ -14,6 +14,8 @@ namespace Rebilly\Sdk\Model; +use DateTimeImmutable; +use DateTimeInterface; use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; @@ -31,6 +33,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('pendingPeriodHours', $data)) { $this->setPendingPeriodHours($data['pendingPeriodHours']); } + if (array_key_exists('automaticReadinessTime', $data)) { + $this->setAutomaticReadinessTime($data['automaticReadinessTime']); + } + if (array_key_exists('automaticReadinessLastExecutedAt', $data)) { + $this->setAutomaticReadinessLastExecutedAt($data['automaticReadinessLastExecutedAt']); + } $this->setMetadata($metadata); } @@ -63,6 +71,23 @@ public function setPendingPeriodHours(null|int $pendingPeriodHours): static return $this; } + public function getAutomaticReadinessTime(): ?string + { + return $this->fields['automaticReadinessTime'] ?? null; + } + + public function setAutomaticReadinessTime(null|string $automaticReadinessTime): static + { + $this->fields['automaticReadinessTime'] = $automaticReadinessTime; + + return $this; + } + + public function getAutomaticReadinessLastExecutedAt(): ?DateTimeImmutable + { + return $this->fields['automaticReadinessLastExecutedAt'] ?? null; + } + public function jsonSerialize(): array { $data = []; @@ -72,7 +97,24 @@ public function jsonSerialize(): array if (array_key_exists('pendingPeriodHours', $this->fields)) { $data['pendingPeriodHours'] = $this->fields['pendingPeriodHours']; } + if (array_key_exists('automaticReadinessTime', $this->fields)) { + $data['automaticReadinessTime'] = $this->fields['automaticReadinessTime']; + } + if (array_key_exists('automaticReadinessLastExecutedAt', $this->fields)) { + $data['automaticReadinessLastExecutedAt'] = $this->fields['automaticReadinessLastExecutedAt']?->format(DateTimeInterface::RFC3339); + } return $data; } + + private function setAutomaticReadinessLastExecutedAt(null|DateTimeImmutable|string $automaticReadinessLastExecutedAt): static + { + if ($automaticReadinessLastExecutedAt !== null && !($automaticReadinessLastExecutedAt instanceof DateTimeImmutable)) { + $automaticReadinessLastExecutedAt = new DateTimeImmutable($automaticReadinessLastExecutedAt); + } + + $this->fields['automaticReadinessLastExecutedAt'] = $automaticReadinessLastExecutedAt; + + return $this; + } } diff --git a/src/Model/WorldlineAtosFrankfurtCredentials.php b/src/Model/WorldlineAtosFrankfurtCredentials.php index e1007d062..a5db633bd 100644 --- a/src/Model/WorldlineAtosFrankfurtCredentials.php +++ b/src/Model/WorldlineAtosFrankfurtCredentials.php @@ -84,24 +84,24 @@ public function setMpgId(string $mpgId): static return $this; } - public function getClientCertificate(): ?string + public function getClientCertificate(): string { - return $this->fields['clientCertificate'] ?? null; + return $this->fields['clientCertificate']; } - public function setClientCertificate(null|string $clientCertificate): static + public function setClientCertificate(string $clientCertificate): static { $this->fields['clientCertificate'] = $clientCertificate; return $this; } - public function getPrivateKey(): ?string + public function getPrivateKey(): string { - return $this->fields['privateKey'] ?? null; + return $this->fields['privateKey']; } - public function setPrivateKey(null|string $privateKey): static + public function setPrivateKey(string $privateKey): static { $this->fields['privateKey'] = $privateKey; diff --git a/src/Model/WorldlineAtosFrankfurtSettings.php b/src/Model/WorldlineAtosFrankfurtSettings.php index 612c956bd..fb26bb880 100644 --- a/src/Model/WorldlineAtosFrankfurtSettings.php +++ b/src/Model/WorldlineAtosFrankfurtSettings.php @@ -37,9 +37,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('terminalIds', $data)) { $this->setTerminalIds($data['terminalIds']); } - if (array_key_exists('useMtls', $data)) { - $this->setUseMtls($data['useMtls']); - } $this->setMetadata($metadata); } @@ -96,18 +93,6 @@ public function setTerminalIds(null|string $terminalIds): static return $this; } - public function getUseMtls(): ?bool - { - return $this->fields['useMtls'] ?? null; - } - - public function setUseMtls(null|bool $useMtls): static - { - $this->fields['useMtls'] = $useMtls; - - return $this; - } - public function jsonSerialize(): array { $data = []; @@ -123,9 +108,6 @@ public function jsonSerialize(): array if (array_key_exists('terminalIds', $this->fields)) { $data['terminalIds'] = $this->fields['terminalIds']; } - if (array_key_exists('useMtls', $this->fields)) { - $data['useMtls'] = $this->fields['useMtls']; - } return $data; } diff --git a/src/Service.php b/src/Service.php index ec44f5ffb..5175ba5cb 100644 --- a/src/Service.php +++ b/src/Service.php @@ -20,8 +20,6 @@ class Service { private Client $client; - private Api\AccountRegistrationSettingsApi $accountRegistrationSettings; - private Api\AmlChecksApi $amlChecks; private Api\AmlSettingsApi $amlSettings; @@ -74,6 +72,8 @@ class Service private Api\PurchaseApi $purchase; + private Api\ReleaseFlagsApi $releaseFlags; + private Api\SearchApi $search; private Api\ShippingRatesApi $shippingRates; @@ -82,6 +82,8 @@ class Service private Api\OrderPausesApi $orderPauses; + private Api\OrderChangesApi $orderChanges; + private Api\OrderCancellationsApi $orderCancellations; private Api\OrderReactivationsApi $orderReactivations; @@ -122,8 +124,6 @@ class Service private Api\DepositStrategiesApi $depositStrategies; - private Api\DepositCustomPropertySetsApi $depositCustomPropertySets; - private Api\CheckoutFormsApi $checkoutForms; private Api\ServiceCredentialsApi $serviceCredentials; @@ -158,8 +158,18 @@ class Service private Api\PayoutRequestsApi $payoutRequests; + private Api\PayoutRequestSplitsApi $payoutRequestSplits; + + private Api\PayoutRequestAutoAllocationsApi $payoutRequestAutoAllocations; + private Api\PayoutRequestAllocationsApi $payoutRequestAllocations; + private Api\PayoutRequestAllocationOperationsApi $payoutRequestAllocationOperations; + + private Api\PayoutRequestBatchOperationsApi $payoutRequestBatchOperations; + + private Api\PayoutRequestBatchPreviewsApi $payoutRequestBatchPreviews; + private Api\PayoutRequestBatchesApi $payoutRequestBatches; private Api\ProfileApi $profile; @@ -178,6 +188,8 @@ class Service private Api\WebhooksApi $webhooks; + private Api\WebhookEventsApi $webhookEvents; + private Api\WebsitesApi $websites; private Api\DataExportsApi $dataExports; @@ -197,7 +209,6 @@ class Service public function __construct(?Client $client = null, array $config = []) { $this->client = $client ?? new Client($config); - $this->accountRegistrationSettings = new Api\AccountRegistrationSettingsApi($this->client); $this->amlChecks = new Api\AmlChecksApi($this->client); $this->amlSettings = new Api\AmlSettingsApi($this->client); $this->files = new Api\FilesApi($this->client); @@ -224,10 +235,12 @@ public function __construct(?Client $client = null, array $config = []) $this->products = new Api\ProductsApi($this->client); $this->quotes = new Api\QuotesApi($this->client); $this->purchase = new Api\PurchaseApi($this->client); + $this->releaseFlags = new Api\ReleaseFlagsApi($this->client); $this->search = new Api\SearchApi($this->client); $this->shippingRates = new Api\ShippingRatesApi($this->client); $this->orders = new Api\OrdersApi($this->client); $this->orderPauses = new Api\OrderPausesApi($this->client); + $this->orderChanges = new Api\OrderChangesApi($this->client); $this->orderCancellations = new Api\OrderCancellationsApi($this->client); $this->orderReactivations = new Api\OrderReactivationsApi($this->client); $this->subscriptions = new Api\SubscriptionsApi($this->client); @@ -248,7 +261,6 @@ public function __construct(?Client $client = null, array $config = []) $this->depositRequests = new Api\DepositRequestsApi($this->client); $this->cashiers = new Api\CashiersApi($this->client); $this->depositStrategies = new Api\DepositStrategiesApi($this->client); - $this->depositCustomPropertySets = new Api\DepositCustomPropertySetsApi($this->client); $this->checkoutForms = new Api\CheckoutFormsApi($this->client); $this->serviceCredentials = new Api\ServiceCredentialsApi($this->client); $this->customDomains = new Api\CustomDomainsApi($this->client); @@ -266,7 +278,12 @@ public function __construct(?Client $client = null, array $config = []) $this->paymentCardsBankNames = new Api\PaymentCardsBankNamesApi($this->client); $this->paymentMethods = new Api\PaymentMethodsApi($this->client); $this->payoutRequests = new Api\PayoutRequestsApi($this->client); + $this->payoutRequestSplits = new Api\PayoutRequestSplitsApi($this->client); + $this->payoutRequestAutoAllocations = new Api\PayoutRequestAutoAllocationsApi($this->client); $this->payoutRequestAllocations = new Api\PayoutRequestAllocationsApi($this->client); + $this->payoutRequestAllocationOperations = new Api\PayoutRequestAllocationOperationsApi($this->client); + $this->payoutRequestBatchOperations = new Api\PayoutRequestBatchOperationsApi($this->client); + $this->payoutRequestBatchPreviews = new Api\PayoutRequestBatchPreviewsApi($this->client); $this->payoutRequestBatches = new Api\PayoutRequestBatchesApi($this->client); $this->profile = new Api\ProfileApi($this->client); $this->previews = new Api\PreviewsApi($this->client); @@ -276,6 +293,7 @@ public function __construct(?Client $client = null, array $config = []) $this->tracking = new Api\TrackingApi($this->client); $this->users = new Api\UsersApi($this->client); $this->webhooks = new Api\WebhooksApi($this->client); + $this->webhookEvents = new Api\WebhookEventsApi($this->client); $this->websites = new Api\WebsitesApi($this->client); $this->dataExports = new Api\DataExportsApi($this->client); $this->organizationExports = new Api\OrganizationExportsApi($this->client); @@ -291,11 +309,6 @@ public function getClient(): Client return $this->client; } - public function accountRegistrationSettings(): Api\AccountRegistrationSettingsApi - { - return $this->accountRegistrationSettings; - } - public function amlChecks(): Api\AmlChecksApi { return $this->amlChecks; @@ -426,6 +439,11 @@ public function purchase(): Api\PurchaseApi return $this->purchase; } + public function releaseFlags(): Api\ReleaseFlagsApi + { + return $this->releaseFlags; + } + public function search(): Api\SearchApi { return $this->search; @@ -446,6 +464,11 @@ public function orderPauses(): Api\OrderPausesApi return $this->orderPauses; } + public function orderChanges(): Api\OrderChangesApi + { + return $this->orderChanges; + } + public function orderCancellations(): Api\OrderCancellationsApi { return $this->orderCancellations; @@ -546,11 +569,6 @@ public function depositStrategies(): Api\DepositStrategiesApi return $this->depositStrategies; } - public function depositCustomPropertySets(): Api\DepositCustomPropertySetsApi - { - return $this->depositCustomPropertySets; - } - public function checkoutForms(): Api\CheckoutFormsApi { return $this->checkoutForms; @@ -636,11 +654,36 @@ public function payoutRequests(): Api\PayoutRequestsApi return $this->payoutRequests; } + public function payoutRequestSplits(): Api\PayoutRequestSplitsApi + { + return $this->payoutRequestSplits; + } + + public function payoutRequestAutoAllocations(): Api\PayoutRequestAutoAllocationsApi + { + return $this->payoutRequestAutoAllocations; + } + public function payoutRequestAllocations(): Api\PayoutRequestAllocationsApi { return $this->payoutRequestAllocations; } + public function payoutRequestAllocationOperations(): Api\PayoutRequestAllocationOperationsApi + { + return $this->payoutRequestAllocationOperations; + } + + public function payoutRequestBatchOperations(): Api\PayoutRequestBatchOperationsApi + { + return $this->payoutRequestBatchOperations; + } + + public function payoutRequestBatchPreviews(): Api\PayoutRequestBatchPreviewsApi + { + return $this->payoutRequestBatchPreviews; + } + public function payoutRequestBatches(): Api\PayoutRequestBatchesApi { return $this->payoutRequestBatches; @@ -686,6 +729,11 @@ public function webhooks(): Api\WebhooksApi return $this->webhooks; } + public function webhookEvents(): Api\WebhookEventsApi + { + return $this->webhookEvents; + } + public function websites(): Api\WebsitesApi { return $this->websites;