Skip to main content
POST
JavaScript

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-ID
string

Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).

Body

application/json

Input for creating a contract and its subscriptions atomically.

customerId
string
required

The customer ref ID the contract belongs to

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
subscriptions
ContractSubscriptionEntry · object[]
required

The subscriptions to attach to the contract (must be non-empty). Each entry is either a new subscription to create or a reference to an existing custom subscription.

Minimum array length: 1
name
string | null

Optional contract name

Maximum string length: 255
poNumber
string | null

Optional purchase-order number

Maximum string length: 255
activationStartDate
string<date-time>

Optional contract activation start date

activationEndDate
string<date-time>

Optional contract activation end date

setupBilling
boolean
default:true

Whether to set up billing for the contract by creating a billing contract in the connected billing provider. When false, the contract only provisions access (grants entitlements) and no billing contract is created. Defaults to true.

Response

The created contract, including the custom subscriptions attached to it.

Response object

data
Contract · object
required

A billing contract as reported by the connected billing provider.