Unfortunately, this feature is not supported on mobile devices. For the best experience, please use a computer.

Core APIs (latest)

Introduction

The Rebilly API is built on HTTP and is RESTful. It has predictable resource URLs and returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. Use your favorite HTTP/REST library in your programming language when using this API, or use one of the Rebilly SDKs, which are available in PHP and JavaScript.

Every action in the Rebilly UI is supported by an API which is documented and available for use, so that you may automate any necessary workflows or processes. This API reference documentation contains the most commonly integrated resources.

Authentication

This topic describes the different forms of authentication that are available in the Rebilly API, and how to use them.

Rebilly offers four forms of authentication: secret key, publishable key, JSON Web Tokens, and public signature key.

  • Secret API key: Use to make requests from the server side. Never share these keys. Keep them guarded and secure.
  • Publishable API key: Use in your client-side code to tokenize payment information.
  • JWT: Use to make short-life tokens that expire after a set period of time.

Manage API keys

To create or manage API keys, select one of the following:

For more information on API keys, see API keys.

Errors

Rebilly follows the error response format proposed in RFC 9457, which is also known as Problem Details for HTTP APIs. As with any API responses, your client must be prepared to gracefully handle additional members of the response.

SDKs

Rebilly provides a JavaScript SDK and a PHP SDK to help interact with the Rebilly API. However, no SDK is required to use the API.

Rebilly also provides FramePay, a client-side iFrame-based solution, to help create payment tokens while minimizing PCI DSS compliance burdens and maximizing your customization ability. FramePay interacts with the payment tokens creation operation.

JavaScript SDK

For installation and usage instructions, see SDKs. All JavaScript SDK code examples are included in the API reference documentation.

PHP SDK

For installation and usage instructions, see SDKs. All SDK code examples are included in the API reference documentation. To use them, you must configure the $client as follows:

$client = new Rebilly\Client([
    'apiKey' => 'YourApiKeyHere',
    'baseUrl' => 'https://api.rebilly.com',
]);

Get started

The full Rebilly API has over 500 operations. This is likely more than you may need to implement your use cases. If you would like to implement a particular use case, contact Rebilly for guidance and feedback on the best API operations to use for the task.

To integrate Rebilly, and learn about related resources and concepts, see Get started.

Download OpenAPI description
Languages
Servers
Mock server
https://www.rebilly.com/_mock/docs/dev-docs/api/
Sandbox server
https://api-sandbox.rebilly.com/organizations/{organizationId}/
Live server
https://api.rebilly.com/organizations/{organizationId}/

Customers

Use these operations to manage customers. A customer is an entity that purchases goods or services from you (a merchant), and is the payee in any transaction that is credited to you. Customers are associated with payment instruments, subscriptions, invoices, and other related resources.

In other systems, customers may be referred to as accounts, clients, members, patrons, or players. For information on the customer resource, see Resources.

Operations

Customer authentication

Use these operations to validate the identity of users and manage authentication credentials.

Operations

Tags

Use tags to organize and categorize customers or KYC documents based on keywords.

Operations

Customers timeline

Use customer timelines to maintain an audit trail of changes and activity for each customer.

Operations

Payment instruments

Use these operations to manage payment instruments. Payment instrument is a term which describes any means of making a digital payment, such as: credit cards, debit cards, direct debits, payment service providers, and digital wallets.

For more information on payment instruments, see Payment instruments.

OperationsWebhooks

Payment tokens

Use payment tokens to reduce the scope of PCI DSS compliance.

A payment token can be made using a different authentication scheme (public key authentication), which enables you to create a payment token directly from the browser. This bypasses the need to send sensitive cardholder info to your servers. We recommend using this with the FramePay library, which helps you integrate a form into this API resource and create payment tokens.

Operations

Transactions

Use these operations to:

  • set up payment instruments for payments
  • authorize and hold funds
  • capture funds
  • make payments
  • make payouts
  • refund transactions.
Operations

Disputes

Use these operations to manage disputes. A dispute occurs when a customer contests a charge to their account. The dispute and related information is made available to the merchant by the bank or credit card company. The merchant then has the option to represent the charge and win the case. This process is called dispute resolution. If the merchant is unable to represent the charge, the card issuer typically reverses the sale and adds fees on top of the charge. This process is called a chargeback.

OperationsWebhooks

Fees

Use fees to reconcile transactions with applicable fees and discount rates. Fees are not applied directly to transaction amounts, they do not modify the transaction amount. Fees help to describe each part of the transaction amount.

Important: These operations are experimental and may change.

Operations

Transactions timeline

Use transaction timelines to maintain an audit trail of changes and activity for each transaction.

Operations

Orders

Use these operations to manage customer orders. An order is a customer's request to purchase items. It can contain subscription and one-time sale items. When an order contains one or more subscription items, it is a subscription order.

An order generates an invoice. A subscription order generates an invoice for each service period. For more information, see Orders.

Operations

Retrieve orders

Request

Retrieves a list of orders.

Query
filterstring

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

sortArray of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -. Multiple fields can be sorted by separating each with ,.

limitinteger[ 0 .. 1000 ]

Limits the number of collection items to be returned.

offsetinteger[ 0 .. 1000 ]

Specifies the starting point within the collection of items to be returned.

qstring

Use this field to perform a partial search of text fields.

expandstring

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions?expand=string&filter=string&limit=1000&offset=1000&q=string&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

List of subscriptions retrieved.

Headers
Pagination-Totalinteger

Total number of items.

Example:

332

Pagination-Limitinteger

Maximum number of items per page.

Example:

100

Pagination-Offsetinteger

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example:

2

Bodyapplication/jsonArray [
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

]
Response
application/json
[ { "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": {}, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [], "lineItemSubtotal": {}, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [], "deliveryAddress": {}, "billingAddress": {}, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": {}, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": {}, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [], "_embedded": {} } ]

Create an order

Request

Creates an order.

To create or update an order with a specified ID, use the Upsert an order operation.

Query
expandstring

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

Bodyapplication/jsonrequired

Order resource.

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

renewalTimestring or null(date-time)

Date and time when the subscription renews.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

couponIdsArray of strings or nullwrite-only

List of coupons to redeem on the customer and restrict to this order.

For more information, see Coupons.

This parameter uses the following logic:

  • If this parameter is not supplied, applied coupons are not changed.
  • If an empty array is supplied, all applied coupon redemptions are canceled.
  • If a list of coupons is supplied, unapplied coupons in the list are applied. Coupons that have already been applied do not change state. Applied coupons that are not supplied in list are canceled.

If the list of applied coupons on a pending order is changed by this parameter during an order update, the invoice for the order is reissued.

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions?expand=string' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "orderType": "subscription-order",
    "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
    "trial": {
      "enabled": true,
      "endTime": "2019-08-24T14:15:22Z"
    },
    "isTrialOnly": false,
    "invoiceTimeShift": null,
    "recurringInterval": null,
    "autopay": true,
    "startTime": null,
    "renewalTime": "2019-08-24T14:15:22Z",
    "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N",
    "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
    "currency": "USD",
    "items": [
      {
        "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
        "quantity": 0,
        "quantityFilled": 0,
        "plan": {
          "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
        },
        "usageLimits": {
          "softLimit": {
            "quantity": 1
          },
          "hardLimit": {
            "quantity": 1
          }
        }
      }
    ],
    "deliveryAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "billingAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "abandonTime": "2019-08-24T14:15:22Z",
    "delinquencyPeriod": "P7D",
    "couponIds": [
      "string"
    ],
    "poNumber": "PO123456",
    "shipping": {
      "amount": 0.1,
      "calculator": "manual"
    },
    "notes": "string",
    "riskMetadata": null,
    "customFields": {
      "foo": "bar"
    }
  }'
Experience it firsthand in the API Explorer!

Responses

Order created.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "recentInvoice": {}, "initialInvoice": {}, "customer": {}, "website": {}, "leadSource": {}, "shippingRate": {}, "paymentInstrument": {}, "upcomingInvoice": {} } }

Retrieve an order

