Rebilly REST API
Introduction
The Rebilly API is built on HTTP. Our API is RESTful. It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. You can use your favorite HTTP/REST library for your programming language to use Rebilly's API, or you can use one of our SDKs (currently available in and ).
We have other APIs that are also available. Every action from our is supported by an API which is documented and available for use so that you may automate any workflows necessary. This document contains the most commonly integrated resources.
Authentication
When you sign up for an account, you are given your first secret API key. You can generate additional API keys, and delete API keys (as you may need to rotate your keys in the future). You authenticate to the Rebilly API by providing your secret key in the request header.
Rebilly offers three forms of authentication: secret key, publishable key, JSON Web Tokens, and public signature key.
- : used for requests made from the server side. Never share these keys. Keep them guarded and secure.
- : used for requests from the client side. For now can only be used to create a and a .
- : short lifetime tokens that can be assigned a specific expiration time.
Never share your secret keys. Keep them guarded and secure.
<!-- ReDoc-Inject: <security-definitions> -->
Errors
Rebilly follow's the error response format proposed in also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response.
Forbidden
<RedocResponse pointer={"#/components/responses/Forbidden"} />
Conflict
<RedocResponse pointer={"#/components/responses/Conflict"} />
NotFound
<RedocResponse pointer={"#/components/responses/NotFound"} />
Unauthorized
<RedocResponse pointer={"#/components/responses/Unauthorized"} />
ValidationError
<RedocResponse pointer={"#/components/responses/ValidationError"} />
SDKs
Rebilly offers a Javascript SDK and a PHP SDK to help interact with the API. However, no SDK is required to use the API.
Rebilly also offers , a client-side iFrame-based solution to help create payment tokens while minimizing PCI DSS compliance burdens and maximizing the customizability. is interacting with the .
Javascript SDK
Installation and usage instructions can be found . SDK code examples are included in these docs.
PHP SDK
For all PHP SDK examples provided in these docs you will need to configure the $client.
You may do it like this:
Using filter with collections
Rebilly provides collections filtering. You can use ?filter param on collections to define which records should be shown in the response.
Here is filter format description:
-
Fields and values in filter are separated with
::?filter=firstName:John. -
Sub-fields are separated with
.:?filter=billingAddress.country:US. -
Multiple filters are separated with
;:?filter=firstName:John;lastName:Doe. They will be joined withANDlogic. In this example:firstName:JohnANDlastName:Doe. -
You can use multiple values using
,as values separator:?filter=firstName:John,Bob. Multiple values specified for a field will be joined withORlogic. In this example:firstName:JohnORfirstName:Bob. -
To negate the filter use
!:?filter=firstName:!John. Note that you can negate multiple values like this:?filter=firstName:!John,!Bob. This filter rule will exclude all Johns and Bobs from the response. -
You can use range filters like this:
?filter=amount:1..10. -
You can use gte (greater than or equals) filter like this:
?filter=amount:1.., or lte (less than or equals) than filter like this:?filter=amount:..10. This also works for datetime-based fields. -
You can create some and use them in filter:
?filter=firstName:@yourListName. You can also exclude list values:?filter=firstName:!@yourListName. -
Datetime-based fields accept values formatted using RFC 3339 like this:
?filter=createdTime:2021-02-14T13:30:00Z.
Expand to include embedded objects
Rebilly provides the ability to pre-load additional objects with a request.
You can use ?expand param on most requests to expand
and include embedded objects within the
_embedded property of the response.
The _embedded property contains an array of
objects keyed by the expand parameter value(s).
You may expand multiple objects by passing them as comma-separated to the expand value like so:
And in the response, you would see:
Expand may be utilitized not only on GET requests but also on PATCH, POST, PUT requests too.
Getting started guide
Rebilly's API has over 300 operations. That's more than you'll need to implement your use cases. If you have a use case you would like to implement, please consult us for feedback on the best API operations for the task.
Our getting started guide will demonstrate a basic order form use case. It will allow us to highlight core resources in Rebilly that will be helpful for many other use cases too.
Within 25 minutes, you'll have sent API requests (via our console) to create a subscription order.
$client = new Rebilly\Client([ 'apiKey' => 'YourApiKeyHere', 'baseUrl' => 'https://api.rebilly.com',]);?expand=recentInvoice,customer"_embedded": [ "recentInvoice": {...}, "customer": {...}]- Homepage
- https://api.apis.guru/v2/specs/rebilly.com/2.1.json
- Provider
- rebilly.com
- OpenAPI version
- 3.0.3
- Spec (JSON)
- https://api.apis.guru/v2/specs/rebilly.com/2.1/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/rebilly.com/2.1/openapi.yaml
Tools (186)
Extracted live via the executor SDK.
-
3DSecure.get3DSecureRetrieve a ThreeDSecure entry with specified identifier string.
-
3DSecure.get3DSecureCollectionRetrieve a list of ThreeDSecure entries
-
3DSecure.post3DSecureCreate a ThreeDSecure entry.
-
aml.getAmlEntrySearch multiple PEP/Sanctions/Adverse Media lists with first and last name to find any blocklisted identities. Performs a fuzzy search including soundex. Not all fields are guaranteed to be filled.
-
bankAccounts.getBankAccountRetrieve a Bank Account with specified identifier string.
-
bankAccounts.getBankAccountCollectionRetrieve a list of Bank Accounts.
-
bankAccounts.patchBankAccountUpdate bank account's values except for the account number and routing. number.
-
bankAccounts.postBankAccountCreate a Bank Account.
-
bankAccounts.postBankAccountDeactivationDeactivate a Bank Account.
-
bankAccounts.putBankAccountCreate or update a BankAccount with predefined identifier string.
-
blocklists.deleteBlocklistDelete a blocklist with predefined identifier string.
-
blocklists.getBlocklistRetrieve a blocklist with specified identifier string.
-
blocklists.getBlocklistCollectionRetrieve a list of blocklists.
-
blocklists.postBlocklistCreate a blocklist.
-
blocklists.putBlocklistCreate a blocklist with predefined identifier string.
-
coupons.getCouponRetrieve a coupon with specified coupon ID string.
-
coupons.getCouponCollectionRetrieve a list of coupons.
-
coupons.getCouponRedemptionRetrieve a coupon redemption with specified identifier string
-
coupons.getCouponRedemptionCollectionRetrieve a list of coupon redemptions
-
coupons.postCouponCreate a coupon.
-
coupons.postCouponExpirationSet a coupon's expiry time with the specified coupon ID. The expiredTime of a coupon must be greater than its issuedTime. This cannot be performed on expired coupons.
-
coupons.postCouponRedemptionRedeem a coupon.
-
coupons.postCouponRedemptionCancellationCancel a coupon redemption
-
coupons.putCouponCreate or update a coupon with predefined coupon ID.
-
customerAuthentication.deleteAuthenticationTokenLogout a customer.
-
customerAuthentication.deleteCredentialDelete a credential with predefined identifier string.
-
customerAuthentication.deletePasswordTokenDelete a Reset Password Token with predefined identifier string.
-
customerAuthentication.getAuthenticationOptionRead current authentication options.
-
customerAuthentication.getAuthenticationTokenCollectionRetrieve a list of auth tokens.
-
customerAuthentication.getAuthenticationTokenVerificationVerify an authentication token.
-
customerAuthentication.getCredentialRetrieve a credential with specified identifier string.
-
customerAuthentication.getCredentialCollectionRetrieve a list of credentials.
-
customerAuthentication.getPasswordTokenRetrieve a Reset Password Token with specified identifier string.
-
customerAuthentication.getPasswordTokenCollectionRetrieve a list of tokens.
-
customerAuthentication.postAuthenticationTokenLogin a customer.
-
customerAuthentication.postAuthenticationTokenExchangeExchange Authentication Token for JWT.
It will also invalidate an Authentication Token by default (so it can only be exchanged once).
-
customerAuthentication.postCredentialCreate a credential.
-
customerAuthentication.postPasswordTokenCreate a Reset Password Token.
-
customerAuthentication.putAuthenticationOptionChange options.
-
customerAuthentication.putCredentialCreate or update a credential with predefined identifier string.
-
customers.deleteCustomerMerge one duplicate customer to another target customer and delete the. former.
-
customers.deleteCustomerLeadSourceDelete a Lead Source that belongs to a certain customer.
-
customers.getCustomerRetrieve a customer with specified identifier string.
-
customers.getCustomerCollectionRetrieve a list of customers.
-
customers.getCustomerLeadSourceRetrieve a Lead Source of given customer.
-
customers.postCustomerCreate a customer without a predefined ID. The customer's primary address will be used as the default address for payment instruments, subscriptions and invoices if none are provided.
If you wish to create the customer with a predefined ID (which we recommend to prevent duplication), you may use our
PUTrequest described below.Read our guide to to understand more.
-
customers.postCustomerTimelineCustomEventTypeCreate Customer Timeline custom event type.
-
customers.putCustomerCreate or update (upsert) a customer with predefined identifier string. Read our guide to to understand more.
-
customers.putCustomerLeadSourceCreate a Lead Source for a customer.
-
customersTimeline.deleteCustomerTimelineDelete a Customer Timeline message with predefined identifier string.
-
customersTimeline.getCustomerTimelineRetrieve a customer message with specified identifier string.
-
customersTimeline.getCustomerTimelineCollectionRetrieve a list of customer timeline messages.
-
customersTimeline.getCustomerTimelineCustomEventTypeRetrieve customer timeline custom event type.
-
customersTimeline.getCustomerTimelineCustomEventTypeCollectionRetrieve a list of customer timeline custom event types.
-
customersTimeline.getCustomerTimelineEventCollectionRetrieve a list of customer timeline messages for all customers.
-
customersTimeline.postCustomerTimelineCreate a customer Timeline comment or custom defined event.
-
customFields.getCustomFieldRetrieve a schema of the given Custom Field for the given resource type.
-
customFields.getCustomFieldCollectionRetrieve a schema of Custom Fields for the given resource type.
-
customFields.putCustomFieldCreate or alter a schema of the given Custom Field for the given resource. type.
-
disputes.getDisputeRetrieve a dispute with specified identifier string.
-
disputes.getDisputeCollectionRetrieve a list of disputes.
-
disputes.postDisputeCreate a dispute.
-
disputes.putDisputeCreate or update a Dispute with predefined identifier string.
-
files.deleteAttachmentDelete the Attachment with predefined identifier string.
-
files.deleteFileDelete the File with predefined identifier string.
-
files.getAttachmentRetrieve a Attachment with specified identifier string.
-
files.getAttachmentCollectionRetrieve a list of attachments. You may sort by the id, name, relatedId, relatedType, fileId, createdTime, and updatedTime.
-
files.getFileRetrieve a File with specified identifier string.
-
files.getFileCollectionRetrieve a list of files.
-
files.getFileDownloadDownload a file.
-
files.getFileDownloadExtensionDownload image in specific format. Images are converted server-side.
-
files.postAttachmentCreate an Attachment.
-
files.postFileAdditionally, a file can be sent with:.
- multipart/form-data POST request: in this case all property names are the same as the JSON ones (
fileis an uploaded file) - file body request: the file body is sent as the request body, with the appropriate
Content-Type. No additional properties can be set along the request data
The following file types only are allowed:
- jpg
- png
- gif
- mp3
If using a Publishable Api Key, only private files can be created. The files can later on be modified or used using a secret API key.
- multipart/form-data POST request: in this case all property names are the same as the JSON ones (
-
files.putAttachmentUpdate the Attachment with predefined ID.
-
files.putFileUpdate the File with predefined ID. Note that file can be uploaded with POST. only.
-
invoices.deleteInvoiceTimelineDelete an Invoice Timeline message with predefined identifier string.
-
invoices.getCustomerUpcomingInvoiceCollectionRetrieve a list of upcoming invoices from the subscriptions which belong to. the given customer. The endpoint is temporary before upcoming invoices get a complete integration.
-
invoices.getInvoiceRetrieve an invoice with specified identifier string.
-
invoices.getInvoiceCollectionRetrieve a list of invoices.
-
invoices.getInvoiceItemCollectionRetrieve an invoice items with specified invoice identifier string.
-
invoices.getInvoiceTimelineRetrieve a invoice message with specified identifier string.
-
invoices.getInvoiceTimelineCollectionRetrieve a list of invoice timeline messages.
-
invoices.getInvoiceTransactionAllocationCollectionGet the precise amounts from a transaction allocated as invoice payments.
-
invoices.postInvoiceCreate an invoice.
-
invoices.postInvoiceAbandonmentAbandon an invoice with specified identifier string.
-
invoices.postInvoiceIssuanceIssue an invoice with specified identifier string. It must be in
draftstatus. -
invoices.postInvoiceItemCreate an invoice item.
-
invoices.postInvoiceRecalculationRecalculate an invoice with specified identifier string. It will recalculate shipping rates, taxes, discounts. It is useful when coupon was revoked or customer redeemed coupon after invoice was issued and you want to apply it to this invoice.
-
invoices.postInvoiceReissuanceReissue an invoice with specified identifier string. It must be issued. (status must be
unpaidorpast-due). -
invoices.postInvoiceTimelineCreate an invoice Timeline comment.
-
invoices.postInvoiceTransactionApply a transaction to an invoice. The invoice must be unpaid. The transaction must have a non-zero unused amount (not fully applied to other invoices).
-
invoices.postInvoiceVoidVoid an invoice with specified identifier string.
-
invoices.putInvoiceCreate or update an invoice with predefined identifier string.
-
kycDocuments.deleteKycRequestDelete the KYC request with the predefined identifier string.
-
kycDocuments.getKycDocumentRetrieve a KYC document with specified identifier string.
-
kycDocuments.getKycDocumentCollectionRetrieve a list of KYC documents.
-
kycDocuments.getKycRequestRetrieve a KYC request with specified identifier string.
-
kycDocuments.getKycRequestCollectionRetrieve a list of KYC requests.
-
kycDocuments.patchKycRequestUpdate a KYC request.
-
kycDocuments.postKycDocumentCreate a KYC Document.
-
kycDocuments.postKycDocumentAcceptanceMarks that status of the document as
accepted. Updates the review time and reviewer information. Intended to be used for manual overrides. -
kycDocuments.postKycDocumentMatchesUpdates a KYC document's documentMatches. Intended to be used for manual overrides.
-
kycDocuments.postKycDocumentRejectionMarks that status of the document as
rejected. Updates the review time and reviewer information. Intended to be used for manual overrides. -
kycDocuments.postKycDocumentReviewMark the KYC document as reviewed. Updates the review time and reviewer. information.
-
kycDocuments.postKycRequestCreate a KYC Request.
-
kycDocuments.putKycDocumentCreate or update a KYC document with predefined identifier string.
-
orders.deleteSubscriptionCancellationDelete an order's cancellation. Only draft can be deleted.
-
orders.deleteSubscriptionTimelineDelete an Order Timeline message with predefined identifier string.
-
orders.getSubscriptionRetrieve an order with specified identifier string.
-
orders.getSubscriptionCancellationRetrieve an order сancellation with specified identifier string.
-
orders.getSubscriptionCancellationCollectionRetrieve a list of cancellations for all subscriptions.
-
orders.getSubscriptionCollectionRetrieve a list of orders.
-
orders.getSubscriptionReactivationRetrieve an order reactivation with specified identifier string.
-
orders.getSubscriptionReactivationCollectionRetrieve a list of reactivations for all subscriptions.
-
orders.getSubscriptionTimelineRetrieve a order message with specified identifier string.
-
orders.getSubscriptionTimelineCollectionRetrieve a list of order timeline messages.
-
orders.getSubscriptionUpcomingInvoiceCollectionRetrieve an upcoming invoice from the specified subscription order. The endpoint is temporary before upcoming invoices get a complete integration.
-
orders.postSubscriptionCreate an order. Consider using the upsert. operation to accomplish this task.
-
orders.postSubscriptionCancellationCancel an order or preview the cancellation parameters before that.
-
orders.postSubscriptionInterimInvoiceIssue an interim invoice for a subscription, typically used in conjunction. with plan changes and pro rata adjustments. This process creates an invoice, adds the subscription's line items to the invoice, and issues the invoice, and applies payment to it if a transaction id is supplied.
-
orders.postSubscriptionItemsChangeChange an order's items or quantities and designate when and if there should be pro-rata credits given.
-
orders.postSubscriptionReactivationReactivate a subscription.
-
orders.postSubscriptionTimelineCreate an order Timeline comment.
-
orders.postUpcomingInvoiceIssuanceIssue an upcoming invoice with specified identifier string for early pay.
-
orders.putSubscriptionCreate or update an order with predefined identifier string.
-
orders.putSubscriptionCancellationCancel a subscription.
-
paymentCards.getPaymentCardRetrieve a Payment Card with specified identifier string.
-
paymentCards.getPaymentCardCollectionRetrieve a list of Payments Cards.
-
paymentCards.patchPaymentCardUpdate any of the payment card's values except for the pan.
-
paymentCards.postPaymentCardCreate a Payment Card.
-
paymentCards.postPaymentCardDeactivationDeactivate a Payment Card.
-
paymentCards.putPaymentCardCreate a payment card with predefined ID
-
paymentInstruments.getPaymentInstrumentRetrieve a payment instrument by ID.
-
paymentInstruments.getPaymentInstrumentCollectionRetrieve a list of payment instruments.
-
paymentInstruments.patchPaymentInstrumentUpdate allowed payment instrument's values.
-
paymentInstruments.postPaymentInstrumentCreate a payment instrument. If such payment card or bank account payment instrument already exists then updates it instead.
-
paymentInstruments.postPaymentInstrumentDeactivationDeactivate a payment instrument.
-
paymentTokens.getTokenRetrieve a token with specified identifier string.
-
paymentTokens.getTokenCollectionRetrieve a list of tokens.
-
paymentTokens.postDigitalWalletValidationis the recommended way to use when validating a digital wallet session.
-
paymentTokens.postTokenis the recommended way to create a payment token because it minimizes PCI DSS compliance. Once a payment token is created, it can only be used once.
A payment token expires upon first use or within 30 minutes of the token creation (whichever comes first).
-
payPalAccounts.getPayPalAccountRetrieve a PayPal Account with specified identifier string.
-
payPalAccounts.getPayPalAccountCollectionRetrieve a list of PayPal Accounts.
-
payPalAccounts.postPayPalAccountCreate a PayPal Account.
-
payPalAccounts.postPayPalAccountDeactivationDeactivate a PayPal Account.
-
payPalAccounts.putPayPalAccountCreate a PayPal account with predefined ID
-
plans.deletePlanDelete a Plan with predefined identifier string.
-
plans.getPlanRetrieve a plan with specified identifier string.
-
plans.getPlanCollectionRetrieve a list of plans.
-
plans.postPlanCreate a plan.
-
plans.putPlanCreate or update a Plan with predefined identifier string.
-
products.deleteProductDelete a product with predefined identifier string.
-
products.getProductRetrieve a product with specified identifier string.
-
products.getProductCollectionRetrieve a list of products.
-
products.postProductCreate a Product.
-
products.putProductCreate a product with predefined identifier string.
-
search.getSearchSearch merchant's data to return resources such as customers, invoices, orders, transactions.
-
shippingZones.deleteShippingZoneDelete a shipping zone with predefined identifier string.
-
shippingZones.getShippingZoneRetrieve a shipping zone with specified identifier string.
-
shippingZones.getShippingZoneCollectionRetrieve a list of shipping zones.
-
shippingZones.postShippingZoneCreate a Shipping Zone.
-
shippingZones.putShippingZoneCreate a shipping zone with predefined identifier string.
-
tags.deleteTagDelete a tag. It's an asynchronous operation.
-
tags.deleteTagCustomerUntag a customer.
-
tags.deleteTagCustomerCollectionUntag a list of customers. If the customer from the list is already untagged it will be ignored. It's an asynchronous operation.
-
tags.getTagRetrieve a tag.
-
tags.getTagCollectionRetrieve a list of tags.
-
tags.patchTagUpdate a tag.
-
tags.postTagCreate a tag.
-
tags.postTagCustomerTag a customer.
-
tags.postTagCustomerCollectionTag a list of customers. If the customer from the list is already tagged it will be ignored. It's an asynchronous operation.
-
transactions.deleteTransactionTimelineDelete a Transaction Timeline message with predefined identifier string.
-
transactions.getTransactionRetrieve a Transaction with specified identifier string.
-
transactions.getTransactionCollectionRetrieve a list of transactions.
-
transactions.getTransactionTimelineRetrieve a timeline message with specified identifier string.
-
transactions.getTransactionTimelineCollectionRetrieve a list of transaction timeline messages.
-
transactions.patchTransactionUpdate a transaction's custom fields.
-
transactions.postPayoutCreate a transaction of type
credit. -
transactions.postReadyToPayGet available payment methods for a specific transaction or a purchase.
The payment methods order shown to a customer SHOULD be the same as the order in the response.
The list of available methods is generated from available intersected with the last matched
adjust-ready-to-payaction onready-to-pay-requestedevent.If there were no actions matched for the specific request – all methods supported by the Gateway Accounts are sent.
To invert this behavior – place an all-matching rule at the very end of the
ready-to-pay-requestedevent in Rules Engine with an emptypaymentMethodsproperty of theadjust-ready-to-payaction. -
transactions.postTransactionCreate a transaction of type
saleorauthorize. This endpoint supports two main styles of transactions:- A real-time decision and response.
- User approval/interaction is required.
A real-time decision is very familiar. You send a request, and inspect the
resultof the response forapprovedordeclined.However, many transactions, especially those for alternative methods, require the user to interact with a 3rd party. You may be able to envision PayPal, for example, the user must give permission to complete the payment (or accept the billing agreement).
Even payment cards may require user approval in the case of 3D secure authentication. In the event that approval is required, you will receive a response back and notice that the
resultisunknown. You will find that thestatusiswaiting-approval. And you will find in the_linkssection of the response a link for theapprovalUrl.In this case you would either open the
approvalUrlin an iframe or in a pop (better workflow for mobile). -
transactions.postTransactionQueryQuery a Transaction with a specified identifier string. The query will contact the gateway account to find the result and amount/currency. The response should be analyzed. If deemed appropriate, the transaction could be updated using the Transaction Update API.
-
transactions.postTransactionRefundRefund a Transaction with specified identifier string. Note that the refund will be in the same currency as the original transaction.
-
transactions.postTransactionTimelineCreate a transaction Timeline comment.
-
transactions.postTransactionUpdateUpdate a Transaction manually to completed status with given result with optional currency and amount.
-
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools