curl --request PATCH \
--url https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy \
--header 'Content-Type: application/json' \
--data '
{
"cancellationPolicyText": {},
"refundPolicyText": {},
"termsOfServiceUrl": {},
"acknowledgementRequired": true,
"customPolicyEnabled": true
}
'import requests
url = "https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy"
payload = {
"cancellationPolicyText": {},
"refundPolicyText": {},
"termsOfServiceUrl": {},
"acknowledgementRequired": True,
"customPolicyEnabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cancellationPolicyText: {},
refundPolicyText: {},
termsOfServiceUrl: {},
acknowledgementRequired: true,
customPolicyEnabled: true
})
};
fetch('https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy', 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/payments-settings/2027-03-beta/payments-settings/policy",
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([
'cancellationPolicyText' => [
],
'refundPolicyText' => [
],
'termsOfServiceUrl' => [
],
'acknowledgementRequired' => true,
'customPolicyEnabled' => true
]),
CURLOPT_HTTPHEADER => [
"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/payments-settings/2027-03-beta/payments-settings/policy"
payload := strings.NewReader("{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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/payments-settings/2027-03-beta/payments-settings/policy")
.header("Content-Type", "application/json")
.body("{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"acknowledgementRequired": true,
"customPolicyEnabled": true,
"cancellationPolicyText": "<string>",
"refundPolicyText": "<string>",
"termsOfServiceUrl": "<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"
}
}Update policy settings
Update the payment policy settings for your HubSpot account. This endpoint allows you to modify existing policy configurations, which can include terms and conditions related to payments. Ensure that you have the necessary permissions to write payment checkout settings before making changes.
curl --request PATCH \
--url https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy \
--header 'Content-Type: application/json' \
--data '
{
"cancellationPolicyText": {},
"refundPolicyText": {},
"termsOfServiceUrl": {},
"acknowledgementRequired": true,
"customPolicyEnabled": true
}
'import requests
url = "https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy"
payload = {
"cancellationPolicyText": {},
"refundPolicyText": {},
"termsOfServiceUrl": {},
"acknowledgementRequired": True,
"customPolicyEnabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cancellationPolicyText: {},
refundPolicyText: {},
termsOfServiceUrl: {},
acknowledgementRequired: true,
customPolicyEnabled: true
})
};
fetch('https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy', 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/payments-settings/2027-03-beta/payments-settings/policy",
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([
'cancellationPolicyText' => [
],
'refundPolicyText' => [
],
'termsOfServiceUrl' => [
],
'acknowledgementRequired' => true,
'customPolicyEnabled' => true
]),
CURLOPT_HTTPHEADER => [
"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/payments-settings/2027-03-beta/payments-settings/policy"
payload := strings.NewReader("{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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/payments-settings/2027-03-beta/payments-settings/policy")
.header("Content-Type", "application/json")
.body("{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/commerce/payments-settings/2027-03-beta/payments-settings/policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancellationPolicyText\": {},\n \"refundPolicyText\": {},\n \"termsOfServiceUrl\": {},\n \"acknowledgementRequired\": true,\n \"customPolicyEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"acknowledgementRequired": true,
"customPolicyEnabled": true,
"cancellationPolicyText": "<string>",
"refundPolicyText": "<string>",
"termsOfServiceUrl": "<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"
}
}Supported products
Supported products
Required Scopes
Required Scopes
Body
An object containing the text of the cancellation policy.
An object containing the text of the refund policy.
An object representing the URL for the terms of service.
A boolean that specifies if acknowledgement is required for the policy.
A boolean indicating whether a custom policy is enabled.
Response
successful operation
A boolean indicating whether an acknowledgement is required for the policy.
A boolean indicating whether a custom policy is enabled.
A string containing the text of the cancellation policy.
A string containing the text of the refund policy.
A string representing the URL of the terms of service.
Was this page helpful?