Object Queries

Retrieve a subscription

Retrieve the details of a specific Subscription object.

get/object-query/subscriptions/{key}

Path parameters

keystring required

Object ID or Number.

Query parameters

pageSizeinteger

The maximum number of results to return in a single page. If the specified pageSize is less than 1 or greater than 99, Zuora will return a 400 error.

cursorstring

A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with next_page=W3sib3JkZXJ=, your subsequent call can include cursor=W3sib3JkZXJ= in order to fetch the next page of the list.

sort[]string[]

A case-insensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. accountnumber.ASC) or descending (e.g. accountnumber.DESC). You cannot sort on properties in arrays. If the array-type properties are specified for the sort[] parameter, they are ignored.

expand[]string[]

Allows you to expand responses by including related object information in a single call.

filter[]string[]

A case-insensitive filter on the list.

fields[]string[]

A case-insensitive query parameter that allows you to specify which fields are returned in the response.

includeNullFieldsboolean

Specifies whether to include fields with the null value in the response.

  • If set to true, all fields will be returned in the response, including those with the null value.
  • If set to false, only fields with non-null values will be returned.

Headers

Idempotency-Keystring

Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.

With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.

Accept-Encodingstring

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encodingstring

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Zuora-Track-Idstring

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Entity-Idsstring

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

Zuora-Org-Idsstring

Comma separated IDs. If you have <a href="https://docs.zuora.com/en/zuora-platform/organization-and-entity-management/multi-org/overview-of-multi-org" target="_blank">Zuora Multi-Org</a> enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header.

The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.

Zuora-Versionstring

The minor API version.

For a list of available minor versions, see API upgrades.

Response

OK

idstring

The unique identifier of the subscription.

createdByIdstring

The unique identifier of the user who created the subscription.

createdDatestring date-time

The date and time when the subscription was created in the Zuora system, in the yyyy-mm-dd hh:mm:ss format.

updatedByIdstring

The unique identifier of the user who last updated the subscription.

updatedDatestring date-time

The date and time when the subscription was last updated, in the yyyy-mm-dd hh:mm:ss format.

accountIdstring

The ID of the account associated with this subscription.

autoRenewboolean

If true, the subscription automatically renews at the end of the term.

cancelledDatestring date

The date on which the subscription was canceled.

contractAcceptanceDatestring date

The date when the customer accepts the contract, in the yyyy-mm-dd format.

If this field is not set:

  • If the serviceActivationDate field is not set, the value of this field is set to be the contract effective date.

  • If the serviceActivationDate field is set, the value of this field is set to be the service activation date.

The billing trigger dates must follow this rule:

contractEffectiveDate <= serviceActivationDate <= contractAcceptanceDate

contractEffectiveDatestring date

The date when the subscription is activated, in the yyyy-mm-dd format.

You must specify a Service Activation date if the Customer Acceptance date is set. If the Customer Acceptance date is not set, the value of the serviceActivationDate field defaults to be the Contract Effective Date.

The billing trigger dates must follow this rule:

contractEffectiveDate <= serviceActivationDate <= contractAcceptanceDate

creatorAccountIdstring

The ID of the account that created the subscription. This field is automatically populated with the ID of the account that creates the subscription.

creatorInvoiceOwnerIdstring

The account ID that owns the invoices associated with the subscription or the amended subscription.

currentTerminteger

The length of the period for the current subscription term.

currentTermPeriodType'Month' | 'Year' | 'Day' | 'Week'

The period type for the current subscription term.

initialTerminteger

The length of the period for the initial subscription term.

initialTermPeriodType'Month' | 'Year' | 'Day' | 'Week'

The period type for the first subscription term.

invoiceOwnerIdstring

The account ID that owns the invoices associated with the subscription.

isInvoiceSeparateboolean

Determines if the subscription is invoiced separately. If true, then all charges for this subscription are collected into the subscription's own invoice.

namestring

The name of the subscription.

notesstring

Additional information about the subscription.

originalCreatedDatestring

The date when the subscription was originally created. This value is the same as the createdDate value until the subscription is amended.

originalIdstring

The original rate plan charge ID. Only available for update subscription.

previousSubscriptionIdstring

The ID of the previous subscription. This field is only available if the subscription is a renewal subscription.

renewalSetting'RENEW_WITH_SPECIFIC_TERM' | 'RENEW_TO_EVERGREEN'

Specifies whether a termed subscription will remain TERMED or change to EVERGREEN when it is renewed.

renewalTerminteger

The length of the period for the subscription renewal term.

renewalTermPeriodType'Month' | 'Year' | 'Day' | 'Week'

The period type for the subscription renewal term.

revisionstring

An auto-generated decimal value uniquely tagged with a subscription. The value always contains one decimal place, for example, the revision of a new subscription is 1.0. If a further version of the subscription is created, the revision value will be increased by 1. Also, the revision value is always incremental regardless of deletion of subscription versions.

serviceActivationDatestring date

The date on which the services or products within a subscription have been activated and access has been provided to the customer, in the yyyy-mm-dd format.

status'Draft' | 'Pending Activation' | 'Pending Acceptance' | 'Active' | 'Cancelled' | 'Suspended'

Subscription status.

isLatestVersionboolean

If true, the current subscription object is the latest version.

subscriptionEndDatestring date