Request

Retrieves an order with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Query
expandstring

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}?expand=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Order retrieved.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "recentInvoice": {}, "initialInvoice": {}, "customer": {}, "website": {}, "leadSource": {}, "shippingRate": {}, "paymentInstrument": {}, "upcomingInvoice": {} } }

Upsert an order

Request

Creates or updates (upserts) an order with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Query
expandstring

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

Bodyapplication/jsonrequired

Order resource.

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

renewalTimestring or null(date-time)

Date and time when the subscription renews.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

couponIdsArray of strings or nullwrite-only

List of coupons to redeem on the customer and restrict to this order.

For more information, see Coupons.

This parameter uses the following logic:

  • If this parameter is not supplied, applied coupons are not changed.
  • If an empty array is supplied, all applied coupon redemptions are canceled.
  • If a list of coupons is supplied, unapplied coupons in the list are applied. Coupons that have already been applied do not change state. Applied coupons that are not supplied in list are canceled.

If the list of applied coupons on a pending order is changed by this parameter during an order update, the invoice for the order is reissued.

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

curl -i -X PUT \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}?expand=string' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "orderType": "subscription-order",
    "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
    "trial": {
      "enabled": true,
      "endTime": "2019-08-24T14:15:22Z"
    },
    "isTrialOnly": false,
    "invoiceTimeShift": null,
    "recurringInterval": null,
    "autopay": true,
    "startTime": null,
    "renewalTime": "2019-08-24T14:15:22Z",
    "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N",
    "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
    "currency": "USD",
    "items": [
      {
        "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
        "quantity": 0,
        "quantityFilled": 0,
        "plan": {
          "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
        },
        "usageLimits": {
          "softLimit": {
            "quantity": 1
          },
          "hardLimit": {
            "quantity": 1
          }
        }
      }
    ],
    "deliveryAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "billingAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "abandonTime": "2019-08-24T14:15:22Z",
    "delinquencyPeriod": "P7D",
    "couponIds": [
      "string"
    ],
    "poNumber": "PO123456",
    "shipping": {
      "amount": 0.1,
      "calculator": "manual"
    },
    "notes": "string",
    "riskMetadata": null,
    "customFields": {
      "foo": "bar"
    }
  }'
Experience it firsthand in the API Explorer!

Responses

Order updated.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "recentInvoice": {}, "initialInvoice": {}, "customer": {}, "website": {}, "leadSource": {}, "shippingRate": {}, "paymentInstrument": {}, "upcomingInvoice": {} } }

Delete a pending order

Request

Deletes a pending order with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X DELETE \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Pending order deleted.

Response
application/json
{ "status": 401, "type": "http://example.com", "title": "string", "detail": "string", "instance": "string" }

Void a subscription order

Request

Voids a pending order with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/void' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Order voided.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "recentInvoice": {}, "initialInvoice": {}, "customer": {}, "website": {}, "leadSource": {}, "shippingRate": {}, "paymentInstrument": {}, "upcomingInvoice": {} } }

Change subscription order items

Request

Changes subscription order items or quantities, and designates if or when pro-rata credits should be given.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Query
expandstring

Expand a response to receive a full related object in the _embedded path.

To expand multiple objects, use a comma-separated list. Example: expand=recentInvoice,initialInvoice.

Available arguments are:

  • customer
  • leadSource
  • website
  • shippingRate
  • initialInvoice
  • recentInvoice
  • upcomingInvoice
  • paymentInstrument

For more information, see Expand to include embedded objects.

Bodyapplication/jsonrequired

Change items request.

itemsArray of objectsnon-emptyrequired

Details of items in the order.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required

Plan details.

One of:

Plan details.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].quantityinteger

Number of units of the product on the given plan.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

renewalPolicystringrequired

Specifies if the subscription retains its current renewalTime or resets it to a newly calculated renewalTime.

Enum"reset""retain"
proratedbooleanrequired

Specifies whether to give a pro rata credit for the amount of time remaining between the effectiveTime and the end of the current period.

In addition, if the renewalTime is retained, by setting the renewalPolicy to retain, a pro rata debit occurs for the amount between the effectiveTime and the renewalTime as a percentage of the normal period size.

effectiveTimestring(date-time)

Date from which the renewal time for reset operations and proration calculations are made. If this field is omitted, this value defaults to the current time.

previewboolean

Specifies if changes to the subscription can be previewed. Subscriptions cannot be changed in preview.

Default false
keepTrialboolean

Specifies if the subscription order must retain its active trial. This field is only applicable if renewalPolicy is set to retain.

Default false
curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/change-items?expand=string' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "items": [
      {
        "plan": {
          "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
        },
        "quantity": 0,
        "usageLimits": {
          "softLimit": {
            "quantity": 1
          },
          "hardLimit": {
            "quantity": 1
          }
        }
      }
    ],
    "renewalPolicy": "reset",
    "prorated": true,
    "effectiveTime": "2019-08-24T14:15:22Z",
    "preview": false,
    "keepTrial": false
  }'
Experience it firsthand in the API Explorer!

Responses

Order changed.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

orderIdstring<= 50 charactersread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

orderTypestringrequired

Specifies the type of order. An order may be a subscription or a one-time purchase.

Value"subscription-order"
Discriminator
customerIdstring(CustomerId)<= 50 charactersrequired

ID of the customer resource.

renewalReminderTimestring or null(date-time)read-only

Date and time when the renewal reminder event triggers.

renewalReminderNumberinteger or nullread-only

Number of triggered renewal reminder events.

trialReminderTimestring or null(date-time)read-only

Date and time when the trial reminder event triggers.

trialReminderNumberinteger or nullread-only

Number of triggered trial reminder events.

abandonReminderTimestring or null(date-time)read-only

Date and time when the abandon order reminder event triggers.

abandonReminderNumberinteger or nullread-only

Number of abandon order reminder events that are triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Trial details. To use plan defaults do not send the trial key, or send a null value.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default false
isTrialConvertedbooleanread-only

Specifies if a subscription had trial conversion. Trial conversion is when at least one successful payment is made on the subscription after a trial.

Example:

true

invoiceTimeShift(InvoiceTimeShift (object or null)) or null

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

Example:

null

One of:

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

recurringIntervalobject or null

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same recurring period length.

Example:

null

autopayboolean

Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at paymentInstrumentId, or the default payment instrument on the subscription.

