Create a subscription

Creates a new subscription.

Request
query Parameters
expand[]
Array of strings

Allows you to expand responses by including related object information in a single call. See the 'Expand responses' section of the Quickstart API Tutorial for detailed instructions.

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

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-id
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
invoice_owner_account_id
string

Identifier of the account that owns the invoice associated with this subscription. If you specify this field, do not specify invoice_owner_account_data.

object (AccountCreateRequest)

The information of the new account that owns the invoice associated with this subscription. If you specify this field, do not specify invoice_owner_account_id.

account_id
string

Identifier of the account that owns the subscription. Subscription owner account can be different from the invoice owner account. If you specify this field, do not specify account_data.

object (AccountCreateRequest)

The information of the new account that owns the subscription. The subscription owner account can be different from the invoice owner account. If you specify this field, do not specify account_id.

auto_renew
boolean

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

subscription_number
string

Human-readable identifier of the subscription; maybe user-supplied.

object (Term)

Initial term information for the subscription.

object (Term)

Renewal term information for the subscription

object (StartOn)

Indicates on which date the subscription becomes effective.

description
string

Description of the subscription. Often useful for displaying to users.

invoice_separately
boolean

Separates a single subscription from other subscriptions and creates an invoice for this 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.

object (ProcessingOptions)

Processing options for the invoice or payment.

object (CustomFields)

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

Array of objects (SubscriptionPlanCreateRequest)

The plans associated with this subscription.

Responses
201

Default Response

post/subscriptions
Request samples
application/json
{
  • "account_id": "RC-00000011",
  • "auto_renew": true,
  • "initial_term": {
    },
  • "start_on": {
    },
  • "description": "Create Subscription",
  • "invoice_separately": false,
  • "custom_fields": {
    },
  • "subscription_plans": [
    ]
}
Response samples
application/json
{
  • "id": "8ad09c4b8258af4901825f043f5a40f3",
  • "custom_fields": {
    },
  • "subscription_number": "A-S00013324",
  • "state": "active",
  • "account_id": "2c92c0f86a8dd422016a9e7a70116b0d",
  • "invoice_owner_account_id": "2c92c0f86a8dd422016a9e7a70116b0d",
  • "auto_renew": true,
  • "latest_version": true,
  • "initial_term": {
    },
  • "current_term": {
    },
  • "start_date": "2022-07-01",
  • "end_date": "2022-08-01",
  • "description": "Create Subscription",
  • "contract_effective": "2022-07-01",
  • "service_activation": "2022-07-01",
  • "customer_acceptance": "2022-07-01",
  • "invoice_separately": false,
  • "order_number": "O-00020812"
}