Skip to main content
POST
Create Contract

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
startDate
string<date-time>
required

The start date of the contract

customerId
string
required

The id of the customer that the contract is associated with

Pattern: ^[0-9a-fA-F]{24}$
planId
string

The id of an existing plan to attach to this contract. When provided, products/productGroups are ignored and the plan is used as-is. Mutually exclusive with inline product definition.

Pattern: ^[0-9a-fA-F]{24}$
name
string

The name of the contract. Required when planId is not provided.

salesForceOpportunityId
string | null

The id of the sales force opportunity that the contract is associated with

endDate
string<date-time> | null

The end date of the contract

signatureDate
string<date-time> | null

The signature date of the contract

products
object[]

The products that the contract is associated with

creditGrants
object[] | null

Credit grants that fund credit pools for the customer under this contract. Each grant credits a pool identified by its creditProductId; usage products draw down those pools via consumesCreditProductIds.

productGroups
object[]

Product groups are list of products that can be grouped as a single line item with shared settings like ERP settings, commitment settings, etc.

accountManager
string | null

The name of the account manager of the contract

shouldProRateInvoices
boolean
deprecated

Whether to pro rate the invoices for the contract. If not provided, it will default to false

autoRenewContract
boolean

Whether the contract is set to auto renew. If not provided, it will be treated as true

customFields
object[] | null

Custom fields from CRM systems (Salesforce, HubSpot, etc.)

customFieldValues
object[] | null

The stored custom field values associated with the contract

status
enum<string>

The status of the contract

Available options:
InReview,
Scheduled,
Active,
Inactive,
Expired,
Terminated,
PendingTermination,
Error
purchaseOrder
string

The purchase order number of the contract

currency
enum<string> | null

The currency of the contract. Overrides the customer-level currency for all invoices under this contract. If not provided, the customer currency or account default (USD) is used.

Available options:
USD,
EUR,
GBP,
ILS,
CAD,
AUD,
COP,
BRL,
ARS,
INR,
MXN,
CHF
isTrial
boolean

Whether the contract is a trial. All invoices under a trial contract are flagged with isTrial: true. If not provided, it defaults to false.

externalId
string | null

A caller-owned external id for the contract. Once set, the contract can be fetched or deleted by passing this value in place of the Vayu id on the /contracts/{contractId} endpoints.

Response

RequestSuccess

contract
object
required