Default true
startTimestring or null(date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Example:

null

churnTimestring or null(date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null(date-time)

Date and time when the subscription renews.

rebillNumberinteger or nullread-only

Current billing period number.

lineItemsArray of objectsDeprecatedread-only

Subscription line items which queue until the next renewal, or interim, invoice is issued for the subscription.

lineItemSubtotalobjectread-only

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

paymentInstrumentIdstring or null<= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:

"inst_0YVB8KPKNXCBR9EDX7JHSED75N"

billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring<= 50 charactersrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

initialInvoiceIdstring or null<= 50 charactersread-only

ID of the initial invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

recentInvoiceIdstring or null<= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

itemsArray of objects(SubscriptionOrOneTimeSaleItem)non-emptyrequired

Details of items in the order.

items[].idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

items[].planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

items[].quantityFilledinteger

Number of filled product units.

items[].planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

items[].plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

items[].usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

items[].revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

items[].isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

items[].isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

items[]._embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

deliveryAddressContactObject (object) or null

Delivery address of the order.

One of:

Delivery address of the order.

billingAddressContactObject (object) or null

Billing address of the order.

One of:

Billing address of the order.

activationTimestring or null(date-time)read-only

Date and time when the order is activated.

voidTimestring or null(date-time)read-only

Date and time when the order is voided.

abandonTimestring or null(date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

delinquencyPeriodstring or null

Length of time, in ISO-8601 durations format, which is added to the due time of the order when setting the delinquency time for all related invoices. When the delinquency time of an invoice is reached, the order is automatically canceled.

If the provided value is null, the order does not change state.

Default null
Example:

"P7D"

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:

"PO123456"

shippingobject(Shipping)

Shipping settings.

notesstring

Notes for the customer displayed on the order invoice.

canceledBystring or nullread-only

Specifies who initiated the cancellation.

Enum"merchant""customer""rebilly"null
cancelCategorystring or nullread-only

Category of the cancellation.

Enum"billing-failure""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""never-started"
cancelDescriptionstring or null<= 255 charactersread-only

Description of the cancellation reason in free form.

revisionintegerread-only

Number of times the order data has been modified.

The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

riskMetadataobject or null

Risk metadata. If this value is null, this field uses risk metadata that is captured when creating the payment token.

Example:

null

billingPortalTokenstring or nullread-only

Customer JWT to access billing portal. This field is presented only if billing portal exists. This is an experimental field and can be changed or removed in the future.

customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "orderType": "subscription-order", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "renewalReminderTime": "2019-08-24T14:15:22Z", "renewalReminderNumber": 0, "trialReminderTime": "2019-08-24T14:15:22Z", "trialReminderNumber": 0, "abandonReminderTime": "2019-08-24T14:15:22Z", "abandonReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "isTrialConverted": true, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "recentInvoice": {}, "initialInvoice": {}, "customer": {}, "website": {}, "leadSource": {}, "shippingRate": {}, "paymentInstrument": {}, "upcomingInvoice": {} } }

Update a subscription order itemExperimental

Request

Updates a subscription order item. This is an experimental endpoint, can be changed or removed in the future.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

itemIdstringrequired

ID of subscription item.

Bodyapplication/jsonrequired

Update item request.

quantityFilledintegerrequired

Filled quantity of the subscription item (experimental property).

curl -i -X PATCH \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/items/{itemId}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "quantityFilled": 0
  }'
Experience it firsthand in the API Explorer!

Responses

Order item updated.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the order item.

Example:

"ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX"

planIdstring<= 50 charactersDeprecated

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

quantityinteger

Number of product units in the specified plan.

quantityFilledinteger

Number of filled product units.

planOriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionPlan (object) or TrialOnlyPlan (object)))required
Any of:

Use an existing plan without changes for the current order.

To create a new plan, see Create a plan.

plan.idstring(ResourceId)<= 50 charactersrequired

Unique resource ID.

usageLimitsobject

Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered.

revisionintegerread-only

Revision number that increments with each overriding change to this specific plan item.

isModifiedbooleanread-only

Specifies if the plan information is modified for this subscription.

isGrandfatheredbooleanread-only

Specifies if the current plan revision number is greater than the plan item revision number.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "ord_itm_0YVJ6172Q2CXW9VP7KJMKHCMMX", "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X", "quantity": 0, "quantityFilled": 0, "plan": { "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21" }, "usageLimits": { "softLimit": {}, "hardLimit": {} }, "revision": 0, "isModified": true, "isGrandfathered": true, "_embedded": { "product": {} } }

Issue an interim invoice

Request

Issues an interim invoice for a subscription order. Use this operation for plan changes and pro rata adjustments.

This process:

  • Creates an invoice.
  • Adds the subscription line items to the invoice.
  • Issues the invoice.
  • Optionally, applies payment to the invoice if a transactionId is supplied.
Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

Issue an interim invoice.

transactionIdstring(TransactionId)<= 50 characters

ID of the transaction.

curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/interim-invoice' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "transactionId": "txn_0YVDTQJ8YWDGQACV2N2N5SPWQ0"
  }'
Experience it firsthand in the API Explorer!

Responses

Invoice created.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

websiteIdstring(WebsiteId)<= 50 charactersrequired
invoiceNumberintegerread-only

Auto-incrementing number based on the sequence of invoices for any particular customer.

orderIdstring or nullread-only

ID of the order (experimental).

Example:

"ord_01GYJPRKHBD6ZYHH897QCJMBS4"

subscriptionIdstring<= 50 charactersread-only

ID of the related subscription order, if available. This field is null if there are no related subscription orders.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

quoteIdstring or null<= 50 charactersread-only

ID of the related quote, if available. This field is null if there are no related quotes.

Example:

"qt_0YV7DES3WPC5J8JD8QTVNZBZNZ"

currencystring(CurrencyCode)= 3 charactersrequired

Currency code in ISO 4217 format.

amountnumber(double)read-only

Amount of the invoice.

amountDuenumber(double)read-only

Amount that is due on the invoice.

subtotalAmountnumber(double)read-only

Subtotal amount of the invoice.

discountAmountnumber(double)read-only

Discount amount that is applied to the invoice.

shippingobject(Shipping)

Shipping settings.

taxobject(Taxes)

Taxes.

organizationTaxIdNumberobject or null

Organization tax ID number that is displayed on the invoice.

customerTaxIdNumberobject or null

Customer tax ID number that is displayed on the invoice.

billingAddressobject(ContactObject)

Contact's information.

deliveryAddressobject(ContactObject)

Contact's information.

poNumberstring or null<= 50 characters

Purchase order number that is displayed on the invoice.

Example:

"PO123456"

notesstring<= 65535 characters

Notes for the customer that are displayed on the invoice.

itemsArray of objects(InvoiceItem)read-only

Invoice items array.

discountsArray of objectsread-only

Discounts applied.

autopayScheduledTimestring or null(date-time)

Date and time when an automatic payment (autopay) is scheduled.

autopayRetryNumberinteger>= 0read-only

Number of times that an automatic payment (autopay) has been attempted on an invoice.

Default 0
statusstringread-only

Status of the invoice.

Enum"draft""quotation""unpaid""paid""partially-paid""past-due""abandoned""voided""partially-refunded""refunded"
delinquentCollectionPeriodintegerread-only

Length of time, in days, between when the invoice is due and when the invoice is paid.

collectionPeriodintegerread-only

Length of time, in days, between when the invoice is issued and when the invoice is paid.

abandonedTimestring or null(date-time)read-only

Date and time when the invoice is abandoned.

voidedTimestring or null(date-time)read-only

Date and time when the invoice is voided.

paidTimestring or null(date-time)read-only

Date and time when the invoice is paid.

dueTimestring(date-time)

Date and time when the invoice is due for payment.

issuedTimestring(date-time)(ServerTimestamp)read-only

Read-only timestamp in ISO 8601 date-time format.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

paymentFormUrlstring or null(url)read-only

URL where the customer is redirected to pay the invoice using one of the methods which are available to the customer. This is an alternative to creating a new transaction with empty methods.

customerIdstring<= 50 charactersrequired

ID of the customer resource.

Example:

"cus_0YV7DDSDD1C8DA64KHH2W33CPF"

transactionsArray of objects(Transaction)<= 10 itemsread-only

Invoice transactions array.

retryInstructionobject or null

Invoice payment retry instruction. This object specifies how to proceed if a payment related to the invoice fails.

revisionintegerread-only

Number of times the invoice data has been modified.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

typestringread-only

Type of invoice.

Enum"initial""renewal""interim""cancellation""one-time""refund""charge""one-time-sale"
dueReminderTimestring or null(date-time)read-only

Date and time when a past due reminder event is triggered.

dueReminderNumberinteger or nullread-only

Number of past due reminder events that have been triggered.

organizationIdstring<= 50 charactersread-only

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

delinquencyTimestring or null(date-time)

Date and time when the related order is considered delinquent, and is canceled. If this value is null, no delinquency time is configured. If the dueTime of the order becomes greater than the delinquencyTime value, the delinquencyTime value becomes equal to dueTime.

If an invoice is not related to an order, this field can only be null.

Default null
_linksArray of objectsread-only

