Subscriptions

Retrieve a subscription by key

This REST API reference describes how to retrieve detailed information about a specified subscription in the latest version.

get/v1/subscriptions/{subscription-key}

Path parameters

subscription-keystring required

Possible values are:

  • a subscription number
  • a subscription ID

Query parameters

charge-detailstring

The segmented rate plan charges. When an amendment results in a change to a charge, Zuora creates a segmented rate plan charge. Use this field to track segment charges.

Possible values are:

  • last-segment: (Default) The last rate plan charge on the subscription, that is, the last segmented rate plan charge with the maximum start and end dates.

  • current-segment: The segmented charge that is active on today’s date (effectiveStartDate <= today’s date <= effectiveEndDate).

  • all-segments: All the segmented charges. The ratePlans > ratePlanCharges >chargeSegments nested field is returned in the response. The chargeSegments field contains an array of the charge information for all the charge segments.

  • specific-segment: Use this value together with as-of-date={specificDate}. The segmented charge that is active on a date you specified ((specific date = effectiveStartDate) OR (effectiveStartDate < specific date < effectiveEndDate)) is returned. The format of the date is yyyy-mm-dd.

as-of-datestring

The date for charge-detail. It is only available when charge-detail is specific-segment.

The date should be in the format YYYY-MM-DD.

exclude-rate-plans-with-no-chargesboolean

When a rate plan charge has multiple segments, the last segment is returned by default.

If this charge has been removed before the start date of the last segment (the latest one), with this parameter set to true, this charge is excluded from the response; If all the charges under a rate plan are excluded, the rate plan is not returned in the response.

The default value is false.

getDetailedMetricsboolean

If the getDetailedMetrics field is true, contractedNetMrr, asOfDayGrossMrr, asOfDayNetMrr, and netTotalContractedValue will be in the response. The default value is false.

asOfDaystring

The date for detailed metrics. Only available when getDetailedMetrics is true. The date should be in the format YYYY-MM-DD.

The default value is the current date.

getInvoiceOwnerDetailsboolean

Retrieves the invoice owner of a subscription. If this parameter is set to true, the invoice owner account details invoiceOwnerAccountDetails will be in the response.

getSubscriptionOwnerDetailsboolean

Retrieves the owner of a subscription. If this parameter is set to true, the subscription owner account details accountOwnerDetails will be in the response.

Headers

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

accountIdstring

The ID of the account associated with this subscription.

accountNamestring

The name of the account associated with this subscription.

accountNumberstring

The number of the account associated with this subscription.

autoRenewboolean

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

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.

contractEffectiveDatestring date

Effective contract date for this subscription, as yyyy-mm-dd.

contractedMrrnumber

Monthly recurring revenue of the subscription.

contractedNetMrrnumber

Monthly recurring revenue of the subscription inclusive of all the discounts applicable, including the fixed-amount discounts and percentage discounts.

asOfDayGrossMrrnumber

Monthly recurring revenue of the subscription exclusive of any discounts applicable as of specified day.

asOfDayNetMrrnumber

Monthly recurring revenue of the subscription inclusive of all the discounts applicable, including the fixed-amount discounts and percentage discounts as of specified day.

netTotalContractedValuenumber

Total contracted value of the subscription inclusive of all the discounts applicable, including the fixed-amount discounts and percentage discounts.

currencystring

The currency of the subscription. Note: This field is available only if you have the <a href="https://docs.zuora.com?resourceId=billing-multiple-currencies-overview" target="_blank">Multiple Currencies</a> feature enabled.

currentTerminteger

The length of the period for the current subscription term.

currentTermPeriodTypestring

The period type for the current subscription term.

Values are:

  • Month (default)
  • Year
  • Day
  • Week
customerAcceptanceDatestring date

The date on which the services or products within a subscription have been accepted by the customer, as yyyy-mm-dd.

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.

idstring

Subscription ID.

initialTerminteger

The length of the period for the first subscription term.

initialTermPeriodTypestring

The period type for the first subscription term.

Values are:

  • Month (default)
  • Year
  • Day
  • Week
invoiceGroupNumberstring nullable

The number of the invoice group associated with the subscription.

The value of this field is null if you have the Flexible Billing Attributes feature disabled.

invoiceOwnerAccountIdstring
invoiceOwnerAccountNamestring
invoiceOwnerAccountNumberstring
invoiceScheduleIdinteger

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://docs.zuora.com?resourceId=billing-billing-schedule-overview" target="_blank">Billing Schedule</a> feature enabled.

invoiceSeparatelyboolean

