Preview an order

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.

SecuritybearerAuth
Request
header Parameters
zuora-track-id
string

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

async
boolean
Default: false

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.

zuora-entity-ids
string

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-key
string

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-encoding
string

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-encoding
string

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.

Request Body schema: application/json
required
category
string

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

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

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

description
string

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

account_number
string

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

account_id
string

Identifier of the account.

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

order_number
string

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.

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

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

object (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_periods
integer

Specifies how many billing periods you want to preview.

term_end
boolean

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

metrics
required
Array of strings

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_date
string <date>

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

Responses
201

Default Response

400

Bad Request

401

Unauthorized

404

Not Found

405

Method Not Allowed

429

Too Many Requests

500

Internal Server Error

502

Bad Gateway

503

Service Unavailable

504

Gateway Timeout

post/orders/preview
Request samples
application/json
{
  • "description": "Preview an order request",
  • "account_data": {
    },
  • "metrics": [
    ],
  • "subscriptions": [
    ]
}
Response samples
application/json
{
  • "subscriptions": [
    ]
}