Related links.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "in_0YVF9605RKC62BP14NE2R7V2XT", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "invoiceNumber": 0, "orderId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "quoteId": "qt_0YV7DES3WPC5J8JD8QTVNZBZNZ", "currency": "USD", "amount": 0.1, "amountDue": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shipping": { "amount": 0.1, "calculator": "manual" }, "tax": { "calculator": "manual", "amount": 0, "items": [] }, "organizationTaxIdNumber": { "type": "eu-vat", "value": "GB980780684" }, "customerTaxIdNumber": { "type": "eu-vat", "value": "GB980780684" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "poNumber": "PO123456", "notes": "string", "items": [ {} ], "discounts": [ {} ], "autopayScheduledTime": "2019-08-24T14:15:22Z", "autopayRetryNumber": 0, "status": "draft", "delinquentCollectionPeriod": 0, "collectionPeriod": 0, "abandonedTime": "2019-08-24T14:15:22Z", "voidedTime": "2019-08-24T14:15:22Z", "paidTime": "2019-08-24T14:15:22Z", "dueTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "paymentFormUrl": "string", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "transactions": [ {} ], "retryInstruction": { "attempts": [], "afterAttemptPolicies": [], "afterRetryEndPolicies": [] }, "revision": 0, "type": "initial", "dueReminderTime": "2019-08-24T14:15:22Z", "dueReminderNumber": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "delinquencyTime": null, "_links": [ {} ], "_embedded": { "customer": {}, "website": {}, "organization": {}, "leadSource": {}, "shippingRate": {} } }

Retrieve subscription order pauses

Request

Retrieves a list of subscription order pauses.

Query
limitinteger[ 0 .. 1000 ]

Limits the number of collection items to be returned.

offsetinteger[ 0 .. 1000 ]

Specifies the starting point within the collection of items to be returned.

filterstring

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

sortArray of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -. Multiple fields can be sorted by separating each with ,.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-pauses?filter=string&limit=1000&offset=1000&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

List of subscription order pauses retrieved.

Headers
Pagination-Totalinteger

Total number of items.

Example:

332

Pagination-Limitinteger

Maximum number of items per page.

Example:

100

Pagination-Offsetinteger

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example:

2

Bodyapplication/jsonArray [
idstring<= 50 charactersread-only

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

statusstringread-only

Status of the subscription pause.

Enum"pending""ongoing""revoked""finished"
pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

]
Response
application/json
[ { "id": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "status": "pending", "pausedBy": "merchant", "description": "string", "effectiveTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "timeRemaining": "P3600S", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [] } ]

Pause a subscription order

Request

Pauses a subscription order with a specified ID.

Bodyapplication/jsonrequired

Pause resource.

subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

curl -i -X POST \
  https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-pauses \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "pausedBy": "merchant",
    "description": "string",
    "effectiveTime": "2019-08-24T14:15:22Z",
    "endTime": "2019-08-24T14:15:22Z",
    "timeRemaining": "P3600S"
  }'
Experience it firsthand in the API Explorer!

Responses

Pause created.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

statusstringread-only

Status of the subscription pause.

Enum"pending""ongoing""revoked""finished"
pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "status": "pending", "pausedBy": "merchant", "description": "string", "effectiveTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "timeRemaining": "P3600S", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }

Retrieve a subscription order pause

Request

Retrieves a subscription order pause with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-pauses/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Pause retrieved.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

statusstringread-only

Status of the subscription pause.

Enum"pending""ongoing""revoked""finished"
pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "status": "pending", "pausedBy": "merchant", "description": "string", "effectiveTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "timeRemaining": "P3600S", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }

Update a subscription order pause

Request

Updates a subscription order pause.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/json
subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

curl -i -X PUT \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-pauses/{id}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "pausedBy": "merchant",
    "description": "string",
    "effectiveTime": "2019-08-24T14:15:22Z",
    "endTime": "2019-08-24T14:15:22Z",
    "timeRemaining": "P3600S"
  }'
Experience it firsthand in the API Explorer!

Responses

Pause updated.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

subscriptionIdstring<= 50 charactersrequired

ID of the paused subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

statusstringread-only

Status of the subscription pause.

Enum"pending""ongoing""revoked""finished"
pausedBystring

Specifies who initiated the pause.

Default "customer"
Enum"merchant""customer"
descriptionstring or null<= 255 characters

Description of the pause reason in free form.

effectiveTimestring or null(date-time)

Date and time when the service period pauses.

This time must be later than the current time. If this time is earlier then the current time, the current time is used.

If this field is omitted, this value defaults to the current time.

endTimestring or null(date-time)

Date and time when the pause ends and the subscription resumes billing.

To resume a subscription from this point in time, use the current time or an earlier time. If endTime is earlier then the current time, the current time is used. If this field is empty, the subscription is indefinitely paused.

timeRemainingstring or null

Amount of time between the pause end time and the renewal time in ISO-8601 durations format. By default, this value is computed as the time between the pause and the renewal.

Example: A $30 per month subscription on a 30-day month is paused on day 20 of the subscription. There are 10 unused days on the subscription. Therefore, the subscription renews in 10 days after it is resumed. The upcoming invoice does not change the amount for the invoiced period, it remains at $30. If the subscription uses a billing anchor, the renewal time after a pause shift behaves as though the renewal time is moved forward by an Order API operation, and the billing anchor is ignored for that period.

For more information, see Service period anchor, billing timing, and invoice time shift.

Example:

"P3600S"

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "status": "pending", "pausedBy": "merchant", "description": "string", "effectiveTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "timeRemaining": "P3600S", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }

Delete a subscription order pause

Request

Deletes a subscription order pause with a specified ID. If the specified pause is pending, it is revoked. If the specified pause is ongoing, it is finished.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X DELETE \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-pauses/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Subscription order pause revoked or finished.

Response
application/json
{ "status": 401, "type": "http://example.com", "title": "string", "detail": "string", "instance": "string" }

Retrieve subscription order cancellations

Request

Retrieves a list of subscription order cancellations.

Query
limitinteger[ 0 .. 1000 ]

Limits the number of collection items to be returned.

offsetinteger[ 0 .. 1000 ]

Specifies the starting point within the collection of items to be returned.

filterstring

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

sortArray of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -. Multiple fields can be sorted by separating each with ,.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations?filter=string&limit=1000&offset=1000&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

List of cancelled subscription orders retrieved.

Headers
Pagination-Totalinteger

Total number of items.

Example:

332

Pagination-Limitinteger

Maximum number of items per page.

Example:

100

Pagination-Offsetinteger

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example:

2

Bodyapplication/jsonArray [
idstring<= 50 charactersread-only

ID of the cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

proratedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation proration is calculated.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

appliedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation fees or credits are applied.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTimestring or null(date-time)read-only

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

lineItemSubtotalobjectread-only

Subtotal of the line items added after the subscription cancellation.

_linksArray of objects(SelfLink)read-only

Related links.

]
Response
application/json
[ { "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [], "lineItemSubtotal": {}, "_links": [] } ]

Cancel a subscription order

Request

Cancels a subscription order.

Bodyapplication/jsonrequired

Cancellation resource.

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

curl -i -X POST \
  https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "canceledBy": "merchant",
    "reason": "did-not-use",
    "description": "string",
    "prorated": false,
    "status": "draft",
    "churnTime": "2019-08-24T14:15:22Z",
    "churnTimePolicy": "null",
    "lineItems": [
      {
        "type": "debit",
        "description": "string",
        "unitPriceAmount": 49.95,
        "unitPriceCurrency": "USD",
        "quantity": 1,
        "periodStartTime": "2019-08-24T14:15:22Z",
        "periodEndTime": "2019-08-24T14:15:22Z"
      }
    ]
  }'
Experience it firsthand in the API Explorer!

Responses

Cancellation created.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

proratedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation proration is calculated.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

appliedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation fees or credits are applied.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTimestring or null(date-time)read-only

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

lineItemSubtotalobjectread-only

Subtotal of the line items added after the subscription cancellation.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [ {} ], "lineItemSubtotal": { "amount": 49.95, "currency": "USD" }, "_links": [ {} ] }

Retrieve a subscription order cancellation

Request

Retrieves a subscription order cancellation with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Subscription order cancellation retrieved.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

proratedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation proration is calculated.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

appliedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation fees or credits are applied.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTimestring or null(date-time)read-only

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

lineItemSubtotalobjectread-only

Subtotal of the line items added after the subscription cancellation.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [ {} ], "lineItemSubtotal": { "amount": 49.95, "currency": "USD" }, "_links": [ {} ] }

