Retrieve orders

Retrieves a list of orders.

SecurityAPI Key: SecretApiKey or HTTP: JWT or HTTP: ApplicationJWT
Request
query Parameters
filter
string

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.

sort
Array 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 ,.

limit
integer [ 0 .. 1000 ]

Limits the number of collection items to be returned.

offset
integer [ 0 .. 1000 ]

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

q
string

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

expand
string

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.

get
/subscriptions
Request samples
$subscriptions = $client->subscriptions()->search([
    'filter' => 'customerId:testCustomerId',
]);
Responses

200

List of subscriptions retrieved.

Response Headers
Pagination-Total
integer

Total number of items.

Example: 332
Pagination-Limit
integer

Maximum number of items per page.

Example: 100
Pagination-Offset
integer

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
Response Schema: application/json
Array
id
string <= 50 characters

ID of the order.

orderId
string <= 50 characters

ID of the order (experimental).

orderType
required
string

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

customerId
required
string (CustomerId) <= 50 characters

ID of the customer resource.

renewalReminderTime
string or null <date-time>

Date and time when the renewal reminder event triggers.

renewalReminderNumber
integer or null

Number of triggered renewal reminder events.

trialReminderTime
string or null <date-time>

Date and time when the trial reminder event triggers.

trialReminderNumber
integer or null

Number of triggered trial reminder events.

abandonReminderTime
string or null <date-time>

Date and time when the abandon order reminder event triggers.

abandonReminderNumber
integer or null

Number of abandon order reminder events that are triggered.

organizationId
string <= 50 characters

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

status
string

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"
inTrial
boolean

Specifies if the subscription is currently in a trial period.

object

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

isTrialOnly
boolean
Default: false

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

isTrialConverted
boolean

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

(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.

object 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.

autopay
boolean
Default: true

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.

startTime
string 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.

churnTime
string or null <date-time>

Date and time when the subscription is deactivated.

renewalTime
string or null <date-time>

Date and time when the subscription renews.

rebillNumber
integer or null

Current billing period number.

Array of objects
Deprecated

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

object

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

paymentInstrumentId
string 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.

billingStatus
string

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"
websiteId
required
string <= 50 characters
currency
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

initialInvoiceId
string or null <= 50 characters

ID of the initial invoice.

recentInvoiceId
string or null <= 50 characters

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

required
Array of objects (SubscriptionOrOneTimeSaleItem) non-empty

Details of items in the order.

ContactObject (object) or null

Delivery address of the order.

ContactObject (object) or null

Billing address of the order.

activationTime
string or null <date-time>

Date and time when the order is activated.

voidTime
string or null <date-time>

Date and time when the order is voided.

abandonTime
string 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.

delinquencyPeriod
string or null
Default: 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.

poNumber
string or null

Purchase order number displayed on the issued invoices.

object (Shipping)

Shipping settings.

notes
string

Notes for the customer displayed on the order invoice.

canceledBy
string or null

Specifies who initiated the cancellation.

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

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" "switched-plan" "other" null
cancelDescription
string or null <= 255 characters

Description of the cancellation reason in free form.

revision
integer

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.

riskMetadata
object or null

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

billingPortalToken
string or null

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.

customFields
object (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.

createdTime
string <date-time> (CreatedTime)

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

updatedTime
string <date-time> (UpdatedTime)

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

Array of objects

Related links.

object

Embedded objects that are requested by the expand query parameter.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

Response samples
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, "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, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "delinquencyPeriod": "P7D", "poNumber": "PO123456", "notes": "string", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "revision": 0, "riskMetadata": null, "billingPortalToken": "string", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", } ]