Update a draft quote
curl --request PATCH \
--url https://api.custral.com/v1/quotes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"product": "Pro seats",
"quantity": 1,
"unitPrice": 1
}
],
"contactName": "<string>",
"contactEmail": "jsmith@example.com",
"billingEvery": 6,
"billingAnchorDay": 15,
"requireSignature": true,
"contractTemplate": "<string>",
"expiresAt": "<string>",
"clearDiscount": true
}
'import requests
url = "https://api.custral.com/v1/quotes/{id}"
payload = {
"products": [
{
"product": "Pro seats",
"quantity": 1,
"unitPrice": 1
}
],
"contactName": "<string>",
"contactEmail": "jsmith@example.com",
"billingEvery": 6,
"billingAnchorDay": 15,
"requireSignature": True,
"contractTemplate": "<string>",
"expiresAt": "<string>",
"clearDiscount": 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({
products: [{product: 'Pro seats', quantity: 1, unitPrice: 1}],
contactName: '<string>',
contactEmail: 'jsmith@example.com',
billingEvery: 6,
billingAnchorDay: 15,
requireSignature: true,
contractTemplate: '<string>',
expiresAt: '<string>',
clearDiscount: true
})
};
fetch('https://api.custral.com/v1/quotes/{id}', 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.custral.com/v1/quotes/{id}",
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([
'products' => [
[
'product' => 'Pro seats',
'quantity' => 1,
'unitPrice' => 1
]
],
'contactName' => '<string>',
'contactEmail' => 'jsmith@example.com',
'billingEvery' => 6,
'billingAnchorDay' => 15,
'requireSignature' => true,
'contractTemplate' => '<string>',
'expiresAt' => '<string>',
'clearDiscount' => 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.custral.com/v1/quotes/{id}"
payload := strings.NewReader("{\n \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": 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.custral.com/v1/quotes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/quotes/{id}")
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 \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"number": "Q-0007",
"status": "draft",
"customer": {
"recordId": "<string>",
"name": "Hooli"
},
"url": "<string>",
"contactName": "<string>",
"contactEmail": "<string>",
"currency": "usd",
"collectionMethod": "autopay",
"paymentTermsDays": 123,
"trialDays": 123,
"billingEvery": 123,
"billingAnchorDay": 123,
"requireSignature": true,
"contractTemplateId": "<string>",
"startDate": "<string>",
"expiresAt": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"acceptedAt": "2023-11-07T05:31:56Z",
"acceptedName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productRecordId": "<string>",
"name": "Pro seats",
"description": "<string>",
"quantity": 123,
"unitAmount": 123,
"interval": "one_time",
"usageEvent": "<string>"
}
],
"discount": {
"type": "percent",
"value": 123,
"duration": "once",
"months": 60
},
"paymentSchedule": [
{
"label": "<string>",
"due": "<string>",
"type": "percent",
"value": 123,
"billedAt": "<string>"
}
],
"billingError": "<string>",
"totals": {
"recurring": [
{
"interval": "<string>",
"listAmount": 123,
"phases": [
{
"fromPeriod": 123,
"toPeriod": 123,
"amount": 123
}
]
}
],
"oneTimeListTotal": 123,
"oneTimeTotal": 123
}
},
"reqId": "req_2a1f9c8e7b6d5"
}Quotes
Update a draft quote
Change a draft. Only the fields you send change; products replaces every line. A quote that has been sent is quote_not_draft. Requires scope: quotes:write.
PATCH
/
v1
/
quotes
/
{id}
Update a draft quote
curl --request PATCH \
--url https://api.custral.com/v1/quotes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"products": [
{
"product": "Pro seats",
"quantity": 1,
"unitPrice": 1
}
],
"contactName": "<string>",
"contactEmail": "jsmith@example.com",
"billingEvery": 6,
"billingAnchorDay": 15,
"requireSignature": true,
"contractTemplate": "<string>",
"expiresAt": "<string>",
"clearDiscount": true
}
'import requests
url = "https://api.custral.com/v1/quotes/{id}"
payload = {
"products": [
{
"product": "Pro seats",
"quantity": 1,
"unitPrice": 1
}
],
"contactName": "<string>",
"contactEmail": "jsmith@example.com",
"billingEvery": 6,
"billingAnchorDay": 15,
"requireSignature": True,
"contractTemplate": "<string>",
"expiresAt": "<string>",
"clearDiscount": 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({
products: [{product: 'Pro seats', quantity: 1, unitPrice: 1}],
contactName: '<string>',
contactEmail: 'jsmith@example.com',
billingEvery: 6,
billingAnchorDay: 15,
requireSignature: true,
contractTemplate: '<string>',
expiresAt: '<string>',
clearDiscount: true
})
};
fetch('https://api.custral.com/v1/quotes/{id}', 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.custral.com/v1/quotes/{id}",
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([
'products' => [
[
'product' => 'Pro seats',
'quantity' => 1,
'unitPrice' => 1
]
],
'contactName' => '<string>',
'contactEmail' => 'jsmith@example.com',
'billingEvery' => 6,
'billingAnchorDay' => 15,
'requireSignature' => true,
'contractTemplate' => '<string>',
'expiresAt' => '<string>',
'clearDiscount' => 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.custral.com/v1/quotes/{id}"
payload := strings.NewReader("{\n \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": 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.custral.com/v1/quotes/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/quotes/{id}")
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 \"products\": [\n {\n \"product\": \"Pro seats\",\n \"quantity\": 1,\n \"unitPrice\": 1\n }\n ],\n \"contactName\": \"<string>\",\n \"contactEmail\": \"jsmith@example.com\",\n \"billingEvery\": 6,\n \"billingAnchorDay\": 15,\n \"requireSignature\": true,\n \"contractTemplate\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"clearDiscount\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"number": "Q-0007",
"status": "draft",
"customer": {
"recordId": "<string>",
"name": "Hooli"
},
"url": "<string>",
"contactName": "<string>",
"contactEmail": "<string>",
"currency": "usd",
"collectionMethod": "autopay",
"paymentTermsDays": 123,
"trialDays": 123,
"billingEvery": 123,
"billingAnchorDay": 123,
"requireSignature": true,
"contractTemplateId": "<string>",
"startDate": "<string>",
"expiresAt": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"acceptedAt": "2023-11-07T05:31:56Z",
"acceptedName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lineItems": [
{
"productRecordId": "<string>",
"name": "Pro seats",
"description": "<string>",
"quantity": 123,
"unitAmount": 123,
"interval": "one_time",
"usageEvent": "<string>"
}
],
"discount": {
"type": "percent",
"value": 123,
"duration": "once",
"months": 60
},
"paymentSchedule": [
{
"label": "<string>",
"due": "<string>",
"type": "percent",
"value": 123,
"billedAt": "<string>"
}
],
"billingError": "<string>",
"totals": {
"recurring": [
{
"interval": "<string>",
"listAmount": 123,
"phases": [
{
"fromPeriod": 123,
"toPeriod": 123,
"amount": 123
}
]
}
],
"oneTimeListTotal": 123,
"oneTimeTotal": 123
}
},
"reqId": "req_2a1f9c8e7b6d5"
}Authorizations
A Custral API key, created in Settings → Developers → Applications, sent as Authorization: Bearer sk_…. The X-Api-Key header is also accepted and takes precedence. Use a secret key (sk_…) from your server; a publishable key (pk_…) may hold only objects:read and usage:write. Never expose a secret key in a browser.
Body
application/json
Was this page helpful?