Upsert a subscription order cancellation

Request

Creates or updates (upserts) a subscription order cancellation with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

Cancellation resource.

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

curl -i -X PUT \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations/{id}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "canceledBy": "merchant",
    "reason": "did-not-use",
    "description": "string",
    "prorated": false,
    "status": "draft",
    "churnTime": "2019-08-24T14:15:22Z",
    "churnTimePolicy": "null",
    "lineItems": [
      {
        "type": "debit",
        "description": "string",
        "unitPriceAmount": 49.95,
        "unitPriceCurrency": "USD",
        "quantity": 1,
        "periodStartTime": "2019-08-24T14:15:22Z",
        "periodEndTime": "2019-08-24T14:15:22Z"
      }
    ]
  }'
Experience it firsthand in the API Explorer!

Responses

Cancellation updated.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

proratedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation proration is calculated.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

appliedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation fees or credits are applied.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTimestring or null(date-time)read-only

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

lineItemSubtotalobjectread-only

Subtotal of the line items added after the subscription cancellation.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [ {} ], "lineItemSubtotal": { "amount": 49.95, "currency": "USD" }, "_links": [ {} ] }

Update a subscription order cancellation

Request

Updates a subscription order cancellation with a specified ID. Use this operation to update a cancellation reason and description.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

Patch cancellation resource.

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

curl -i -X PATCH \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations/{id}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "canceledBy": "merchant",
    "reason": "did-not-use",
    "description": "string",
    "prorated": false,
    "status": "draft",
    "churnTime": "2019-08-24T14:15:22Z",
    "churnTimePolicy": "null",
    "lineItems": [
      {
        "type": "debit",
        "description": "string",
        "unitPriceAmount": 49.95,
        "unitPriceCurrency": "USD",
        "quantity": 1,
        "periodStartTime": "2019-08-24T14:15:22Z",
        "periodEndTime": "2019-08-24T14:15:22Z"
      }
    ]
  }'
Experience it firsthand in the API Explorer!

Responses

Cancellation updated.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

subscriptionIdstring<= 50 charactersrequired

ID of the canceled subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

proratedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation proration is calculated.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

appliedInvoiceIdstring or null<= 50 charactersread-only

ID of the invoice on which the cancellation fees or credits are applied.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

canceledBystring

Specifies who initiated the cancellation.

Default "customer"
Enum"merchant""customer""rebilly"
reasonstring

Reason for the cancellation.

Default "other"
Enum"did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive""other""billing-failure"
descriptionstring<= 255 characters

Description of the cancellation reason in free form.

proratedboolean

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

Default false
statusstring

Status of the subscription order.

Default "confirmed"
Enum ValueDescription
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTimestring or null(date-time)read-only

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

churnTimestring(date-time)

Date and time when the subscription is deactivated.

churnTimePolicystring or nullrequired

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum"null""now""at-next-renewal"
lineItemsArray of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

lineItemSubtotalobjectread-only

Subtotal of the line items added after the subscription cancellation.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [ {} ], "lineItemSubtotal": { "amount": 49.95, "currency": "USD" }, "_links": [ {} ] }

Delete a subscription order cancellation

Request

Deletes a subscription order cancellation with a specified ID.

Important: Only subscription order cancellations with a status of draft can be deleted.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X DELETE \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-cancellations/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Subscription order cancellation deleted.

Response
application/json
{ "status": 401, "type": "http://example.com", "title": "string", "detail": "string", "instance": "string" }

Retrieve subscription order reactivations

Request

Retrieves a list of subscription order reactivations.

Query
limitinteger[ 0 .. 1000 ]

Limits the number of collection items to be returned.

offsetinteger[ 0 .. 1000 ]

Specifies the starting point within the collection of items to be returned.

filterstring

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

sortArray of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -. Multiple fields can be sorted by separating each with ,.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-reactivations?filter=string&limit=1000&offset=1000&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

List of subscription order reactivations retrieved.

Headers
Pagination-Totalinteger

Total number of items.

Example:

332

Pagination-Limitinteger

Maximum number of items per page.

Example:

100

Pagination-Offsetinteger

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example:

2

Bodyapplication/jsonArray [
idstring<= 50 charactersread-only

ID of the reactivation.

Example:

"ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0"

subscriptionIdstring<= 50 charactersrequired

ID of the reactivated subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

cancellationIdstring<= 50 charactersread-only

ID of the related cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

descriptionstring or null<= 255 characters

Description of the reactivation reason in free form.

renewalTimestring(date-time)

Date and time of the next subscription renewal. If this field is omitted, this value is computed from the effectiveTime field.

If the subscription is canceled but still active, it is ignored and the next renewal occurs as scheduled.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

]
Response
application/json
[ { "id": "ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "cancellationId": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "description": "string", "renewalTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [] } ]

Reactivate a subscription order

Request

Reactivates a subscription order with a specified ID.

Bodyapplication/jsonrequired

Reactivation resource.

subscriptionIdstring<= 50 charactersrequired

ID of the reactivated subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

descriptionstring or null<= 255 characters

Description of the reactivation reason in free form.

effectiveTimestring(date-time)write-only

Date and time when the service period starts, unless the subscription is canceled but still active.

If the subscription is still active, the subscription continues for the current service period.

If this field is omitted, this value defaults to the current time.

renewalTimestring(date-time)

Date and time of the next subscription renewal. If this field is omitted, this value is computed from the effectiveTime field.

If the subscription is canceled but still active, it is ignored and the next renewal occurs as scheduled.

paymentInstrumentIdstring or null<= 50 characterswrite-only

ID of the payment instrument. If this field is omitted, the subscription payment instrument remains unchanged.

Example:

"4f6cf35x-2c4y-483z-a0a9-158621f77a21"

curl -i -X POST \
  https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-reactivations \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
    "description": "string",
    "effectiveTime": "2019-08-24T14:15:22Z",
    "renewalTime": "2019-08-24T14:15:22Z",
    "paymentInstrumentId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
  }'
Experience it firsthand in the API Explorer!

Responses

Reactivation created. The order is now active. If the order had a related cancellation with a status of confirmed, it is revoked.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the reactivation.

Example:

"ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0"

subscriptionIdstring<= 50 charactersrequired

ID of the reactivated subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

cancellationIdstring<= 50 charactersread-only

ID of the related cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

descriptionstring or null<= 255 characters

Description of the reactivation reason in free form.

renewalTimestring(date-time)

Date and time of the next subscription renewal. If this field is omitted, this value is computed from the effectiveTime field.

If the subscription is canceled but still active, it is ignored and the next renewal occurs as scheduled.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "cancellationId": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "description": "string", "renewalTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }

Retrieve a subscription order reactivation

Request

Retrieves a subscription order reactivation with a specified ID.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscription-reactivations/{id}' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Reactivation retrieved.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the reactivation.

Example:

"ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0"

subscriptionIdstring<= 50 charactersrequired

ID of the reactivated subscription.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

cancellationIdstring<= 50 charactersread-only

ID of the related cancellation.

Example:

"ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV"

descriptionstring or null<= 255 characters

Description of the reactivation reason in free form.

renewalTimestring(date-time)

Date and time of the next subscription renewal. If this field is omitted, this value is computed from the effectiveTime field.

If the subscription is canceled but still active, it is ignored and the next renewal occurs as scheduled.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects(SelfLink)read-only

Related links.

