├── .github └── CODEOWNERS ├── .gitignore ├── .redocly.yaml ├── LICENSE ├── README.md ├── openapi ├── code_samples │ ├── PHP │ │ ├── attachments │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── attachments@{id} │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── authentication-options │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── authentication-tokens │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── authentication-tokens@{token} │ │ │ ├── delete.php │ │ │ └── get.php │ │ ├── bank-accounts │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── bank-accounts@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── bank-accounts@{id}@deactivation │ │ │ └── post.php │ │ ├── blacklists │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── blacklists@{id} │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── contacts │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── contacts@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── coupons-redemptions │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── coupons-redemptions@{id} │ │ │ └── get.php │ │ ├── coupons-redemptions@{id}@cancel │ │ │ └── post.php │ │ ├── coupons │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── coupons@{redemptionCode} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── credentials │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── credentials@{id} │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── custom-fields@{resource} │ │ │ └── get.php │ │ ├── custom-fields@{resource}@{name} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── customers │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── customers@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── customers@{id}@lead-source │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── disputes │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── disputes@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── files │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── files@{id} │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── invoices │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── invoices@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── invoices@{id}@abandon │ │ │ └── post.php │ │ ├── invoices@{id}@issue │ │ │ └── post.php │ │ ├── invoices@{id}@items │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── invoices@{id}@void │ │ │ └── post.php │ │ ├── payment-cards │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── payment-cards@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── payment-cards@{id}@authorization │ │ │ └── post.php │ │ ├── payment-cards@{id}@deactivation │ │ │ └── post.php │ │ ├── payments │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── payments@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── paypal-accounts │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── paypal-accounts@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── paypal-accounts@{id}@activation │ │ │ └── post.php │ │ ├── paypal-accounts@{id}@deactivation │ │ │ └── post.php │ │ ├── plans │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── plans@{id} │ │ │ ├── delete.php │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── subscription-cancellations │ │ │ └── post.php │ │ ├── subscriptions │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── subscriptions@{id} │ │ │ ├── get.php │ │ │ └── put.php │ │ ├── subscriptions@{id}@change-plan │ │ │ └── post.php │ │ ├── tokens │ │ │ ├── get.php │ │ │ └── post.php │ │ ├── tokens@{token} │ │ │ └── get.php │ │ ├── transactions │ │ │ └── get.php │ │ ├── transactions@{id} │ │ │ └── get.php │ │ ├── transactions@{id}@cancel │ │ │ └── post.php │ │ └── transactions@{id}@refund │ │ │ └── post.php │ └── README.md ├── components │ ├── README.md │ ├── headers │ │ ├── Pagination-Limit.yaml │ │ ├── Pagination-Offset.yaml │ │ ├── Pagination-Total.yaml │ │ ├── Rate-Limit-Limit.yaml │ │ ├── Rate-Limit-Remaining.yaml │ │ └── Rate-Limit-Reset.yaml │ ├── parameters │ │ ├── collectionExpand.yaml │ │ ├── collectionFields.yaml │ │ ├── collectionFilter.yaml │ │ ├── collectionLimit.yaml │ │ ├── collectionOffset.yaml │ │ ├── collectionQuery.yaml │ │ ├── collectionSort.yaml │ │ ├── customFieldResource.yaml │ │ ├── customerId.yaml │ │ ├── hash.yaml │ │ ├── mediaType.yaml │ │ ├── organizationId.yaml │ │ ├── resourceId.yaml │ │ ├── subscriptionExpand.yaml │ │ └── tag.yaml │ ├── requestBodies │ │ ├── Attachment.yaml │ │ ├── BankAccount.yaml │ │ ├── Blacklist.yaml │ │ ├── Contact.yaml │ │ ├── Coupon.yaml │ │ ├── Credential.yaml │ │ ├── Customer.yaml │ │ ├── Dispute.yaml │ │ ├── Invoice.yaml │ │ ├── Payment.yaml │ │ ├── Plan.yaml │ │ ├── Product.yaml │ │ ├── Subscription.yaml │ │ ├── SubscriptionCancellation.yaml │ │ ├── Tag.yaml │ │ └── TransactionRequest.yaml │ ├── responses │ │ ├── AccessForbidden.yaml │ │ ├── Conflict.yaml │ │ ├── Customer.yaml │ │ ├── Found.yaml │ │ ├── InvalidDataError.yaml │ │ └── NotFound.yaml │ ├── schemas │ │ ├── Attachment.yaml │ │ ├── BankAccounts │ │ │ ├── AccountNumberTypes │ │ │ │ ├── BBANType.yaml │ │ │ │ └── IBANType.yaml │ │ │ ├── BankAccount.yaml │ │ │ ├── BankAccountCreatePlain.yaml │ │ │ └── BankAccountCreateToken.yaml │ │ ├── Blacklist.yaml │ │ ├── Contact.yaml │ │ ├── Contact │ │ │ ├── ContactEmails.yaml │ │ │ ├── ContactObject.yaml │ │ │ └── ContactPhoneNumbers.yaml │ │ ├── Coupon │ │ │ ├── Coupon.yaml │ │ │ ├── CouponExpiration.yaml │ │ │ ├── CouponRedemption.yaml │ │ │ ├── CouponRestriction.yaml │ │ │ ├── CouponRestrictions │ │ │ │ ├── discounts-per-redemption.yaml │ │ │ │ ├── minimum-order-amount.yaml │ │ │ │ ├── paid-by-time.yaml │ │ │ │ ├── redemptions-per-customer.yaml │ │ │ │ ├── restrict-to-invoices.yaml │ │ │ │ ├── restrict-to-plans.yaml │ │ │ │ ├── restrict-to-products.yaml │ │ │ │ ├── restrict-to-subscriptions.yaml │ │ │ │ └── total-redemptions.yaml │ │ │ ├── Discount.yaml │ │ │ ├── Discounts │ │ │ │ ├── fixed.yaml │ │ │ │ └── percent.yaml │ │ │ ├── InvoiceDiscount.yaml │ │ │ └── RedemptionRestriction.yaml │ │ ├── Credential.yaml │ │ ├── CurrencyCode.yaml │ │ ├── CustomField.yaml │ │ ├── Customer.yaml │ │ ├── CustomerAuthentication │ │ │ ├── AuthenticationOptions.yaml │ │ │ ├── AuthenticationToken.yaml │ │ │ ├── AuthenticationTokenMetadata.yaml │ │ │ ├── CustomerJWT.yaml │ │ │ └── TokenModes │ │ │ │ ├── password.yaml │ │ │ │ └── passwordless.yaml │ │ ├── CustomerAverageValue.yaml │ │ ├── CustomerLifetimeRevenue.yaml │ │ ├── Dispute.yaml │ │ ├── Embeds │ │ │ ├── AuthTransactionEmbed.yaml │ │ │ ├── BankAccountEmbed.yaml │ │ │ ├── CustomerEmbed.yaml │ │ │ ├── FileEmbed.yaml │ │ │ ├── GatewayAccountEmbed.yaml │ │ │ ├── InitialInvoiceEmbed.yaml │ │ │ ├── InvoicesEmbed.yaml │ │ │ ├── LeadSourceEmbed.yaml │ │ │ ├── OrganizationEmbed.yaml │ │ │ ├── ParentTransactionEmbed.yaml │ │ │ ├── PaymentCardEmbed.yaml │ │ │ ├── PlanEmbed.yaml │ │ │ ├── ProductEmbed.yaml │ │ │ ├── RecentInvoiceEmbed.yaml │ │ │ ├── RetriedTransactionEmbed.yaml │ │ │ ├── SubscriptionEmbed.yaml │ │ │ ├── TransactionEmbed.yaml │ │ │ └── WebsiteEmbed.yaml │ │ ├── Error.yaml │ │ ├── EventType.yaml │ │ ├── Files │ │ │ ├── File.yaml │ │ │ ├── FileCreateFromInline.yaml │ │ │ └── FileCreateFromUrl.yaml │ │ ├── InvalidError.yaml │ │ ├── Invoices │ │ │ ├── Invoice.yaml │ │ │ ├── InvoiceIssue.yaml │ │ │ ├── InvoiceItem.yaml │ │ │ ├── InvoiceReissue.yaml │ │ │ ├── InvoiceTax.yaml │ │ │ ├── InvoiceTimeShift.yaml │ │ │ └── InvoiceTransactionAllocation.yaml │ │ ├── KycDocument │ │ │ ├── KycDocument.yaml │ │ │ ├── KycDocumentMatches.yaml │ │ │ └── KycDocumentRejection.yaml │ │ ├── LeadSource.yaml │ │ ├── LeadSourceData.yaml │ │ ├── Links │ │ │ ├── ApprovalUrlLink.yaml │ │ │ ├── AttachmentResourceLink.yaml │ │ │ ├── AuthTransactionLink.yaml │ │ │ ├── CancelUrlLink.yaml │ │ │ ├── CustomerLink.yaml │ │ │ ├── DefaultPaymentInstrumentLink.yaml │ │ │ ├── DisputeLink.yaml │ │ │ ├── FileDownloadLink.yaml │ │ │ ├── FileLink.yaml │ │ │ ├── GatewayAccountLink.yaml │ │ │ ├── InitialInvoiceLink.yaml │ │ │ ├── InvoiceLink.yaml │ │ │ ├── InvoicesLink.yaml │ │ │ ├── LeadSourceLink.yaml │ │ │ ├── Link.yaml │ │ │ ├── OrganizationLink.yaml │ │ │ ├── ParentTransactionLink.yaml │ │ │ ├── PaymentCardLink.yaml │ │ │ ├── PermalinkLink.yaml │ │ │ ├── PlanLink.yaml │ │ │ ├── ProductLink.yaml │ │ │ ├── RecalculateInvoiceLink.yaml │ │ │ ├── RecentInvoiceLink.yaml │ │ │ ├── RefundUrlLink.yaml │ │ │ ├── RetriedTransactionLink.yaml │ │ │ ├── SelfLink.yaml │ │ │ ├── SignedLinkLink.yaml │ │ │ ├── SubscriptionLink.yaml │ │ │ ├── TransactionAllocationsLink.yaml │ │ │ ├── TransactionLink.yaml │ │ │ └── WebsiteLink.yaml │ │ ├── Method.yaml │ │ ├── PayPalAccount.yaml │ │ ├── Payment.yaml │ │ ├── PaymentCards │ │ │ ├── PaymentCard.yaml │ │ │ ├── PaymentCardCreatePlain.yaml │ │ │ └── PaymentCardCreateToken.yaml │ │ ├── PaymentInstrument.yaml │ │ ├── PaymentInstrumentValidation.yaml │ │ ├── PaymentInstruments │ │ │ ├── AlipayInstrument.yaml │ │ │ ├── AstroPay-CardInstrument.yaml │ │ │ ├── BoletoInstrument.yaml │ │ │ ├── China-UnionPayInstrument.yaml │ │ │ ├── EPSInstrument.yaml │ │ │ ├── FlexepinInstrument.yaml │ │ │ ├── KlarnaInstrument.yaml │ │ │ ├── PayPalAccountAuthorization.yaml │ │ │ ├── QQPayInstrument.yaml │ │ │ ├── SMSVoucherInstrument.yaml │ │ │ ├── Skrill-Rapid-TransferInstrument.yaml │ │ │ ├── UPayCardInstrument.yaml │ │ │ ├── WeChat-PayInstrument.yaml │ │ │ ├── achInstrument.yaml │ │ │ ├── bank-accountInstrument.yaml │ │ │ ├── bitcoinInstrument.yaml │ │ │ ├── cashInstrument.yaml │ │ │ ├── checkInstrument.yaml │ │ │ ├── ePay-bgInstrument.yaml │ │ │ ├── iDEALInstrument.yaml │ │ │ ├── payment-cardInstrument.yaml │ │ │ └── paypalInstrument.yaml │ │ ├── PaymentRetry │ │ │ ├── AmountAdjustment.yaml │ │ │ ├── PaymentRetry.yaml │ │ │ └── Policies │ │ │ │ ├── discount.yaml │ │ │ │ └── partial.yaml │ │ ├── PaymentTokens │ │ │ ├── BankAccountToken.yaml │ │ │ ├── PaymentCardToken.yaml │ │ │ ├── PaymentInstruments │ │ │ │ ├── BBANInstrument.yaml │ │ │ │ └── IBANInstrument.yaml │ │ │ ├── PaymentToken.yaml │ │ │ ├── TokenBankAccountInstrument.yaml │ │ │ ├── TokenMethod.yaml │ │ │ └── TokenPaymentCardInstrument.yaml │ │ ├── Plans │ │ │ ├── Formulas │ │ │ │ ├── fixed-fee.yaml │ │ │ │ ├── flat-rate.yaml │ │ │ │ ├── stairstep.yaml │ │ │ │ ├── tiered.yaml │ │ │ │ └── volume.yaml │ │ │ ├── Plan.yaml │ │ │ ├── PlanBillingTiming.yaml │ │ │ ├── PlanPeriod.yaml │ │ │ └── PlanPriceFormula.yaml │ │ ├── PriceBasedShippingRate.yaml │ │ ├── Product.yaml │ │ ├── ResetPasswordToken.yaml │ │ ├── ResourceCustomFields.yaml │ │ ├── ResourceId.yaml │ │ ├── RiskMetadata.yaml │ │ ├── Rules │ │ │ └── MatchedRule.yaml │ │ ├── Scheduling │ │ │ ├── CommonScheduleInstruction.yaml │ │ │ ├── CustomEventScheduleInstruction.yaml │ │ │ ├── DueTimeShiftInstruction.yaml │ │ │ ├── InvoiceRetryScheduleInstruction.yaml │ │ │ ├── IssueTimeShiftInstruction.yaml │ │ │ ├── Methods │ │ │ │ ├── auto.yaml │ │ │ │ ├── date-interval.yaml │ │ │ │ ├── day-of-month.yaml │ │ │ │ ├── day-of-week.yaml │ │ │ │ ├── immediately.yaml │ │ │ │ └── intelligent.yaml │ │ │ ├── README.md │ │ │ └── ServicePeriodAnchorInstruction.yaml │ │ ├── Search.yaml │ │ ├── ServerTimestamp.yaml │ │ ├── ShippingZone.yaml │ │ ├── Subscription.yaml │ │ ├── Subscription │ │ │ ├── OrderTypes │ │ │ │ ├── one-time-order.yaml │ │ │ │ └── subscription-order.yaml │ │ │ ├── SubscriptionCancellation.yaml │ │ │ ├── SubscriptionCancellationState.yaml │ │ │ ├── SubscriptionMetadata.yaml │ │ │ ├── SubscriptionReactivation.yaml │ │ │ ├── UpcomingInvoiceItem.yaml │ │ │ └── UpcomingInvoiceItemCollection.yaml │ │ ├── SubscriptionChange.yaml │ │ ├── SubscriptionInvoice.yaml │ │ ├── Tags │ │ │ └── Tag.yaml │ │ ├── ThreeDSecure.yaml │ │ ├── Timelines │ │ │ ├── Actions │ │ │ │ ├── redemption-cancel.yaml │ │ │ │ └── resend-email.yaml │ │ │ ├── CustomerTimeline.yaml │ │ │ ├── CustomerTimelineCustomEvent.yaml │ │ │ ├── InvoiceTimeline.yaml │ │ │ ├── OrderTimeline.yaml │ │ │ ├── TimelineAction.yaml │ │ │ ├── TimelineExtraData.yaml │ │ │ ├── TimelineTable.yaml │ │ │ ├── TransactionTimeline.yaml │ │ │ ├── three-columns.yaml │ │ │ └── two-columns.yaml │ │ ├── TransactionGatewayLog.yaml │ │ ├── TransactionRefund.yaml │ │ └── Transactions │ │ │ ├── ThreeDSecureResult.yaml │ │ │ ├── Transaction.yaml │ │ │ ├── TransactionNotificationUrl.yaml │ │ │ ├── TransactionRedirectUrl.yaml │ │ │ └── TransactionRequest.yaml │ └── securitySchemes │ │ ├── JWT.yaml │ │ ├── PublishableApiKey.yaml │ │ └── SecretApiKey.yaml ├── description.md ├── openapi.yaml ├── paths │ ├── 3dsecure.yaml │ ├── 3dsecure@{id}.yaml │ ├── README.md │ ├── attachments.yaml │ ├── attachments@{id}.yaml │ ├── authentication-options.yaml │ ├── authentication-tokens.yaml │ ├── authentication-tokens@{token}.yaml │ ├── authentication-tokens@{token}@exchange.yaml │ ├── bank-accounts.yaml │ ├── bank-accounts@{id}.yaml │ ├── bank-accounts@{id}@deactivation.yaml │ ├── blacklists.yaml │ ├── blacklists@{id}.yaml │ ├── contacts.yaml │ ├── contacts@{id}.yaml │ ├── coupons-redemptions.yaml │ ├── coupons-redemptions@{id}.yaml │ ├── coupons-redemptions@{id}@cancel.yaml │ ├── coupons.yaml │ ├── coupons@{redemptionCode}.yaml │ ├── coupons@{redemptionCode}@expiration.yaml │ ├── credentials.yaml │ ├── credentials@{id}.yaml │ ├── custom-fields@{resource}.yaml │ ├── custom-fields@{resource}@{name}.yaml │ ├── customer-timeline-custom-events.yaml │ ├── customer-timeline-custom-events@{id}.yaml │ ├── customer-timeline-events.yaml │ ├── customers.yaml │ ├── customers@{id}.yaml │ ├── customers@{id}@lead-source.yaml │ ├── customers@{id}@timeline.yaml │ ├── customers@{id}@timeline@{messageId}.yaml │ ├── customers@{id}@upcoming-invoices.yaml │ ├── disputes.yaml │ ├── disputes@{id}.yaml │ ├── disputes@{id}@matched-rules.yaml │ ├── files.yaml │ ├── files@{id}.yaml │ ├── files@{id}@download.yaml │ ├── files@{id}@download{extension}.yaml │ ├── invoices.yaml │ ├── invoices@{id}.yaml │ ├── invoices@{id}@abandon.yaml │ ├── invoices@{id}@issue.yaml │ ├── invoices@{id}@items.yaml │ ├── invoices@{id}@matched-rules.yaml │ ├── invoices@{id}@recalculate.yaml │ ├── invoices@{id}@reissue.yaml │ ├── invoices@{id}@timeline.yaml │ ├── invoices@{id}@timeline@{messageId}.yaml │ ├── invoices@{id}@transaction-allocations.yaml │ ├── invoices@{id}@void.yaml │ ├── kyc-documents.yaml │ ├── kyc-documents@{id}.yaml │ ├── kyc-documents@{id}@acceptance.yaml │ ├── kyc-documents@{id}@rejection.yaml │ ├── kyc-documents@{id}@review.yaml │ ├── password-tokens.yaml │ ├── password-tokens@{id}.yaml │ ├── payment-cards.yaml │ ├── payment-cards@{id}.yaml │ ├── payment-cards@{id}@authorization.yaml │ ├── payment-cards@{id}@deactivation.yaml │ ├── payment-cards@{id}@matched-rules.yaml │ ├── payment-instrument-validation.yaml │ ├── payment-instrument-validation@{id}.yaml │ ├── payments.yaml │ ├── payments@{id}.yaml │ ├── paypal-accounts.yaml │ ├── paypal-accounts@{id}.yaml │ ├── paypal-accounts@{id}@activation.yaml │ ├── paypal-accounts@{id}@deactivation.yaml │ ├── plans.yaml │ ├── plans@{id}.yaml │ ├── products.yaml │ ├── products@{id}.yaml │ ├── search.yaml │ ├── shipping-zones.yaml │ ├── shipping-zones@{id}.yaml │ ├── subscription-cancellations.yaml │ ├── subscription-cancellations@{id}.yaml │ ├── subscription-reactivations.yaml │ ├── subscription-reactivations@{id}.yaml │ ├── subscriptions.yaml │ ├── subscriptions@{id}.yaml │ ├── subscriptions@{id}@change-plan.yaml │ ├── subscriptions@{id}@interim-invoice.yaml │ ├── subscriptions@{id}@matched-rules.yaml │ ├── subscriptions@{id}@timeline.yaml │ ├── subscriptions@{id}@timeline@{messageId}.yaml │ ├── subscriptions@{id}@upcoming-invoices.yaml │ ├── subscriptions@{id}@upcoming-invoices@{invoiceId}@issue.yaml │ ├── tags.yaml │ ├── tags@{tag}.yaml │ ├── tags@{tag}@customers.yaml │ ├── tags@{tag}@customers@{customerId}.yaml │ ├── tokens.yaml │ ├── tokens@{token}.yaml │ ├── transactions.yaml │ ├── transactions@{id}.yaml │ ├── transactions@{id}@cancel.yaml │ ├── transactions@{id}@gateway-logs.yaml │ ├── transactions@{id}@matched-rules.yaml │ ├── transactions@{id}@refund.yaml │ ├── transactions@{id}@timeline.yaml │ └── transactions@{id}@timeline@{messageId}.yaml └── plugins │ ├── README.md │ ├── x-rebillyMerge.js │ └── x-sortableEnum.js ├── package.json ├── transformers ├── index.js ├── xRebillyMerge.js └── xSortableEnum.js ├── web ├── apple-touch-icon-163dpi.png ├── apple-touch-icon-326dpi.png ├── favicon.ico ├── favicon.png ├── index.html └── rb_apiLogo.svg └── yarn.lock /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code Owners settings 2 | # See: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners 3 | 4 | # These owners will be the default owners for everything in the repo. 5 | * @Rebilly/js @Rebilly/php 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dir for API portal deploy 2 | web_deploy 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | node_modules 28 | 29 | # Optional npm cache directory 30 | .npm 31 | 32 | # Optional REPL history 33 | .node_repl_history 34 | 35 | # npm 36 | package-lock.json 37 | 38 | # OpenAPI output bundles folder 39 | dist 40 | -------------------------------------------------------------------------------- /.redocly.yaml: -------------------------------------------------------------------------------- 1 | apiDefinitions: 2 | main: openapi/openapi.yaml 3 | lint: 4 | rules: 5 | no-unused-schemas: warning 6 | transformers: ./transformers/index.js 7 | referenceDocs: 8 | showConsole: true 9 | layout: 10 | scope: section 11 | theme: 12 | logo: 13 | gutter: 20px 30px 14px 30px 14 | colors: 15 | text: 16 | primary: '#333333' 17 | typography: 18 | headings: 19 | fontFamily: Roboto 20 | fontFamily: 'Roboto, Verdana, Geneva, sans-serif' 21 | fontSize: 14px 22 | code: 23 | fontFamily: '"Courier New",monospace' 24 | tokens: 25 | token.property: 26 | color: '#aofbaa' 27 | string: 28 | color: '#aofbaa' 29 | rightPanelHeading: 30 | color: white 31 | rightPanel: 32 | backgroundColor: '#263238' 33 | links: 34 | color: '#6CC496' 35 | htmlTemplate: ./web/index.html 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Rebilly SRL 2 | Rebilly API specification is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License. 3 | To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/4.0/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Moved 2 | 3 | This has moved to part of the monorepo: 4 | 5 | https://github.com/Rebilly/api-definitions 6 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/attachments/get.php: -------------------------------------------------------------------------------- 1 | $attachments = $client->attachments()->search([ 2 | 'filter' => 'relatedType:customer', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/attachments/post.php: -------------------------------------------------------------------------------- 1 | $attachmentForm = new Rebilly\Entities\Attachment(); 2 | $attachmentForm->setFileId('fileId'); 3 | $attachmentForm->setRelatedType($attachmentForm::TYPE_CUSTOMER); 4 | $attachmentForm->setRelatedId('customerId'); 5 | 6 | try { 7 | $attachment = $client->attachments()->create($attachmentForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/attachments@{id}/delete.php: -------------------------------------------------------------------------------- 1 | $client->attachments()->delete('attachmentId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/attachments@{id}/get.php: -------------------------------------------------------------------------------- 1 | $attachment = $client->attachments()->load('attachmentId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/attachments@{id}/put.php: -------------------------------------------------------------------------------- 1 | $attachmentForm = new Rebilly\Entities\Attachment(); 2 | $attachmentForm->setFileId('fileId'); 3 | $attachmentForm->setRelatedType($attachmentForm::TYPE_CUSTOMER); 4 | $attachmentForm->setRelatedId('customerId'); 5 | 6 | try { 7 | $attachment = $client->attachments()->update('attachmentId', $attachmentForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-options/get.php: -------------------------------------------------------------------------------- 1 | $authenticationOptions = $client->authenticationOptions()->load(); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-options/put.php: -------------------------------------------------------------------------------- 1 | $authenticationOptionsForm = new Rebilly\Entities\AuthenticationOptions(); 2 | // Regular expression below matches any password with 6+ length that contains alphabet symbols and/or numbers. 3 | $authenticationOptionsForm->setPasswordPattern('/^[a-zA-Z0-9]{6,}$/'); 4 | 5 | try { 6 | $authenticationOptions = $client->authenticationOptions()->update($authenticationOptionsForm); 7 | } catch (UnprocessableEntityException $e) { 8 | echo $e->getMessage(); 9 | } 10 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-tokens/get.php: -------------------------------------------------------------------------------- 1 | $authenticationTokens = $client->authenticationTokens()->search([ 2 | 'filter' => 'customerId:testCustomer', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-tokens/post.php: -------------------------------------------------------------------------------- 1 | $authenticationForm = new Rebilly\Entities\AuthenticationToken(); 2 | $authenticationForm->setUsername('username'); 3 | $authenticationForm->setPassword('test123'); 4 | 5 | try { 6 | $authenticationToken = $client->authenticationTokens()->login($authenticationForm); 7 | } catch (UnprocessableEntityException $e) { 8 | echo $e->getMessage(); 9 | } 10 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-tokens@{token}/delete.php: -------------------------------------------------------------------------------- 1 | $client->authenticationTokens()->logout('token'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/authentication-tokens@{token}/get.php: -------------------------------------------------------------------------------- 1 | $isVerified = $client->authenticationTokens()->verify('token'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/bank-accounts/get.php: -------------------------------------------------------------------------------- 1 | $bankAccounts = $client->bankAccounts()->search([ 2 | 'filter' => 'customerId:testId', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/bank-accounts/post.php: -------------------------------------------------------------------------------- 1 | $bankAccountForm = new Rebilly\Entities\BankAccount(); 2 | $bankAccountForm->setCustomerId('customerId'); 3 | $bankAccountForm->setRoutingNumber('0123456'); 4 | $bankAccountForm->setAccountNumber('0123456'); 5 | $bankAccountForm->setAccountType('checking'); 6 | $bankAccountForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $bankAccount = $client->bankAccounts()->create($bankAccountForm); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/bank-accounts@{id}/get.php: -------------------------------------------------------------------------------- 1 | $bankAccount = $client->bankAccounts()->load('bankAccountId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/bank-accounts@{id}/put.php: -------------------------------------------------------------------------------- 1 | $bankAccountForm = new Rebilly\Entities\BankAccount(); 2 | $bankAccountForm->setCustomerId('customerId'); 3 | $bankAccountForm->setRoutingNumber('0123456'); 4 | $bankAccountForm->setAccountNumber('0123456'); 5 | $bankAccountForm->setAccountType('checking'); 6 | $bankAccountForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $bankAccount = $client->customers()->create($bankAccountForm, 'bankAccountId'); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/bank-accounts@{id}@deactivation/post.php: -------------------------------------------------------------------------------- 1 | $bankAccount = $client->bankAccounts()->deactivate('bankAccountId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/blacklists/get.php: -------------------------------------------------------------------------------- 1 | $blacklists = $client->blacklists()->search([ 2 | 'filter' => 'value:testValue', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/blacklists/post.php: -------------------------------------------------------------------------------- 1 | $blacklistForm = new Rebilly\Entities\Blacklist(); 2 | $blacklistForm->setType($blacklistForm::TYPE_EMAIL); 3 | $blacklistForm->setValue('test@test.com'); 4 | $blacklistForm->setExpiredTime('2025-01-01 05:00:00'); 5 | 6 | try { 7 | $blacklist = $client->blacklists()->create($blacklistForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/blacklists@{id}/delete.php: -------------------------------------------------------------------------------- 1 | $client->blacklists()->delete('blacklistId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/blacklists@{id}/get.php: -------------------------------------------------------------------------------- 1 | $blacklist = $client->blacklists()->load('blacklistId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/blacklists@{id}/put.php: -------------------------------------------------------------------------------- 1 | $blacklistForm = new Rebilly\Entities\Blacklist(); 2 | $blacklistForm->setType($blacklistForm::TYPE_EMAIL); 3 | $blacklistForm->setValue('test@test.com'); 4 | $blacklistForm->setExpiredTime('2025-01-01 05:00:00'); 5 | 6 | try { 7 | $blacklist = $client->blacklists()->create($blacklistForm, 'blacklistId'); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/contacts/get.php: -------------------------------------------------------------------------------- 1 | $contacts = $client->contacts()->search([ 2 | 'filter' => 'firstName:John', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/contacts/post.php: -------------------------------------------------------------------------------- 1 | $contactForm = new Rebilly\Entities\Contact(); 2 | $contactForm->setFirstName('Sherlock'); 3 | $contactForm->setLastName('Holmes'); 4 | $contactForm->setOrganization('TestOrganization'); 5 | $contactForm->setEmails( 6 | [ 7 | [ 8 | 'label' => 'main', 9 | 'value' => 'johndoe@testemail.com', 10 | 'primary' => true, 11 | ], 12 | [ 13 | 'label' => 'secondary', 14 | 'value' => 'otheremail@testemail.com', 15 | ], 16 | ] 17 | ); 18 | $contactForm->setPhoneNumbers( 19 | [ 20 | [ 21 | 'label' => 'work', 22 | 'value' => '+123456789', 23 | 'primary' => true, 24 | ], 25 | [ 26 | 'label' => 'home', 27 | 'value' => '+9874654321', 28 | ], 29 | ] 30 | ); 31 | 32 | try { 33 | $contact = $client->contacts()->create($contactForm); 34 | } catch (UnprocessableEntityException $e) { 35 | echo $e->getMessage(); 36 | } 37 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/contacts@{id}/get.php: -------------------------------------------------------------------------------- 1 | $contact = $client->contacts()->load('contactId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/contacts@{id}/put.php: -------------------------------------------------------------------------------- 1 | $contactForm = new Rebilly\Entities\Contact(); 2 | $contactForm->setFirstName('Sherlock'); 3 | $contactForm->setLastName('Holmes'); 4 | $contactForm->setOrganization('TestOrganization'); 5 | $contactForm->setEmails( 6 | [ 7 | [ 8 | 'label' => 'main', 9 | 'value' => 'johndoe@testemail.com', 10 | 'primary' => true, 11 | ], 12 | [ 13 | 'label' => 'secondary', 14 | 'value' => 'otheremail@testemail.com', 15 | ], 16 | ] 17 | ); 18 | $contactForm->setPhoneNumbers( 19 | [ 20 | [ 21 | 'label' => 'work', 22 | 'value' => '+123456789', 23 | 'primary' => true, 24 | ], 25 | [ 26 | 'label' => 'home', 27 | 'value' => '+9874654321', 28 | ], 29 | ] 30 | ); 31 | 32 | try { 33 | $contact = $client->contacts()->update('contactId', $contactForm); 34 | } catch (UnprocessableEntityException $e) { 35 | echo $e->getMessage(); 36 | } 37 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons-redemptions/get.php: -------------------------------------------------------------------------------- 1 | $couponRedemptions = $client->couponsRedemptions()->search([ 2 | 'filter' => 'customerId:testCustomer', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons-redemptions/post.php: -------------------------------------------------------------------------------- 1 | $redemptionForm = new Rebilly\Entities\Coupons\Redemption(); 2 | $redemptionForm->setCustomerId('customerId'); 3 | $redemptionForm->setRedemptionCode('redemptionCode'); 4 | 5 | $restrictionArray = [ 6 | 'type' => Rebilly\Entities\Coupons\Restriction::TYPE_DISCOUNTS_PER_REDEMPTION, 7 | 'quantity' => 2, 8 | ]; 9 | 10 | $restrictionForm = new Rebilly\Entities\Coupons\Restriction([ 11 | $restrictionArray, 12 | ]); 13 | 14 | $redemptionForm->setAdditionalRestrictions($restrictionForm); 15 | 16 | try { 17 | $couponRedemption = $client->couponsRedemptions()->redeem($redemptionForm); 18 | } catch (UnprocessableEntityException $e) { 19 | echo $e->getMessage(); 20 | } 21 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons-redemptions@{id}/get.php: -------------------------------------------------------------------------------- 1 | $couponRedemption = $client->couponsRedemptions()->load('redemptionCode'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons-redemptions@{id}@cancel/post.php: -------------------------------------------------------------------------------- 1 | $client->couponsRedemptions()->cancel('id'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons/get.php: -------------------------------------------------------------------------------- 1 | $coupons = $client->coupons()->search([ 2 | 'filter' => 'status:issued', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons/post.php: -------------------------------------------------------------------------------- 1 | $couponForm = new Rebilly\Entities\Coupons\Coupon(); 2 | 3 | $discountArray = [ 4 | 'currency' => 'USD', 5 | 'amount' => 1.99, 6 | ]; 7 | 8 | $discountForm = new \Rebilly\Entities\Coupons\Discounts\Fixed($discountArray); 9 | $couponForm->setDiscount($discountForm); 10 | // Coupon can be used right now 11 | $couponForm->setIssuedTime(date('Y-m-d H:i:s')); 12 | 13 | $restrictionArray = [ 14 | 'quantity' => 2, 15 | ]; 16 | 17 | $restrictionForm = new Rebilly\Entities\Coupons\Restrictions\DiscountsPerRedemption($restrictionArray); 18 | 19 | $couponForm->setRestrictions([$restrictionForm]); 20 | 21 | try { 22 | $coupon = $client->coupons()->create($couponForm); 23 | } catch (UnprocessableEntityException $e) { 24 | echo $e->getMessage(); 25 | } 26 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons@{redemptionCode}/get.php: -------------------------------------------------------------------------------- 1 | $coupon = $client->coupons()->load('redemptionCode'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/coupons@{redemptionCode}/put.php: -------------------------------------------------------------------------------- 1 | $couponForm = new Rebilly\Entities\Coupons\Coupon(); 2 | 3 | $discountArray = [ 4 | 'type' => Rebilly\Entities\Coupons\Discount::TYPE_FIXED, 5 | 'currency' => 'USD', 6 | 'amount' => 1.99, 7 | ]; 8 | 9 | $discountForm = new Rebilly\Entities\Coupons\Discount($discountArray); 10 | $couponForm->setDiscount($discountForm); 11 | 12 | $restrictionArray = [ 13 | 'type' => Rebilly\Entities\Coupons\Restriction::TYPE_DISCOUNTS_PER_REDEMPTION, 14 | 'quantity' => 2, 15 | ]; 16 | 17 | $restrictionForm = new Rebilly\Entities\Coupons\Restriction([ 18 | $restrictionArray, 19 | ]); 20 | 21 | $couponForm->setRestrictions($restrictionForm); 22 | 23 | try { 24 | $coupon = $client->coupons()->create($couponForm, 'redemptionCode'); 25 | } catch (UnprocessableEntityException $e) { 26 | echo $e->getMessage(); 27 | } 28 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/credentials/get.php: -------------------------------------------------------------------------------- 1 | $customerCredentials = $client->customerCredentials()->search([ 2 | 'filter' => 'customerId:testCustomer', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/credentials/post.php: -------------------------------------------------------------------------------- 1 | $customerCredentialForm = new Rebilly\Entities\CustomerCredential(); 2 | $customerCredentialForm->setCustomerId('customerId'); 3 | $customerCredentialForm->setUsername('test'); 4 | $customerCredentialForm->setPassword('1234'); 5 | 6 | try { 7 | $customerCredential = $client->customerCredentials()->create($customerCredentialForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/credentials@{id}/delete.php: -------------------------------------------------------------------------------- 1 | $client->customerCredentials()->delete('credentialId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/credentials@{id}/get.php: -------------------------------------------------------------------------------- 1 | $customerCredential = $client->customerCredentials()->load('credentialId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/credentials@{id}/put.php: -------------------------------------------------------------------------------- 1 | $customerCredentialForm = new Rebilly\Entities\CustomerCredential(); 2 | $customerCredentialForm->setCustomerId('customerId'); 3 | $customerCredentialForm->setUsername('test'); 4 | $customerCredentialForm->setPassword('1234'); 5 | 6 | try { 7 | $customerCredential = $client->customerCredentials()->update('credentialId', $customerCredentialForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/custom-fields@{resource}/get.php: -------------------------------------------------------------------------------- 1 | $customFields = $client->customFields()->search('customers', [ 2 | 'filter' => 'type:boolean', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/custom-fields@{resource}@{name}/get.php: -------------------------------------------------------------------------------- 1 | $customField = $client->customFields()->load('customers', 'testFieldName'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/custom-fields@{resource}@{name}/put.php: -------------------------------------------------------------------------------- 1 | $customFieldForm = new Rebilly\Entities\CustomField(); 2 | $customFieldForm->setType($customFieldForm::TYPE_BOOLEAN); 3 | 4 | try { 5 | $customField = $client->customFields()->update('customers', 'testFieldName', $customFieldForm); 6 | } catch (UnprocessableEntityException $e) { 7 | echo $e->getMessage(); 8 | } 9 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers/get.php: -------------------------------------------------------------------------------- 1 | $customers = $client->customers()->search([ 2 | 'filter' => 'firstName:John', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers/post.php: -------------------------------------------------------------------------------- 1 | $customerForm = new Rebilly\Entities\Customer(); 2 | $customerForm->setPrimaryAddress([ 3 | 'firstName' => 'John', 4 | 'lastName' => 'Doe', 5 | 'organization' => 'Test LTD', 6 | 'address' => 'Test street 5', 7 | 'address2' => 'Test house 5', 8 | 'city' => 'New York', 9 | 'region' => 'Long Island', 10 | 'country' => 'US', 11 | 'postalCode' => '123456', 12 | 'emails' => [ 13 | [ 14 | 'label' => 'main', 15 | 'value' => 'johndoe@testemail.com', 16 | 'primary' => true, 17 | ], 18 | [ 19 | 'label' => 'secondary', 20 | 'value' => 'otheremail@testemail.com', 21 | ], 22 | ], 23 | 'phoneNumbers' => [ 24 | [ 25 | 'label' => 'work', 26 | 'value' => '+123456789', 27 | 'primary' => true, 28 | ], 29 | [ 30 | 'label' => 'home', 31 | 'value' => '+9874654321', 32 | ], 33 | ], 34 | ]); 35 | 36 | try { 37 | $customer = $client->customers()->create($customerForm); 38 | } catch (UnprocessableEntityException $e) { 39 | echo $e->getMessage(); 40 | } 41 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers@{id}/get.php: -------------------------------------------------------------------------------- 1 | $customers = $client->customers()->load('myCustomerId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers@{id}/put.php: -------------------------------------------------------------------------------- 1 | $customerForm = new Rebilly\Entities\Customer(); 2 | $customerForm->setPrimaryAddress([ 3 | 'firstName' => 'John', 4 | 'lastName' => 'Doe', 5 | 'organization' => 'Test LTD', 6 | 'address' => 'Test street 5', 7 | 'address2' => 'Test house 5', 8 | 'city' => 'New York', 9 | 'region' => 'Long Island', 10 | 'country' => 'US', 11 | 'postalCode' => '123456', 12 | 'emails' => [ 13 | [ 14 | 'label' => 'main', 15 | 'value' => 'johndoe@testemail.com', 16 | 'primary' => true, 17 | ], 18 | [ 19 | 'label' => 'secondary', 20 | 'value' => 'otheremail@testemail.com', 21 | ], 22 | ], 23 | 'phoneNumbers' => [ 24 | [ 25 | 'label' => 'work', 26 | 'value' => '+123456789', 27 | 'primary' => true, 28 | ], 29 | [ 30 | 'label' => 'home', 31 | 'value' => '+9874654321', 32 | ], 33 | ], 34 | ]); 35 | 36 | try { 37 | $customer = $client->customers()->update('myCustomerId', $customerForm); 38 | } catch (UnprocessableEntityException $e) { 39 | echo $e->getMessage(); 40 | } 41 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers@{id}@lead-source/delete.php: -------------------------------------------------------------------------------- 1 | $customer = $client->customers()->deleteLeadSource('myCustomerId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers@{id}@lead-source/get.php: -------------------------------------------------------------------------------- 1 | $customer = $client->customers()->load('myCustomerId'); 2 | $leadSource = $customer->getLeadSource(); 3 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/customers@{id}@lead-source/put.php: -------------------------------------------------------------------------------- 1 | $leadSourceForm = new Rebilly\Entities\LeadSource(); 2 | $leadSourceForm->setSource('TestSource'); 3 | $leadSourceForm->setCampaign('TestCampaign'); 4 | 5 | try { 6 | $customer = $client->customers()->updateLeadSource('myCustomerId', $leadSourceForm); 7 | } catch (UnprocessableEntityException $e) { 8 | echo $e->getMessage(); 9 | } 10 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/disputes/get.php: -------------------------------------------------------------------------------- 1 | $disputes = $client->disputes()->search([ 2 | 'filter' => 'transactionId:testId', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/disputes/post.php: -------------------------------------------------------------------------------- 1 | $disputeForm = new Rebilly\Entities\Dispute(); 2 | $disputeForm->setTransactionId('transactionId'); 3 | $disputeForm->setCurrency('USD'); 4 | $disputeForm->setAmount(10); 5 | $disputeForm->setReasonCode(1000); 6 | $disputeForm->setType($disputeForm::TYPE_1CB); 7 | $disputeForm->setStatus($disputeForm::STATUS_RESPONSE_NEEDED); 8 | $disputeForm->setPostedTime('2025-01-01 05:00:00'); 9 | 10 | try { 11 | $dispute = $client->disputes()->create($disputeForm); 12 | } catch (UnprocessableEntityException $e) { 13 | echo $e->getMessage(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/disputes@{id}/get.php: -------------------------------------------------------------------------------- 1 | $dispute = $client->disputes()->load('disputeId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/disputes@{id}/put.php: -------------------------------------------------------------------------------- 1 | $disputeForm = new Rebilly\Entities\Dispute(); 2 | $disputeForm->setTransactionId('transactionId'); 3 | $disputeForm->setCurrency('USD'); 4 | $disputeForm->setAmount(10); 5 | $disputeForm->setReasonCode(1000); 6 | $disputeForm->setType($disputeForm::TYPE_1CB); 7 | $disputeForm->setStatus($disputeForm::STATUS_RESPONSE_NEEDED); 8 | $disputeForm->setPostedTime('2025-01-01 05:00:00'); 9 | 10 | try { 11 | $dispute = $client->disputes()->update('disputeId', $dispute); 12 | } catch (UnprocessableEntityException $e) { 13 | echo $e->getMessage(); 14 | } 15 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/files/get.php: -------------------------------------------------------------------------------- 1 | $files = $client->files()->search([ 2 | 'filter' => 'name:TestFile', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/files/post.php: -------------------------------------------------------------------------------- 1 | $fileForm = new Rebilly\Entities\File(); 2 | $fileForm->setUrl('http://test.com/somefile.jpg'); 3 | 4 | try { 5 | $file = $client->files()->create($fileForm); 6 | } catch (UnprocessableEntityException $e) { 7 | echo $e->getMessage(); 8 | } 9 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/files@{id}/delete.php: -------------------------------------------------------------------------------- 1 | $client->files()->delete('fileId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/files@{id}/get.php: -------------------------------------------------------------------------------- 1 | $file = $client->files()->load('fileId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/files@{id}/put.php: -------------------------------------------------------------------------------- 1 | $fileForm = new Rebilly\Entities\File(); 2 | $fileForm->setDescription('This is a test file'); 3 | 4 | try { 5 | $file = $client->files()->update('fileId', $fileForm); 6 | } catch (UnprocessableEntityException $e) { 7 | echo $e->getMessage(); 8 | } 9 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices/get.php: -------------------------------------------------------------------------------- 1 | $invoices = $client->invoices()->search([ 2 | 'filter' => 'customerId:testCustomerId', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices/post.php: -------------------------------------------------------------------------------- 1 | setCustomerId('customerId'); 4 | $invoiceForm->setWebsiteId('websiteId'); 5 | $invoiceForm->setCurrency('USD'); 6 | $invoiceForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $invoice = $client->invoices()->create($invoiceForm); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}/get.php: -------------------------------------------------------------------------------- 1 | $invoice = $client->invoices()->load('invoiceId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}/put.php: -------------------------------------------------------------------------------- 1 | setCustomerId('customerId'); 4 | $invoiceForm->setWebsiteId('websiteId'); 5 | $invoiceForm->setCurrency('USD'); 6 | $invoiceForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $invoice = $client->invoices()->update('invoiceId', $invoiceForm); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}@abandon/post.php: -------------------------------------------------------------------------------- 1 | $invoice = $client->invoices()->abandon('invoiceId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}@issue/post.php: -------------------------------------------------------------------------------- 1 | $invoice = $client->invoices()->issue('invoiceId', '2025-01-01 05:00:00'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}@items/get.php: -------------------------------------------------------------------------------- 1 | $invoiceItems = $client->invoiceItems()->search('invoiceId', [ 2 | 'filter' => 'quantity:5', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}@items/post.php: -------------------------------------------------------------------------------- 1 | $invoiceItemForm = new Rebilly\Entities\InvoiceItem(); 2 | $invoiceItemForm->setType($invoiceItemForm::TYPE_DEBIT); 3 | $invoiceItemForm->setUnitPrice(0.99); 4 | $invoiceItemForm->setQuantity(5); 5 | 6 | try { 7 | $invoiceItem = $client->invoiceItems()->create($invoiceItemForm, 'invoiceId'); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/invoices@{id}@void/post.php: -------------------------------------------------------------------------------- 1 | $invoice = $client->invoices()->void('invoiceId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards/get.php: -------------------------------------------------------------------------------- 1 | $paymentCards = $client->paymentCards()->search([ 2 | 'filter' => 'status:active', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards/post.php: -------------------------------------------------------------------------------- 1 | $paymentCardForm = new Rebilly\Entities\PaymentCard(); 2 | $paymentCardForm->setCustomerId('customerId'); 3 | $paymentCardForm->setPan('4111111111111111'); 4 | $paymentCardForm->setExpYear(2025); 5 | $paymentCardForm->setExpMonth(8); 6 | $paymentCardForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $paymentCard = $client->paymentCards()->create($paymentCardForm); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards@{id}/get.php: -------------------------------------------------------------------------------- 1 | $paymentCard = $client->paymentCards()->load('paymentCardId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards@{id}/put.php: -------------------------------------------------------------------------------- 1 | $paymentCardForm = new Rebilly\Entities\PaymentCard(); 2 | $paymentCardForm->setCustomerId('customerId'); 3 | $paymentCardForm->setPan('4111111111111111'); 4 | $paymentCardForm->setExpYear(2025); 5 | $paymentCardForm->setExpMonth(8); 6 | $paymentCardForm->setBillingAddress([ 7 | 'firstName' => 'John', 8 | 'lastName' => 'Doe', 9 | 'organization' => 'Test LTD', 10 | 'address' => 'Test street 5', 11 | 'address2' => 'Test house 5', 12 | 'city' => 'New York', 13 | 'region' => 'Long Island', 14 | 'country' => 'US', 15 | 'postalCode' => '123456', 16 | 'emails' => [ 17 | [ 18 | 'label' => 'main', 19 | 'value' => 'johndoe@testemail.com', 20 | 'primary' => true, 21 | ], 22 | [ 23 | 'label' => 'secondary', 24 | 'value' => 'otheremail@testemail.com', 25 | ], 26 | ], 27 | 'phoneNumbers' => [ 28 | [ 29 | 'label' => 'work', 30 | 'value' => '+123456789', 31 | 'primary' => true, 32 | ], 33 | [ 34 | 'label' => 'home', 35 | 'value' => '+9874654321', 36 | ], 37 | ], 38 | ]); 39 | 40 | try { 41 | $paymentCard = $client->paymentCards()->create($paymentCardForm, 'paymentCardId'); 42 | } catch (UnprocessableEntityException $e) { 43 | echo $e->getMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards@{id}@authorization/post.php: -------------------------------------------------------------------------------- 1 | $paymentCardAuthorizationForm = new Rebilly\Entities\PaymentCardAuthorization(); 2 | $paymentCardAuthorizationForm->setWebsiteId('websiteId'); 3 | $paymentCardAuthorizationForm->setCurrency('USD'); 4 | $paymentCardAuthorizationForm->setGatewayAccountId('gatewayAccountId'); 5 | 6 | try { 7 | $paymentCard = $client->paymentCards()->authorize('paymentCardId', $paymentCardAuthorizationForm); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payment-cards@{id}@deactivation/post.php: -------------------------------------------------------------------------------- 1 | $client->paymentCards()->deactivate('paymentCardId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payments/get.php: -------------------------------------------------------------------------------- 1 | $payments = $client->payments()->search([ 2 | 'filter' => 'currency:USD', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payments/post.php: -------------------------------------------------------------------------------- 1 | $paymentForm = new Rebilly\Entities\Payment(); 2 | 3 | $paymentForm->setWebsiteId('websiteId'); 4 | $paymentForm->setCustomerId('customerId'); 5 | $paymentForm->setCurrency('USD'); 6 | $paymentForm->setAmount(1.99); 7 | 8 | $data = [ 9 | 'method' => Rebilly\Entities\PaymentMethod::METHOD_CASH, 10 | ]; 11 | 12 | $paymentInstrumentForm = new Rebilly\Entities\PaymentMethodInstrument($data); 13 | 14 | $paymentForm->setPaymentInstrument($paymentInstrumentForm); 15 | 16 | try { 17 | $payment = $client->payments()->create($paymentForm); 18 | } catch (UnprocessableEntityException $e) { 19 | echo $e->getMessage(); 20 | } 21 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payments@{id}/get.php: -------------------------------------------------------------------------------- 1 | $payment = $client->payments()->load('paymentId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/payments@{id}/put.php: -------------------------------------------------------------------------------- 1 | $paymentForm = new Rebilly\Entities\Payment(); 2 | 3 | $paymentForm->setWebsiteId('websiteId'); 4 | $paymentForm->setCustomerId('customerId'); 5 | $paymentForm->setCurrency('USD'); 6 | $paymentForm->setAmount(1.99); 7 | 8 | $data = [ 9 | 'method' => Rebilly\Entities\PaymentMethod::METHOD_CASH, 10 | ]; 11 | 12 | $paymentInstrumentForm = new Rebilly\Entities\PaymentMethodInstrument($data); 13 | 14 | $paymentForm->setPaymentInstrument($paymentInstrumentForm); 15 | 16 | try { 17 | $payment = $client->payments()->update('paymentId', $paymentForm); 18 | } catch (UnprocessableEntityException $e) { 19 | echo $e->getMessage(); 20 | } 21 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts/get.php: -------------------------------------------------------------------------------- 1 | $payPalAccounts = $client->payPalAccounts()->search([ 2 | 'filter' => 'status:active', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts/post.php: -------------------------------------------------------------------------------- 1 | $payPalForm = new Rebilly\Entities\PayPalAccount(); 2 | $payPalForm->setCustomerId('customerId'); 3 | $payPalForm->setBillingAddress([ 4 | 'firstName' => 'John', 5 | 'lastName' => 'Doe', 6 | 'organization' => 'Test LTD', 7 | 'address' => 'Test street 5', 8 | 'address2' => 'Test house 5', 9 | 'city' => 'New York', 10 | 'region' => 'Long Island', 11 | 'country' => 'US', 12 | 'postalCode' => '123456', 13 | 'emails' => [ 14 | [ 15 | 'label' => 'main', 16 | 'value' => 'johndoe@testemail.com', 17 | 'primary' => true, 18 | ], 19 | [ 20 | 'label' => 'secondary', 21 | 'value' => 'otheremail@testemail.com', 22 | ], 23 | ], 24 | 'phoneNumbers' => [ 25 | [ 26 | 'label' => 'work', 27 | 'value' => '+123456789', 28 | 'primary' => true, 29 | ], 30 | [ 31 | 'label' => 'home', 32 | 'value' => '+9874654321', 33 | ], 34 | ], 35 | ]); 36 | 37 | try { 38 | $payPalAccount = $client->payPalAccounts()->create($payPalForm); 39 | } catch (UnprocessableEntityException $e) { 40 | echo $e->getMessage(); 41 | } 42 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts@{id}/get.php: -------------------------------------------------------------------------------- 1 | $payPalAccount = $client->payPalAccounts()->load('payPalAccountId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts@{id}/put.php: -------------------------------------------------------------------------------- 1 | $payPalForm = new Rebilly\Entities\PayPalAccount(); 2 | $payPalForm->setCustomerId('customerId'); 3 | $payPalForm->setBillingAddress([ 4 | 'firstName' => 'John', 5 | 'lastName' => 'Doe', 6 | 'organization' => 'Test LTD', 7 | 'address' => 'Test street 5', 8 | 'address2' => 'Test house 5', 9 | 'city' => 'New York', 10 | 'region' => 'Long Island', 11 | 'country' => 'US', 12 | 'postalCode' => '123456', 13 | 'emails' => [ 14 | [ 15 | 'label' => 'main', 16 | 'value' => 'johndoe@testemail.com', 17 | 'primary' => true, 18 | ], 19 | [ 20 | 'label' => 'secondary', 21 | 'value' => 'otheremail@testemail.com', 22 | ], 23 | ], 24 | 'phoneNumbers' => [ 25 | [ 26 | 'label' => 'work', 27 | 'value' => '+123456789', 28 | 'primary' => true, 29 | ], 30 | [ 31 | 'label' => 'home', 32 | 'value' => '+9874654321', 33 | ], 34 | ], 35 | ]); 36 | 37 | try { 38 | $payPalAccount = $client->payPalAccounts()->create($payPalForm, 'payPalAccountId'); 39 | } catch (UnprocessableEntityException $e) { 40 | echo $e->getMessage(); 41 | } 42 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts@{id}@activation/post.php: -------------------------------------------------------------------------------- 1 | $activationData = [ 2 | 'websiteId' => 'testWebsiteId', 3 | 'currency' => 'USD', 4 | ]; 5 | 6 | try { 7 | $client->payPalAccounts()->activate($activationData, 'payPalAccountId'); 8 | } catch (UnprocessableEntityException $e) { 9 | echo $e->getMessage(); 10 | } 11 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/paypal-accounts@{id}@deactivation/post.php: -------------------------------------------------------------------------------- 1 | $client->payPalAccounts()->deactivate('payPalAccountId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/plans/get.php: -------------------------------------------------------------------------------- 1 | $plans = $client->plans()->search([ 2 | 'filter' => 'name:TestPlan', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/plans/post.php: -------------------------------------------------------------------------------- 1 | $planForm = new Rebilly\Entities\Plan(); 2 | $planForm->setName('TestPlan'); 3 | $planForm->setCurrency('USD'); 4 | $planForm->setTrialAmount(1); 5 | $planForm->setTrialPeriodUnit('day'); 6 | $planForm->setTrialPeriodLength(1); 7 | $planForm->setProductId('test-product'); 8 | 9 | try { 10 | $plan = $client->plans()->create($planForm); 11 | } catch (UnprocessableEntityException $e) { 12 | echo $e->getMessage(); 13 | } 14 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/plans@{id}/delete.php: -------------------------------------------------------------------------------- 1 | $client->plans()->delete('planId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/plans@{id}/get.php: -------------------------------------------------------------------------------- 1 | $plan = $client->plans()->load('planId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/plans@{id}/put.php: -------------------------------------------------------------------------------- 1 | $planForm = new Rebilly\Entities\Plan(); 2 | $planForm->setName('TestPlan'); 3 | $planForm->setCurrency('USD'); 4 | $planForm->setTrialAmount(1); 5 | $planForm->setTrialPeriodUnit('day'); 6 | $planForm->setTrialPeriodLength(1); 7 | 8 | try { 9 | $plan = $client->plans()->update('planId', $planForm); 10 | } catch (UnprocessableEntityException $e) { 11 | echo $e->getMessage(); 12 | } 13 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscription-cancellations/post.php: -------------------------------------------------------------------------------- 1 | $subscriptionCancelForm = new Rebilly\Entities\SubscriptionCancel(); 2 | $subscriptionCancelForm->setEffectiveTime(new DateTime()); 3 | 4 | try { 5 | $subscription = $client->subscriptions()->cancel('subscriptionId', $subscriptionCancelForm); 6 | } catch (UnprocessableEntityException $e) { 7 | echo $e->getMessage(); 8 | } 9 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscriptions/get.php: -------------------------------------------------------------------------------- 1 | $subscriptions = $client->subscriptions()->search([ 2 | 'filter' => 'customerId:testCustomerId', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscriptions/post.php: -------------------------------------------------------------------------------- 1 | $subscriptionForm = new Rebilly\Entities\Subscription(); 2 | $subscriptionForm->setCustomerId('customerId'); 3 | $subscriptionForm->setWebsiteId('websiteId'); 4 | $subscriptionForm->setItems([ 5 | [ 6 | 'planId' => 'my-plan', 7 | 'quantity' => 1, 8 | ], 9 | ]); 10 | $subscriptionForm->setBillingAddress([ 11 | 'firstName' => 'John', 12 | 'lastName' => 'Doe', 13 | 'organization' => 'Test LTD', 14 | 'address' => 'Test street 5', 15 | 'address2' => 'Test house 5', 16 | 'city' => 'New York', 17 | 'region' => 'Long Island', 18 | 'country' => 'US', 19 | 'postalCode' => '123456', 20 | 'emails' => [ 21 | [ 22 | 'label' => 'main', 23 | 'value' => 'johndoe@testemail.com', 24 | 'primary' => true, 25 | ], 26 | [ 27 | 'label' => 'secondary', 28 | 'value' => 'otheremail@testemail.com', 29 | ], 30 | ], 31 | 'phoneNumbers' => [ 32 | [ 33 | 'label' => 'work', 34 | 'value' => '+123456789', 35 | 'primary' => true, 36 | ], 37 | [ 38 | 'label' => 'home', 39 | 'value' => '+9874654321', 40 | ], 41 | ], 42 | ]); 43 | 44 | try { 45 | $subscription = $client->subscriptions()->create($subscriptionForm); 46 | } catch (UnprocessableEntityException $e) { 47 | echo $e->getMessage(); 48 | } 49 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscriptions@{id}/get.php: -------------------------------------------------------------------------------- 1 | $subscription = $client->subscriptions()->load('subscriptionId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscriptions@{id}/put.php: -------------------------------------------------------------------------------- 1 | $subscriptionForm = new Rebilly\Entities\Subscription(); 2 | $subscriptionForm->setCustomerId('customerId'); 3 | $subscriptionForm->setWebsiteId('websiteId'); 4 | $subscriptionForm->setItems($subscriptionForm->createItems([ 5 | 'planId' => 'my-plan', 6 | 'quantity' => 1, 7 | ])); 8 | $subscriptionForm->setBillingAddress([ 9 | 'firstName' => 'John', 10 | 'lastName' => 'Doe', 11 | 'organization' => 'Test LTD', 12 | 'address' => 'Test street 5', 13 | 'address2' => 'Test house 5', 14 | 'city' => 'New York', 15 | 'region' => 'Long Island', 16 | 'country' => 'US', 17 | 'postalCode' => '123456', 18 | 'emails' => [ 19 | [ 20 | 'label' => 'main', 21 | 'value' => 'johndoe@testemail.com', 22 | 'primary' => true, 23 | ], 24 | [ 25 | 'label' => 'secondary', 26 | 'value' => 'otheremail@testemail.com', 27 | ], 28 | ], 29 | 'phoneNumbers' => [ 30 | [ 31 | 'label' => 'work', 32 | 'value' => '+123456789', 33 | 'primary' => true, 34 | ], 35 | [ 36 | 'label' => 'home', 37 | 'value' => '+9874654321', 38 | ], 39 | ], 40 | ]); 41 | 42 | try { 43 | $subscription = $client->subscriptions()->update('subscriptionId', $subscriptionForm); 44 | } catch (UnprocessableEntityException $e) { 45 | echo $e->getMessage(); 46 | } 47 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/subscriptions@{id}@change-plan/post.php: -------------------------------------------------------------------------------- 1 | $subscriptionChangePlanForm = new Rebilly\Entities\SubscriptionChangePlan(); 2 | $subscriptionChangePlanForm->setPlanId('newPlanId'); 3 | $subscriptionChangePlanForm->setRenewalPolicy('retain'); 4 | $subscriptionChangePlanForm->setPreview(true); 5 | $subscriptionChangePlanForm->setProrated(true); 6 | $subscriptionChangePlanForm->setEffectiveTime('2018-02-02 00:00:00'); 7 | 8 | try { 9 | $subscription = $client->subscriptions()->changePlan('subscriptionId', $subscriptionChangePlanForm); 10 | echo $subscription->getLineItemSubtotal(); 11 | } catch (UnprocessableEntityException $e) { 12 | echo $e->getMessage(); 13 | } 14 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/tokens/get.php: -------------------------------------------------------------------------------- 1 | $paymentCardTokens = $client->paymentCardTokens()->search([ 2 | 'filter' => 'token:string', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/tokens@{token}/get.php: -------------------------------------------------------------------------------- 1 | $paymentCardToken = $client->paymentCardTokens()->load('tokenId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/transactions/get.php: -------------------------------------------------------------------------------- 1 | $transactions = $client->transactions()->search([ 2 | 'filter' => 'result:approved', 3 | ]); 4 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/transactions@{id}/get.php: -------------------------------------------------------------------------------- 1 | $transaction = $client->transactions()->load('transactionId'); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/transactions@{id}@cancel/post.php: -------------------------------------------------------------------------------- 1 | try { 2 | $payment = $client->transactions()->cancel('transactionId'); 3 | } catch (UnprocessableEntityException $e) { 4 | echo $e->getMessage(); 5 | } 6 | -------------------------------------------------------------------------------- /openapi/code_samples/PHP/transactions@{id}@refund/post.php: -------------------------------------------------------------------------------- 1 | $transaction = $client->transactions()->refund('transactionId', 1.99); 2 | -------------------------------------------------------------------------------- /openapi/code_samples/README.md: -------------------------------------------------------------------------------- 1 | Code samples 2 | ===== 3 | 4 | Generate [x-code-samples](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-code-samples) 5 | Path `//.` where: 6 | * `` - name of the language from [this](https://github.com/github/linguist/blob/master/lib/linguist/popular.yml) list. 7 | * `` - path of target method, where all slashes replaced with `@` sign. 8 | * `` - verb of target method. 9 | * `` - ignored. 10 | -------------------------------------------------------------------------------- /openapi/components/README.md: -------------------------------------------------------------------------------- 1 | Reusable components 2 | =========== 3 | 4 | * You can create the following folders here: 5 | - `schemas` - reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject) 6 | - `responses` - reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject) 7 | - `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject) 8 | - `examples` - reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#exampleObject) 9 | - `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#headerObject) 10 | - `requestBodies` - reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#requestBodyObject) 11 | - `links` - reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#linkObject) 12 | - `callbacks` - reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#callbackObject) 13 | - `securitySchemes` - reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#securitySchemeObject) 14 | * Filename of files inside the folders represent component name, i.e. `Customer.yaml` 15 | -------------------------------------------------------------------------------- /openapi/components/headers/Pagination-Limit.yaml: -------------------------------------------------------------------------------- 1 | description: Items per page limit 2 | schema: 3 | type: integer 4 | -------------------------------------------------------------------------------- /openapi/components/headers/Pagination-Offset.yaml: -------------------------------------------------------------------------------- 1 | description: Pagination offset 2 | schema: 3 | type: integer 4 | -------------------------------------------------------------------------------- /openapi/components/headers/Pagination-Total.yaml: -------------------------------------------------------------------------------- 1 | description: Total items count 2 | schema: 3 | type: integer 4 | -------------------------------------------------------------------------------- /openapi/components/headers/Rate-Limit-Limit.yaml: -------------------------------------------------------------------------------- 1 | description: The number of allowed requests in the current period 2 | schema: 3 | type: integer 4 | -------------------------------------------------------------------------------- /openapi/components/headers/Rate-Limit-Remaining.yaml: -------------------------------------------------------------------------------- 1 | description: The number of remaining requests in the current period 2 | schema: 3 | type: integer 4 | -------------------------------------------------------------------------------- /openapi/components/headers/Rate-Limit-Reset.yaml: -------------------------------------------------------------------------------- 1 | description: > 2 | The date in format defined by [RFC 3 | 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) 4 | 5 | when the current period will reset 6 | schema: 7 | type: string 8 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionExpand.yaml: -------------------------------------------------------------------------------- 1 | name: expand 2 | in: query 3 | description: > 4 | Expand a response to get a full related object included inside 5 | 6 | of the `_embedded` path in the response. 7 | 8 | 9 | It accepts a comma-separated list of objects to expand. 10 | 11 | 12 | See the [expand guide](#section/Expand-to-Include-Embedded-Objects) for more 13 | info. 14 | schema: 15 | type: string 16 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionFields.yaml: -------------------------------------------------------------------------------- 1 | name: fields 2 | in: query 3 | description: >- 4 | Limit the returned fields to the list specified, separated by comma. Note that 5 | id is always returned. 6 | schema: 7 | type: string 8 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionFilter.yaml: -------------------------------------------------------------------------------- 1 | name: filter 2 | in: query 3 | description: > 4 | The collection items filter requires a special format. 5 | 6 | Use "," for multiple allowed values. Use ";" for multiple fields. 7 | 8 | See the [filter guide](#section/Using-filter) for more options and examples 9 | about this format. 10 | schema: 11 | type: string 12 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionLimit.yaml: -------------------------------------------------------------------------------- 1 | name: limit 2 | in: query 3 | description: The collection items limit 4 | schema: 5 | type: integer 6 | minimum: 0 7 | maximum: 1000 8 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionOffset.yaml: -------------------------------------------------------------------------------- 1 | name: offset 2 | in: query 3 | description: The collection items offset 4 | schema: 5 | type: integer 6 | minimum: 0 7 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionQuery.yaml: -------------------------------------------------------------------------------- 1 | name: q 2 | in: query 3 | description: The partial search of the text fields. 4 | schema: 5 | type: string 6 | -------------------------------------------------------------------------------- /openapi/components/parameters/collectionSort.yaml: -------------------------------------------------------------------------------- 1 | name: sort 2 | in: query 3 | description: >- 4 | The collection items sort field and order (prefix with "-" for descending 5 | sort). 6 | style: form 7 | explode: false 8 | schema: 9 | type: array 10 | items: 11 | type: string 12 | -------------------------------------------------------------------------------- /openapi/components/parameters/customFieldResource.yaml: -------------------------------------------------------------------------------- 1 | name: resource 2 | in: path 3 | description: The resource type string 4 | required: true 5 | schema: 6 | type: string 7 | enum: 8 | - customers 9 | - payment-cards 10 | - subscriptions 11 | - transactions 12 | - websites 13 | - contacts 14 | - products 15 | - plans 16 | -------------------------------------------------------------------------------- /openapi/components/parameters/customerId.yaml: -------------------------------------------------------------------------------- 1 | name: customerId 2 | in: path 3 | description: The customer identifier string 4 | required: true 5 | schema: 6 | type: string 7 | maxLength: 50 8 | pattern: '^[@~\-\.\w]+$' 9 | -------------------------------------------------------------------------------- /openapi/components/parameters/hash.yaml: -------------------------------------------------------------------------------- 1 | name: hash 2 | in: path 3 | description: The token identifier string 4 | required: true 5 | schema: 6 | type: string 7 | -------------------------------------------------------------------------------- /openapi/components/parameters/mediaType.yaml: -------------------------------------------------------------------------------- 1 | name: Accept 2 | in: header 3 | description: The response media type 4 | schema: 5 | type: string 6 | enum: 7 | - application/json 8 | - text/csv 9 | - application/pdf 10 | default: application/json 11 | -------------------------------------------------------------------------------- /openapi/components/parameters/organizationId.yaml: -------------------------------------------------------------------------------- 1 | name: Organization-Id 2 | in: header 3 | description: >- 4 | Organization identifier in scope of which need to perform request (if not 5 | specified, the default organization will be used) 6 | schema: 7 | $ref: ../schemas/ResourceId.yaml 8 | required: false 9 | -------------------------------------------------------------------------------- /openapi/components/parameters/resourceId.yaml: -------------------------------------------------------------------------------- 1 | name: id 2 | in: path 3 | description: The resource identifier string 4 | required: true 5 | schema: 6 | type: string 7 | maxLength: 50 8 | pattern: '^[@~\-\.\w]+$' 9 | -------------------------------------------------------------------------------- /openapi/components/parameters/subscriptionExpand.yaml: -------------------------------------------------------------------------------- 1 | name: expand 2 | in: query 3 | description: > 4 | Expand a response to get a full related object included inside 5 | 6 | of the `_embedded` path in the response. 7 | 8 | 9 | To expand multiple objects, it accepts a comma-separated 10 | 11 | list of objects (example: `expand=recentInvoice,initialInvoice`). 12 | 13 | 14 | Available arguments are: 15 | - recentInvoice 16 | - initialInvoice 17 | - customer 18 | - website 19 | 20 | See the [expand guide](#section/Expand-to-Include-Embedded-Objects) for more 21 | info. 22 | schema: 23 | type: string 24 | -------------------------------------------------------------------------------- /openapi/components/parameters/tag.yaml: -------------------------------------------------------------------------------- 1 | name: tag 2 | in: path 3 | description: The tag name 4 | required: true 5 | schema: 6 | type: string 7 | pattern: '^[@~\-\.\w\s]+$' 8 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Attachment.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Attachment.yaml 5 | description: Attachment resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/BankAccount.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/BankAccounts/BankAccount.yaml 5 | description: BankAccount resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Blacklist.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Blacklist.yaml 5 | description: Blacklist resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Contact.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Contact.yaml 5 | description: Contact resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Coupon.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Coupon/Coupon.yaml 5 | description: Coupon resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Credential.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Credential.yaml 5 | description: Credential resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Customer.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Customer.yaml 5 | description: Customer resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Dispute.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Dispute.yaml 5 | description: Dispute resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Invoice.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Invoices/Invoice.yaml 5 | description: Invoice resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Payment.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Payment.yaml 5 | description: Payment resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Plan.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Plans/Plan.yaml 5 | description: Plan resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Product.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Product.yaml 5 | description: Product resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Subscription.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Subscription.yaml 5 | description: Subscription resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/SubscriptionCancellation.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Subscription/SubscriptionCancellation.yaml 5 | description: Cancellation resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/Tag.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Tags/Tag.yaml 5 | description: Tag resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/requestBodies/TransactionRequest.yaml: -------------------------------------------------------------------------------- 1 | content: 2 | application/json: 3 | schema: 4 | $ref: ../schemas/Transactions/TransactionRequest.yaml 5 | description: Payment resource 6 | required: true 7 | -------------------------------------------------------------------------------- /openapi/components/responses/AccessForbidden.yaml: -------------------------------------------------------------------------------- 1 | description: 'Access forbidden, invalid API-KEY was used' 2 | content: 3 | application/json: 4 | schema: 5 | $ref: ../schemas/Error.yaml 6 | -------------------------------------------------------------------------------- /openapi/components/responses/Conflict.yaml: -------------------------------------------------------------------------------- 1 | description: Conflict 2 | content: 3 | application/json: 4 | schema: 5 | $ref: ../schemas/Error.yaml 6 | -------------------------------------------------------------------------------- /openapi/components/responses/Customer.yaml: -------------------------------------------------------------------------------- 1 | description: Customer 2 | headers: 3 | Rate-Limit-Limit: 4 | $ref: ../headers/Rate-Limit-Limit.yaml 5 | Rate-Limit-Remaining: 6 | $ref: ../headers/Rate-Limit-Remaining.yaml 7 | Rate-Limit-Reset: 8 | $ref: ../headers/Rate-Limit-Reset.yaml 9 | content: 10 | application/json: 11 | schema: 12 | $ref: ../schemas/Customer.yaml 13 | -------------------------------------------------------------------------------- /openapi/components/responses/Found.yaml: -------------------------------------------------------------------------------- 1 | description: Resource was moved 2 | headers: 3 | Location: 4 | schema: 5 | type: string 6 | -------------------------------------------------------------------------------- /openapi/components/responses/InvalidDataError.yaml: -------------------------------------------------------------------------------- 1 | description: Invalid data was sent 2 | content: 3 | application/json: 4 | schema: 5 | $ref: ../schemas/InvalidError.yaml 6 | -------------------------------------------------------------------------------- /openapi/components/responses/NotFound.yaml: -------------------------------------------------------------------------------- 1 | description: Resource was not found 2 | content: 3 | application/json: 4 | schema: 5 | $ref: ../schemas/Error.yaml 6 | -------------------------------------------------------------------------------- /openapi/components/schemas/BankAccounts/AccountNumberTypes/BBANType.yaml: -------------------------------------------------------------------------------- 1 | description: BBAN type object 2 | allOf: 3 | - $ref: ../BankAccountCreatePlain.yaml 4 | - type: object 5 | required: 6 | - customerId 7 | - accountNumber 8 | - routingNumber 9 | - accountType 10 | - address 11 | properties: 12 | customerId: 13 | description: The Customer's ID. 14 | allOf: 15 | - $ref: ../../ResourceId.yaml 16 | accountNumber: 17 | description: Bank's Account Number. 18 | type: string 19 | pattern: '^[0-9]+$' 20 | routingNumber: 21 | description: Bank's Routing Number. 22 | type: string 23 | pattern: '^[0-9]+$' 24 | accountType: 25 | description: Bank's Account type. 26 | type: string 27 | enum: 28 | - checking 29 | - savings 30 | - other 31 | bankName: 32 | description: Bank's name. 33 | type: string 34 | bic: 35 | description: Bank Identifier Code. 36 | type: string 37 | address: 38 | description: The Address. 39 | allOf: 40 | - $ref: ../../Contact/ContactObject.yaml 41 | customFields: 42 | $ref: ../../ResourceCustomFields.yaml 43 | -------------------------------------------------------------------------------- /openapi/components/schemas/BankAccounts/AccountNumberTypes/IBANType.yaml: -------------------------------------------------------------------------------- 1 | description: IBAN type object 2 | allOf: 3 | - $ref: ../BankAccountCreatePlain.yaml 4 | - type: object 5 | required: 6 | - customerId 7 | - accountNumber 8 | - address 9 | properties: 10 | customerId: 11 | description: The Customer's ID. 12 | allOf: 13 | - $ref: ../../ResourceId.yaml 14 | accountNumber: 15 | description: > 16 | Bank's Account Number. Detailed information about all ISO 17 | 13616-compliant national IBAN formats is available 18 | 19 | in [SWIFT IBAN 20 | Registry](https://www.swift.com/standards/data-standards/iban). 21 | type: string 22 | bankName: 23 | description: Bank's name. 24 | type: string 25 | bic: 26 | description: Bank Identifier Code. 27 | type: string 28 | address: 29 | description: The Address. 30 | allOf: 31 | - $ref: ../../Contact/ContactObject.yaml 32 | customFields: 33 | $ref: ../../ResourceCustomFields.yaml 34 | -------------------------------------------------------------------------------- /openapi/components/schemas/BankAccounts/BankAccountCreatePlain.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - accountNumberType 4 | discriminator: 5 | propertyName: accountNumberType 6 | mapping: 7 | BBAN: ./AccountNumberTypes/BBANType.yaml 8 | IBAN: ./AccountNumberTypes/IBANType.yaml 9 | properties: 10 | accountNumberType: 11 | description: >- 12 | Bank's Account Number type. A valid value is basic bank account number 13 | (BBAN) or international bank account number (IBAN). 14 | type: string 15 | default: BBAN 16 | enum: 17 | - IBAN 18 | - BBAN 19 | -------------------------------------------------------------------------------- /openapi/components/schemas/BankAccounts/BankAccountCreateToken.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - customerId 4 | - token 5 | properties: 6 | customerId: 7 | description: The Customer's ID. 8 | allOf: 9 | - $ref: ../ResourceId.yaml 10 | token: 11 | description: BankAccountToken ID. 12 | type: string 13 | customFields: 14 | $ref: ../ResourceCustomFields.yaml 15 | -------------------------------------------------------------------------------- /openapi/components/schemas/Blacklist.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - type 4 | - value 5 | properties: 6 | id: 7 | description: The blacklist identifier string 8 | readOnly: true 9 | allOf: 10 | - $ref: ./ResourceId.yaml 11 | type: 12 | description: The blacklist type 13 | type: string 14 | enum: 15 | - payment-card 16 | - bank-account 17 | - customer-id 18 | - email 19 | - email-domain 20 | - ip-address 21 | - country 22 | - fingerprint 23 | - bin 24 | - address 25 | value: 26 | description: The blacklist value 27 | type: string 28 | expirationTime: 29 | description: The blacklist expiration time 30 | type: string 31 | format: date-time 32 | createdTime: 33 | description: The blacklist created time 34 | allOf: 35 | - $ref: ./ServerTimestamp.yaml 36 | updatedTime: 37 | description: The blacklist updated time 38 | allOf: 39 | - $ref: ./ServerTimestamp.yaml 40 | _links: 41 | type: array 42 | description: The links related to resource 43 | readOnly: true 44 | minItems: 1 45 | items: 46 | $ref: ./Links/SelfLink.yaml 47 | -------------------------------------------------------------------------------- /openapi/components/schemas/Contact/ContactEmails.yaml: -------------------------------------------------------------------------------- 1 | description: The list of emails 2 | type: array 3 | items: 4 | type: object 5 | required: 6 | - label 7 | - value 8 | properties: 9 | label: 10 | description: The email label 11 | type: string 12 | example: main 13 | value: 14 | description: The email value 15 | type: string 16 | example: rebilly@example.com 17 | primary: 18 | description: True if email is primary 19 | type: boolean 20 | example: true 21 | -------------------------------------------------------------------------------- /openapi/components/schemas/Contact/ContactPhoneNumbers.yaml: -------------------------------------------------------------------------------- 1 | description: The list of phone numbers 2 | type: array 3 | items: 4 | type: object 5 | required: 6 | - label 7 | - value 8 | properties: 9 | label: 10 | description: The phone label 11 | type: string 12 | example: main 13 | value: 14 | description: The phone value 15 | type: string 16 | example: 512-710-1640 17 | primary: 18 | description: True if phone is primary 19 | type: boolean 20 | example: true 21 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponExpiration.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - expiredTime 4 | properties: 5 | expiredTime: 6 | description: >- 7 | The coupon's expiry time, must be greater than the issued time. Null or 8 | empty string will immediately expire the coupon. 9 | type: string 10 | format: date-time 11 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRedemption.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Coupons redemption log 3 | properties: 4 | id: 5 | readOnly: true 6 | allOf: 7 | - $ref: ../ResourceId.yaml 8 | redemptionCode: 9 | description: Coupon's redemption code 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | customerId: 13 | description: Customer's ID 14 | allOf: 15 | - $ref: ../ResourceId.yaml 16 | additionalRestrictions: 17 | description: Additional restrictions for coupon's redemptions 18 | type: array 19 | items: 20 | $ref: ./RedemptionRestriction.yaml 21 | createdTime: 22 | description: Coupon redeem time 23 | readOnly: true 24 | allOf: 25 | - $ref: ../ServerTimestamp.yaml 26 | canceledTime: 27 | description: Coupon redemption canceled time 28 | readOnly: true 29 | allOf: 30 | - $ref: ../ServerTimestamp.yaml 31 | _links: 32 | type: array 33 | description: The links related to resource 34 | readOnly: true 35 | minItems: 1 36 | items: 37 | $ref: ../Links/SelfLink.yaml 38 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestriction.yaml: -------------------------------------------------------------------------------- 1 | description: Coupon restrictions 2 | type: object 3 | discriminator: 4 | propertyName: type 5 | mapping: 6 | discounts-per-redemption: ./CouponRestrictions/discounts-per-redemption.yaml 7 | minimum-order-amount: ./CouponRestrictions/minimum-order-amount.yaml 8 | paid-by-time: ./CouponRestrictions/paid-by-time.yaml 9 | redemptions-per-customer: ./CouponRestrictions/redemptions-per-customer.yaml 10 | restrict-to-invoices: ./CouponRestrictions/restrict-to-invoices.yaml 11 | restrict-to-plans: ./CouponRestrictions/restrict-to-plans.yaml 12 | restrict-to-products: ./CouponRestrictions/restrict-to-products.yaml 13 | restrict-to-subscriptions: ./CouponRestrictions/restrict-to-subscriptions.yaml 14 | total-redemptions: ./CouponRestrictions/total-redemptions.yaml 15 | properties: 16 | type: 17 | description: Coupon's restriction type 18 | type: string 19 | enum: 20 | - discounts-per-redemption 21 | - minimum-order-amount 22 | - redemptions-per-customer 23 | - restrict-to-invoices 24 | - restrict-to-plans 25 | - restrict-to-subscriptions 26 | - restrict-to-products 27 | - total-redemptions 28 | - paid-by-time 29 | required: 30 | - type 31 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/discounts-per-redemption.yaml: -------------------------------------------------------------------------------- 1 | description: discounts-per-redemption restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - quantity 8 | properties: 9 | quantity: 10 | type: integer 11 | description: Restriction quantity 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/minimum-order-amount.yaml: -------------------------------------------------------------------------------- 1 | description: minimum-order-amount restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - amount 8 | - currency 9 | properties: 10 | amount: 11 | type: integer 12 | description: Minimum order quantity 13 | currency: 14 | allOf: 15 | - $ref: ../../CurrencyCode.yaml 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/paid-by-time.yaml: -------------------------------------------------------------------------------- 1 | description: paid-by-time restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - time 8 | properties: 9 | time: 10 | type: string 11 | format: date-time 12 | description: >- 13 | The time when the coupon's redemption is no longer valid and removed 14 | from unpaid invoices if applied. Note that this datetime cannot be 15 | changed. 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/redemptions-per-customer.yaml: -------------------------------------------------------------------------------- 1 | description: Quantity per Customer restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - quantity 8 | properties: 9 | quantity: 10 | type: integer 11 | description: Restriction value 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/restrict-to-invoices.yaml: -------------------------------------------------------------------------------- 1 | description: restrict-to-invoices restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - invoiceIds 8 | properties: 9 | invoiceIds: 10 | type: array 11 | description: Invoice IDs coupon can be applied to 12 | items: 13 | type: string 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/restrict-to-plans.yaml: -------------------------------------------------------------------------------- 1 | description: restrict-to-plans restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - planIds 8 | properties: 9 | planIds: 10 | type: array 11 | description: Plan IDs coupon can be applied to 12 | items: 13 | type: string 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/restrict-to-products.yaml: -------------------------------------------------------------------------------- 1 | description: restrict-to-products restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - productIds 8 | properties: 9 | productIds: 10 | type: array 11 | description: Product IDs coupon can be applied to 12 | items: 13 | type: string 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/restrict-to-subscriptions.yaml: -------------------------------------------------------------------------------- 1 | description: restrict-to-subscriptions restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - subscriptionIds 8 | properties: 9 | subscriptionIds: 10 | type: array 11 | description: Subscription IDs coupon can be applied to 12 | items: 13 | type: string 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/CouponRestrictions/total-redemptions.yaml: -------------------------------------------------------------------------------- 1 | description: total-redemptions restrictions 2 | allOf: 3 | - $ref: ../CouponRestriction.yaml 4 | - $ref: ../RedemptionRestriction.yaml 5 | - type: object 6 | required: 7 | - quantity 8 | properties: 9 | quantity: 10 | type: integer 11 | description: Total redemptions quantity 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/Discount.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | discriminator: 3 | propertyName: type 4 | mapping: 5 | fixed: ./Discounts/fixed.yaml 6 | percent: ./Discounts/percent.yaml 7 | properties: 8 | type: 9 | description: Discount type 10 | type: string 11 | enum: 12 | - fixed 13 | - percent 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/Discounts/fixed.yaml: -------------------------------------------------------------------------------- 1 | description: Coupon fixed amount discount 2 | allOf: 3 | - $ref: ../Discount.yaml 4 | - type: object 5 | required: 6 | - amount 7 | - currency 8 | properties: 9 | amount: 10 | description: Discount amount 11 | type: number 12 | format: double 13 | minimum: 0 14 | exclusiveMinimum: true 15 | currency: 16 | allOf: 17 | - $ref: ../../CurrencyCode.yaml 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/Discounts/percent.yaml: -------------------------------------------------------------------------------- 1 | description: Coupon percent discount 2 | allOf: 3 | - $ref: ../Discount.yaml 4 | - type: object 5 | required: 6 | - value 7 | properties: 8 | value: 9 | description: Discount percent 10 | type: number 11 | format: double 12 | minimum: 0 13 | exclusiveMinimum: true 14 | maximum: 100 15 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/InvoiceDiscount.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | redemptionCode: 5 | description: Coupon's redemption code 6 | allOf: 7 | - $ref: ../ResourceId.yaml 8 | redemptionId: 9 | description: Redemption ID 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | amount: 13 | description: Total amount that was discounted by this Coupon 14 | type: number 15 | format: double 16 | description: 17 | type: string 18 | description: Discount description 19 | -------------------------------------------------------------------------------- /openapi/components/schemas/Coupon/RedemptionRestriction.yaml: -------------------------------------------------------------------------------- 1 | description: Redemption restrictions 2 | type: object 3 | discriminator: 4 | propertyName: type 5 | mapping: 6 | discounts-per-redemption: ./CouponRestrictions/discounts-per-redemption.yaml 7 | minimum-order-amount: ./CouponRestrictions/minimum-order-amount.yaml 8 | paid-by-time: ./CouponRestrictions/paid-by-time.yaml 9 | restrict-to-invoices: ./CouponRestrictions/restrict-to-invoices.yaml 10 | restrict-to-plans: ./CouponRestrictions/restrict-to-plans.yaml 11 | restrict-to-products: ./CouponRestrictions/restrict-to-products.yaml 12 | restrict-to-subscriptions: ./CouponRestrictions/restrict-to-subscriptions.yaml 13 | properties: 14 | type: 15 | description: Redemption's additional restriction type 16 | type: string 17 | enum: 18 | - discounts-per-redemption 19 | - minimum-order-amount 20 | - restrict-to-invoices 21 | - restrict-to-plans 22 | - restrict-to-subscriptions 23 | - restrict-to-products 24 | - paid-by-time 25 | required: 26 | - type 27 | -------------------------------------------------------------------------------- /openapi/components/schemas/Credential.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - username 4 | - password 5 | - customerId 6 | properties: 7 | id: 8 | description: The credential identifier string 9 | readOnly: true 10 | allOf: 11 | - $ref: ./ResourceId.yaml 12 | username: 13 | description: Credential's username 14 | type: string 15 | password: 16 | description: The credential's password 17 | type: string 18 | format: password 19 | writeOnly: true 20 | customerId: 21 | description: The credential's customer ID 22 | type: string 23 | expiredTime: 24 | description: The credential's expired time 25 | type: string 26 | format: date-time 27 | _links: 28 | type: array 29 | description: The links related to resource 30 | readOnly: true 31 | minItems: 1 32 | items: 33 | anyOf: 34 | - $ref: ./Links/SelfLink.yaml 35 | - $ref: ./Links/CustomerLink.yaml 36 | -------------------------------------------------------------------------------- /openapi/components/schemas/CurrencyCode.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | description: ISO 4217 alphabetic currency code 3 | minLength: 3 4 | maxLength: 3 5 | example: USD 6 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAuthentication/AuthenticationOptions.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | passwordPattern: 4 | description: Allowed password pattern 5 | type: string 6 | credentialTtl: 7 | description: The default lifetime of the credential in seconds 8 | type: integer 9 | authTokenTtl: 10 | description: The default lifetime of the auth-token in seconds 11 | type: integer 12 | resetTokenTtl: 13 | description: The default lifetime of the reset-token in seconds 14 | type: integer 15 | otpRequired: 16 | description: Should OTP be required to exchange token 17 | type: boolean 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAuthentication/AuthenticationToken.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | discriminator: 3 | propertyName: mode 4 | mapping: 5 | password: ./TokenModes/password.yaml 6 | passwordless: ./TokenModes/passwordless.yaml 7 | properties: 8 | token: 9 | description: The token identifier string 10 | type: string 11 | readOnly: true 12 | mode: 13 | description: The token's generation mode 14 | type: string 15 | enum: 16 | - password 17 | - passwordless 18 | writeOnly: true 19 | default: password 20 | otpRequired: 21 | description: Should OTP be required to exchange this token 22 | type: boolean 23 | credentialId: 24 | description: The credential's ID 25 | readOnly: true 26 | allOf: 27 | - $ref: ../ResourceId.yaml 28 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAuthentication/AuthenticationTokenMetadata.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | expiredTime: 4 | description: Token's expired time 5 | type: string 6 | format: date-time 7 | _links: 8 | type: array 9 | description: The links related to resource 10 | readOnly: true 11 | minItems: 1 12 | items: 13 | $ref: ../Links/SelfLink.yaml 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAuthentication/TokenModes/password.yaml: -------------------------------------------------------------------------------- 1 | required: 2 | - username 3 | - password 4 | allOf: 5 | - $ref: ../AuthenticationToken.yaml 6 | - properties: 7 | username: 8 | description: The token's username 9 | type: string 10 | password: 11 | description: The token's password 12 | type: string 13 | format: password 14 | writeOnly: true 15 | customerId: 16 | description: The token's customer ID 17 | readOnly: true 18 | allOf: 19 | - $ref: ../../ResourceId.yaml 20 | - $ref: ../AuthenticationTokenMetadata.yaml 21 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAuthentication/TokenModes/passwordless.yaml: -------------------------------------------------------------------------------- 1 | required: 2 | - customerId 3 | allOf: 4 | - $ref: ../AuthenticationToken.yaml 5 | - properties: 6 | customerId: 7 | description: The token's customer ID 8 | allOf: 9 | - $ref: ../../ResourceId.yaml 10 | - $ref: ../AuthenticationTokenMetadata.yaml 11 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerAverageValue.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | currency: 5 | description: Merchant's reporting currency 6 | allOf: 7 | - $ref: ./CurrencyCode.yaml 8 | amount: 9 | description: Average approved payment amount in Merchant's reporting currency 10 | type: number 11 | format: double 12 | amountUsd: 13 | description: Average approved payment amount in USD 14 | type: number 15 | format: double 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/CustomerLifetimeRevenue.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | currency: 5 | description: Merchant's reporting currency 6 | allOf: 7 | - $ref: ./CurrencyCode.yaml 8 | amount: 9 | description: Revenue amount in Merchant's reporting currency 10 | type: number 11 | format: double 12 | amountUsd: 13 | description: Revenue amount in USD 14 | type: number 15 | format: double 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/AuthTransactionEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Auth Transaction object 3 | readOnly: true 4 | properties: 5 | authTransaction: 6 | $ref: ../Transactions/Transaction.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/BankAccountEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Bank Account object 3 | readOnly: true 4 | properties: 5 | bankAccount: 6 | $ref: ../BankAccounts/BankAccount.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/CustomerEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Customer object 3 | readOnly: true 4 | properties: 5 | customer: 6 | $ref: ../Customer.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/FileEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: File object 3 | readOnly: true 4 | properties: 5 | file: 6 | $ref: ../Files/File.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/GatewayAccountEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Gateway Account object 3 | readOnly: true 4 | properties: 5 | gatewayAccount: 6 | $ref: >- 7 | https://api.redoc.ly/registry/rebilly/api-reference-users/users/bundle/master/openapi.yaml#/components/schemas/GatewayAccount 8 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/InitialInvoiceEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Initial Invoice object 3 | readOnly: true 4 | properties: 5 | initialInvoice: 6 | $ref: ../Invoices/Invoice.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/InvoicesEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Invoices collection 3 | readOnly: true 4 | properties: 5 | invoices: 6 | type: array 7 | items: 8 | $ref: ../Invoices/Invoice.yaml 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/LeadSourceEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Lead Source object 3 | readOnly: true 4 | properties: 5 | leadSource: 6 | $ref: ../LeadSource.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/OrganizationEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Organization object 3 | readOnly: true 4 | properties: 5 | organization: 6 | $ref: >- 7 | https://api.redoc.ly/registry/rebilly/api-reference-users/users/bundle/master/openapi.yaml#/components/schemas/Organization 8 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/ParentTransactionEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Retried Transaction object 3 | readOnly: true 4 | properties: 5 | parentTransaction: 6 | $ref: ../Transactions/Transaction.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/PaymentCardEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Payment Card object 3 | readOnly: true 4 | properties: 5 | paymentCard: 6 | $ref: ../PaymentCards/PaymentCard.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/PlanEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Plan object 3 | readOnly: true 4 | properties: 5 | plan: 6 | $ref: ../Plans/Plan.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/ProductEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Product object 3 | readOnly: true 4 | properties: 5 | product: 6 | $ref: ../Product.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/RecentInvoiceEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Recent Invoice object 3 | readOnly: true 4 | properties: 5 | recentInvoice: 6 | $ref: ../Invoices/Invoice.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/RetriedTransactionEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Parent Transaction object 3 | readOnly: true 4 | properties: 5 | retriedTransaction: 6 | $ref: ../Transactions/Transaction.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/SubscriptionEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Subscription object 3 | readOnly: true 4 | properties: 5 | subscription: 6 | $ref: ../Subscription.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/TransactionEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Transaction object 3 | readOnly: true 4 | properties: 5 | transaction: 6 | $ref: ../Transactions/Transaction.yaml 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Embeds/WebsiteEmbed.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Website object 3 | readOnly: true 4 | properties: 5 | website: 6 | type: object 7 | -------------------------------------------------------------------------------- /openapi/components/schemas/Error.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | status: 4 | type: integer 5 | minimum: 100 6 | maximum: 600 7 | description: The HTTP status code. 8 | error: 9 | type: string 10 | type: 11 | type: string 12 | description: >- 13 | A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that 14 | identifies the problem type. It should provide human-readable 15 | documentation for the problem type. When this member is not present, its 16 | value is assumed to be "about:blank". 17 | title: 18 | type: string 19 | description: >- 20 | A short, human-readable summary of the problem type. It SHOULD NOT change 21 | from occurrence to occurrence of the problem, except for purposes of 22 | localization. 23 | -------------------------------------------------------------------------------- /openapi/components/schemas/EventType.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | description: Rebilly event type 3 | readOnly: true 4 | enum: 5 | - dispute-created 6 | - gateway-account-requested 7 | - transaction-processed 8 | - subscription-activated 9 | - subscription-canceled 10 | - subscription-created 11 | - subscription-renewed 12 | - payment-card-expired 13 | - invoice-past-due 14 | - invoice-paid 15 | - transaction-declined 16 | - transaction-process-requested 17 | - risk-score-changed 18 | - transaction-discrepancy-found 19 | -------------------------------------------------------------------------------- /openapi/components/schemas/Files/FileCreateFromInline.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - file 4 | properties: 5 | file: 6 | description: The file in base64 encoded format. 7 | type: string 8 | example: R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs= 9 | isPublic: 10 | description: The File visibility. If public a permalink is provided. 11 | type: boolean 12 | example: false 13 | name: 14 | description: The file name used for downloading 15 | type: string 16 | example: logo.png 17 | description: 18 | description: The file description 19 | type: string 20 | example: My file description 21 | tags: 22 | description: The tags list 23 | type: array 24 | items: 25 | type: string 26 | example: 27 | - test 28 | - tags 29 | -------------------------------------------------------------------------------- /openapi/components/schemas/Files/FileCreateFromUrl.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - url 4 | properties: 5 | url: 6 | description: The URL of the file to upload. 7 | type: string 8 | example: >- 9 | https://blog.rebilly.com/wp-content/uploads/2017/09/rb_LogoInverted_Small.png 10 | isPublic: 11 | description: The File visibility. If public a permalink is provided. 12 | type: boolean 13 | example: false 14 | name: 15 | description: The file name used for downloading 16 | type: string 17 | example: logo.png 18 | description: 19 | description: The file description 20 | type: string 21 | example: My file description 22 | tags: 23 | description: The tags list 24 | type: array 25 | items: 26 | type: string 27 | example: 28 | - test 29 | - tags 30 | -------------------------------------------------------------------------------- /openapi/components/schemas/InvalidError.yaml: -------------------------------------------------------------------------------- 1 | description: Invalid data was sent 2 | allOf: 3 | - $ref: ./Error.yaml 4 | - type: object 5 | properties: 6 | invalidFields: 7 | type: array 8 | items: 9 | type: object 10 | properties: 11 | field: 12 | type: string 13 | description: >- 14 | The field name. Dot notation is used for nested object field 15 | names. 16 | message: 17 | type: string 18 | example: 19 | - field: field1 20 | message: field1 is invalid 21 | - field: subObject.field2 22 | message: field2 is invalid 23 | - field: subObject.field2 24 | message: another error in the field2 25 | -------------------------------------------------------------------------------- /openapi/components/schemas/Invoices/InvoiceIssue.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | issuedTime: 4 | description: Invoice issued time. Will be issued immediately if `null` or omitted. 5 | type: string 6 | format: date-time 7 | nullable: true 8 | dueTime: 9 | description: Invoice due time. Will be set same as `issuedTime` if `null` or omitted. 10 | type: string 11 | format: date-time 12 | nullable: true 13 | -------------------------------------------------------------------------------- /openapi/components/schemas/Invoices/InvoiceReissue.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | dueTime: 4 | description: Invoice due time. Will be set as current date-time if `null` or omitted. 5 | type: string 6 | format: date-time 7 | nullable: true 8 | -------------------------------------------------------------------------------- /openapi/components/schemas/Invoices/InvoiceTax.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | amount: 5 | description: Tax amount 6 | type: number 7 | format: double 8 | description: 9 | type: string 10 | description: Tax description 11 | -------------------------------------------------------------------------------- /openapi/components/schemas/Invoices/InvoiceTimeShift.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: > 3 | The invoice time shift in conjunction with `billingTiming` allows to setup 4 | different billing use cases such as: 5 | 6 | 7 | - Bill immediately when the service period _starts_ 8 | 9 | - Bill immediately after the service period _ends_ 10 | 11 | - Bill _interval of time_ before the service period _starts_ 12 | 13 | - Bill _interval of time_ after the service period _starts_ 14 | 15 | - Bill _interval of time_ before the service period _ends_ 16 | 17 | - Bill _interval of time_ after the service period _ends_ 18 | properties: 19 | issueTimeShift: 20 | $ref: ../Scheduling/IssueTimeShiftInstruction.yaml 21 | dueTimeShift: 22 | $ref: ../Scheduling/DueTimeShiftInstruction.yaml 23 | -------------------------------------------------------------------------------- /openapi/components/schemas/Invoices/InvoiceTransactionAllocation.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | invoiceId: 4 | $ref: ../ResourceId.yaml 5 | transactionId: 6 | $ref: ../ResourceId.yaml 7 | amount: 8 | type: number 9 | currency: 10 | allOf: 11 | - $ref: ../CurrencyCode.yaml 12 | _links: 13 | type: array 14 | description: The links related to resource 15 | readOnly: true 16 | minItems: 2 17 | maxItems: 2 18 | items: 19 | anyOf: 20 | - $ref: ../Links/InvoiceLink.yaml 21 | - $ref: ../Links/TransactionLink.yaml 22 | -------------------------------------------------------------------------------- /openapi/components/schemas/KycDocument/KycDocumentRejection.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | type: 5 | type: string 6 | enum: 7 | - document-unreadable 8 | - document-expired 9 | - document-not-matching 10 | - underage-person 11 | - other 12 | message: 13 | description: The rejection message 14 | type: string 15 | example: Provided document is unreadable 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/LeadSource.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ./LeadSourceData.yaml 3 | - type: object 4 | properties: 5 | original: 6 | readOnly: true 7 | allOf: 8 | - $ref: ./LeadSourceData.yaml 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/ApprovalUrlLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - approvalUrl 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/AttachmentResourceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - customer 10 | - dispute 11 | - invoice 12 | - payment 13 | - plan 14 | - product 15 | - subscription 16 | - transaction 17 | required: 18 | - rel 19 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/AuthTransactionLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - authTransaction 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/CancelUrlLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - cancelUrl 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/CustomerLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - customer 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/DefaultPaymentInstrumentLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - defaultPaymentInstrument 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/DisputeLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - dispute 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/FileDownloadLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - download 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/FileLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - file 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/GatewayAccountLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - gatewayAccount 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/InitialInvoiceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - initialInvoice 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/InvoiceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - invoice 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/InvoicesLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - invoices 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/LeadSourceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - leadSource 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/Link.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | href: 4 | description: The link URL 5 | type: string 6 | required: 7 | - href 8 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/OrganizationLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - organization 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/ParentTransactionLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - parentTransaction 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/PaymentCardLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - paymentCard 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/PermalinkLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - permalink 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/PlanLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - plan 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/ProductLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - product 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/RecalculateInvoiceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - recalculateInvoice 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/RecentInvoiceLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - recentInvoice 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/RefundUrlLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - refundUrl 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/RetriedTransactionLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - retriedTransaction 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/SelfLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - self 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/SignedLinkLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - signedLink 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/SubscriptionLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - subscription 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/TransactionAllocationsLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - transactionAllocations 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/TransactionLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - transaction 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/Links/WebsiteLink.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: ./Link.yaml 4 | properties: 5 | rel: 6 | description: The link type 7 | type: string 8 | enum: 9 | - website 10 | required: 11 | - rel 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentCards/PaymentCardCreatePlain.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - customerId 4 | - pan 5 | - expYear 6 | - expMonth 7 | - billingAddress 8 | properties: 9 | customerId: 10 | description: The Customer's ID. 11 | allOf: 12 | - $ref: ../ResourceId.yaml 13 | pan: 14 | description: The card PAN (Primary Account Number). 15 | type: string 16 | writeOnly: true 17 | expYear: 18 | description: Card's expiry year. 19 | type: integer 20 | expMonth: 21 | description: Card's expiry month. 22 | type: integer 23 | cvv: 24 | description: Card's cvv (card verification value). 25 | type: string 26 | writeOnly: true 27 | billingAddress: 28 | description: The Billing Address. 29 | allOf: 30 | - $ref: ../Contact/ContactObject.yaml 31 | customFields: 32 | $ref: ../ResourceCustomFields.yaml 33 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentCards/PaymentCardCreateToken.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - customerId 4 | - token 5 | properties: 6 | customerId: 7 | description: The Customer's ID. 8 | allOf: 9 | - $ref: ../ResourceId.yaml 10 | token: 11 | description: PaymentCardToken ID. 12 | type: string 13 | customFields: 14 | $ref: ../ResourceCustomFields.yaml 15 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/AlipayInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Alipay payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/AstroPay-CardInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: AstroPay Card payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/BoletoInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Boleto payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/China-UnionPayInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: China UnionPay payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/EPSInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: EPS payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/FlexepinInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Flexepin payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/KlarnaInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Klarna payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/PayPalAccountAuthorization.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - websiteId 4 | - currency 5 | properties: 6 | websiteId: 7 | description: The Website ID 8 | type: string 9 | currency: 10 | allOf: 11 | - $ref: ../CurrencyCode.yaml 12 | amount: 13 | description: The amount to authorize 14 | type: number 15 | format: double 16 | default: 1 17 | gatewayAccountId: 18 | description: The Gateway Account ID which use to send transactions 19 | type: string 20 | redirectUrl: 21 | $ref: ../Transactions/TransactionRedirectUrl.yaml 22 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/QQPayInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: QQPay payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/SMSVoucherInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: SMSVoucher payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/Skrill-Rapid-TransferInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Skrill Rapid Transfer payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/UPayCardInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: SMSVoucher payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/WeChat-PayInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: WeChat Pay payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/achInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: ACH payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | required: 6 | - bankAccountId 7 | properties: 8 | bankAccountId: 9 | description: The bank account identifier string 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/bank-accountInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: ACH payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | required: 6 | - bankAccountId 7 | properties: 8 | bankAccountId: 9 | description: The bank account identifier string 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/bitcoinInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Bitcoin payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/cashInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Cash payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | properties: 6 | receivedBy: 7 | description: The receiver's name 8 | type: string 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/checkInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Check payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | properties: 6 | reference: 7 | description: Reference data 8 | type: string 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/ePay-bgInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: ePay.bg payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/iDEALInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: iDEAL payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/payment-cardInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Payment card payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | required: 6 | - paymentCardId 7 | properties: 8 | paymentCardId: 9 | description: The payment card identifier string 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentInstruments/paypalInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: PayPal payment instrument object 2 | allOf: 3 | - $ref: ../PaymentInstrument.yaml 4 | - type: object 5 | required: 6 | - payPalAccountId 7 | properties: 8 | payPalAccountId: 9 | description: The PayPal account identifier string 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentRetry/AmountAdjustment.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | discriminator: 3 | propertyName: method 4 | mapping: 5 | discount: ./Policies/discount.yaml 6 | partial: ./Policies/partial.yaml 7 | properties: 8 | method: 9 | type: string 10 | enum: 11 | - none 12 | - partial 13 | - discount 14 | required: 15 | - method 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentRetry/PaymentRetry.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | attempts: 4 | type: array 5 | minItems: 1 6 | items: 7 | type: object 8 | properties: 9 | scheduleInstruction: 10 | $ref: ../Scheduling/CommonScheduleInstruction.yaml 11 | paymentInstruction: 12 | $ref: ./AmountAdjustment.yaml 13 | required: 14 | - scheduleInstruction 15 | - paymentInstruction 16 | afterAttemptPolicy: 17 | description: The policy on the attempt finishes 18 | type: string 19 | enum: 20 | - none 21 | - change-subscription-renewal-time 22 | afterRetryEndPolicy: 23 | description: The policy on the retry ends 24 | type: string 25 | enum: 26 | - none 27 | - cancel-subscription 28 | required: 29 | - attempts 30 | - afterAttemptPolicy 31 | - afterRetryEndPolicy 32 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentRetry/Policies/discount.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../AmountAdjustment.yaml 3 | - type: object 4 | properties: 5 | value: 6 | description: The payment amount discount 7 | type: number 8 | format: float 9 | type: 10 | description: The payment amount discount type 11 | type: string 12 | enum: 13 | - percent 14 | - fixed 15 | required: 16 | - value 17 | - type 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentRetry/Policies/partial.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../AmountAdjustment.yaml 3 | - type: object 4 | properties: 5 | value: 6 | description: The payment amount 7 | type: number 8 | format: float 9 | type: 10 | description: The payment amount type 11 | type: string 12 | enum: 13 | - percent 14 | - fixed 15 | required: 16 | - value 17 | - type 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/PaymentInstruments/BBANInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Payment Token instrument object 2 | allOf: 3 | - $ref: ../TokenBankAccountInstrument.yaml 4 | - type: object 5 | required: 6 | - accountNumber 7 | - routingNumber 8 | - accountType 9 | properties: 10 | accountNumber: 11 | description: Bank Account Number 12 | type: string 13 | pattern: '^[0-9]+$' 14 | writeOnly: true 15 | routingNumber: 16 | description: Bank Routing Number 17 | type: string 18 | pattern: '^[0-9]+$' 19 | accountType: 20 | description: Bank Account Type 21 | type: string 22 | enum: 23 | - checking 24 | - savings 25 | - other 26 | bic: 27 | description: Bank Identifier Code 28 | type: string 29 | bankName: 30 | description: Bank name 31 | type: string 32 | last4: 33 | description: Bank Account Number's last 4 digits 34 | type: string 35 | readOnly: true 36 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/PaymentInstruments/IBANInstrument.yaml: -------------------------------------------------------------------------------- 1 | description: Payment Token instrument object 2 | allOf: 3 | - $ref: ../TokenBankAccountInstrument.yaml 4 | - type: object 5 | required: 6 | - accountNumber 7 | properties: 8 | accountNumber: 9 | description: > 10 | Bank Account Number. Detailed information about all ISO 11 | 13616-compliant national IBAN formats is available 12 | 13 | in [SWIFT IBAN 14 | Registry](https://www.swift.com/standards/data-standards/iban). 15 | type: string 16 | writeOnly: true 17 | bic: 18 | description: Bank Identifier Code 19 | type: string 20 | bankName: 21 | description: Bank name 22 | type: string 23 | last4: 24 | description: Bank Account Number's last 4 digits 25 | type: string 26 | readOnly: true 27 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/PaymentToken.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | title: Payment Token 3 | required: 4 | - method 5 | - billingAddress 6 | properties: 7 | id: 8 | description: The token identifier string 9 | readOnly: true 10 | allOf: 11 | - $ref: ../ResourceId.yaml 12 | isUsed: 13 | description: Whether the token was already used 14 | type: boolean 15 | default: false 16 | readOnly: true 17 | method: 18 | allOf: 19 | - $ref: ./TokenMethod.yaml 20 | fingerprint: 21 | description: Device fingerprint hash 22 | type: string 23 | billingAddress: 24 | description: The billing address object 25 | allOf: 26 | - $ref: ../Contact/ContactObject.yaml 27 | leadSource: 28 | allOf: 29 | - $ref: ../LeadSource.yaml 30 | writeOnly: true 31 | createdTime: 32 | description: Token created time 33 | allOf: 34 | - $ref: ../ServerTimestamp.yaml 35 | updatedTime: 36 | description: Token updated time 37 | allOf: 38 | - $ref: ../ServerTimestamp.yaml 39 | usageTime: 40 | description: Token usage time 41 | allOf: 42 | - $ref: ../ServerTimestamp.yaml 43 | expirationTime: 44 | description: Token expiration time 45 | allOf: 46 | - $ref: ../ServerTimestamp.yaml 47 | _links: 48 | type: array 49 | description: The links related to resource 50 | readOnly: true 51 | minItems: 1 52 | items: 53 | $ref: ../Links/SelfLink.yaml 54 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/TokenBankAccountInstrument.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - accountNumberType 4 | discriminator: 5 | propertyName: accountNumberType 6 | mapping: 7 | BBAN: ./PaymentInstruments/BBANInstrument.yaml 8 | IBAN: ./PaymentInstruments/IBANInstrument.yaml 9 | properties: 10 | accountNumberType: 11 | description: >- 12 | Bank's Account Number type. A valid value is basic bank account number 13 | (BBAN) or international bank account number (IBAN). 14 | type: string 15 | default: BBAN 16 | enum: 17 | - IBAN 18 | - BBAN 19 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/TokenMethod.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | description: The token payment method 3 | enum: 4 | - cash 5 | - check 6 | - paypal 7 | - Alipay 8 | - AstroPay Card 9 | - bank-transfer 10 | - bitcoin 11 | - Boleto 12 | - cash-deposit 13 | - CASHlib 14 | - CashToCode 15 | - China UnionPay 16 | - domestic-cards 17 | - echeck 18 | - ecoPayz 19 | - ecoVoucher 20 | - EPS 21 | - ePay.bg 22 | - Flexepin 23 | - Giropay 24 | - Gpaysafe 25 | - iDebit 26 | - iDEAL 27 | - INOVAPAY-pin 28 | - INOVAPAY-wallet 29 | - InstaDebit 30 | - instant-bank-transfer 31 | - Interac-online 32 | - Interac-eTransfer 33 | - invoice 34 | - Jeton 35 | - Klarna 36 | - miscellaneous 37 | - Neteller 38 | - Nordea-Solo 39 | - OchaPay 40 | - online-bank-transfer 41 | - Onlineueberweisen 42 | - Paysafecard 43 | - Pay4Fun 44 | - PinPay 45 | - phone 46 | - POLi 47 | - Przelewy24 48 | - QQPay 49 | - Resurs 50 | - SEPA 51 | - Skrill 52 | - Skrill Rapid Transfer 53 | - SMSVoucher 54 | - SparkPay 55 | - Trustly 56 | - UPayCard 57 | - voucher 58 | - WeChat Pay 59 | -------------------------------------------------------------------------------- /openapi/components/schemas/PaymentTokens/TokenPaymentCardInstrument.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Payment Token instrument object 3 | required: 4 | - pan 5 | - billingAddress 6 | - expMonth 7 | - expYear 8 | properties: 9 | pan: 10 | description: Payment Card PAN (Primary Account Number) 11 | type: string 12 | writeOnly: true 13 | bin: 14 | description: Payment Card BIN (the PAN's first 6 digits) 15 | type: string 16 | format: bin 17 | readOnly: true 18 | last4: 19 | description: Payment Card PAN's last 4 digits 20 | type: string 21 | readOnly: true 22 | brand: 23 | readOnly: true 24 | allOf: 25 | - $ref: >- 26 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/payment-instruments/payment-card-brands.json 27 | expMonth: 28 | description: Payment Card expiry month 29 | type: integer 30 | expYear: 31 | description: Payment Card expiry year 32 | type: integer 33 | cvv: 34 | description: Payment Card CVV/CVC 35 | type: string 36 | writeOnly: true 37 | -------------------------------------------------------------------------------- /openapi/components/schemas/Plans/Formulas/fixed-fee.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../PlanPriceFormula.yaml 3 | - type: object 4 | required: 5 | - price 6 | properties: 7 | price: 8 | description: > 9 | For the very simple price when it's fixed and does not depend on the 10 | quantity chosen by customer. 11 | 12 | 13 | If the price is 0, it's free. 14 | type: number 15 | format: double 16 | example: 99.95 17 | -------------------------------------------------------------------------------- /openapi/components/schemas/Plans/Formulas/flat-rate.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../PlanPriceFormula.yaml 3 | - type: object 4 | required: 5 | - price 6 | properties: 7 | price: 8 | description: | 9 | Flat-rate pricing is represented in a simple price per unit. 10 | Some examples: 11 | 12 | - $30 per unit 13 | - $0.10 per transaction 14 | - $50 per period 15 | 16 | If the price is 0, it's free. 17 | type: number 18 | format: double 19 | example: 99.95 20 | maxQuantity: 21 | description: 'If the value is `null`, it''s assumed to be infinite.' 22 | type: integer 23 | example: 1 24 | -------------------------------------------------------------------------------- /openapi/components/schemas/Plans/PlanBillingTiming.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | default: prepaid 3 | description: | 4 | The billing timing in relation to the service period. 5 | For `prepaid` plans the customer pays when the service period starts, 6 | whereas, for `postpaid` plans, the customer pays when the service period ends. 7 | enum: 8 | - prepaid 9 | - postpaid 10 | -------------------------------------------------------------------------------- /openapi/components/schemas/Plans/PlanPeriod.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - unit 4 | - length 5 | properties: 6 | unit: 7 | description: The unit of time 8 | type: string 9 | enum: 10 | - day 11 | - week 12 | - month 13 | - year 14 | length: 15 | description: The length of time 16 | type: integer 17 | -------------------------------------------------------------------------------- /openapi/components/schemas/Plans/PlanPriceFormula.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | discriminator: 3 | propertyName: formula 4 | mapping: 5 | fixed-fee: ./Formulas/fixed-fee.yaml 6 | flat-rate: ./Formulas/flat-rate.yaml 7 | stairstep: ./Formulas/stairstep.yaml 8 | tiered: ./Formulas/tiered.yaml 9 | volume: ./Formulas/volume.yaml 10 | required: 11 | - formula 12 | properties: 13 | formula: 14 | type: string 15 | description: > 16 | The price formula determines what algorithm is used to calculate the 17 | invoice price based on a few factors, 18 | 19 | - the quantity in the subscription (which may be variable if usage 20 | pricing, otherwise determined when creating the subscription) 21 | 22 | - the price brackets data 23 | 24 | 25 | To determine which formula is correct, please see the price formula 26 | documentation. 27 | enum: 28 | - fixed-fee 29 | - flat-rate 30 | - stairstep 31 | - tiered 32 | - volume 33 | -------------------------------------------------------------------------------- /openapi/components/schemas/PriceBasedShippingRate.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - name 4 | - currency 5 | - price 6 | properties: 7 | name: 8 | description: The shipping rate name 9 | type: string 10 | maxLength: 255 11 | minOrderSubtotal: 12 | description: >- 13 | Minimum order subtotal for which this shipping rate is applicable, 14 | defaults to 0.00 15 | type: number 16 | format: double 17 | default: 0 18 | maxOrderSubtotal: 19 | description: >- 20 | Maximum order subtotal for which this shipping rate is applicable (NULL if 21 | no maximum) 22 | type: number 23 | format: double 24 | price: 25 | description: The shipping price - 0 is a valid value (for free) 26 | type: number 27 | format: double 28 | currency: 29 | allOf: 30 | - $ref: ./CurrencyCode.yaml 31 | _links: 32 | type: array 33 | description: The links related to resource 34 | readOnly: true 35 | minItems: 1 36 | items: 37 | $ref: ./Links/SelfLink.yaml 38 | -------------------------------------------------------------------------------- /openapi/components/schemas/ResetPasswordToken.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - username 4 | - password 5 | properties: 6 | token: 7 | description: The token's identifier string 8 | type: string 9 | readOnly: true 10 | username: 11 | description: The token's username 12 | type: string 13 | credentialId: 14 | description: Token's credential ID 15 | type: string 16 | readOnly: true 17 | expiredTime: 18 | description: Password expired time 19 | type: string 20 | format: date-time 21 | _links: 22 | type: array 23 | description: The links related to resource 24 | readOnly: true 25 | minItems: 1 26 | items: 27 | $ref: ./Links/SelfLink.yaml 28 | -------------------------------------------------------------------------------- /openapi/components/schemas/ResourceCustomFields.yaml: -------------------------------------------------------------------------------- 1 | description: > 2 | "Custom Fields list as a map `{"custom field name": "custom field value", 3 | ...}"`. 4 | 5 | The format must follow the saved format (see Custom Fields section for the 6 | formats). 7 | type: object 8 | -------------------------------------------------------------------------------- /openapi/components/schemas/ResourceId.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | description: The resource ID. Defaults to UUID v4 3 | maxLength: 50 4 | example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 5 | -------------------------------------------------------------------------------- /openapi/components/schemas/Rules/MatchedRule.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | id: 5 | description: Event tracking id 6 | readOnly: true 7 | allOf: 8 | - $ref: ../ResourceId.yaml 9 | event: 10 | $ref: ../EventType.yaml 11 | description: 12 | description: Rule's description 13 | type: string 14 | rulesVersion: 15 | type: integer 16 | description: Rule version 17 | occurredTime: 18 | description: Time when event occurred. 19 | allOf: 20 | - $ref: ../ServerTimestamp.yaml 21 | context: 22 | type: object 23 | description: Event's context 24 | additionalProperties: 25 | type: string 26 | processedRules: 27 | type: object 28 | description: Processed rules 29 | properties: 30 | name: 31 | type: string 32 | description: Rule name 33 | actions: 34 | type: array 35 | description: Rule actions applied 36 | items: 37 | type: string 38 | result: 39 | type: string 40 | description: Rule result 41 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/CommonScheduleInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: The calculation instruction of scheduled time 3 | discriminator: 4 | propertyName: method 5 | mapping: 6 | auto: ./Methods/auto.yaml 7 | date-interval: ./Methods/date-interval.yaml 8 | day-of-month: ./Methods/day-of-month.yaml 9 | day-of-week: ./Methods/day-of-week.yaml 10 | immediately: ./Methods/immediately.yaml 11 | intelligent: ./Methods/intelligent.yaml 12 | properties: 13 | method: 14 | type: string 15 | enum: 16 | - auto 17 | - intelligent 18 | - immediately 19 | - date-interval 20 | - day-of-month 21 | - day-of-week 22 | required: 23 | - method 24 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/CustomEventScheduleInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: The calculation instruction of scheduled time 3 | discriminator: 4 | propertyName: method 5 | mapping: 6 | date-interval: ./Methods/date-interval.yaml 7 | day-of-month: ./Methods/day-of-month.yaml 8 | day-of-week: ./Methods/day-of-week.yaml 9 | properties: 10 | method: 11 | type: string 12 | enum: 13 | - date-interval 14 | - day-of-month 15 | - day-of-week 16 | required: 17 | - method 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/DueTimeShiftInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: > 3 | The calculation instruction of due time. 4 | 5 | This is used in conjunction with the **billing anchor** to calculate due time 6 | of invoice. 7 | 8 | The chronology of due time shift is always **after**. 9 | default: 10 | duration: 1 11 | unit: hour 12 | properties: 13 | duration: 14 | type: integer 15 | description: The number of the units 16 | minimum: 1 17 | unit: 18 | oneOf: 19 | - $ref: >- 20 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-unit.json 21 | - $ref: >- 22 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-plural-unit.json 23 | required: 24 | - duration 25 | - unit 26 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/InvoiceRetryScheduleInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: The calculation instruction of scheduled time 3 | discriminator: 4 | propertyName: method 5 | mapping: 6 | date-interval: ./Methods/date-interval.yaml 7 | day-of-month: ./Methods/day-of-month.yaml 8 | day-of-week: ./Methods/day-of-week.yaml 9 | immediately: ./Methods/immediately.yaml 10 | intelligent: ./Methods/intelligent.yaml 11 | properties: 12 | method: 13 | type: string 14 | enum: 15 | - intelligent 16 | - immediately 17 | - date-interval 18 | - day-of-month 19 | - day-of-week 20 | required: 21 | - method 22 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/IssueTimeShiftInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: > 3 | The calculation instruction of billing time. 4 | 5 | This is used in conjunction with the **service period anchor** to calculate 6 | the time the invoice is issued. 7 | required: 8 | - chronology 9 | - duration 10 | - unit 11 | properties: 12 | chronology: 13 | type: string 14 | description: The chronology of the billing time relatively to the service period start. 15 | enum: 16 | - before 17 | duration: 18 | type: integer 19 | description: The number of the units 20 | minimum: 1 21 | unit: 22 | oneOf: 23 | - $ref: >- 24 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-unit.json 25 | - $ref: >- 26 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-plural-unit.json 27 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/auto.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/date-interval.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | - $ref: ../CustomEventScheduleInstruction.yaml 4 | - $ref: ../InvoiceRetryScheduleInstruction.yaml 5 | - type: object 6 | properties: 7 | duration: 8 | type: integer 9 | description: The number of the units 10 | minimum: 1 11 | unit: 12 | oneOf: 13 | - $ref: >- 14 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-unit.json 15 | - $ref: >- 16 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-plural-unit.json 17 | required: 18 | - duration 19 | - unit 20 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/day-of-month.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | - $ref: ../CustomEventScheduleInstruction.yaml 4 | - $ref: ../ServicePeriodAnchorInstruction.yaml 5 | - $ref: ../InvoiceRetryScheduleInstruction.yaml 6 | - type: object 7 | properties: 8 | day: 9 | type: integer 10 | minimum: 1 11 | maximum: 31 12 | description: | 13 | The day of the month when event will be scheduled. 14 | Be aware if the month has less days, 15 | the last day of the month will be selected. 16 | time: 17 | $ref: >- 18 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/extended-time-iso8601.json 19 | required: 20 | - day 21 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/day-of-week.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | - $ref: ../CustomEventScheduleInstruction.yaml 4 | - $ref: ../ServicePeriodAnchorInstruction.yaml 5 | - $ref: ../InvoiceRetryScheduleInstruction.yaml 6 | - type: object 7 | properties: 8 | day: 9 | $ref: >- 10 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/long-day-of-week.json 11 | week: 12 | type: string 13 | default: next 14 | enum: 15 | - next 16 | - first-in-month 17 | - last-in-month 18 | time: 19 | $ref: >- 20 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/extended-time-iso8601.json 21 | required: 22 | - day 23 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/immediately.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | - $ref: ../ServicePeriodAnchorInstruction.yaml 4 | - $ref: ../InvoiceRetryScheduleInstruction.yaml 5 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/Methods/intelligent.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../CommonScheduleInstruction.yaml 3 | - $ref: ../CustomEventScheduleInstruction.yaml 4 | - $ref: ../InvoiceRetryScheduleInstruction.yaml 5 | - type: object 6 | properties: 7 | duration: 8 | type: integer 9 | description: The number of the units 10 | minimum: 1 11 | unit: 12 | oneOf: 13 | - $ref: >- 14 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-unit.json 15 | - $ref: >- 16 | https://rebilly.github.io/api-standards/schema/json-schema-draft-04/date-time/time-plural-unit.json 17 | required: 18 | - duration 19 | - unit 20 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/README.md: -------------------------------------------------------------------------------- 1 | # Scheduling objects 2 | 3 | ## Objects 4 | 5 | ### Schedule method 6 | 7 | Strategies how to calculate relative time. It answers the question of "when" to schedule. 8 | 9 | Available methods: 10 | 11 | - intelligent 12 | - immediately 13 | - date-interval 14 | - day-of-month 15 | - day-of-week 16 | 17 | ## To do 18 | 19 | - Object to define repetition: once, time duration (repeat 1 month), etc 20 | -------------------------------------------------------------------------------- /openapi/components/schemas/Scheduling/ServicePeriodAnchorInstruction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: > 3 | Instruction for calculating the service period anchor. 4 | 5 | This is used in conjunction with the **subscription start** to calculate the 6 | time the service period starts and ends. 7 | discriminator: 8 | propertyName: method 9 | mapping: 10 | day-of-month: ./Methods/day-of-month.yaml 11 | day-of-week: ./Methods/day-of-week.yaml 12 | immediately: ./Methods/immediately.yaml 13 | default: 14 | method: immediately 15 | required: 16 | - method 17 | properties: 18 | method: 19 | type: string 20 | default: immediately 21 | enum: 22 | - immediately 23 | - day-of-month 24 | - day-of-week 25 | -------------------------------------------------------------------------------- /openapi/components/schemas/Search.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | customers: 4 | description: List of returned customers 5 | readOnly: true 6 | type: array 7 | items: 8 | allOf: 9 | - $ref: ./Customer.yaml 10 | invoices: 11 | description: List of returned invoices 12 | readOnly: true 13 | type: array 14 | items: 15 | allOf: 16 | - $ref: ./Invoices/Invoice.yaml 17 | orders: 18 | description: List of returned orders 19 | readOnly: true 20 | type: array 21 | items: 22 | allOf: 23 | - $ref: ./Subscription.yaml 24 | transactions: 25 | description: List of returned transactions 26 | readOnly: true 27 | type: array 28 | items: 29 | allOf: 30 | - $ref: ./Transactions/Transaction.yaml 31 | searched: 32 | description: 'Names of searched resources, even if they returned nothing' 33 | readOnly: true 34 | type: array 35 | items: 36 | type: string 37 | -------------------------------------------------------------------------------- /openapi/components/schemas/ServerTimestamp.yaml: -------------------------------------------------------------------------------- 1 | type: string 2 | description: 'Read-only timestamp, automatically assigned on back-end.' 3 | format: date-time 4 | readOnly: true 5 | -------------------------------------------------------------------------------- /openapi/components/schemas/Subscription/OrderTypes/one-time-order.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ../../Subscription.yaml 3 | - properties: 4 | status: 5 | description: One-time order status 6 | type: string 7 | readOnly: true 8 | enum: 9 | - pending 10 | - completed 11 | - abandoned 12 | - $ref: ../SubscriptionMetadata.yaml 13 | -------------------------------------------------------------------------------- /openapi/components/schemas/Subscription/SubscriptionCancellationState.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | canceledTime: 4 | description: Subscription canceled time 5 | allOf: 6 | - $ref: ../ServerTimestamp.yaml 7 | canceledBy: 8 | description: Canceled by 9 | type: string 10 | readOnly: true 11 | enum: 12 | - merchant 13 | - customer 14 | - rebilly 15 | cancelCategory: 16 | description: Cancel category 17 | type: string 18 | readOnly: true 19 | enum: 20 | - billing-failure 21 | - did-not-use 22 | - did-not-want 23 | - missing-features 24 | - bugs-or-problems 25 | - do-not-remember 26 | - risk-warning 27 | - contract-expired 28 | - too-expensive 29 | - never-started 30 | - switched-plan 31 | - other 32 | cancelDescription: 33 | description: Cancel reason description in free form 34 | type: string 35 | readOnly: true 36 | maxLength: 255 37 | -------------------------------------------------------------------------------- /openapi/components/schemas/Subscription/SubscriptionMetadata.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | customFields: 4 | $ref: ../ResourceCustomFields.yaml 5 | createdTime: 6 | description: Subscription created time 7 | allOf: 8 | - $ref: ../ServerTimestamp.yaml 9 | updatedTime: 10 | description: Subscription updated time 11 | allOf: 12 | - $ref: ../ServerTimestamp.yaml 13 | _links: 14 | type: array 15 | description: The links related to resource 16 | readOnly: true 17 | minItems: 1 18 | items: 19 | anyOf: 20 | - $ref: ../Links/SelfLink.yaml 21 | - $ref: ../Links/CustomerLink.yaml 22 | - $ref: ../Links/WebsiteLink.yaml 23 | - $ref: ../Links/LeadSourceLink.yaml 24 | -------------------------------------------------------------------------------- /openapi/components/schemas/Subscription/UpcomingInvoiceItem.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Line item 3 | required: 4 | - type 5 | - unitPriceAmount 6 | - unitPriceCurrency 7 | - quantity 8 | properties: 9 | type: 10 | description: Type of line item 11 | type: string 12 | enum: 13 | - debit 14 | - credit 15 | description: 16 | description: Description of line item 17 | type: string 18 | unitPriceAmount: 19 | description: Unit price of the line item 20 | type: number 21 | format: double 22 | example: 49.95 23 | unitPriceCurrency: 24 | allOf: 25 | - $ref: ../CurrencyCode.yaml 26 | quantity: 27 | description: Quantity of line item 28 | type: integer 29 | example: 1 30 | periodStartTime: 31 | description: Date-time when the period begins for this item 32 | type: string 33 | format: date-time 34 | periodEndTime: 35 | description: Date-time when the period ends for this item 36 | type: string 37 | format: date-time 38 | createdTime: 39 | description: Date-time when the item was added to the subscription 40 | allOf: 41 | - $ref: ../ServerTimestamp.yaml 42 | -------------------------------------------------------------------------------- /openapi/components/schemas/Subscription/UpcomingInvoiceItemCollection.yaml: -------------------------------------------------------------------------------- 1 | type: array 2 | items: 3 | $ref: ./UpcomingInvoiceItem.yaml 4 | -------------------------------------------------------------------------------- /openapi/components/schemas/SubscriptionInvoice.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | transactionId: 4 | description: >- 5 | If present, applies a payment to the invoice created. If the payment is 6 | for the invoice total, it would be marked as paid. 7 | allOf: 8 | - $ref: ./ResourceId.yaml 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Tags/Tag.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Tag 3 | required: 4 | - name 5 | properties: 6 | id: 7 | description: The tag's identifier string 8 | readOnly: true 9 | allOf: 10 | - $ref: ../ResourceId.yaml 11 | name: 12 | description: 'The tag''s unique name, which is case-insensitive.' 13 | type: string 14 | maxLength: 255 15 | pattern: '^[@~\-\.\w\s]+$' 16 | example: New 17 | createdTime: 18 | description: The tag's created time 19 | allOf: 20 | - $ref: ../ServerTimestamp.yaml 21 | updatedTime: 22 | description: The tag's updated time 23 | allOf: 24 | - $ref: ../ServerTimestamp.yaml 25 | _links: 26 | type: array 27 | description: The links related to resource 28 | readOnly: true 29 | minItems: 1 30 | items: 31 | anyOf: 32 | - $ref: ../Links/SelfLink.yaml 33 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/Actions/redemption-cancel.yaml: -------------------------------------------------------------------------------- 1 | description: Cancel Redemption 2 | allOf: 3 | - $ref: ../TimelineAction.yaml 4 | - type: object 5 | properties: 6 | redemptionId: 7 | allOf: 8 | - $ref: ../../ResourceId.yaml 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/Actions/resend-email.yaml: -------------------------------------------------------------------------------- 1 | description: Resend Email action 2 | allOf: 3 | - $ref: ../TimelineAction.yaml 4 | - type: object 5 | properties: 6 | messageId: 7 | allOf: 8 | - $ref: ../../ResourceId.yaml 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/CustomerTimelineCustomEvent.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - name 4 | properties: 5 | id: 6 | description: Customer Timeline Custom Event identifier string 7 | readOnly: true 8 | allOf: 9 | - $ref: ../ResourceId.yaml 10 | name: 11 | description: >- 12 | Customer Timeline Custom Event type name. It must not be similar to any 13 | Rebilly system event. 14 | type: string 15 | minLength: 1 16 | maxLength: 255 17 | createdTime: 18 | description: Customer Timeline Custom event created time 19 | allOf: 20 | - $ref: ../ServerTimestamp.yaml 21 | updatedTime: 22 | description: Customer Timeline Custom event updated time 23 | allOf: 24 | - $ref: ../ServerTimestamp.yaml 25 | _links: 26 | type: array 27 | description: The links related to resource 28 | readOnly: true 29 | minItems: 1 30 | items: 31 | $ref: ../Links/SelfLink.yaml 32 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/TimelineAction.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | discriminator: 3 | propertyName: action 4 | mapping: 5 | redemption-cancel: ./Actions/redemption-cancel.yaml 6 | resend-email: ./Actions/resend-email.yaml 7 | readOnly: true 8 | properties: 9 | action: 10 | type: string 11 | enum: 12 | - resend-email 13 | - redemption-cancel 14 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/TimelineExtraData.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Additional data 3 | readOnly: true 4 | properties: 5 | actions: 6 | description: >- 7 | Actions available to a Timeline message. Can be empty in case no actions 8 | are available for a message 9 | type: array 10 | minItems: 0 11 | items: 12 | $ref: ./TimelineAction.yaml 13 | tables: 14 | type: array 15 | minItems: 0 16 | items: 17 | $ref: ./TimelineTable.yaml 18 | author: 19 | type: object 20 | description: Timeline comment author data 21 | properties: 22 | userFullName: 23 | type: string 24 | userId: 25 | type: string 26 | mentions: 27 | type: object 28 | additionalProperties: 29 | type: string 30 | example: 31 | '@test@mail.com': userId-1 32 | links: 33 | type: array 34 | items: 35 | type: object 36 | properties: 37 | resourceType: 38 | type: string 39 | enum: 40 | - kyc-document 41 | - invoice 42 | - subscription 43 | - transaction 44 | - email-message 45 | - dispute 46 | - credit-memo 47 | - coupon 48 | resourceId: 49 | $ref: ../ResourceId.yaml 50 | placeholder: 51 | type: string 52 | example: KYC Document 53 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/TimelineTable.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: Additional information about Timeline message 3 | discriminator: 4 | propertyName: type 5 | mapping: 6 | three-columns: ./three-columns.yaml 7 | two-columns: ./two-columns.yaml 8 | properties: 9 | type: 10 | type: string 11 | enum: 12 | - two-columns 13 | - three-columns 14 | title: 15 | type: string 16 | description: Data table title 17 | footer: 18 | type: string 19 | description: Data table footer 20 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/three-columns.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ./TimelineTable.yaml 3 | - type: object 4 | properties: 5 | data: 6 | type: array 7 | description: Table data. Each array element represents a table row 8 | items: 9 | type: object 10 | properties: 11 | attribute: 12 | type: string 13 | previousValue: 14 | type: string 15 | newValue: 16 | type: string 17 | example: 18 | attribute: Descriptor 19 | previousValue: test.com 20 | newValue: new-test.com 21 | -------------------------------------------------------------------------------- /openapi/components/schemas/Timelines/two-columns.yaml: -------------------------------------------------------------------------------- 1 | allOf: 2 | - $ref: ./TimelineTable.yaml 3 | - type: object 4 | properties: 5 | data: 6 | type: array 7 | description: Table data. Each array element represents a table row 8 | items: 9 | type: object 10 | properties: 11 | attribute: 12 | type: string 13 | value: 14 | type: string 15 | example: 16 | attribute: Who 17 | value: John Doe 18 | -------------------------------------------------------------------------------- /openapi/components/schemas/TransactionGatewayLog.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | properties: 4 | headers: 5 | description: The request headers 6 | type: array 7 | items: 8 | type: string 9 | url: 10 | description: The request URL 11 | type: string 12 | request: 13 | description: The request body 14 | type: string 15 | response: 16 | description: The response body 17 | type: string 18 | duration: 19 | description: 'The request time, msec' 20 | type: integer 21 | createdTime: 22 | description: The log entry created time 23 | allOf: 24 | - $ref: ./ServerTimestamp.yaml 25 | _links: 26 | type: array 27 | description: The links related to resource 28 | minItems: 1 29 | items: 30 | $ref: ./Links/TransactionLink.yaml 31 | -------------------------------------------------------------------------------- /openapi/components/schemas/TransactionRefund.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - amount 4 | properties: 5 | amount: 6 | description: Refund amount 7 | type: number 8 | format: double 9 | -------------------------------------------------------------------------------- /openapi/components/schemas/Transactions/ThreeDSecureResult.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | readOnly: true 3 | required: 4 | - enrolled 5 | - authenticated 6 | - liability 7 | properties: 8 | enrolled: 9 | description: Is the cardholder enrolled in 3D Secure 10 | type: string 11 | enum: 12 | - 'yes' 13 | - 'no' 14 | - invalid card/timeout 15 | - unavailable 16 | authenticated: 17 | description: The 3D Secure entry Auth Response Status 18 | type: string 19 | enum: 20 | - 'yes' 21 | - 'no' 22 | - not applicable 23 | - attempted 24 | liability: 25 | type: string 26 | enum: 27 | - protected 28 | - not protected 29 | - protected (attempt) 30 | -------------------------------------------------------------------------------- /openapi/components/schemas/Transactions/TransactionNotificationUrl.yaml: -------------------------------------------------------------------------------- 1 | description: > 2 | The URL where a server-to-server POST notification will be sent. It will be 3 | sent when the 4 | 5 | transaction's result is finalized after a timeout or an offsite interaction. 6 | Do not trust the 7 | 8 | notification; follow with a GET request to confirm the result of the 9 | transaction. Please 10 | 11 | respond with a 2xx HTTP status code, or we will reattempt the request again. 12 | 13 | The 2 placeholders are available to use in this URI: `{id}` and `{result}`. 14 | type: string 15 | format: uri 16 | -------------------------------------------------------------------------------- /openapi/components/schemas/Transactions/TransactionRedirectUrl.yaml: -------------------------------------------------------------------------------- 1 | description: | 2 | The URL to redirect the end-user when an offsite transaction is completed. 3 | The 2 placeholders are available to use in this URI: `{id}` and `{result}`. 4 | Defaults to the website's configured URL. 5 | type: string 6 | format: uri 7 | -------------------------------------------------------------------------------- /openapi/components/securitySchemes/JWT.yaml: -------------------------------------------------------------------------------- 1 | description: > 2 | You can create a JSON Web Token (JWT) via our [JWT Session 3 | resource](https://user-api-docs.rebilly.com/#operation/PostSigninRequest). 4 | 5 | Usage format: `Bearer ` 6 | type: http 7 | scheme: bearer 8 | bearerFormat: JWT 9 | -------------------------------------------------------------------------------- /openapi/components/securitySchemes/PublishableApiKey.yaml: -------------------------------------------------------------------------------- 1 | description: > 2 | Only for the Tokens resource. 3 | 4 | You can create a Publishable API Key via our [API Keys 5 | resource](https://user-api-docs.rebilly.com/#tag/API-Keys), by 6 | specifying the type as `publishable`. 7 | name: Authorization 8 | type: apiKey 9 | in: header 10 | -------------------------------------------------------------------------------- /openapi/components/securitySchemes/SecretApiKey.yaml: -------------------------------------------------------------------------------- 1 | description: | 2 | When you sign up for an account, you are given your first secret API key. 3 | To do so please [follow this link.](https://app.rebilly.com/signup) 4 | Also you can generate additional API keys, and delete API keys (as you may 5 | need to rotate your keys in the future). All API keys can be restricted to a 6 | small set of permissions (restricted API keys). 7 | name: REB-APIKEY 8 | type: apiKey 9 | in: header 10 | -------------------------------------------------------------------------------- /openapi/paths/3dsecure@{id}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - 3D Secure 7 | summary: Retrieve a ThreeDSecure entry 8 | operationId: Get3DSecure 9 | description: | 10 | Retrieve a ThreeDSecure entry with specified identifier string 11 | responses: 12 | '200': 13 | description: ThreeDSecure entry was retrieved successfully 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/ThreeDSecure.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | -------------------------------------------------------------------------------- /openapi/paths/README.md: -------------------------------------------------------------------------------- 1 | Paths 2 | ===== 3 | 4 | * Write each path specification in separate file 5 | * Filename is mapped to path by replacing `@` with `/`, i.e. `user@{username}.yaml` matches to `user/{username}` path 6 | -------------------------------------------------------------------------------- /openapi/paths/bank-accounts@{id}@deactivation.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Bank Accounts 7 | summary: Deactivate a Bank Account 8 | operationId: PostBankAccountDeactivation 9 | description: | 10 | Deactivate a Bank Account 11 | responses: 12 | '201': 13 | description: Bank Account was deactivated 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/BankAccounts/BankAccount.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | '409': 30 | $ref: ../components/responses/Conflict.yaml 31 | x-code-samples: 32 | - lang: PHP 33 | source: 34 | $ref: '../code_samples/PHP/bank-accounts@{id}@deactivation/post.php' 35 | -------------------------------------------------------------------------------- /openapi/paths/coupons-redemptions@{id}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Coupons 7 | summary: Retrieve a coupon redemption with specified identifier string 8 | operationId: GetCouponRedemption 9 | responses: 10 | '200': 11 | description: Retrieve a coupon redemption with specified identifier string 12 | content: 13 | application/json: 14 | schema: 15 | $ref: ../components/schemas/Coupon/CouponRedemption.yaml 16 | '401': 17 | $ref: ../components/responses/AccessForbidden.yaml 18 | '404': 19 | $ref: ../components/responses/NotFound.yaml 20 | x-code-samples: 21 | - lang: PHP 22 | source: 23 | $ref: '../code_samples/PHP/coupons-redemptions@{id}/get.php' 24 | -------------------------------------------------------------------------------- /openapi/paths/coupons-redemptions@{id}@cancel.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Coupons 7 | summary: Cancel a coupon redemption 8 | operationId: PostCouponRedemptionCancellation 9 | responses: 10 | '201': 11 | description: Cancel a coupon redemption 12 | '401': 13 | $ref: ../components/responses/AccessForbidden.yaml 14 | '404': 15 | $ref: ../components/responses/NotFound.yaml 16 | x-code-samples: 17 | - lang: PHP 18 | source: 19 | $ref: '../code_samples/PHP/coupons-redemptions@{id}@cancel/post.php' 20 | -------------------------------------------------------------------------------- /openapi/paths/custom-fields@{resource}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/customFieldResource.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Custom Fields 7 | summary: Retrieve Custom Fields 8 | operationId: GetCustomFieldCollection 9 | description: | 10 | Retrieve a schema of Custom Fields for the given resource type 11 | responses: 12 | '200': 13 | description: A schema of Custom Fields was retrieved successfully 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | description: The list of custom fields 25 | type: array 26 | items: 27 | $ref: ../components/schemas/CustomField.yaml 28 | '401': 29 | $ref: ../components/responses/AccessForbidden.yaml 30 | x-code-samples: 31 | - lang: PHP 32 | source: 33 | $ref: '../code_samples/PHP/custom-fields@{resource}/get.php' 34 | -------------------------------------------------------------------------------- /openapi/paths/customer-timeline-custom-events@{id}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Customers Timeline 7 | summary: >- 8 | Retrieve customer timeline custom event type with specified identifier 9 | string 10 | operationId: GetCustomerTimelineCustomEventType 11 | description: | 12 | Retrieve customer timeline custom event type 13 | responses: 14 | '200': 15 | description: Customer Timeline custom event type was retrieved successfully 16 | headers: 17 | Rate-Limit-Limit: 18 | $ref: ../components/headers/Rate-Limit-Limit.yaml 19 | Rate-Limit-Remaining: 20 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 21 | Rate-Limit-Reset: 22 | $ref: ../components/headers/Rate-Limit-Reset.yaml 23 | Pagination-Total: 24 | $ref: ../components/headers/Pagination-Total.yaml 25 | Pagination-Limit: 26 | $ref: ../components/headers/Pagination-Limit.yaml 27 | Pagination-Offset: 28 | $ref: ../components/headers/Pagination-Offset.yaml 29 | content: 30 | application/json: 31 | schema: 32 | $ref: ../components/schemas/Timelines/CustomerTimelineCustomEvent.yaml 33 | '401': 34 | $ref: ../components/responses/AccessForbidden.yaml 35 | -------------------------------------------------------------------------------- /openapi/paths/customers@{id}@upcoming-invoices.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Invoices 7 | summary: Retrieve customer's upcoming invoices 8 | operationId: GetCustomerUpcomingInvoiceCollection 9 | description: > 10 | Retrieve a list of upcoming invoices from the subscriptions which belong to 11 | the given customer. 12 | 13 | The endpoint is temporary before upcoming invoices get a complete 14 | integration. 15 | parameters: 16 | - $ref: ../components/parameters/collectionExpand.yaml 17 | responses: 18 | '200': 19 | description: Upcoming invoices are retrieved successfully. 20 | headers: 21 | Rate-Limit-Limit: 22 | $ref: ../components/headers/Rate-Limit-Limit.yaml 23 | Rate-Limit-Remaining: 24 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 25 | Rate-Limit-Reset: 26 | $ref: ../components/headers/Rate-Limit-Reset.yaml 27 | content: 28 | application/json: 29 | schema: 30 | type: array 31 | items: 32 | $ref: ../components/schemas/Invoices/Invoice.yaml 33 | '401': 34 | $ref: ../components/responses/AccessForbidden.yaml 35 | '404': 36 | $ref: ../components/responses/NotFound.yaml 37 | -------------------------------------------------------------------------------- /openapi/paths/disputes@{id}@matched-rules.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Disputes 7 | summary: Get matched rules for the dispute 8 | operationId: GetDisputeMatchedRuleCollection 9 | description: Get matched rules for the dispute 10 | responses: 11 | '200': 12 | description: List of matched rules was retrieved successfully. 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | type: array 24 | items: 25 | $ref: ../components/schemas/Rules/MatchedRule.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/paths/files@{id}@download.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Files 7 | summary: Download a file 8 | operationId: GetFileDownload 9 | description: | 10 | Download a file 11 | responses: 12 | '200': 13 | description: The file was retrieved successfully 14 | headers: 15 | Content-Length: 16 | description: The number of bytes in the file 17 | schema: 18 | type: integer 19 | Content-Type: 20 | description: The MIME type of the file 21 | schema: 22 | type: string 23 | content: 24 | application/json: 25 | schema: 26 | type: string 27 | readOnly: true 28 | '302': 29 | $ref: ../components/responses/Found.yaml 30 | '401': 31 | $ref: ../components/responses/AccessForbidden.yaml 32 | '404': 33 | $ref: ../components/responses/NotFound.yaml 34 | -------------------------------------------------------------------------------- /openapi/paths/files@{id}@download{extension}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - name: extension 4 | in: path 5 | description: File extension which also indicates the desired file format 6 | required: true 7 | schema: 8 | type: string 9 | enum: 10 | - .png 11 | - .jpg 12 | - .gif 13 | - $ref: ../components/parameters/organizationId.yaml 14 | get: 15 | tags: 16 | - Files 17 | summary: Download image in specific format 18 | operationId: GetFileDownloadExtension 19 | description: | 20 | Download image in specific format. Images are converted server-side 21 | responses: 22 | '200': 23 | description: The file was retrieved successfully 24 | headers: 25 | Content-Length: 26 | description: The number of bytes in the file 27 | schema: 28 | type: integer 29 | Content-Type: 30 | description: The MIME type of the file 31 | schema: 32 | type: string 33 | content: 34 | application/json: 35 | schema: 36 | type: string 37 | readOnly: true 38 | '401': 39 | $ref: ../components/responses/AccessForbidden.yaml 40 | '404': 41 | $ref: ../components/responses/NotFound.yaml 42 | '422': 43 | $ref: ../components/responses/InvalidDataError.yaml 44 | -------------------------------------------------------------------------------- /openapi/paths/invoices@{id}@abandon.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Invoices 7 | summary: Abandon an invoice 8 | operationId: PostInvoiceAbandonment 9 | description: | 10 | Abandon an invoice with specified identifier string 11 | responses: 12 | '201': 13 | description: Invoice was abandoned successfully 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/Invoices/Invoice.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | x-code-samples: 30 | - lang: PHP 31 | source: 32 | $ref: '../code_samples/PHP/invoices@{id}@abandon/post.php' 33 | -------------------------------------------------------------------------------- /openapi/paths/invoices@{id}@matched-rules.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Invoices 7 | summary: Get matched rules for the invoice 8 | operationId: GetInvoiceMatchedRuleCollection 9 | description: Get matched rules for the invoice 10 | responses: 11 | '200': 12 | description: List of matched rules was retrieved successfully. 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | type: array 24 | items: 25 | $ref: ../components/schemas/Rules/MatchedRule.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/paths/invoices@{id}@recalculate.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Invoices 7 | summary: Recalculate an invoice 8 | operationId: PostInvoiceRecalculation 9 | description: > 10 | Recalculate an invoice with specified identifier string. 11 | 12 | It will recalculate shipping rates, taxes, discounts. It is useful when 13 | coupon was revoked or customer redeemed coupon after invoice was issued and 14 | you want to apply it to this invoice. 15 | responses: 16 | '201': 17 | description: Invoice was recalculated successfully 18 | headers: 19 | Rate-Limit-Limit: 20 | $ref: ../components/headers/Rate-Limit-Limit.yaml 21 | Rate-Limit-Remaining: 22 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 23 | Rate-Limit-Reset: 24 | $ref: ../components/headers/Rate-Limit-Reset.yaml 25 | content: 26 | application/json: 27 | schema: 28 | $ref: ../components/schemas/Invoices/Invoice.yaml 29 | '401': 30 | $ref: ../components/responses/AccessForbidden.yaml 31 | '404': 32 | $ref: ../components/responses/NotFound.yaml 33 | '409': 34 | $ref: ../components/responses/Conflict.yaml 35 | -------------------------------------------------------------------------------- /openapi/paths/invoices@{id}@reissue.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Invoices 7 | summary: Reissue an invoice 8 | operationId: PostInvoiceReissuance 9 | description: > 10 | Reissue an invoice with specified identifier string. It must be issued 11 | (status must be `unpaid` or `past-due`). 12 | requestBody: 13 | content: 14 | application/json: 15 | schema: 16 | $ref: ../components/schemas/Invoices/InvoiceReissue.yaml 17 | description: InvoiceReissue resource 18 | required: true 19 | responses: 20 | '201': 21 | description: Invoice was reissued successfully 22 | headers: 23 | Rate-Limit-Limit: 24 | $ref: ../components/headers/Rate-Limit-Limit.yaml 25 | Rate-Limit-Remaining: 26 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 27 | Rate-Limit-Reset: 28 | $ref: ../components/headers/Rate-Limit-Reset.yaml 29 | content: 30 | application/json: 31 | schema: 32 | $ref: ../components/schemas/Invoices/Invoice.yaml 33 | '401': 34 | $ref: ../components/responses/AccessForbidden.yaml 35 | '404': 36 | $ref: ../components/responses/NotFound.yaml 37 | '409': 38 | $ref: ../components/responses/Conflict.yaml 39 | -------------------------------------------------------------------------------- /openapi/paths/invoices@{id}@void.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Invoices 7 | summary: Void an invoice 8 | operationId: PostInvoiceVoid 9 | description: | 10 | Void an invoice with specified identifier string 11 | responses: 12 | '201': 13 | description: Invoice was voided successfully 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/Invoices/Invoice.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | x-code-samples: 30 | - lang: PHP 31 | source: 32 | $ref: '../code_samples/PHP/invoices@{id}@void/post.php' 33 | -------------------------------------------------------------------------------- /openapi/paths/kyc-documents@{id}@acceptance.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - KYC Documents 7 | summary: Accept a KYC document 8 | operationId: PostKycDocumentAcceptance 9 | description: > 10 | Marks that status of the document as `accepted`. Updates the review time and 11 | reviewer information. Intended to be used for manual overrides. 12 | responses: 13 | '201': 14 | description: KYC document acceptance was created 15 | headers: 16 | Rate-Limit-Limit: 17 | $ref: ../components/headers/Rate-Limit-Limit.yaml 18 | Rate-Limit-Remaining: 19 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 20 | Rate-Limit-Reset: 21 | $ref: ../components/headers/Rate-Limit-Reset.yaml 22 | content: 23 | application/json: 24 | schema: 25 | $ref: ../components/schemas/KycDocument/KycDocument.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/paths/kyc-documents@{id}@rejection.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - KYC Documents 7 | summary: Reject a KYC document 8 | operationId: PostKycDocumentRejection 9 | description: > 10 | Marks that status of the document as `rejected`. Updates the review time and 11 | reviewer information. Intended to be used for manual overrides. 12 | requestBody: 13 | content: 14 | application/json: 15 | schema: 16 | $ref: ../components/schemas/KycDocument/KycDocumentRejection.yaml 17 | description: KYC document resource 18 | required: true 19 | responses: 20 | '201': 21 | description: KYC document rejection was created 22 | headers: 23 | Rate-Limit-Limit: 24 | $ref: ../components/headers/Rate-Limit-Limit.yaml 25 | Rate-Limit-Remaining: 26 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 27 | Rate-Limit-Reset: 28 | $ref: ../components/headers/Rate-Limit-Reset.yaml 29 | content: 30 | application/json: 31 | schema: 32 | $ref: ../components/schemas/KycDocument/KycDocument.yaml 33 | '401': 34 | $ref: ../components/responses/AccessForbidden.yaml 35 | '404': 36 | $ref: ../components/responses/NotFound.yaml 37 | '422': 38 | $ref: ../components/responses/InvalidDataError.yaml 39 | -------------------------------------------------------------------------------- /openapi/paths/kyc-documents@{id}@review.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - KYC Documents 7 | summary: Review a KYC document 8 | operationId: PostKycDocumentReview 9 | description: >- 10 | Mark the KYC document as reviewed. Updates the review time and reviewer 11 | information. 12 | responses: 13 | '201': 14 | description: KYC document was reviewed. 15 | headers: 16 | Rate-Limit-Limit: 17 | $ref: ../components/headers/Rate-Limit-Limit.yaml 18 | Rate-Limit-Remaining: 19 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 20 | Rate-Limit-Reset: 21 | $ref: ../components/headers/Rate-Limit-Reset.yaml 22 | content: 23 | application/json: 24 | schema: 25 | $ref: ../components/schemas/KycDocument/KycDocument.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | '422': 31 | $ref: ../components/responses/InvalidDataError.yaml 32 | -------------------------------------------------------------------------------- /openapi/paths/payment-cards@{id}@deactivation.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Payment Cards 7 | summary: Deactivate a Payment Card 8 | operationId: PostPaymentCardDeactivation 9 | description: | 10 | Deactivate a Payment Card 11 | responses: 12 | '201': 13 | description: Payment Card was deactivated 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/PaymentCards/PaymentCard.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | '409': 30 | $ref: ../components/responses/Conflict.yaml 31 | x-code-samples: 32 | - lang: PHP 33 | source: 34 | $ref: '../code_samples/PHP/payment-cards@{id}@deactivation/post.php' 35 | -------------------------------------------------------------------------------- /openapi/paths/payment-cards@{id}@matched-rules.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Payment Cards 7 | summary: Get matched rules for the payment card 8 | operationId: GetPaymentCardMatchedRuleCollection 9 | description: Get matched rules for the payment card 10 | responses: 11 | '200': 12 | description: List of matched rules was retrieved successfully. 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | type: array 24 | items: 25 | $ref: ../components/schemas/Rules/MatchedRule.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/paths/paypal-accounts@{id}@deactivation.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - PayPal Accounts 7 | summary: Deactivate a PayPal Account 8 | operationId: PostPayPalAccountDeactivation 9 | description: | 10 | Deactivate a PayPal Account 11 | responses: 12 | '201': 13 | description: PayPal Account was deactivated 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/PayPalAccount.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | '409': 30 | $ref: ../components/responses/Conflict.yaml 31 | x-code-samples: 32 | - lang: PHP 33 | source: 34 | $ref: '../code_samples/PHP/paypal-accounts@{id}@deactivation/post.php' 35 | -------------------------------------------------------------------------------- /openapi/paths/subscription-reactivations@{id}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Subscriptions 7 | summary: Retrieve a subscription reactivation 8 | operationId: GetSubscriptionReactivation 9 | description: Retrieve a subscription reactivation with specified identifier string 10 | responses: 11 | '200': 12 | description: Reactivation was retrieved successfully 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | $ref: ../components/schemas/Subscription/SubscriptionReactivation.yaml 24 | '401': 25 | $ref: ../components/responses/AccessForbidden.yaml 26 | '404': 27 | $ref: ../components/responses/NotFound.yaml 28 | -------------------------------------------------------------------------------- /openapi/paths/subscriptions@{id}@matched-rules.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Subscriptions 7 | summary: Get matched rules for the subscription 8 | operationId: GetSubscriptionMatchedRuleCollection 9 | description: Get matched rules for the subscription 10 | responses: 11 | '200': 12 | description: List of matched rules was retrieved successfully. 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | type: array 24 | items: 25 | $ref: ../components/schemas/Rules/MatchedRule.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/paths/subscriptions@{id}@upcoming-invoices.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Invoices 7 | summary: Retrieve subscription's upcoming invoice 8 | operationId: GetSubscriptionUpcomingInvoiceCollection 9 | description: > 10 | Retrieve an upcoming invoice from the specified subscription. 11 | 12 | The endpoint is temporary before upcoming invoices get a complete 13 | integration. 14 | parameters: 15 | - $ref: ../components/parameters/collectionExpand.yaml 16 | responses: 17 | '200': 18 | description: Upcoming invoices are retrieved successfully. 19 | headers: 20 | Rate-Limit-Limit: 21 | $ref: ../components/headers/Rate-Limit-Limit.yaml 22 | Rate-Limit-Remaining: 23 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 24 | Rate-Limit-Reset: 25 | $ref: ../components/headers/Rate-Limit-Reset.yaml 26 | content: 27 | application/json: 28 | schema: 29 | type: array 30 | items: 31 | $ref: ../components/schemas/Invoices/Invoice.yaml 32 | '401': 33 | $ref: ../components/responses/AccessForbidden.yaml 34 | '404': 35 | $ref: ../components/responses/NotFound.yaml 36 | -------------------------------------------------------------------------------- /openapi/paths/tags@{tag}@customers@{customerId}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/tag.yaml 3 | - $ref: ../components/parameters/customerId.yaml 4 | - $ref: ../components/parameters/organizationId.yaml 5 | post: 6 | tags: 7 | - Tags 8 | summary: Tag a customer 9 | operationId: PostTagCustomer 10 | description: | 11 | Tag a customer 12 | responses: 13 | '204': 14 | description: Customer was tagged 15 | '401': 16 | $ref: ../components/responses/AccessForbidden.yaml 17 | '404': 18 | $ref: ../components/responses/NotFound.yaml 19 | delete: 20 | tags: 21 | - Tags 22 | summary: Untag a customer 23 | operationId: DeleteTagCustomer 24 | description: | 25 | Untag a customer 26 | responses: 27 | '204': 28 | description: Customer was untagged 29 | '401': 30 | $ref: ../components/responses/AccessForbidden.yaml 31 | '404': 32 | $ref: ../components/responses/NotFound.yaml 33 | -------------------------------------------------------------------------------- /openapi/paths/tokens@{token}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: token 3 | in: path 4 | description: The token identifier string 5 | required: true 6 | schema: 7 | type: string 8 | - $ref: ../components/parameters/organizationId.yaml 9 | get: 10 | tags: 11 | - Payment Tokens 12 | summary: Retrieve a token 13 | operationId: GetToken 14 | description: | 15 | Retrieve a token with specified identifier string 16 | security: 17 | - PublishableApiKey: [] 18 | responses: 19 | '200': 20 | description: Token was retrieved successfully 21 | headers: 22 | Rate-Limit-Limit: 23 | $ref: ../components/headers/Rate-Limit-Limit.yaml 24 | Rate-Limit-Remaining: 25 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 26 | Rate-Limit-Reset: 27 | $ref: ../components/headers/Rate-Limit-Reset.yaml 28 | content: 29 | application/json: 30 | schema: 31 | $ref: ../components/schemas/PaymentTokens/PaymentToken.yaml 32 | '401': 33 | $ref: ../components/responses/AccessForbidden.yaml 34 | '404': 35 | $ref: ../components/responses/NotFound.yaml 36 | x-code-samples: 37 | - lang: PHP 38 | source: 39 | $ref: '../code_samples/PHP/tokens@{token}/get.php' 40 | -------------------------------------------------------------------------------- /openapi/paths/transactions@{id}.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Transactions 7 | summary: Retrieve a Transaction 8 | operationId: GetTransaction 9 | description: | 10 | Retrieve a Transaction with specified identifier string 11 | responses: 12 | '200': 13 | description: Transaction was retrieved successfully 14 | headers: 15 | Rate-Limit-Limit: 16 | $ref: ../components/headers/Rate-Limit-Limit.yaml 17 | Rate-Limit-Remaining: 18 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 19 | Rate-Limit-Reset: 20 | $ref: ../components/headers/Rate-Limit-Reset.yaml 21 | content: 22 | application/json: 23 | schema: 24 | $ref: ../components/schemas/Transactions/Transaction.yaml 25 | '401': 26 | $ref: ../components/responses/AccessForbidden.yaml 27 | '404': 28 | $ref: ../components/responses/NotFound.yaml 29 | x-code-samples: 30 | - lang: PHP 31 | source: 32 | $ref: '../code_samples/PHP/transactions@{id}/get.php' 33 | -------------------------------------------------------------------------------- /openapi/paths/transactions@{id}@cancel.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | post: 5 | tags: 6 | - Transactions 7 | summary: Cancel a pending or suspended transaction 8 | operationId: PostTransactionCancellation 9 | description: >- 10 | Cancel a scheduled transaction. Once handled a transaction cannot be 11 | canceled 12 | responses: 13 | '201': 14 | description: Successful cancel the payment 15 | headers: 16 | Rate-Limit-Limit: 17 | $ref: ../components/headers/Rate-Limit-Limit.yaml 18 | Rate-Limit-Remaining: 19 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 20 | Rate-Limit-Reset: 21 | $ref: ../components/headers/Rate-Limit-Reset.yaml 22 | content: 23 | application/json: 24 | schema: 25 | $ref: ../components/schemas/Transactions/Transaction.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | x-code-samples: 31 | - lang: PHP 32 | source: 33 | $ref: '../code_samples/PHP/transactions@{id}@cancel/post.php' 34 | -------------------------------------------------------------------------------- /openapi/paths/transactions@{id}@gateway-logs.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Transactions 7 | summary: Retrieve a Transaction Gateway Logs 8 | operationId: GetTransactionGatewayLogCollection 9 | description: >- 10 | Retrieve Gateway communication Logs for Transaction with specified 11 | identifier string 12 | responses: 13 | '200': 14 | description: Logs were retrieved successfully 15 | content: 16 | application/json: 17 | schema: 18 | $ref: ../components/schemas/TransactionGatewayLog.yaml 19 | '401': 20 | $ref: ../components/responses/AccessForbidden.yaml 21 | '404': 22 | $ref: ../components/responses/NotFound.yaml 23 | -------------------------------------------------------------------------------- /openapi/paths/transactions@{id}@matched-rules.yaml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - $ref: ../components/parameters/resourceId.yaml 3 | - $ref: ../components/parameters/organizationId.yaml 4 | get: 5 | tags: 6 | - Transactions 7 | summary: Get matched rules for the transaction 8 | operationId: GetTransactionMatchedRuleCollection 9 | description: Get matched rules for the transaction 10 | responses: 11 | '200': 12 | description: List of matched rules was retrieved successfully. 13 | headers: 14 | Rate-Limit-Limit: 15 | $ref: ../components/headers/Rate-Limit-Limit.yaml 16 | Rate-Limit-Remaining: 17 | $ref: ../components/headers/Rate-Limit-Remaining.yaml 18 | Rate-Limit-Reset: 19 | $ref: ../components/headers/Rate-Limit-Reset.yaml 20 | content: 21 | application/json: 22 | schema: 23 | type: array 24 | items: 25 | $ref: ../components/schemas/Rules/MatchedRule.yaml 26 | '401': 27 | $ref: ../components/responses/AccessForbidden.yaml 28 | '404': 29 | $ref: ../components/responses/NotFound.yaml 30 | -------------------------------------------------------------------------------- /openapi/plugins/README.md: -------------------------------------------------------------------------------- 1 | ## Plugins Folder 2 | 3 | This folder contains post-process plugins that are run just after bundle. 4 | Check out `x-rebillyMerge.js` plugin for reference. 5 | 6 | 7 | ## Available Plugins 8 | 9 | ### x-rebillyMerge 10 | Inline references and merge all subschemas using [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) 11 | ##### Usage: 12 | 13 | ```yaml 14 | x-rebillyMerge: 15 | - $ref: "#/components/arameters/someParam" 16 | - enum: 17 | - aaa 18 | - bbb 19 | ``` 20 | 21 | ### x-sortableEnum 22 | Prefix each enum value with `"-"` 23 | 24 | ##### Usage: 25 | 26 | ```yaml 27 | x-sortableEnum: 28 | - aaa 29 | - bbb 30 | ``` 31 | Result: 32 | ```yaml 33 | enum: 34 | - aaa 35 | - -aaa 36 | - bbb 37 | - -bbb 38 | ``` 39 | -------------------------------------------------------------------------------- /openapi/plugins/x-rebillyMerge.js: -------------------------------------------------------------------------------- 1 | var jpointer = require('json-pointer'); 2 | var mergePatch = require('json-merge-patch'); 3 | 4 | module.exports = { 5 | pathExpression: '$..["x-rebillyMerge"]', 6 | init: function(_swagger, options) { 7 | if (options.verbose) { 8 | console.log('* x-rebillyMerge plugin'); 9 | } 10 | }, 11 | process: function(parent, name, jsonpath, swagger) { 12 | var value = parent[name]; 13 | if (!Array.isArray(value)) { 14 | throw Error('x-rebillyMerge argument should be array at ' + jsonpath); 15 | } 16 | let res = null; 17 | value.forEach(function(obj) { 18 | if (typeof obj !== 'object') throw Error('Can\'t merge non-object values at ' + jsonpath); 19 | if (obj.$ref && (typeof obj.$ref === 'string')) { 20 | obj = jpointer.get(swagger, obj.$ref.substring(1)); 21 | } 22 | res = mergePatch.apply(res, obj); 23 | }); 24 | delete parent[name]; 25 | Object.assign(parent, res); 26 | }, 27 | finish: function(swagger) { 28 | // TODO: cleanup unused $refs 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /openapi/plugins/x-sortableEnum.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pathExpression: '$..["x-sortableEnum"]', 3 | init: function(_swagger, options) { 4 | if (options.verbose) { 5 | console.log('* x-sortableEnum plugin'); 6 | } 7 | }, 8 | process: function(parent, name, jsonpath, swagger) { 9 | var value = parent[name]; 10 | if (!Array.isArray(value)) { 11 | throw Error('x-sortableEnum argument should be an array at ' + jsonpath); 12 | } 13 | res = []; 14 | value.forEach(function(str) { 15 | if (typeof str !== 'string') throw Error('x-sortableEnum supports only string enums ' + jsonpath); 16 | res.push(str); 17 | res.push('-' + str); 18 | }); 19 | delete parent[name]; 20 | parent.enum = res; 21 | }, 22 | finish: function(swagger) { 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rebilly-openapi-spec", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "@redocly/openapi-cli": "0.11.0", 6 | "json-merge-patch": "^0.2.3", 7 | "json-pointer": "^0.6.0" 8 | }, 9 | "private": true, 10 | "scripts": { 11 | "start": "openapi preview-docs", 12 | "build": "openapi bundle -o dist", 13 | "test": "openapi validate", 14 | "gh-pages": "echo \"Not implemented\"" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /transformers/index.js: -------------------------------------------------------------------------------- 1 | const xRebillyMerge = require('./xRebillyMerge'); 2 | const xSortableEnum = require('./xSortableEnum'); 3 | 4 | module.exports = [xRebillyMerge, xSortableEnum]; 5 | -------------------------------------------------------------------------------- /transformers/xRebillyMerge.js: -------------------------------------------------------------------------------- 1 | const jsonmergepatch = require('json-merge-patch'); 2 | 3 | const MERGE_KEY = 'x-rebillyMerge'; 4 | 5 | module.exports = class RebillyMerge { 6 | static get rule() { 7 | return 'rebillyMerge'; 8 | } 9 | 10 | any() { 11 | return { 12 | onEnter: async (node, _, ctx) => { 13 | if (!node[MERGE_KEY]) return; 14 | 15 | var value = node[MERGE_KEY]; 16 | if (!Array.isArray(value)) { 17 | return [ctx.createError('x-rebillyMerge argument should be ane array', 'key')]; 18 | } 19 | 20 | let res = null; 21 | const errors = []; 22 | for (let obj of value) { 23 | if (typeof obj !== 'object') { 24 | errors.push(ctx.createError("Can't merge non-object values", 'key')); 25 | return; 26 | } 27 | if (obj.$ref && typeof obj.$ref === 'string') { 28 | obj = (await ctx.resolveNode(obj, ctx)).node; 29 | } 30 | res = jsonmergepatch.apply(res, obj); 31 | } 32 | 33 | Object.assign(node, res); 34 | 35 | delete node[MERGE_KEY]; 36 | 37 | return errors; 38 | }, 39 | }; 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /transformers/xSortableEnum.js: -------------------------------------------------------------------------------- 1 | const SORTABLE_ENUM_KEY = 'x-sortableEnum'; 2 | 3 | module.exports = class SortableEnum { 4 | static get rule() { 5 | return 'sortableEnum'; 6 | } 7 | 8 | any() { 9 | return { 10 | onEnter: (node) => { 11 | if (!node[SORTABLE_ENUM_KEY]) return; 12 | 13 | var value = node[SORTABLE_ENUM_KEY]; 14 | 15 | // TODO: validate value is an array 16 | 17 | const updatedEnum = []; 18 | value.forEach(function(value) { 19 | if (typeof value !== 'string') throw Error('x-sortableEnum supports only string enums ' + jsonpath); 20 | updatedEnum.push(value); 21 | updatedEnum.push('-' + value); 22 | }); 23 | delete node[SORTABLE_ENUM_KEY]; 24 | node.enum = updatedEnum; 25 | }, 26 | }; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /web/apple-touch-icon-163dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rebilly/RebillyAPI/f8ac9cbac1fb467396c5ecd90046c9d938b68e1a/web/apple-touch-icon-163dpi.png -------------------------------------------------------------------------------- /web/apple-touch-icon-326dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rebilly/RebillyAPI/f8ac9cbac1fb467396c5ecd90046c9d938b68e1a/web/apple-touch-icon-326dpi.png -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rebilly/RebillyAPI/f8ac9cbac1fb467396c5ecd90046c9d938b68e1a/web/favicon.ico -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rebilly/RebillyAPI/f8ac9cbac1fb467396c5ecd90046c9d938b68e1a/web/favicon.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rebilly REST API Specification 5 | 6 | 7 | 8 | 9 | 13 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {{redocHead}} 32 | 33 | 34 | {{redocBody}} 35 | 36 | 37 | --------------------------------------------------------------------------------