VayuDocumentationIntegrationsAPI ReferenceChange Log
SupportGet started now
API EndpointsContracts

Create Contract

Create a new Contract.

POST
/contracts

Authorization

BearerAuthorizer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

startDate*string

The start date of the contract

customerId*string

The id of the customer that the contract is associated with

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.

name?string

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

salesForceOpportunityId?string

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

endDate?string

The end date of the contract

signatureDate?string

The signature date of the contract

products?array<>

The products that the contract is associated with

creditGrants?array<>

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?array<>

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

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?array<>

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

customFieldValues?array<>

The stored custom field values associated with the contract

status?ContractStatus

The status of the contract

purchaseOrder?string

The purchase order number of the contract

currency?string
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

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 Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/contracts" \  -H "Content-Type: application/json" \  -d '{    "startDate": "2019-08-24T14:15:22Z",    "customerId": "string"  }'
{  "contract": {    "startDate": "2019-08-24T14:15:22Z",    "customerId": "string",    "planId": "string",    "name": "string",    "salesForceOpportunityId": "string",    "endDate": "2019-08-24T14:15:22Z",    "signatureDate": "2019-08-24T14:15:22Z",    "products": [      {        "displayName": "string",        "description": "string",        "disableDescription": true,        "scheduling": {          "billingDay": 1,          "duration": {            "unit": "DAY",            "value": 0          }        },        "pricing": {          "type": "ONE_TIME",          "price": 0,          "discount": {            "name": "string",            "type": "FIXED",            "amount": 0,            "recurring": 1          },          "isCreditPurchase": true,          "issuedSeparately": true        },        "catalogProductId": "string",        "productErpId": "string",        "nsClass": "string",        "nsClassId": "string",        "externalIntegrations": [          {            "provider": "Paddle",            "externalId": "string"          }        ],        "commitment": {          "units": 0,          "price": 0,          "type": "PRICE",          "scheduling": {            "billingDay": 1,            "duration": {              "unit": "DAY",              "value": 0            }          },          "overageStrategy": "IGNORE"        },        "paymentTerm": "Prepayment",        "isCalendarAligned": true,        "cloudProviderSettings": {          "cloudProvider": "AWS",          "cloudProviderMarketplaceId": "string",          "dimension": "string"        },        "consumesCreditProductIds": [          "string"        ]      }    ],    "creditGrants": [      {        "name": "string",        "creditProductId": "string",        "balanceKind": "MONETARY",        "grantAmount": 0,        "price": 0,        "schedule": "ONE_TIME",        "expirationDate": "2019-08-24T14:15:22Z",        "expirationPolicy": "AT_NEXT_GRANT",        "applyAutomatically": true,        "externalIntegrations": [          {            "provider": "Paddle",            "externalId": "string"          }        ]      }    ],    "productGroups": [      {        "displayName": "string",        "description": "string",        "productErpId": "string",        "nsClass": "string",        "nsClassId": "string",        "products": [          {            "displayName": "string",            "description": "string",            "disableDescription": true,            "scheduling": {              "billingDay": 1,              "duration": {                "unit": "DAY",                "value": 0              }            },            "pricing": {              "type": "ONE_TIME",              "price": 0,              "discount": {                "name": "string",                "type": "FIXED",                "amount": 0,                "recurring": 1              },              "isCreditPurchase": true,              "issuedSeparately": true            },            "catalogProductId": "string",            "productErpId": "string",            "nsClass": "string",            "nsClassId": "string",            "externalIntegrations": [              {                "provider": "Paddle",                "externalId": "string"              }            ],            "commitment": {              "units": 0,              "price": 0,              "type": "PRICE",              "scheduling": {                "billingDay": 1,                "duration": {                  "unit": "DAY",                  "value": 0                }              },              "overageStrategy": "IGNORE"            },            "paymentTerm": "Prepayment",            "isCalendarAligned": true,            "cloudProviderSettings": {              "cloudProvider": "AWS",              "cloudProviderMarketplaceId": "string",              "dimension": "string"            },            "consumesCreditProductIds": [              "string"            ]          }        ],        "baseAmount": 0,        "commitment": {          "units": 0,          "price": 0,          "type": "PRICE",          "scheduling": {            "billingDay": 1,            "duration": {              "unit": "DAY",              "value": 0            }          },          "overageStrategy": "IGNORE"        },        "isCalendarAligned": true      }    ],    "accountManager": "string",    "shouldProRateInvoices": true,    "autoRenewContract": true,    "customFields": [      {        "integrationSource": "NetSuite",        "integrationEntityType": "Account",        "fieldPath": "string",        "vayuCustomFieldName": "string",        "valueType": "String",        "value": null      }    ],    "customFieldValues": [      {        "customFieldDefinitionId": "string",        "value": "string",        "fieldName": "string"      }    ],    "status": "InReview",    "purchaseOrder": "string",    "currency": "USD",    "isTrial": true,    "externalId": "string",    "id": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "type": "invalid_request_error",  "code": "string",  "message": "string",  "param": "string",  "params": [    {      "param": "string",      "message": "string"    }  ]}
{  "type": "authentication_error",  "code": "authentication_failed",  "message": "string"}
{  "type": "rate_limit_error",  "code": "rate_limit_exceeded",  "message": "string"}
{  "type": "api_error",  "code": "internal_error",  "message": "string"}