Response
application/json
{ "id": "ord_rct_0YVJ62AF5XCFCA6EBFAAA3Z7E0", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "cancellationId": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "description": "string", "renewalTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }

Retrieve upcoming subscription order invoiceDeprecated

Request

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Query
expandstring

Expands a request to include embedded objects within the _embedded property of the response. This field accepts a comma-separated list of objects.

For more information, see Expand to include embedded objects.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/upcoming-invoices?expand=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Upcoming invoices retrieved.

Bodyapplication/jsonArray [
idstring<= 50 charactersread-only

ID of the upcoming invoice, which is persisted in the future renewal invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

websiteIdstring(WebsiteId)<= 50 characters
subscriptionIdstring<= 50 charactersread-only

ID of the related subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

currencystring(CurrencyCode)= 3 characters

Currency code in ISO 4217 format.

customerIdstring<= 50 characters

ID of the customer resource.

Example:

"cus_0YV7DDSDD1C8DA64KHH2W33CPF"

revisioninteger

Number of times the upcoming invoice data has changed.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

organizationIdstring<= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

itemsArray of objects(UpcomingInvoiceItem)

Upcoming invoice items array.

amountnumber(double)read-only

Amount of the invoice.

amountDuenumber(double)read-only

Amount that is due on the invoice.

subtotalAmountnumber(double)read-only

Subtotal amount of the invoice.

discountAmountnumber(double)read-only

Discount amount that is applied to the invoice.

shippingobject(Shipping)

Shipping settings.

taxobject(Taxes)

Taxes.

billingAddressobject(ContactObject)

Contact's information.

deliveryAddressobject(ContactObject)

Contact's information.

poNumberstring or null

Purchase order number that is displayed on the invoice.

Example:

"PO123456"

notesstring

Notes for the customer that are displayed on the invoice.

discountsArray of objectsread-only

Discounts applied.

dueTimestring(date-time)

Date and time when the invoice is due for payment.

issuedTimestring(date-time)(ServerTimestamp)read-only

Read-only timestamp in ISO 8601 date-time format.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects

Related links.

_embeddedobject

Embedded objects that are requested by the expand query parameter.

]
Response
application/json
[ { "id": "in_0YVF9605RKC62BP14NE2R7V2XT", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "currency": "USD", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "revision": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "items": [], "amount": 0.1, "amountDue": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shipping": {}, "tax": {}, "billingAddress": {}, "deliveryAddress": {}, "poNumber": "PO123456", "notes": "string", "discounts": [], "dueTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [], "_embedded": {} } ]

Retrieve an upcoming subscription order invoice

Request

Retrieves an upcoming invoice for a specified subscription order.

An upcoming invoice is an invoice that has not been issued. It functions as a preview of the next invoice for the order. For more information, see Invoices.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Query
expandstring

Expands a request to include embedded objects within the _embedded property of the response. This field accepts a comma-separated list of objects.

For more information, see Expand to include embedded objects.

curl -i -X GET \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/upcoming-invoice?expand=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Experience it firsthand in the API Explorer!

Responses

Upcoming invoice retrieved.

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the upcoming invoice, which is persisted in the future renewal invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

websiteIdstring(WebsiteId)<= 50 characters
subscriptionIdstring<= 50 charactersread-only

ID of the related subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

currencystring(CurrencyCode)= 3 characters

Currency code in ISO 4217 format.

customerIdstring<= 50 characters

ID of the customer resource.

Example:

"cus_0YV7DDSDD1C8DA64KHH2W33CPF"

revisioninteger

Number of times the upcoming invoice data has changed.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

organizationIdstring<= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

itemsArray of objects(UpcomingInvoiceItem)

Upcoming invoice items array.

amountnumber(double)read-only

Amount of the invoice.

amountDuenumber(double)read-only

Amount that is due on the invoice.

subtotalAmountnumber(double)read-only

Subtotal amount of the invoice.

discountAmountnumber(double)read-only

Discount amount that is applied to the invoice.

shippingobject(Shipping)

Shipping settings.

taxobject(Taxes)

Taxes.

billingAddressobject(ContactObject)

Contact's information.

deliveryAddressobject(ContactObject)

Contact's information.

poNumberstring or null

Purchase order number that is displayed on the invoice.

Example:

"PO123456"

notesstring

Notes for the customer that are displayed on the invoice.

discountsArray of objectsread-only

Discounts applied.

dueTimestring(date-time)

Date and time when the invoice is due for payment.

issuedTimestring(date-time)(ServerTimestamp)read-only

Read-only timestamp in ISO 8601 date-time format.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects

Related links.

_embeddedobject

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "in_0YVF9605RKC62BP14NE2R7V2XT", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "currency": "USD", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "revision": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "items": [ {} ], "amount": 0.1, "amountDue": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shipping": { "amount": 0.1, "calculator": "manual" }, "tax": { "calculator": "manual", "amount": 0, "items": [] }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "poNumber": "PO123456", "notes": "string", "discounts": [ {} ], "dueTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "customer": {}, "website": {}, "organization": {}, "leadSource": {} } }

Issue an upcoming invoice for early pay

Request

Issues an upcoming invoice, for a subscription order with a specified ID, for early pay.

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

InvoiceIssue resource.

issuedTimestring or null(date-time)

Date and time when the invoice is issued. If this field is null or omitted, the invoice is issued immediately.

dueTimestring or null(date-time)

Date and time when the invoice is due for payment. If this field is null or omitted, this value is set to the issuedTime value.

curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/upcoming-invoice/issue' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "issuedTime": "2019-08-24T14:15:22Z",
    "dueTime": "2019-08-24T14:15:22Z"
  }'
Experience it firsthand in the API Explorer!

Responses

Upcoming invoice issued.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the upcoming invoice, which is persisted in the future renewal invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

websiteIdstring(WebsiteId)<= 50 characters
subscriptionIdstring<= 50 charactersread-only

ID of the related subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

currencystring(CurrencyCode)= 3 characters

Currency code in ISO 4217 format.

customerIdstring<= 50 characters

ID of the customer resource.

Example:

"cus_0YV7DDSDD1C8DA64KHH2W33CPF"

revisioninteger

Number of times the upcoming invoice data has changed.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

organizationIdstring<= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

itemsArray of objects(UpcomingInvoiceItem)

Upcoming invoice items array.

amountnumber(double)read-only

Amount of the invoice.

amountDuenumber(double)read-only

Amount that is due on the invoice.

subtotalAmountnumber(double)read-only

Subtotal amount of the invoice.

discountAmountnumber(double)read-only

Discount amount that is applied to the invoice.

shippingobject(Shipping)

Shipping settings.

taxobject(Taxes)

Taxes.

billingAddressobject(ContactObject)

Contact's information.

deliveryAddressobject(ContactObject)

Contact's information.

poNumberstring or null

Purchase order number that is displayed on the invoice.

Example:

"PO123456"

notesstring

Notes for the customer that are displayed on the invoice.

discountsArray of objectsread-only

Discounts applied.

dueTimestring(date-time)

Date and time when the invoice is due for payment.

issuedTimestring(date-time)(ServerTimestamp)read-only

Read-only timestamp in ISO 8601 date-time format.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects

Related links.

_embeddedobject

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "in_0YVF9605RKC62BP14NE2R7V2XT", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "currency": "USD", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "revision": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "items": [ {} ], "amount": 0.1, "amountDue": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shipping": { "amount": 0.1, "calculator": "manual" }, "tax": { "calculator": "manual", "amount": 0, "items": [] }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "poNumber": "PO123456", "notes": "string", "discounts": [ {} ], "dueTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "customer": {}, "website": {}, "organization": {}, "leadSource": {} } }

Issue a specific upcoming invoice for early payDeprecated

Request

Path
idstring<= 50 characters^[@~\-\.\w]+$required

ID of the resource.

invoiceIdstringrequired

ID of the upcoming invoice.

Bodyapplication/jsonrequired

InvoiceIssue resource.

issuedTimestring or null(date-time)

Date and time when the invoice is issued. If this field is null or omitted, the invoice is issued immediately.

dueTimestring or null(date-time)

Date and time when the invoice is due for payment. If this field is null or omitted, this value is set to the issuedTime value.

curl -i -X POST \
  'https://www.rebilly.com/_mock/docs/dev-docs/api/subscriptions/{id}/upcoming-invoices/{invoiceId}/issue' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "issuedTime": "2019-08-24T14:15:22Z",
    "dueTime": "2019-08-24T14:15:22Z"
  }'
Experience it firsthand in the API Explorer!

Responses

Upcoming invoice issued.