Separates a single subscription from other subscriptions and creates an invoice for the subscription.

If the value is true, the subscription is billed separately from other subscriptions. If the value is false, the subscription is included with other subscriptions in the account invoice.

invoiceTemplateIdstring nullable

The ID of the invoice template associated with the subscription.

Note:

  • If you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" 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.
invoiceTemplateNamestring

The name of the invoice template associated with the subscription.

Note:

  • If you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" target="_blank">Flexible Billing Attributes</a> feature disabled, 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 the invoiceTemplateId field in the request or you select Default Template from Account for the invoiceTemplateId field during subscription creation, the value of the invoiceTemplateName field is automatically set to null in the response body.
isLatestVersionboolean

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

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

A string of up to 65,535 characters.

orderNumberstring

The order number of the order in which the changes on the subscription are made.

Note: This field is only available if you have the Order Metrics feature enabled. If you wish to have access to the feature, submit a request at Zuora Global Support. We will investigate your use cases and data before enabling this feature for you.

organizationLabelstring

The organization that this object belongs to.

Note: This field is available only when the Multi-Org feature is enabled.

originalListPricenumber

The original list price is the price of a product or service at which it is listed for sale by a manufacturer or retailer.

Note: This field applies to the following charges in a subscription created through an order:

  • oneTimeFlatFee
  • oneTimePerUnit
  • recurringFlatFee
  • recurringPerUnit
  • usageFlatFee
  • usagePerUnit
  • usageOverage
  • usageTieredWithOverage
paymentTermstring

The name of the payment term associated with the subscription. For example, Net 30. The payment term determines the due dates of invoices.

Note:

  • If you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" 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 Term from Account for this field during subscription creation, the value of this field is automatically set to null in the response body.
renewalSettingstring

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

Values are:

  • RENEW_WITH_SPECIFIC_TERM (default)
  • RENEW_TO_EVERGREEN
renewalTerminteger

The length of the period for the subscription renewal term.

renewalTermPeriodTypestring

The period type for the subscription renewal term.

Values are:

  • Month (default)
  • Year
  • Day
  • Week
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.

sequenceSetIdstring nullable

The ID of the sequence set associated with the subscription.

Note:

  • If you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" 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.
communicationProfileIdstring nullable

The ID of the communication profile associated with the subscription.

Note: This field is available in the request body only if you have the <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/leverage-advanced-capabilities/flexible-billing/flexible-billing-attributes/overview-of-flexible-billing-attributes" target="_blank">Flexible Billing Attributes</a> feature turned on. The value is null in the response body without this feature turned on.

sequenceSetNamestring

The name of the sequence set associated with the subscription.

Note:

  • If you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" target="_blank">Flexible Billing Attributes</a> feature disabled, 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 the sequenceSetId field in the request or you select Default Template from Account for the sequenceSetId field during subscription creation, the value of the sequenceSetName field is automatically set to null in the response body.
serviceActivationDatestring date

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

statusstring

Subscription status; possible values are:

  • Draft
  • Pending Activation
  • Pending Acceptance
  • Active
  • Cancelled
  • Suspended
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.

subscriptionNumberstring

Subscription number.

subscriptionStartDatestring date

Date the subscription becomes effective.

successboolean

Returns true if the request was processed successfully.

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.

termTypestring

Possible values are: TERMED, EVERGREEN.

scheduledCancelDatestring date

The date when the subscription is scheduled to be canceled.

scheduledSuspendDatestring date

The date when the subscription is scheduled to be suspended.

scheduledResumeDatestring date

The date when the subscription is scheduled to be resumed.

totalContractedValuenumber

Total contracted value of the subscription.

totalNumberOfChargeSegmentsinteger

Total number of charge segments in this subscription, including segments from removed charges. This value is the sum of the segments for all charges under the subscription.

Note: The default value is 0 if there are no charge segments.

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.

CpqBundleJsonId__QTstring

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

OpportunityCloseDate__QTstring date

The closing date 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.

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.

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.

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.

IntegrationId__NSstring

ID of the corresponding object in NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

IntegrationStatus__NSstring

Status of the subscription's synchronization with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Project__NSstring

The NetSuite project that the subscription was created from. Only available if you have installed the Zuora Connector for NetSuite.

SalesOrder__NSstring

The NetSuite sales order than the subscription was created from. Only available if you have installed the Zuora Connector for NetSuite.

SyncDate__NSstring

Date when the subscription was synchronized with NetSuite. Only available if you have installed the Zuora Connector for NetSuite.

Changes