curl --request POST \
--url https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept', 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/2027-03-beta/changes/{changeId}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/2027-03-beta/changes/{changeId}/accept")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contractId": "<string>",
"deltaLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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,
"billingStartDelayType": "HS_BILLING_START_DELAY_DAYS",
"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,
"isParent": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"parentLineItemId": "<string>",
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"pricingModel": "FLAT",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"recurringBillingTerms": "AUTOMATICALLY_RENEW",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"taxAmount": 123,
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"id": "<string>",
"lineItemChanges": [
{
"action": "ADD",
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"variantId": "<string>"
},
"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": {},
"taxCategory": {},
"taxRateGroupId": {},
"variantId": {}
}
}
],
"proposedLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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,
"billingStartDelayType": "HS_BILLING_START_DELAY_DAYS",
"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,
"isParent": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"parentLineItemId": "<string>",
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"pricingModel": "FLAT",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"recurringBillingTerms": "AUTOMATICALLY_RENEW",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"taxAmount": 123,
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"prorating": true,
"status": "ACCEPTED",
"type": "DIRECT",
"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"
}
}Accept Change
Accept a specific contract change in the HubSpot commerce system. This endpoint is used to finalize and apply changes to a contract that have been proposed. It requires the unique identifier of the change to be accepted.
curl --request POST \
--url https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept', 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/2027-03-beta/changes/{changeId}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/2027-03-beta/changes/{changeId}/accept")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/contracts/2027-03-beta/changes/{changeId}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contractId": "<string>",
"deltaLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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,
"billingStartDelayType": "HS_BILLING_START_DELAY_DAYS",
"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,
"isParent": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"parentLineItemId": "<string>",
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"pricingModel": "FLAT",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"recurringBillingTerms": "AUTOMATICALLY_RENEW",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"taxAmount": 123,
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"id": "<string>",
"lineItemChanges": [
{
"action": "ADD",
"rampKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemAdd": {
"mode": "CUSTOM",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": {},
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"richTextDescription": "<string>",
"sku": "<string>",
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"variantId": "<string>"
},
"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": {},
"taxCategory": {},
"taxRateGroupId": {},
"variantId": {}
}
}
],
"proposedLineItems": [
{
"id": "<string>",
"name": "<string>",
"pricing": {
"prices": [
{
"currencyCode": "<string>",
"price": 123,
"maxQuantity": 123
}
],
"pricingModel": "FLAT"
},
"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,
"billingStartDelayType": "HS_BILLING_START_DELAY_DAYS",
"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,
"isParent": true,
"lineItemCurrencyCode": "<string>",
"mrr": 123,
"parentLineItemId": "<string>",
"positionOnQuote": 123,
"postTaxAmount": 123,
"preDiscountAmount": 123,
"price": 123,
"priceBookId": "<string>",
"pricingModel": "FLAT",
"productId": "<string>",
"productType": "<string>",
"rampKey": "<string>",
"recurringBillingDayOfMonth": 123,
"recurringBillingEndDate": "2023-12-25",
"recurringBillingFrequency": "ANNUALLY",
"recurringBillingNumberOfPayments": 123,
"recurringBillingPeriod": "<string>",
"recurringBillingStartDate": "2023-12-25",
"recurringBillingTerms": "AUTOMATICALLY_RENEW",
"richTextDescription": "<string>",
"sku": "<string>",
"tax": 123,
"taxAmount": 123,
"taxCategory": "<string>",
"taxRateGroupId": "<string>",
"tcv": 123,
"termInMonths": 123,
"tierAmount": 123,
"totalDiscount": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"variantId": "<string>"
}
],
"prorating": true,
"status": "ACCEPTED",
"type": "DIRECT",
"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 accept.
Response
successful operation
The unique identifier of the contract associated with this change.
An array of line items that represent the difference resulting from the contract change.
Show child attributes
Show child attributes
The unique identifier for the contract change.
An array of changes to line items associated with the contract change.
Show child attributes
Show child attributes
An array of line items that are proposed as part of the 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. Valid values include 'DIRECT' and 'QUOTE'.
DIRECT, QUOTE The date and time when the contract change was created, in ISO 8601 format.
The date when the contract change becomes effective, in YYYY-MM-DD format.
The name of the contract change.
The unique identifier of the quote associated with this contract change.
The date and time when the contract change was last updated, in ISO 8601 format.
Was this page helpful?