Orders

An order applies a plan's template to create invoice(s) for a customer, optionally at the appropriate scheduled intervals. A subscription order may also determine if the payment is collected automatically (with autopay set true).

Retrieve a list of orders

Retrieve a list of orders.

SecurityCustomerJWT
Request
query Parameters
filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

q
string

The partial search of the text fields.

Responses
200

A list of orders was retrieved successfully.

Response Headers
Pagination-Total
integer

Total items count.

Pagination-Limit
integer

Items per page limit.

Pagination-Offset
integer

Pagination offset.

Response Schema: application/json
Array
id
string <= 50 characters

The resource ID. Defaults to UUID v4.

orderType
string
Default: "subscription-order"

Specifies the type of order, a subscription or a one-time purchase.

billingStatus
string

The billing status of the most recent invoice. It may help you determine if you should change the service status such as suspending the service.

Enum: "draft" "unpaid" "past-due" "abandoned" "paid" "voided" "refunded" "disputed" "partially-refunded" "partially-paid"
websiteId
string <= 50 characters

The resource ID. Defaults to UUID v4.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

initialInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

recentInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

Array of objects (OrderItem) non-empty
Array (non-empty)
required
OriginalPlan (object) or FlexiblePlan (object)
planId
string <= 50 characters
Deprecated

The resource ID. Defaults to UUID v4.

quantity
integer

Number of units of the product on the given plan.

revision
integer

Increments with each override change to this specific item.

isModified
boolean

Indicates if the plan information was modified for this subscription.

isGrandfathered
boolean

Indicates if the plan's current revision is greater than this item's plan revision.

Array of ProductEmbed (object) non-empty

Any embedded objects available that are requested by the expand querystring parameter.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array of objects (ContactEmails)

The list of emails.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array of objects (ContactEmails)

The list of emails.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

activationTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

voidTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

poNumber
string or null

Purchase order number, will be displayed on the issued invoices.

object (Shipping)

Shipping settings.

calculator
required
string

Shipping calculator.

amount
required
integer

Shipping amount.

notes
string

Notes for the customer which will be displayed on the order invoice.

status
string

The status of the subscription service. A subscription starts in the pending status, and will become active when the service period begins.

Enum: "pending" "active" "canceled" "churned" "paused" "voided" "completed" "trial-ended"
inTrial
boolean

True if the subscription is currently in a trial period.

object

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

endTime
required
string <date-time>

The time the trial should end.

enabled
boolean

Enable or disable the trial for this subscription. If enabled for plans without trial prices, the trial will be free.

isTrialOnly
boolean
Default: false

Whether a subscription ends after a trial period. Recurring settings are ignored if it's true.

object or null

The invoice time shift in conjunction with billingTiming allows to setup different billing use cases such as:

  • Bill immediately when the service period starts
  • Bill immediately after the service period ends
  • Bill interval of time before the service period starts
  • Bill interval of time after the service period starts
  • Bill interval of time before the service period ends
  • Bill interval of time after the service period ends It allows to control the billing time.
object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

object or null

The recurring interval to override plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same recurring period length, this property allows to subscribe to different plans.

object (ServicePeriodAnchorInstruction)
Default: {"method":"immediately"}

Instruction for calculating the service period anchor. This is used in conjunction with the subscription start to calculate the time the service period starts and ends.

autopay
boolean
Default: true

Autopay determines if a payment attempt will be automatic.

startTime
string or null <date-time>

Subscription start time. When the value is sent as null, it will use the current time. This value can't be in past more than one service period.

endTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

renewalTime
string <date-time>

Subscription renewal time.

rebillNumber
integer

The current period number.

Array of objects

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

Array
type
required
string

Type of line item.

Enum: "debit" "credit"
unitPriceAmount
required
number <double>

Unit price of the line item.

unitPriceCurrency
required
string = 3 characters

ISO 4217 alphabetic currency code.

quantity
required
integer

Quantity of line item.

description
string

Description of line item.

periodStartTime
string <date-time>

