API to update an template by template id
PUT
/
invoices
/
template
/
{templateId}
Update template
curl --request PUT \
--url https://services.leadconnectorhq.com/invoices/template/{templateId} \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"logoUrl": "https://example.com/logo.png",
"name": "ABC Corp.",
"phoneNo": "+1-214-559-6993",
"address": "9931 Beechwood, TX",
"website": "wwww.example.com",
"customValues": [
"<string>"
]
},
"currency": "<string>",
"items": [
{
"name": "ABC Product",
"currency": "USD",
"amount": 999,
"qty": 1,
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"taxes": [
{
"_id": "<string>",
"name": "<string>",
"rate": 123,
"calculation": "exclusive",
"description": "<string>",
"taxId": "<string>"
}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": true,
"type": "one_time",
"taxInclusive": true
}
],
"internal": true,
"termsNotes": "<string>",
"title": "New Template"
}
'const options = {
method: 'PUT',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: '6578278e879ad2646715ba9c',
altType: 'location',
name: 'New Template',
businessDetails: {
logoUrl: 'https://example.com/logo.png',
name: 'ABC Corp.',
phoneNo: '+1-214-559-6993',
address: '9931 Beechwood, TX',
website: 'wwww.example.com',
customValues: ['<string>']
},
currency: '<string>',
items: [
{
name: 'ABC Product',
currency: 'USD',
amount: 999,
qty: 1,
description: 'ABC Corp.',
productId: '6578278e879ad2646715ba9c',
priceId: '6578278e879ad2646715ba9c',
taxes: [
{
_id: '<string>',
name: '<string>',
rate: 123,
calculation: 'exclusive',
description: '<string>',
taxId: '<string>'
}
],
automaticTaxCategoryId: '6578278e879ad2646715ba9c',
isSetupFeeItem: true,
type: 'one_time',
taxInclusive: true
}
],
internal: true,
termsNotes: '<string>',
title: 'New Template'
})
};
fetch('https://services.leadconnectorhq.com/invoices/template/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/invoices/template/{templateId}"
payload = {
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"logoUrl": "https://example.com/logo.png",
"name": "ABC Corp.",
"phoneNo": "+1-214-559-6993",
"address": "9931 Beechwood, TX",
"website": "wwww.example.com",
"customValues": ["<string>"]
},
"currency": "<string>",
"items": [
{
"name": "ABC Product",
"currency": "USD",
"amount": 999,
"qty": 1,
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"taxes": [
{
"_id": "<string>",
"name": "<string>",
"rate": 123,
"calculation": "exclusive",
"description": "<string>",
"taxId": "<string>"
}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": True,
"type": "one_time",
"taxInclusive": True
}
],
"internal": True,
"termsNotes": "<string>",
"title": "New Template"
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"_id": "6578278e879ad2646715ba9c",
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
},
"currency": "USD",
"items": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"discount": {
"type": "percentage",
"value": 0
},
"invoiceNumberPrefix": "INV-"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Headers
API Version
Available options:
2021-07-28 Path Parameters
Template Id
Example:
"6578278e879ad2646715ba9c"
Body
application/json
location Id / company Id based on altType
Example:
"6578278e879ad2646715ba9c"
Alt Type
Available options:
location Example:
"location"
Name of the template
Example:
"New Template"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Template title
Example:
"New Template"
Show child attributes
Show child attributes
Response
Successful response
Template Id
Example:
"6578278e879ad2646715ba9c"
Location Id or Agency Id
Example:
"6578278e879ad2646715ba9c"
Available options:
location Name of the Template
Example:
"New Template"
Show child attributes
Show child attributes
Example:
{
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
}
Currency
Example:
"USD"
Invoice Items
Example:
[
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
]
Total Amount
Example:
999
created at
Example:
"2023-12-12T09:27:42.355Z"
updated at
Example:
"2023-12-12T09:27:42.355Z"
Show child attributes
Show child attributes
Example:
{ "type": "percentage", "value": 0 }
prefix for invoice number
Example:
"INV-"
Last modified on March 8, 2026
Was this page helpful?
⌘I
Update template
curl --request PUT \
--url https://services.leadconnectorhq.com/invoices/template/{templateId} \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"logoUrl": "https://example.com/logo.png",
"name": "ABC Corp.",
"phoneNo": "+1-214-559-6993",
"address": "9931 Beechwood, TX",
"website": "wwww.example.com",
"customValues": [
"<string>"
]
},
"currency": "<string>",
"items": [
{
"name": "ABC Product",
"currency": "USD",
"amount": 999,
"qty": 1,
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"taxes": [
{
"_id": "<string>",
"name": "<string>",
"rate": 123,
"calculation": "exclusive",
"description": "<string>",
"taxId": "<string>"
}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": true,
"type": "one_time",
"taxInclusive": true
}
],
"internal": true,
"termsNotes": "<string>",
"title": "New Template"
}
'const options = {
method: 'PUT',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: '6578278e879ad2646715ba9c',
altType: 'location',
name: 'New Template',
businessDetails: {
logoUrl: 'https://example.com/logo.png',
name: 'ABC Corp.',
phoneNo: '+1-214-559-6993',
address: '9931 Beechwood, TX',
website: 'wwww.example.com',
customValues: ['<string>']
},
currency: '<string>',
items: [
{
name: 'ABC Product',
currency: 'USD',
amount: 999,
qty: 1,
description: 'ABC Corp.',
productId: '6578278e879ad2646715ba9c',
priceId: '6578278e879ad2646715ba9c',
taxes: [
{
_id: '<string>',
name: '<string>',
rate: 123,
calculation: 'exclusive',
description: '<string>',
taxId: '<string>'
}
],
automaticTaxCategoryId: '6578278e879ad2646715ba9c',
isSetupFeeItem: true,
type: 'one_time',
taxInclusive: true
}
],
internal: true,
termsNotes: '<string>',
title: 'New Template'
})
};
fetch('https://services.leadconnectorhq.com/invoices/template/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/invoices/template/{templateId}"
payload = {
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"logoUrl": "https://example.com/logo.png",
"name": "ABC Corp.",
"phoneNo": "+1-214-559-6993",
"address": "9931 Beechwood, TX",
"website": "wwww.example.com",
"customValues": ["<string>"]
},
"currency": "<string>",
"items": [
{
"name": "ABC Product",
"currency": "USD",
"amount": 999,
"qty": 1,
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"taxes": [
{
"_id": "<string>",
"name": "<string>",
"rate": 123,
"calculation": "exclusive",
"description": "<string>",
"taxId": "<string>"
}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": True,
"type": "one_time",
"taxInclusive": True
}
],
"internal": True,
"termsNotes": "<string>",
"title": "New Template"
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"_id": "6578278e879ad2646715ba9c",
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Template",
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
},
"currency": "USD",
"items": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"discount": {
"type": "percentage",
"value": 0
},
"invoiceNumberPrefix": "INV-"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}