curl --request PATCH \
--url https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": {},
"effectiveDate": "2023-12-25",
"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
}
'import requests
url = "https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}"
payload = {
"name": {},
"effectiveDate": "2023-12-25",
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: {},
effectiveDate: '2023-12-25',
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
})
};
fetch('https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}', 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/{changeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => [
],
'effectiveDate' => '2023-12-25',
'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
]),
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/{changeId}"
payload := strings.NewReader("{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}"
response = http.request(request)
puts response.read_body{
"contractId": "<string>",
"id": "<string>",
"lineItemChanges": [
{
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemUpdate": {
"allowBuyerSelectedQuantity": {},
"billingCycleAnchorDate": {},
"billingStartDelayDays": {},
"billingStartDelayMonths": {},
"buyerSelectedQuantityMax": {},
"buyerSelectedQuantityMin": {},
"description": {},
"discount": {},
"discountPercentage": {},
"externalId": {},
"images": {},
"isEditablePrice": {},
"isOptional": {},
"lineItemCurrencyCode": {},
"name": {},
"positionOnQuote": {},
"priceBookId": {},
"pricing": {},
"productType": {},
"quantity": {},
"recurringBillingEndDate": {},
"recurringBillingFrequency": {},
"recurringBillingPeriod": {},
"recurringBillingStartDate": {},
"richTextDescription": {},
"sku": {},
"variantId": {}
}
}
],
"prorating": true,
"createdAt": "2023-11-07T05:31:56Z",
"effectiveDate": "2023-12-25",
"name": "<string>",
"quoteId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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"
}
}Update change
Update an existing contract change in your HubSpot account. This endpoint allows you to modify the details of a specific change identified by its changeId. The request must include the necessary fields to update the contract change, such as the name and any line item changes.
curl --request PATCH \
--url https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": {},
"effectiveDate": "2023-12-25",
"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
}
'import requests
url = "https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}"
payload = {
"name": {},
"effectiveDate": "2023-12-25",
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: {},
effectiveDate: '2023-12-25',
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
})
};
fetch('https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}', 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/{changeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => [
],
'effectiveDate' => '2023-12-25',
'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
]),
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/{changeId}"
payload := strings.NewReader("{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2026-09-beta/changes/{changeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {},\n \"effectiveDate\": \"2023-12-25\",\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}"
response = http.request(request)
puts response.read_body{
"contractId": "<string>",
"id": "<string>",
"lineItemChanges": [
{
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemUpdate": {
"allowBuyerSelectedQuantity": {},
"billingCycleAnchorDate": {},
"billingStartDelayDays": {},
"billingStartDelayMonths": {},
"buyerSelectedQuantityMax": {},
"buyerSelectedQuantityMin": {},
"description": {},
"discount": {},
"discountPercentage": {},
"externalId": {},
"images": {},
"isEditablePrice": {},
"isOptional": {},
"lineItemCurrencyCode": {},
"name": {},
"positionOnQuote": {},
"priceBookId": {},
"pricing": {},
"productType": {},
"quantity": {},
"recurringBillingEndDate": {},
"recurringBillingFrequency": {},
"recurringBillingPeriod": {},
"recurringBillingStartDate": {},
"richTextDescription": {},
"sku": {},
"variantId": {}
}
}
],
"prorating": true,
"createdAt": "2023-11-07T05:31:56Z",
"effectiveDate": "2023-12-25",
"name": "<string>",
"quoteId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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"
}
}Supported products
Supported products
Required Scopes
Required Scopes
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The unique identifier of the contract change to update.
Body
An object representing the name of the contract change.
The date on which the contract change becomes effective, formatted as a date string.
An array of line item changes associated with the contract change, each represented by a LineItemChangeRequest object.
Show child attributes
Show child attributes
A boolean indicating whether the contract change should be prorated.
Response
successful operation
The unique identifier of the contract associated with this change.
The unique identifier for this contract change.
An array of line item changes associated with this contract change.
Show child attributes
Show child attributes
A boolean indicating whether the contract change involves prorating.
The current status of the contract change. Valid values include 'DRAFT', 'PROPOSED', 'ACCEPTED', 'CANCELED', 'FAILED', and 'EXPIRED'.
ACCEPTED, CANCELED, DRAFT, EXPIRED, FAILED, PROPOSED The type of contract change, which can be either 'DIRECT' or 'QUOTE'.
DIRECT, QUOTE The date and time when this contract change was created, in ISO 8601 format.
The date when the contract change becomes effective, in ISO 8601 date format.
The name of the contract change.
The unique identifier of the quote associated with this contract change, if applicable.
The date and time when this contract change was last updated, in ISO 8601 format.
Was this page helpful?