cURL
curl --request POST \
--url https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"autoAccept": true,
"lineItemChanges": [
{
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"allowBuyerSelectedQuantity": true,
"billingCycleAnchorDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"positionOnQuote": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"recurringBillingEndDate": "2023-12-25",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"variantId": "<string>"
},
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"prorating": true,
"type": "DIRECT",
"contractId": "<string>",
"effectiveDate": "2023-12-25",
"name": "<string>"
}
'import requests
url = "https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview"
payload = {
"autoAccept": True,
"lineItemChanges": [
{
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": { "prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": "<string>"
}
] },
"quantity": 123,
"allowBuyerSelectedQuantity": True,
"billingCycleAnchorDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": True,
"isOptional": True,
"lineItemCurrencyCode": "<string>",
"positionOnQuote": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"recurringBillingEndDate": "2023-12-25",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"variantId": "<string>"
},
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"prorating": True,
"type": "DIRECT",
"contractId": "<string>",
"effectiveDate": "2023-12-25",
"name": "<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({
autoAccept: true,
lineItemChanges: [
{
lineItemAdd: {
mode: 'CUSTOM',
name: '<string>',
pricing: {prices: [{currencyCode: '<string>', price: {}, maxQuantity: '<string>'}]},
quantity: 123,
allowBuyerSelectedQuantity: true,
billingCycleAnchorDate: '2023-12-25',
billingStartDelayDays: 123,
billingStartDelayMonths: 123,
buyerSelectedQuantityMax: 123,
buyerSelectedQuantityMin: 123,
description: '<string>',
discount: 123,
discountPercentage: 123,
externalId: '<string>',
images: '<string>',
isEditablePrice: true,
isOptional: true,
lineItemCurrencyCode: '<string>',
positionOnQuote: 123,
priceBookId: '<string>',
productId: '<string>',
productType: '<string>',
recurringBillingEndDate: '2023-12-25',
recurringBillingPeriod: '<string>',
recurringBillingStartDate: '2023-12-25',
richTextDescription: '<string>',
sku: '<string>',
variantId: '<string>'
},
rampKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
prorating: true,
type: 'DIRECT',
contractId: '<string>',
effectiveDate: '2023-12-25',
name: '<string>'
})
};
fetch('https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview', 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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview",
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([
'autoAccept' => true,
'lineItemChanges' => [
[
'lineItemAdd' => [
'mode' => 'CUSTOM',
'name' => '<string>',
'pricing' => [
'prices' => [
[
'currencyCode' => '<string>',
'price' => [
],
'maxQuantity' => '<string>'
]
]
],
'quantity' => 123,
'allowBuyerSelectedQuantity' => true,
'billingCycleAnchorDate' => '2023-12-25',
'billingStartDelayDays' => 123,
'billingStartDelayMonths' => 123,
'buyerSelectedQuantityMax' => 123,
'buyerSelectedQuantityMin' => 123,
'description' => '<string>',
'discount' => 123,
'discountPercentage' => 123,
'externalId' => '<string>',
'images' => '<string>',
'isEditablePrice' => true,
'isOptional' => true,
'lineItemCurrencyCode' => '<string>',
'positionOnQuote' => 123,
'priceBookId' => '<string>',
'productId' => '<string>',
'productType' => '<string>',
'recurringBillingEndDate' => '2023-12-25',
'recurringBillingPeriod' => '<string>',
'recurringBillingStartDate' => '2023-12-25',
'richTextDescription' => '<string>',
'sku' => '<string>',
'variantId' => '<string>'
],
'rampKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'prorating' => true,
'type' => 'DIRECT',
'contractId' => '<string>',
'effectiveDate' => '2023-12-25',
'name' => '<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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview"
payload := strings.NewReader("{\n \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview")
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 \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deltaLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"acv": 123,
"allowBuyerSelectedQuantity": true,
"amount": 123,
"archived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"arr": 123,
"billingCycleAnchorDate": "2023-12-25",
"billingPeriodEndDate": "2023-12-25",
"billingPeriodStartDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"effectiveUnitPrice": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"proposedLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"acv": 123,
"allowBuyerSelectedQuantity": true,
"amount": 123,
"archived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"arr": 123,
"billingCycleAnchorDate": "2023-12-25",
"billingPeriodEndDate": "2023-12-25",
"billingPeriodStartDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"effectiveUnitPrice": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
]
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Changes
Preview Change
POST
/
commerce
/
contracts
/
2026-09-beta
/
changes
/
preview
cURL
curl --request POST \
--url https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"autoAccept": true,
"lineItemChanges": [
{
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"allowBuyerSelectedQuantity": true,
"billingCycleAnchorDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"positionOnQuote": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"recurringBillingEndDate": "2023-12-25",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"variantId": "<string>"
},
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"prorating": true,
"type": "DIRECT",
"contractId": "<string>",
"effectiveDate": "2023-12-25",
"name": "<string>"
}
'import requests
url = "https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview"
payload = {
"autoAccept": True,
"lineItemChanges": [
{
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": { "prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": "<string>"
}
] },
"quantity": 123,
"allowBuyerSelectedQuantity": True,
"billingCycleAnchorDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": True,
"isOptional": True,
"lineItemCurrencyCode": "<string>",
"positionOnQuote": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"recurringBillingEndDate": "2023-12-25",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"variantId": "<string>"
},
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"prorating": True,
"type": "DIRECT",
"contractId": "<string>",
"effectiveDate": "2023-12-25",
"name": "<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({
autoAccept: true,
lineItemChanges: [
{
lineItemAdd: {
mode: 'CUSTOM',
name: '<string>',
pricing: {prices: [{currencyCode: '<string>', price: {}, maxQuantity: '<string>'}]},
quantity: 123,
allowBuyerSelectedQuantity: true,
billingCycleAnchorDate: '2023-12-25',
billingStartDelayDays: 123,
billingStartDelayMonths: 123,
buyerSelectedQuantityMax: 123,
buyerSelectedQuantityMin: 123,
description: '<string>',
discount: 123,
discountPercentage: 123,
externalId: '<string>',
images: '<string>',
isEditablePrice: true,
isOptional: true,
lineItemCurrencyCode: '<string>',
positionOnQuote: 123,
priceBookId: '<string>',
productId: '<string>',
productType: '<string>',
recurringBillingEndDate: '2023-12-25',
recurringBillingPeriod: '<string>',
recurringBillingStartDate: '2023-12-25',
richTextDescription: '<string>',
sku: '<string>',
variantId: '<string>'
},
rampKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
prorating: true,
type: 'DIRECT',
contractId: '<string>',
effectiveDate: '2023-12-25',
name: '<string>'
})
};
fetch('https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview', 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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview",
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([
'autoAccept' => true,
'lineItemChanges' => [
[
'lineItemAdd' => [
'mode' => 'CUSTOM',
'name' => '<string>',
'pricing' => [
'prices' => [
[
'currencyCode' => '<string>',
'price' => [
],
'maxQuantity' => '<string>'
]
]
],
'quantity' => 123,
'allowBuyerSelectedQuantity' => true,
'billingCycleAnchorDate' => '2023-12-25',
'billingStartDelayDays' => 123,
'billingStartDelayMonths' => 123,
'buyerSelectedQuantityMax' => 123,
'buyerSelectedQuantityMin' => 123,
'description' => '<string>',
'discount' => 123,
'discountPercentage' => 123,
'externalId' => '<string>',
'images' => '<string>',
'isEditablePrice' => true,
'isOptional' => true,
'lineItemCurrencyCode' => '<string>',
'positionOnQuote' => 123,
'priceBookId' => '<string>',
'productId' => '<string>',
'productType' => '<string>',
'recurringBillingEndDate' => '2023-12-25',
'recurringBillingPeriod' => '<string>',
'recurringBillingStartDate' => '2023-12-25',
'richTextDescription' => '<string>',
'sku' => '<string>',
'variantId' => '<string>'
],
'rampKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'prorating' => true,
'type' => 'DIRECT',
'contractId' => '<string>',
'effectiveDate' => '2023-12-25',
'name' => '<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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview"
payload := strings.NewReader("{\n \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<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://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/preview")
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 \"autoAccept\": true,\n \"lineItemChanges\": [\n {\n \"lineItemAdd\": {\n \"mode\": \"CUSTOM\",\n \"name\": \"<string>\",\n \"pricing\": {\n \"prices\": [\n {\n \"currencyCode\": \"<string>\",\n \"price\": {},\n \"maxQuantity\": \"<string>\"\n }\n ]\n },\n \"quantity\": 123,\n \"allowBuyerSelectedQuantity\": true,\n \"billingCycleAnchorDate\": \"2023-12-25\",\n \"billingStartDelayDays\": 123,\n \"billingStartDelayMonths\": 123,\n \"buyerSelectedQuantityMax\": 123,\n \"buyerSelectedQuantityMin\": 123,\n \"description\": \"<string>\",\n \"discount\": 123,\n \"discountPercentage\": 123,\n \"externalId\": \"<string>\",\n \"images\": \"<string>\",\n \"isEditablePrice\": true,\n \"isOptional\": true,\n \"lineItemCurrencyCode\": \"<string>\",\n \"positionOnQuote\": 123,\n \"priceBookId\": \"<string>\",\n \"productId\": \"<string>\",\n \"productType\": \"<string>\",\n \"recurringBillingEndDate\": \"2023-12-25\",\n \"recurringBillingPeriod\": \"<string>\",\n \"recurringBillingStartDate\": \"2023-12-25\",\n \"richTextDescription\": \"<string>\",\n \"sku\": \"<string>\",\n \"variantId\": \"<string>\"\n },\n \"rampKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"prorating\": true,\n \"type\": \"DIRECT\",\n \"contractId\": \"<string>\",\n \"effectiveDate\": \"2023-12-25\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deltaLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"acv": 123,
"allowBuyerSelectedQuantity": true,
"amount": 123,
"archived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"arr": 123,
"billingCycleAnchorDate": "2023-12-25",
"billingPeriodEndDate": "2023-12-25",
"billingPeriodStartDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"effectiveUnitPrice": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"proposedLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": "<string>"
}
]
},
"quantity": 123,
"acv": 123,
"allowBuyerSelectedQuantity": true,
"amount": 123,
"archived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"arr": 123,
"billingCycleAnchorDate": "2023-12-25",
"billingPeriodEndDate": "2023-12-25",
"billingPeriodStartDate": "2023-12-25",
"billingStartDelayDays": 123,
"billingStartDelayMonths": 123,
"buyerSelectedQuantityMax": 123,
"buyerSelectedQuantityMin": 123,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"discount": 123,
"discountPercentage": 123,
"effectiveUnitPrice": 123,
"externalId": "<string>",
"images": "<string>",
"isEditablePrice": true,
"isOptional": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
]
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Required Scopes
Required Scopes
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
- Option 1
- Option 2
A boolean indicating whether the contract change should be automatically accepted.
An array of line item changes to be applied to the contract. Each item in the array is a reference to a LineItemChangeRequest.
Show child attributes
Show child attributes
A boolean indicating whether the contract change should be prorated.
A string representing the type of contract change. The default and only valid value is 'DIRECT'.
Available options:
DIRECT The date when the contract change becomes effective, formatted as a date string.
A string representing the name of the contract change.
Last modified on August 13, 2026
Was this page helpful?
⌘I