curl --request POST \
--url https://connect.withvayu.com/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true
}
],
"accountManager": "<string>",
"shouldProRateInvoices": true,
"autoRenewContract": true,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
'import requests
url = "https://connect.withvayu.com/contracts"
payload = {
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": True
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": True
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True
}
],
"accountManager": "<string>",
"shouldProRateInvoices": True,
"autoRenewContract": True,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2023-11-07T05:31:56Z',
customerId: '<string>',
name: '<string>',
salesForceOpportunityId: '<string>',
endDate: '2023-11-07T05:31:56Z',
signatureDate: '2023-11-07T05:31:56Z',
products: [
{
displayName: '<string>',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
pricing: {
type: 'ONE_TIME',
price: 1,
discount: {name: '<string>', amount: 1, recurring: 2},
isCreditPurchase: true
},
description: '<string>',
catalogProductId: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true,
cloudProviderSettings: {
cloudProvider: 'AWS',
cloudProviderMarketplaceId: '<string>',
dimension: '<string>'
}
}
],
productGroups: [
{
displayName: '<string>',
products: [
{
displayName: '<string>',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
pricing: {
type: 'ONE_TIME',
price: 1,
discount: {name: '<string>', amount: 1, recurring: 2},
isCreditPurchase: true
},
description: '<string>',
catalogProductId: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true,
cloudProviderSettings: {
cloudProvider: 'AWS',
cloudProviderMarketplaceId: '<string>',
dimension: '<string>'
}
}
],
description: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
baseAmount: 123,
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true
}
],
accountManager: '<string>',
shouldProRateInvoices: true,
autoRenewContract: true,
customFields: [{vayuCustomFieldName: '<string>', fieldPath: '<string>', value: '<unknown>'}],
customFieldValues: [
{customFieldDefinitionId: '<string>', value: '<string>', fieldName: '<string>'}
],
purchaseOrder: '<string>'
})
};
fetch('https://connect.withvayu.com/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://connect.withvayu.com/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2023-11-07T05:31:56Z',
'customerId' => '<string>',
'name' => '<string>',
'salesForceOpportunityId' => '<string>',
'endDate' => '2023-11-07T05:31:56Z',
'signatureDate' => '2023-11-07T05:31:56Z',
'products' => [
[
'displayName' => '<string>',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'pricing' => [
'type' => 'ONE_TIME',
'price' => 1,
'discount' => [
'name' => '<string>',
'amount' => 1,
'recurring' => 2
],
'isCreditPurchase' => true
],
'description' => '<string>',
'catalogProductId' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true,
'cloudProviderSettings' => [
'cloudProvider' => 'AWS',
'cloudProviderMarketplaceId' => '<string>',
'dimension' => '<string>'
]
]
],
'productGroups' => [
[
'displayName' => '<string>',
'products' => [
[
'displayName' => '<string>',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'pricing' => [
'type' => 'ONE_TIME',
'price' => 1,
'discount' => [
'name' => '<string>',
'amount' => 1,
'recurring' => 2
],
'isCreditPurchase' => true
],
'description' => '<string>',
'catalogProductId' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true,
'cloudProviderSettings' => [
'cloudProvider' => 'AWS',
'cloudProviderMarketplaceId' => '<string>',
'dimension' => '<string>'
]
]
],
'description' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'baseAmount' => 123,
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true
]
],
'accountManager' => '<string>',
'shouldProRateInvoices' => true,
'autoRenewContract' => true,
'customFields' => [
[
'vayuCustomFieldName' => '<string>',
'fieldPath' => '<string>',
'value' => '<unknown>'
]
],
'customFieldValues' => [
[
'customFieldDefinitionId' => '<string>',
'value' => '<string>',
'fieldName' => '<string>'
]
],
'purchaseOrder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.withvayu.com/contracts"
payload := strings.NewReader("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://connect.withvayu.com/contracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.withvayu.com/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contract": {
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true
}
],
"accountManager": "<string>",
"shouldProRateInvoices": true,
"autoRenewContract": true,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
}{
"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>"
}Create Contract
Create a new Contract.
curl --request POST \
--url https://connect.withvayu.com/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true
}
],
"accountManager": "<string>",
"shouldProRateInvoices": true,
"autoRenewContract": true,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
'import requests
url = "https://connect.withvayu.com/contracts"
payload = {
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": True
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": True
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": True
}
],
"accountManager": "<string>",
"shouldProRateInvoices": True,
"autoRenewContract": True,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2023-11-07T05:31:56Z',
customerId: '<string>',
name: '<string>',
salesForceOpportunityId: '<string>',
endDate: '2023-11-07T05:31:56Z',
signatureDate: '2023-11-07T05:31:56Z',
products: [
{
displayName: '<string>',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
pricing: {
type: 'ONE_TIME',
price: 1,
discount: {name: '<string>', amount: 1, recurring: 2},
isCreditPurchase: true
},
description: '<string>',
catalogProductId: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true,
cloudProviderSettings: {
cloudProvider: 'AWS',
cloudProviderMarketplaceId: '<string>',
dimension: '<string>'
}
}
],
productGroups: [
{
displayName: '<string>',
products: [
{
displayName: '<string>',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
pricing: {
type: 'ONE_TIME',
price: 1,
discount: {name: '<string>', amount: 1, recurring: 2},
isCreditPurchase: true
},
description: '<string>',
catalogProductId: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true,
cloudProviderSettings: {
cloudProvider: 'AWS',
cloudProviderMarketplaceId: '<string>',
dimension: '<string>'
}
}
],
description: '<string>',
productErpId: '<string>',
nsClass: '<string>',
nsClassId: '<string>',
baseAmount: 123,
commitment: {
units: 1,
price: 1,
type: 'UNITS',
scheduling: {duration: {unit: 'MONTH', value: 500}, billingDay: 1},
overageStrategy: 'IGNORE'
},
isCalendarAligned: true
}
],
accountManager: '<string>',
shouldProRateInvoices: true,
autoRenewContract: true,
customFields: [{vayuCustomFieldName: '<string>', fieldPath: '<string>', value: '<unknown>'}],
customFieldValues: [
{customFieldDefinitionId: '<string>', value: '<string>', fieldName: '<string>'}
],
purchaseOrder: '<string>'
})
};
fetch('https://connect.withvayu.com/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://connect.withvayu.com/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2023-11-07T05:31:56Z',
'customerId' => '<string>',
'name' => '<string>',
'salesForceOpportunityId' => '<string>',
'endDate' => '2023-11-07T05:31:56Z',
'signatureDate' => '2023-11-07T05:31:56Z',
'products' => [
[
'displayName' => '<string>',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'pricing' => [
'type' => 'ONE_TIME',
'price' => 1,
'discount' => [
'name' => '<string>',
'amount' => 1,
'recurring' => 2
],
'isCreditPurchase' => true
],
'description' => '<string>',
'catalogProductId' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true,
'cloudProviderSettings' => [
'cloudProvider' => 'AWS',
'cloudProviderMarketplaceId' => '<string>',
'dimension' => '<string>'
]
]
],
'productGroups' => [
[
'displayName' => '<string>',
'products' => [
[
'displayName' => '<string>',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'pricing' => [
'type' => 'ONE_TIME',
'price' => 1,
'discount' => [
'name' => '<string>',
'amount' => 1,
'recurring' => 2
],
'isCreditPurchase' => true
],
'description' => '<string>',
'catalogProductId' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true,
'cloudProviderSettings' => [
'cloudProvider' => 'AWS',
'cloudProviderMarketplaceId' => '<string>',
'dimension' => '<string>'
]
]
],
'description' => '<string>',
'productErpId' => '<string>',
'nsClass' => '<string>',
'nsClassId' => '<string>',
'baseAmount' => 123,
'commitment' => [
'units' => 1,
'price' => 1,
'type' => 'UNITS',
'scheduling' => [
'duration' => [
'unit' => 'MONTH',
'value' => 500
],
'billingDay' => 1
],
'overageStrategy' => 'IGNORE'
],
'isCalendarAligned' => true
]
],
'accountManager' => '<string>',
'shouldProRateInvoices' => true,
'autoRenewContract' => true,
'customFields' => [
[
'vayuCustomFieldName' => '<string>',
'fieldPath' => '<string>',
'value' => '<unknown>'
]
],
'customFieldValues' => [
[
'customFieldDefinitionId' => '<string>',
'value' => '<string>',
'fieldName' => '<string>'
]
],
'purchaseOrder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.withvayu.com/contracts"
payload := strings.NewReader("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://connect.withvayu.com/contracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.withvayu.com/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"customerId\": \"<string>\",\n \"name\": \"<string>\",\n \"salesForceOpportunityId\": \"<string>\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signatureDate\": \"2023-11-07T05:31:56Z\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"productGroups\": [\n {\n \"displayName\": \"<string>\",\n \"products\": [\n {\n \"displayName\": \"<string>\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"pricing\": {\n \"type\": \"ONE_TIME\",\n \"price\": 1,\n \"discount\": {\n \"name\": \"<string>\",\n \"amount\": 1,\n \"recurring\": 2\n },\n \"isCreditPurchase\": true\n },\n \"description\": \"<string>\",\n \"catalogProductId\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true,\n \"cloudProviderSettings\": {\n \"cloudProvider\": \"AWS\",\n \"cloudProviderMarketplaceId\": \"<string>\",\n \"dimension\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\",\n \"productErpId\": \"<string>\",\n \"nsClass\": \"<string>\",\n \"nsClassId\": \"<string>\",\n \"baseAmount\": 123,\n \"commitment\": {\n \"units\": 1,\n \"price\": 1,\n \"type\": \"UNITS\",\n \"scheduling\": {\n \"duration\": {\n \"unit\": \"MONTH\",\n \"value\": 500\n },\n \"billingDay\": 1\n },\n \"overageStrategy\": \"IGNORE\"\n },\n \"isCalendarAligned\": true\n }\n ],\n \"accountManager\": \"<string>\",\n \"shouldProRateInvoices\": true,\n \"autoRenewContract\": true,\n \"customFields\": [\n {\n \"vayuCustomFieldName\": \"<string>\",\n \"fieldPath\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"customFieldValues\": [\n {\n \"customFieldDefinitionId\": \"<string>\",\n \"value\": \"<string>\",\n \"fieldName\": \"<string>\"\n }\n ],\n \"purchaseOrder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contract": {
"startDate": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"name": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"salesForceOpportunityId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"signatureDate": "2023-11-07T05:31:56Z",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"productGroups": [
{
"displayName": "<string>",
"products": [
{
"displayName": "<string>",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"pricing": {
"type": "ONE_TIME",
"price": 1,
"discount": {
"name": "<string>",
"amount": 1,
"recurring": 2
},
"isCreditPurchase": true
},
"description": "<string>",
"catalogProductId": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true,
"cloudProviderSettings": {
"cloudProvider": "AWS",
"cloudProviderMarketplaceId": "<string>",
"dimension": "<string>"
}
}
],
"description": "<string>",
"productErpId": "<string>",
"nsClass": "<string>",
"nsClassId": "<string>",
"baseAmount": 123,
"commitment": {
"units": 1,
"price": 1,
"type": "UNITS",
"scheduling": {
"duration": {
"unit": "MONTH",
"value": 500
},
"billingDay": 1
},
"overageStrategy": "IGNORE"
},
"isCalendarAligned": true
}
],
"accountManager": "<string>",
"shouldProRateInvoices": true,
"autoRenewContract": true,
"customFields": [
{
"vayuCustomFieldName": "<string>",
"fieldPath": "<string>",
"value": "<unknown>"
}
],
"customFieldValues": [
{
"customFieldDefinitionId": "<string>",
"value": "<string>",
"fieldName": "<string>"
}
],
"purchaseOrder": "<string>"
}
}{
"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>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The start date of the contract
The id of the customer that the contract is associated with
^[0-9a-fA-F]{24}$The name of the contract
The id of the sales force opportunity that the contract is associated with
The end date of the contract
The signature date of the contract
The products that the contract is associated with
Show child attributes
Show child attributes
Product groups are list of products that can be grouped as a single line item with shared settings like ERP settings, commitment settings, etc.
Show child attributes
Show child attributes
The name of the account manager of the contract
Whether to pro rate the invoices for the contract. If not provided, it will default to false
Whether the contract is set to auto renew. If not provided, it will be treated as true
Custom fields from CRM systems (Salesforce, HubSpot, etc.)
Show child attributes
Show child attributes
The stored custom field values associated with the contract
Show child attributes
Show child attributes
The status of the contract
InReview, Active, Inactive, Expired, Terminated, PendingTermination, Error The purchase order number of the contract
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.
USD, EUR, GBP, ILS, CAD, AUD, COP, BRL Response
RequestSuccess
Show child attributes
Show child attributes