Headers
Locationstring(uri)

Location of the related resource.

Example:

"https://api.rebilly.com/example"

Bodyapplication/json
idstring<= 50 charactersread-only

ID of the upcoming invoice, which is persisted in the future renewal invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

websiteIdstring(WebsiteId)<= 50 characters
subscriptionIdstring<= 50 charactersread-only

ID of the related subscription order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

currencystring(CurrencyCode)= 3 characters

Currency code in ISO 4217 format.

customerIdstring<= 50 characters

ID of the customer resource.

Example:

"cus_0YV7DDSDD1C8DA64KHH2W33CPF"

revisioninteger

Number of times the upcoming invoice data has changed.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

organizationIdstring<= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Example:

"org_0YVDM8RC7GDADADSBSMW124JA8"

itemsArray of objects(UpcomingInvoiceItem)

Upcoming invoice items array.

amountnumber(double)read-only

Amount of the invoice.

amountDuenumber(double)read-only

Amount that is due on the invoice.

subtotalAmountnumber(double)read-only

Subtotal amount of the invoice.

discountAmountnumber(double)read-only

Discount amount that is applied to the invoice.

shippingobject(Shipping)

Shipping settings.

taxobject(Taxes)

Taxes.

billingAddressobject(ContactObject)

Contact's information.

deliveryAddressobject(ContactObject)

Contact's information.

poNumberstring or null

Purchase order number that is displayed on the invoice.

Example:

"PO123456"

notesstring

Notes for the customer that are displayed on the invoice.

discountsArray of objectsread-only

Discounts applied.

dueTimestring(date-time)

Date and time when the invoice is due for payment.

issuedTimestring(date-time)(ServerTimestamp)read-only

Read-only timestamp in ISO 8601 date-time format.

createdTimestring(date-time)(CreatedTime)read-only

Date and time which is set automatically when the resource is created.

updatedTimestring(date-time)(UpdatedTime)read-only

Date and time which updates automatically when the resource is updated.

_linksArray of objects

Related links.

_embeddedobject

Embedded objects that are requested by the expand query parameter.

Response
application/json
{ "id": "in_0YVF9605RKC62BP14NE2R7V2XT", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "currency": "USD", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "revision": 0, "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8", "items": [ {} ], "amount": 0.1, "amountDue": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shipping": { "amount": 0.1, "calculator": "manual" }, "tax": { "calculator": "manual", "amount": 0, "items": [] }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "poNumber": "PO123456", "notes": "string", "discounts": [ {} ], "dueTime": "2019-08-24T14:15:22Z", "issuedTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "customer": {}, "website": {}, "organization": {}, "leadSource": {} } }

Preview an order

Request

Previews an order. Use this operation to preview a draft order before making an order.

Bodyapplication/json
websiteIdstring<= 50 characterswrite-onlyrequired
Example:

"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"

itemsArray of objectsnon-emptywrite-onlyrequired

Items details.

items[].planIdstring<= 50 charactersrequired

ID of the plan.

Example:

"plan_0YV7DENSVGDBW9S71XZNNYYQ0X"

items[].quantityinteger

Number of product units in the specified plan.

billingAddressContactObject (object) or nullwrite-only

Billing address details.

One of:

Billing address details.

deliveryAddressContactObject (object) or nullwrite-only

Delivery address details.

One of:

Delivery address details.

couponIdsArray of stringswrite-only

List of coupons that are applied to the order.

shippingobject(Shipping)write-only

Shipping settings.

curl -i -X POST \
  https://www.rebilly.com/_mock/docs/dev-docs/api/previews/orders \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
    "items": [
      {
        "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
        "quantity": 0
      }
    ],
    "billingAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "deliveryAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "^w$",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "512-710-1640",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "couponIds": [
      "string"
    ],
    "currency": "USD",
    "shipping": {
      "amount": 0.1,
      "calculator": "manual"
    }
  }'
Experience it firsthand in the API Explorer!

Responses

Order preview retrieved.

Bodyapplication/json
currencystring(CurrencyCode)= 3 charactersread-only

Currency code in ISO 4217 format.

lineItemsArray of objectsread-only

List of purchase items.

shippingRatesArray of objects(ShippingOption)read-only

Available shipping rates.

taxesArray of objectsread-only

Taxes applied to the purchase.

discountsArray of objectsread-only

Discounts applied to the purchase.

subtotalAmountnumber(double)read-only

Subtotal amount of the purchase.

taxAmountnumber(double)read-only

Tax amount of the purchase.

shippingAmountnumber(double)read-only

Shipping amount of the purchase.

discountsAmountnumber(double)read-only

Total discount amount of the purchase.

totalnumber(double)read-only

Total amount of the purchase.