Date-time when the period begins for this item.

periodEndTime
string <date-time>

Date-time when the period ends for this item.

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

object

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

currency
string (CurrencyCode) = 3 characters

ISO 4217 alphabetic currency code.

amount
number <double>
canceledTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

canceledBy
string

Canceled by.

Enum: "merchant" "customer" "rebilly"
cancelCategory
string

Cancel category.

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" … 2 more
cancelDescription
string <= 255 characters

Cancel reason description in free form.

customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

Array of SelfLink (object) non-empty

The links related to resource.

Array (non-empty)
Any of:
rel
required
string

The link type.

Value: "self"
href
required
string

The link URL.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/orders
Request samples
curl -i -X GET \
  'https://api-sandbox.rebilly.com/storefront/orders?filter=string&sort=string&limit=1000&offset=0&q=string' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'
Response samples
application/json
[
  • {
    }
]

Retrieve an order

Retrieve an order with specified identifier string.

SecurityCustomerJWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Responses
200

Order was retrieved successfully.

Response Schema: application/json
id
string <= 50 characters

The resource ID. Defaults to UUID v4.

orderType
string
Default: "subscription-order"

Specifies the type of order, a subscription or a one-time purchase.

billingStatus
string

The billing status of the most recent invoice. It may help you determine if you should change the service status such as suspending the service.

Enum: "draft" "unpaid" "past-due" "abandoned" "paid" "voided" "refunded" "disputed" "partially-refunded" "partially-paid"
websiteId
string <= 50 characters

The resource ID. Defaults to UUID v4.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

initialInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

recentInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

Array of objects (OrderItem) non-empty
Array (non-empty)
required
OriginalPlan (object) or FlexiblePlan (object)
planId
string <= 50 characters
Deprecated

The resource ID. Defaults to UUID v4.

quantity
integer

Number of units of the product on the given plan.

revision
integer

Increments with each override change to this specific item.

isModified
boolean

Indicates if the plan information was modified for this subscription.

isGrandfathered
boolean

Indicates if the plan's current revision is greater than this item's plan revision.

Array of ProductEmbed (object) non-empty

Any embedded objects available that are requested by the expand querystring parameter.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

activationTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

voidTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

poNumber
string or null

Purchase order number, will be displayed on the issued invoices.

object (Shipping)

Shipping settings.

calculator
required
string

Shipping calculator.

amount
required
integer

Shipping amount.

notes
string

Notes for the customer which will be displayed on the order invoice.

status
string

The status of the subscription service. A subscription starts in the pending status, and will become active when the service period begins.

Enum: "pending" "active" "canceled" "churned" "paused" "voided" "completed" "trial-ended"
inTrial
boolean

True if the subscription is currently in a trial period.

object

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

endTime
required
string <date-time>

The time the trial should end.

enabled
boolean

Enable or disable the trial for this subscription. If enabled for plans without trial prices, the trial will be free.

isTrialOnly
boolean
Default: false

Whether a subscription ends after a trial period. Recurring settings are ignored if it's true.

object or null

The invoice time shift in conjunction with billingTiming allows to setup different billing use cases such as:

  • Bill immediately when the service period starts
  • Bill immediately after the service period ends
  • Bill interval of time before the service period starts
  • Bill interval of time after the service period starts
  • Bill interval of time before the service period ends
  • Bill interval of time after the service period ends It allows to control the billing time.
object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

chronology
required
string

The chronology of the billing time relatively to the service period start.

Value: "before"
duration
required
integer >= 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

duration
required
integer >= 1
Default: 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
Default: "hour"
object or null

The recurring interval to override plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same recurring period length, this property allows to subscribe to different plans.

object (ServicePeriodAnchorInstruction)
Default: {"method":"immediately"}

Instruction for calculating the service period anchor. This is used in conjunction with the subscription start to calculate the time the service period starts and ends.

method
required
string
Default: "immediately"
day
required
integer [ 1 .. 31 ]