The date when the subscription term ends, where the subscription ends at midnight the day before.

For example, if the subscriptionEndDate is 12/31/2016, the subscriptions ends at midnight (00:00:00 hours) on 12/30/2016.

This date is the same as the term end date or the cancelation date, as appropriate.

subscriptionStartDatestring date

Date the subscription becomes effective.

subscriptionVersionAmendmentIdstring

The ID of the amendment made to this subscription version.

termEndDatestring date

Date the subscription term ends. If the subscription is evergreen, this is null or is the cancellation date (if one has been set).

termStartDatestring date

Date the subscription term begins. If this is a renewal subscription, this date is different from the subscription start date.

termType'TERMED' | 'EVERGREEN'

The type of the subscription term.

versioninteger

This is the subscription version automatically generated by Zuora Billing. Each order or amendment creates a new version of the subscription, which incorporates the changes made in the order or amendment.

cMRRnumber

Monthly recurring revenue of the subscription.

billToContactSnapshotIdstring

The ID of the bill-to contact snapshot.

billToContactIdstring

The ID of the bill-to contact for the subscription.

invoiceTemplateIdstring

The ID of the invoice template associated with the subscription.

Note:

  • If you have the <a href="https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes" target="_blank">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is null in the response body.
  • If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select Default Template from Account for this field during subscription creation, the value of this field is automatically set to null in the response body.
sequenceSetIdstring nullable

The ID of the sequence set associated with the subscription.

Note:

  • If you have the <a href="https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_customers_at_subscription_level/Flexible_Billing_Attributes" target="_blank">Flexible Billing Attributes</a> feature disabled, this field is unavailable in the request body and the value of this field is null in the response body.
  • If you have the Flexible Billing Attributes feature enabled, and you do not specify this field in the request or you select Default Set from Account for this field during subscription creation, the value of this field is automatically set to null in the response body.
shipToContactIdstring

The ID of the ship-to contact for the subscription.

shipToContactSnapshotIdstring

The ID of the ship-to contact snapshot.

soldToContactIdstring

The ID of the sold-to contact for the subscription.

soldToContactSnapshotIdstring

The ID of the sold-to contact snapshot.

externallyManagedBy'Amazon' | 'Apple' | 'Google' | 'Roku'

An enum field on the Subscription object to indicate the name of a third-party store. This field is used to represent subscriptions created through third-party stores.

lastBookingDatestring date

The last booking date of the subscription object. This field is writable only when the subscription is newly created as a first version subscription. You can override the date value when creating a subscription through the Subscribe and Amend API or the subscription creation UI (non-Orders). Otherwise, the default value today is set per the user's timezone. The value of this field is as follows:

  • For a new subscription created by the Subscribe and Amend APIs, this field has the value of the subscription creation date.

  • For a subscription changed by an amendment, this field has the value of the amendment booking date.

  • For a subscription created or changed by an order, this field has the value of the order date.

invoiceScheduleIdstring

The ID of the invoice schedule associated with the subscription.

If multiple invoice schedules are created for different terms of a subscription, this field stores the latest invoice schedule.

Note: This field is available only if you have the <a href="https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Flexible_Billing/Billing_Schedule" target="_blank">Billing Schedule</a> feature enabled.

cancelReasonstring

The reason for a subscription cancellation copied from the changeReason field of a Cancel Subscription order action.

This field contains valid value only if a subscription is cancelled through the Orders UI or API. Otherwise, the value for this field will always be null.

prepaymentboolean

Whether the subscription is prepaid.

currencystring

The currency of the subscription.

Note: This field is available only if you have the <a href="https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Flexible_Billing/Multiple_Currencies" target="_blank">Multiple Currencies</a> feature enabled.

orderIdstring

The ID of the order associated with the subscription.

Note: This field is available only for orders that exist after the end of June 2023.

rampIdstring

The ID of the ramp object associated with the subscription.

Note: This field is available only if you have the <a href="https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Flexible_Billing/Ramp" target="_blank">Ramp</a> feature enabled.

paymentTermstring

Name of the payment term associated with the account. For example, "Net 30". The payment term determines the due dates of invoices.

quoteNumber__QTstring

The unique identifier of the Quote. This field is used in Zuora data sources to report on Subscription metrics. If the subscription originated from Zuora Quotes, the value is populated with the value from Zuora Quotes.

quoteType__QTstring

The Quote type that represents the subscription lifecycle stage such as New, Amendment, Renew or Cancel. This field is used in Zuora data sources to report on Subscription metrics. If the subscription originated from Zuora Quotes, the value is populated with the value from Zuora Quotes.

quoteBusinessType__QTstring

The specific identifier for the type of business transaction the Quote represents such as New, Upsell, Downsell, Renewal or Churn. This field is used in Zuora data sources to report on Subscription metrics. If the subscription originated from Zuora Quotes, the value is populated with the value from Zuora Quotes.

opportunityName__QTstring

The unique identifier of the Opportunity. This field is used in Zuora data sources to report on Subscription metrics. If the subscription originated from Zuora Quotes, the value is populated with the value from Zuora Quotes.

opportunityCloseDate__QTstring date
cpqBundleJsonId__QTstring

The Bundle product structures from Zuora Quotes if you utilize Bundling in Salesforce. Do not change the value in this field.

Changes