Response
application/json
{ "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "^w$", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "currency": "USD", "lineItems": [ {} ], "shippingRates": [ {} ], "taxes": [ {} ], "discounts": [ {} ], "subtotalAmount": 0.1, "taxAmount": 0.1, "shippingAmount": 0.1, "discountsAmount": 0.1, "total": 0.1, "shipping": { "amount": 0.1, "calculator": "manual" } }

Soft usage limit reachedWebhook

Request

Bodyapplication/json

Request body resource of the usage limit webhook.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionItemIdstring

ID of the order item.

Example:

"ord_itm_01GYJPRKHBD6ZYHH897QCJMBS4"

planIdstring

ID of the plan.

Example:

"plan_01GYJPRKHBD6ZYHH897QCJMBS4"

usageQuantityinteger

Reported usage quantity.

usageAmountnumber(double)

Reported usage amount.

currencystring

Currency of the reported usage amount.

eventTypestring

Type of webhook event.

Enum"soft-usage-limit-reached""hard-usage-limit-reached"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionItemId": "ord_itm_01GYJPRKHBD6ZYHH897QCJMBS4", "planId": "plan_01GYJPRKHBD6ZYHH897QCJMBS4", "usageQuantity": 0, "usageAmount": 0.1, "currency": "string", "eventType": "soft-usage-limit-reached", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Order abandonedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Order completedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Renewal invoice issuedWebhook

Request

Bodyapplication/json

Renewal invoice issued webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

invoiceIdstring<= 50 characters

ID of the invoice.

Example:

"in_0YVF9605RKC62BP14NE2R7V2XT"

eventTypestring

Type of webhook event.

Value"renewal-invoice-issued"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "invoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "eventType": "renewal-invoice-issued", "_embedded": { "subscription": {}, "invoice": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Hard usage limit reachedWebhook

Request

Bodyapplication/json

Request body resource of the usage limit webhook.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionItemIdstring

ID of the order item.

Example:

"ord_itm_01GYJPRKHBD6ZYHH897QCJMBS4"

planIdstring

ID of the plan.

Example:

"plan_01GYJPRKHBD6ZYHH897QCJMBS4"

usageQuantityinteger

Reported usage quantity.

usageAmountnumber(double)

Reported usage amount.

currencystring

Currency of the reported usage amount.

eventTypestring

Type of webhook event.

Enum"soft-usage-limit-reached""hard-usage-limit-reached"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionItemId": "ord_itm_01GYJPRKHBD6ZYHH897QCJMBS4", "planId": "plan_01GYJPRKHBD6ZYHH897QCJMBS4", "usageQuantity": 0, "usageAmount": 0.1, "currency": "string", "eventType": "soft-usage-limit-reached", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order activatedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order canceledWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order churnedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order downgradedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription items changedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Order modifiedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order reactivatedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription renewal reminderWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order renewedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order trial convertedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order trial end reminderWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order trial endedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order trial end changedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order upgradedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order pausedWebhook

Request

Bodyapplication/json

Subscription pause and order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionPauseIdstring

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

eventTypestring

Type of webhook event.

Enum"subscription-pause-created""subscription-pause-modified""subscription-pause-revoked""subscription-paused""subscription-resumed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionPauseId": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "eventType": "subscription-pause-created", "_embedded": { "subscription": {}, "pause": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order pause createdWebhook

Request

Bodyapplication/json

Subscription pause and order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionPauseIdstring

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

eventTypestring

Type of webhook event.

Enum"subscription-pause-created""subscription-pause-modified""subscription-pause-revoked""subscription-paused""subscription-resumed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionPauseId": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "eventType": "subscription-pause-created", "_embedded": { "subscription": {}, "pause": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order pause modifiedWebhook

Request

Bodyapplication/json

Subscription pause and order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionPauseIdstring

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

eventTypestring

Type of webhook event.

Enum"subscription-pause-created""subscription-pause-modified""subscription-pause-revoked""subscription-paused""subscription-resumed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionPauseId": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "eventType": "subscription-pause-created", "_embedded": { "subscription": {}, "pause": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order pause revokedWebhook

Request

Bodyapplication/json

Subscription pause and order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionPauseIdstring

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

eventTypestring

Type of webhook event.

Enum"subscription-pause-created""subscription-pause-modified""subscription-pause-revoked""subscription-paused""subscription-resumed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionPauseId": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "eventType": "subscription-pause-created", "_embedded": { "subscription": {}, "pause": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Subscription order resumedWebhook

Request

Bodyapplication/json

Subscription pause and order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

subscriptionPauseIdstring

ID of the subscription pause.

Example:

"ord_pau_01H085J3ZR1WKD120D73D7N4C9"

eventTypestring

Type of webhook event.

Enum"subscription-pause-created""subscription-pause-modified""subscription-pause-revoked""subscription-paused""subscription-resumed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "subscriptionPauseId": "ord_pau_01H085J3ZR1WKD120D73D7N4C9", "eventType": "subscription-pause-created", "_embedded": { "subscription": {}, "pause": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Order delinquency time reachedWebhook

Request

Bodyapplication/json

Order webhook request body resource.

subscriptionIdstring

ID of the order.

Example:

"sub_01HRF27SATGE4Z6PBJE6PD8328"

eventTypestring

Type of webhook event.

Enum"order-completed""order-abandoned""subscription-activated""subscription-canceled""subscription-churned""subscription-downgraded""subscription-modified""subscription-reactivated""subscription-renewal-reminder""subscription-renewed"
_embeddedobject

Embedded objects.

_linksArray of objects

Related links.

application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "eventType": "order-completed", "_embedded": { "subscription": {} }, "_links": [ {} ] }

Responses

Returns any 2xx status to indicate that data is received.

Invoices

Use invoices to bill for the goods or services that you provide. If your invoice includes subscription items, it also includes the corresponding service periods and prices.

Operations

Usage

Use these operations to manage the product usage of a subscription item for metered billing purposes.

Use metered billing when product quantity is unknown to the customer at the moment of creating a subscription. Metered billing is based on reported usage records. Every reported usage updates the quantity of an upcoming invoice item for a specified subscription and a plan. To create a metered billing plan, see Plans.

Operations

Credit memos

Use credit memos to provide a customer with store credit. A common use case for using a credit memo is to provide a customer with store credit, rather than a refund, if the customer pays more than they owe or returns a product. For information on the credit memo resource, see Resources.

OperationsWebhooks

Plans

Use pricing plans to describe how the customer must pay for products.

Rebilly provides the following plan types:

  • Trial only: Use this plan to create and offer a free or discounted trial period for your product. For example, a free 2 week trial of an internet service. After the trial, the customer can choose to sign up for a paid subscription, or stop using the service.
  • Recurring: Use this plan to create and offer a subscription for your product. For example, a monthly subscription to an internet service that is charged at 20 USD per month.
  • One time sale: Use this plan to create and offer a one-off sale for your products. For example, a one time purchase of two bags of coffee.

For information on the plans resource, see Plans.

For information on plan pricing, see Pricing formulas.

Operations

Products

Use products to describe the goods and services that your business sells. A product also describes sales items on invoices and receipts. Product pricing is defined in plans. A product may have one or many plans.

For information on the product resource, see Product.

Operations

Coupons

Use coupons to reward customers, generate sales, or to test new pricing strategies. Coupons enable you to apply different types of discounts to invoices, subscriptions, and pricing plans.

Redeemed coupons are attached to a customer's account. Depending on the coupon restrictions, the redeemed coupons are then applied from the customer's account to subsequent invoices or subscriptions. Redeemed coupons can only be applied to invoices of the same currency.

Once a coupon is redeemed it cannot be modified. You may deactivate a coupon or create a new coupon, but you cannot reuse the same coupon code. If you have a use case where you must reuse the same code, contact Rebilly.

Operations

Quotes

Use quote operations to create and manage quotations. Quotations describe the cost of goods or services to potential customers before they commit to a purchase. A quote contains an initial invoice preview that can be accepted to become an order.

A quote can contain subscription and one-time sale items. When a quote contains one or more subscription items, it is a subscription order quote.

Operations

Quotes timeline

Use quote timelines to maintain an audit trail of changes and activity for each quote.

Operations

Shipping rates

Use these operations to manage shipping rates. A shipping rate contains a filter and a pricing for a specific shipping destination.

Operations

Orders timeline

Use order timelines to maintain an audit trail of changes and activity for each order.

Operations

Invoices timeline

Use invoice timelines to maintain an audit trail of changes and activity for each invoice.

Operations

Credit memos timeline

Use credit memo timelines to maintain an audit trail of changes and activity for each credit memo. Credit memos are a means of providing a customer with store credit.

Operations

Blocklists

Use blocklists to prevent fraud and criminal activity.

Blocklists are lists of customer attribute values that are blocked from buying from you. For example, if a customer attempts to make a purchase from you with a credit card that is in a blocklist, the transaction is blocked and is not processed.

Before a new transaction is processed in Rebilly, blocklists are examined to check for attributes related to the entity. If a match is detected, the operation is aborted. A blocklist that expires after a period of time is called a greylist.

Operations

Allowlists

Use allowlists to exclude specific customer attribute data from risk score checks.

Allowlists are lists of data that are excluded from risk score checks. Allowlists prevent specific data from being added to a blocklist record when a risk score threshold reached.

Operations

KYC documents

Use Know Your Customer (KYC) documents to verify your customers identity. The KYC document operations generate a signed link to the Rebilly KYC document gatherer.

Document types:

  • identity-proof: Validates a customer's identity.
  • address-proof: Validates a customer's address.
  • purchase-proof: Validates a customer's purchase.
  • funds-proof: Validates that a customer has funds.
  • credit-file-proof: Verifies that there is an existing credit file with two sources that match the customer's name, DOB, and address.

Rebilly parses and analyzes the documents and accepts or rejects them according to a configurable scoring algorithm. When all document types in a KYC request are accepted, the status is fulfilled, and the KYC request fulfilled webhook is sent.

Operations

AML

Use Anti-Money Laundering (AML) operations to screen customers and help prevent your business from becoming directly or indirectly involved in criminal activity.

Use AML operations during customer creation, and some transaction processing, to help determine if a potential customer (lead), or customer, has political or economic sanctions against them.

AML operations search the following for screening purposes: Politically Exposed Persons (PEPs) lists, sanction lists, and adverse media lists.

OperationsWebhooks

Risk score

Use risk score operations to configure blocklists based on transaction risk factors.

Operations

Custom fields

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. Depending on the resource on which the custom field is added, it may be available in the Rebilly UI.

Example: A custom field called preferredCommunicationChannel is added to the customer resource. It has two allowed values, which are 'email' and 'phone'.

{
  "customFields": {
      "preferredCommunicationChannel": "email"
  }
}

For detailed information on Rebilly resources, see Resources.

Operations

Files

Use the file entity to store files and related metadata. Files can be sorted by size, MIME-type, user-defined tags, and description.

The following methods are available to upload files: multipart/form-data encoded form, RAW POST — by sending the file contents as the POST body, and fetching from URL — by providing the file URL using the 'url' parameter.

Use the attachments entity to link a file to one or multiple objects, such as: customer, dispute, transaction, order, plan, product, invoice, or timeline comment. Attachments enable you to quickly find and use files related to specific entities.

Operations