The day of the month when event will be scheduled. Be aware if the month has less days, the last day of the month will be selected.

time
string (TimeIso8601Extended) ^(([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0...

Extended ISO-8601 format of time.

autopay
boolean
Default: true

Autopay determines if a payment attempt will be automatic.

startTime
string or null <date-time>

Subscription start time. When the value is sent as null, it will use the current time. This value can't be in past more than one service period.

endTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

renewalTime
string <date-time>

Subscription renewal time.

rebillNumber
integer

The current period number.

Array of objects

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

Array
type
required
string

Type of line item.

Enum: "debit" "credit"
unitPriceAmount
required
number <double>

Unit price of the line item.

unitPriceCurrency
required
string = 3 characters

ISO 4217 alphabetic currency code.

quantity
required
integer

Quantity of line item.

description
string

Description of line item.

periodStartTime
string <date-time>

Date-time when the period begins for this item.

periodEndTime
string <date-time>

Date-time when the period ends for this item.

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

object

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

currency
string (CurrencyCode) = 3 characters

ISO 4217 alphabetic currency code.

amount
number <double>
canceledTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

canceledBy
string

Canceled by.

Enum: "merchant" "customer" "rebilly"
cancelCategory
string

Cancel category.

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" … 2 more
cancelDescription
string <= 255 characters

Cancel reason description in free form.

customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

Array of SelfLink (object) non-empty

The links related to resource.

Array (non-empty)
Any of:
rel
required
string

The link type.

Value: "self"
href
required
string

The link URL.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

get/orders/{id}
Request samples
curl -i -X GET \
  'https://api-sandbox.rebilly.com/storefront/orders/{id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "orderType": "subscription-order",
  • "billingStatus": "draft",
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "currency": "USD",
  • "initialInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "recentInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "activationTime": "2019-08-24T14:15:22Z",
  • "voidTime": "2019-08-24T14:15:22Z",
  • "poNumber": "PO123456",
  • "shipping": {
    },
  • "notes": "string",
  • "status": "pending",
  • "inTrial": true,
  • "trial": {
    },
  • "isTrialOnly": false,
  • "invoiceTimeShift": null,
  • "recurringInterval": null,
  • "autopay": true,
  • "startTime": null,
  • "endTime": "2019-08-24T14:15:22Z",
  • "renewalTime": "2019-08-24T14:15:22Z",
  • "rebillNumber": 0,
  • "lineItems": [
    ],
  • "lineItemSubtotal": {
    },
  • "canceledTime": "2019-08-24T14:15:22Z",
  • "canceledBy": "merchant",
  • "cancelCategory": "billing-failure",
  • "cancelDescription": "string",
  • "customFields": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Update an order

Update an order with predefined ID.

SecurityCustomerJWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Request Body schema: application/json

Order resource.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

Responses
200

Order was updated.

Response Schema: application/json
id
string <= 50 characters

The resource ID. Defaults to UUID v4.

orderType
string
Default: "subscription-order"

Specifies the type of order, a subscription or a one-time purchase.

billingStatus
string

The billing status of the most recent invoice. It may help you determine if you should change the service status such as suspending the service.

Enum: "draft" "unpaid" "past-due" "abandoned" "paid" "voided" "refunded" "disputed" "partially-refunded" "partially-paid"
websiteId
string <= 50 characters

The resource ID. Defaults to UUID v4.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

initialInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

recentInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

Array of objects (OrderItem) non-empty
Array (non-empty)
required
OriginalPlan (object) or FlexiblePlan (object)
planId
string <= 50 characters
Deprecated

The resource ID. Defaults to UUID v4.

quantity
integer

Number of units of the product on the given plan.

revision
integer

Increments with each override change to this specific item.

isModified
boolean

Indicates if the plan information was modified for this subscription.

isGrandfathered
boolean

Indicates if the plan's current revision is greater than this item's plan revision.

Array of ProductEmbed (object) non-empty

Any embedded objects available that are requested by the expand querystring parameter.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

activationTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

voidTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

poNumber
string or null

Purchase order number, will be displayed on the issued invoices.

object (Shipping)

Shipping settings.

calculator
required
string

Shipping calculator.

amount
required
integer

Shipping amount.

notes
string

Notes for the customer which will be displayed on the order invoice.

status
string

The status of the subscription service. A subscription starts in the pending status, and will become active when the service period begins.

Enum: "pending" "active" "canceled" "churned" "paused" "voided" "completed" "trial-ended"
inTrial
boolean

True if the subscription is currently in a trial period.

object

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

endTime
required
string <date-time>

The time the trial should end.

enabled
boolean

Enable or disable the trial for this subscription. If enabled for plans without trial prices, the trial will be free.

isTrialOnly
boolean
Default: false

Whether a subscription ends after a trial period. Recurring settings are ignored if it's true.

object or null

The invoice time shift in conjunction with billingTiming allows to setup different billing use cases such as:

  • Bill immediately when the service period starts
  • Bill immediately after the service period ends
  • Bill interval of time before the service period starts
  • Bill interval of time after the service period starts
  • Bill interval of time before the service period ends
  • Bill interval of time after the service period ends It allows to control the billing time.
object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

chronology
required
string

The chronology of the billing time relatively to the service period start.

Value: "before"
duration
required
integer >= 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

duration
required
integer >= 1
Default: 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
Default: "hour"
object or null

The recurring interval to override plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same recurring period length, this property allows to subscribe to different plans.

object (ServicePeriodAnchorInstruction)
Default: {"method":"immediately"}

Instruction for calculating the service period anchor. This is used in conjunction with the subscription start to calculate the time the service period starts and ends.

method
required
string
Default: "immediately"
day
required
integer [ 1 .. 31 ]

The day of the month when event will be scheduled. Be aware if the month has less days, the last day of the month will be selected.

time
string (TimeIso8601Extended) ^(([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0...

Extended ISO-8601 format of time.

autopay
boolean
Default: true

Autopay determines if a payment attempt will be automatic.

startTime
string or null <date-time>

Subscription start time. When the value is sent as null, it will use the current time. This value can't be in past more than one service period.

endTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

renewalTime
string <date-time>

Subscription renewal time.

rebillNumber
integer

The current period number.

Array of objects

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

Array
type
required
string

Type of line item.

Enum: "debit" "credit"
unitPriceAmount
required
number <double>

Unit price of the line item.

unitPriceCurrency
required
string = 3 characters

ISO 4217 alphabetic currency code.

quantity
required
integer

Quantity of line item.

description
string

Description of line item.

periodStartTime
string <date-time>

Date-time when the period begins for this item.

periodEndTime
string <date-time>

Date-time when the period ends for this item.

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

object

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

currency
string (CurrencyCode) = 3 characters

ISO 4217 alphabetic currency code.

amount
number <double>
canceledTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

canceledBy
string

Canceled by.

Enum: "merchant" "customer" "rebilly"
cancelCategory
string

Cancel category.

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" … 2 more
cancelDescription
string <= 255 characters

Cancel reason description in free form.

customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

Array of SelfLink (object) non-empty

The links related to resource.

Array (non-empty)
Any of:
rel
required
string

The link type.

Value: "self"
href
required
string

The link URL.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

422

Invalid data was sent.

patch/orders/{id}
Request samples
application/json
{
  • "deliveryAddress": {
    },
  • "billingAddress": {
    }
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "orderType": "subscription-order",
  • "billingStatus": "draft",
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "currency": "USD",
  • "initialInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "recentInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "activationTime": "2019-08-24T14:15:22Z",
  • "voidTime": "2019-08-24T14:15:22Z",
  • "poNumber": "PO123456",
  • "shipping": {
    },
  • "notes": "string",
  • "status": "pending",
  • "inTrial": true,
  • "trial": {
    },
  • "isTrialOnly": false,
  • "invoiceTimeShift": null,
  • "recurringInterval": null,
  • "autopay": true,
  • "startTime": null,
  • "endTime": "2019-08-24T14:15:22Z",
  • "renewalTime": "2019-08-24T14:15:22Z",
  • "rebillNumber": 0,
  • "lineItems": [
    ],
  • "lineItemSubtotal": {
    },
  • "canceledTime": "2019-08-24T14:15:22Z",
  • "canceledBy": "merchant",
  • "cancelCategory": "billing-failure",
  • "cancelDescription": "string",
  • "customFields": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Cancel an order

Cancel an order.

SecurityCustomerJWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Request Body schema: application/json

Order resource.

reason
required
string

Order cancellation reason.

Enum: "did-not-use" "did-not-want" "missing-features" "bugs-or-problems" "do-not-remember" "too-expensive" "other"
description
string <= 255 characters

Cancel reason description in free form.

Responses
201

Order was canceled.

Response Schema: application/json
id
string <= 50 characters

The resource ID. Defaults to UUID v4.

orderType
string
Default: "subscription-order"

Specifies the type of order, a subscription or a one-time purchase.

billingStatus
string

The billing status of the most recent invoice. It may help you determine if you should change the service status such as suspending the service.

Enum: "draft" "unpaid" "past-due" "abandoned" "paid" "voided" "refunded" "disputed" "partially-refunded" "partially-paid"
websiteId
string <= 50 characters

The resource ID. Defaults to UUID v4.

currency
string = 3 characters

ISO 4217 alphabetic currency code.

initialInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

recentInvoiceId
string <= 50 characters

The resource ID. Defaults to UUID v4.

Array of objects (OrderItem) non-empty
Array (non-empty)
required
OriginalPlan (object) or FlexiblePlan (object)
planId
string <= 50 characters
Deprecated

The resource ID. Defaults to UUID v4.

quantity
integer

Number of units of the product on the given plan.

revision
integer

Increments with each override change to this specific item.

isModified
boolean

Indicates if the plan information was modified for this subscription.

isGrandfathered
boolean

Indicates if the plan's current revision is greater than this item's plan revision.

Array of ProductEmbed (object) non-empty

Any embedded objects available that are requested by the expand querystring parameter.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact first name.

lastName
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact last name.

organization
string or null <= 255 characters ^[\w\s\-\pL,.'&]+$

The contact organization.

address
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address.

address2
string or null <= 60 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact street address (second line).

city
string or null <= 45 characters ^[\w\s\-\pL,.']+$

The contact city.

region
string or null <= 45 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact region (state).

country
string or null <= 2 characters ^[A-Z]{2}$

The contact country ISO Alpha-2 code.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

The contact postal code.

Array of objects (ContactPhoneNumbers)

The list of phone numbers.

Array
label
required
string <= 45 characters

The phone label.

value
required
string <= 50 characters

The phone value.

primary
boolean

True if phone is primary.

Array of objects (ContactEmails)

The list of emails.

Array
label
required
string <= 45 characters

The email label.

value
required
string <email> <= 255 characters

The email value.

primary
boolean

True if email is primary.

dob
string or null <date>

The contact's date of birth in ISO-8601 format (yyyy-mm-dd).

jobTitle
string or null <= 255 characters ^[\w\s\-\/\pL,.#;:()']+$

The contact's job title.

hash
string <= 40 characters

A hash that can be used to compare multiple contacts for identical attribute values.

activationTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

voidTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

poNumber
string or null

Purchase order number, will be displayed on the issued invoices.

object (Shipping)

Shipping settings.

calculator
required
string

Shipping calculator.

amount
required
integer

Shipping amount.

notes
string

Notes for the customer which will be displayed on the order invoice.

status
string

The status of the subscription service. A subscription starts in the pending status, and will become active when the service period begins.

Enum: "pending" "active" "canceled" "churned" "paused" "voided" "completed" "trial-ended"
inTrial
boolean

True if the subscription is currently in a trial period.

object

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

endTime
required
string <date-time>

The time the trial should end.

enabled
boolean

Enable or disable the trial for this subscription. If enabled for plans without trial prices, the trial will be free.

isTrialOnly
boolean
Default: false

Whether a subscription ends after a trial period. Recurring settings are ignored if it's true.

object or null

The invoice time shift in conjunction with billingTiming allows to setup different billing use cases such as:

  • Bill immediately when the service period starts
  • Bill immediately after the service period ends
  • Bill interval of time before the service period starts
  • Bill interval of time after the service period starts
  • Bill interval of time before the service period ends
  • Bill interval of time after the service period ends It allows to control the billing time.
object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

chronology
required
string

The chronology of the billing time relatively to the service period start.

Value: "before"
duration
required
integer >= 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

duration
required
integer >= 1
Default: 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
Default: "hour"
object or null

The recurring interval to override plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same recurring period length, this property allows to subscribe to different plans.

object (ServicePeriodAnchorInstruction)
Default: {"method":"immediately"}

Instruction for calculating the service period anchor. This is used in conjunction with the subscription start to calculate the time the service period starts and ends.

method
required
string
Default: "immediately"
day
required
integer [ 1 .. 31 ]

The day of the month when event will be scheduled. Be aware if the month has less days, the last day of the month will be selected.

time
string (TimeIso8601Extended) ^(([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0...

Extended ISO-8601 format of time.

autopay
boolean
Default: true

Autopay determines if a payment attempt will be automatic.

startTime
string or null <date-time>

Subscription start time. When the value is sent as null, it will use the current time. This value can't be in past more than one service period.

endTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

renewalTime
string <date-time>

Subscription renewal time.

rebillNumber
integer

The current period number.

Array of objects

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

Array
type
required
string

Type of line item.

Enum: "debit" "credit"
unitPriceAmount
required
number <double>

Unit price of the line item.

unitPriceCurrency
required
string = 3 characters

ISO 4217 alphabetic currency code.

quantity
required
integer

Quantity of line item.

description
string

Description of line item.

periodStartTime
string <date-time>

Date-time when the period begins for this item.

periodEndTime
string <date-time>

Date-time when the period ends for this item.

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

object

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

currency
string (CurrencyCode) = 3 characters

ISO 4217 alphabetic currency code.

amount
number <double>
canceledTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

canceledBy
string

Canceled by.

Enum: "merchant" "customer" "rebilly"
cancelCategory
string

Cancel category.

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" … 2 more
cancelDescription
string <= 255 characters

Cancel reason description in free form.

customFields
object (ResourceCustomFields)
Default: {}

Custom Fields list as a map {"custom field name": "custom field value", ...}. The format must follow the saved format (see Custom Fields section for the formats).

createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

Array of SelfLink (object) non-empty

The links related to resource.

Array (non-empty)
Any of:
rel
required
string

The link type.

Value: "self"
href
required
string

The link URL.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

409

Conflict.

422

Invalid data was sent.

post/orders/{id}/cancellation
Request samples
application/json
{
  • "reason": "did-not-use",
  • "description": "string"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "orderType": "subscription-order",
  • "billingStatus": "draft",
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "currency": "USD",
  • "initialInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "recentInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "activationTime": "2019-08-24T14:15:22Z",
  • "voidTime": "2019-08-24T14:15:22Z",
  • "poNumber": "PO123456",
  • "shipping": {
    },
  • "notes": "string",
  • "status": "pending",
  • "inTrial": true,
  • "trial": {
    },
  • "isTrialOnly": false,
  • "invoiceTimeShift": null,
  • "recurringInterval": null,
  • "autopay": true,
  • "startTime": null,
  • "endTime": "2019-08-24T14:15:22Z",
  • "renewalTime": "2019-08-24T14:15:22Z",
  • "rebillNumber": 0,
  • "lineItems": [
    ],
  • "lineItemSubtotal": {
    },
  • "canceledTime": "2019-08-24T14:15:22Z",
  • "canceledBy": "merchant",
  • "cancelCategory": "billing-failure",
  • "cancelDescription": "string",
  • "customFields": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}