Skip to content

Preview an order

Request

Retrieves the preview of the order delta metrics and invoice items of a specified order. Preview for subscriptions and order line items are both supported. This operation is only an order preview and no order is created.

Note that the following limitations apply to this operation:

  • Up to 50 subscriptions are allowed in a single call.
  • Up to 100 order line items are allowed in an order preview.

Security
bearerAuth
Headers
zuora-track-idstring

A custom identifier for tracking API requests. If you set a value for this header, Zuora returns the same value in the response header. This header enables you to track your 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 ("), or quote (').

asyncboolean

Making asynchronous requests allows you to scale your applications more efficiently by leveraging Zuora's infrastructure to enqueue and execute requests for you without blocking. These requests also use built-in retry semantics, which makes them much less likely to fail for non-deterministic reasons, even in extreme high-throughput scenarios. Meanwhile, when you send a request to one of these endpoints, you can expect to receive a response in less than 150 milliseconds and these calls are unlikely to trigger rate limit errors. If set to true, Zuora returns a 202 Accepted response, and the response body contains only a request ID.

Default:false
zuora-entity-idsstring

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

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. This idempotency key should be a unique value, and the Zuora server identifies subsequent retries of the same request using this value. For more information, see Idempotent Requests.

accept-encodingstring

Include a accept-encoding: gzip header to compress responses, which can reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes. For more information about this header, see Request and Response Compression.

content-encodingstring

Include a content-encoding: gzip header to compress a request. Upload a gzipped file for the payload if you specify this header. For more information, see Request and Response Compression.

Bodyapplication/jsonrequired
categorystring

Category of the order to indicate a product sale or return. Default value is sale.

Enum:"sale""return"
custom_fieldsobject(CustomFields)

Set of user-defined fields associated with this object. Useful for storing additional information about the object in a structured format.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

Example:"description of test account"
account_numberstring

Human-readable identifier of the account. It can be user-supplied.

Example:"A-100001"
account_idstring

Identifier of the account.

Example:"2c92c0f86a8dd422016a9e7a70116b0d"
order_datestring, (date)

The date when the order is signed. All the order actions under this order will use this order date as the contract effective date if the contract effective date field is skipped or its value is left as null.

Example:"2022-01-01"
order_numberstring

The order number of the new order. If not provided, system will auto-generate a number for this order. Note: Ensure that the order number does not contain a slash.

line_itemsArray of objects(LineItemCreateRequest)

Order line items are non-subscription-based items created by an order, representing transactional charges such as one-time fees, physical goods, or professional service charges that are not sold as subscription services. By specifying this field, you can launch non-subscription and unified monetization business models in Zuora, in addition to subscription business models.

subscriptionsArray of objects(PostSubscriptionOrderRequest)

Based on the intended order action, each item should include specific fields. For example, to preview a new subscription for a new account, you must specify the account_data and subscription_plans fields at a minimum.

account_dataobject(SubscriptionPreviewAccountRequest)

Account data that is used for the subscription preview. If you specify this field, do not specify account_id. Note that this operation is only for preview and no subscription is created.

number_of_periodsinteger

Specifies how many billing periods you want to preview.

term_endboolean

Indicates whether to preview the subscription till the end of the current term.

metricsArray of stringsrequired

Specifies the metrics you want to preview. You can preview metrics of billing documents, the order delta metrics, or both.

Items Enum:"billing_documents""delta_metrics"
end_datestring, (date)

End date of the period for which you want to preview the subscription

{ "description": "Preview an order request", "account_data": { "currency": "USD", "bill_cycle_day": 1, "sold_to": { … } }, "metrics": [ "delta_metrics" ], "subscriptions": [ { … } ] }

Responses

Default Response

Headers
ratelimit-limitstring

The request limit quota for the time window closest to exhaustion. See rate limits for more information.

ratelimit-remainingnumber

The number of requests remaining in the time window closest to quota exhaustion. See rate limits for more information.

ratelimit-resetnumber

The number of seconds until the quota resets for the time window closest to quota exhaustion. See rate limits for more information.

zuora-request-idstring

Zuora’s internal identifier for this request.

zuora-track-idstring

A user-supplied identifier for this request. If you supply a zuora-track-id as a request header, Zuora returns the zuora-track-id as a response header.

Bodyapplication/json
subscriptionsArray of objects(OrderSubscriptionPreviewResponse)
billing_documentsArray of objects(SubscriptionPreviewBillingDocumentsResponse)
line_itemsArray of objects(LineItemsPreviewResponse)

The order line items on this order.

Response
{ "subscriptions": [ { … } ] }