API to create an invoice Schedule
curl --request POST \
--url https://services.leadconnectorhq.com/invoices/schedule \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data @- <<EOF
{
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "<string>",
"contactDetails": {
"id": "6578278e879ad2646715ba9c",
"name": "Alex",
"phoneNo": "+1234567890",
"email": "alex@example.com",
"additionalEmails": [
{
"email": "alex@example.com"
}
],
"companyName": "ABC Corp.",
"address": {
"addressLine1": "9931 Beechwood",
"addressLine2": "Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "US",
"postalCode": "559-6993"
},
"customFields": [
"<string>"
]
},
"schedule": {
"executeAt": "<string>"
},
"liveMode": true,
"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
}
],
"discount": {
"type": "percentage",
"value": 10,
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"automaticTaxesEnabled": true,
"termsNotes": "<string>",
"title": "<string>",
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "<string>",
"size": 10000
}
]
}
EOFconst options = {
method: 'POST',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: '6578278e879ad2646715ba9c',
altType: 'location',
name: '<string>',
contactDetails: {
id: '6578278e879ad2646715ba9c',
name: 'Alex',
phoneNo: '+1234567890',
email: 'alex@example.com',
additionalEmails: [{email: 'alex@example.com'}],
companyName: 'ABC Corp.',
address: {
addressLine1: '9931 Beechwood',
addressLine2: 'Beechwood',
city: 'St. Houston',
state: 'TX',
countryCode: 'US',
postalCode: '559-6993'
},
customFields: ['<string>']
},
schedule: {executeAt: '<string>'},
liveMode: true,
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
}
],
discount: {
type: 'percentage',
value: 10,
validOnProductIds: '[ \'6579751d56f60276e5bd4154\' ]'
},
automaticTaxesEnabled: true,
termsNotes: '<string>',
title: '<string>',
invoiceNumberPrefix: 'INV-',
attachments: [
{
id: '6241712be68f7a98102ba272',
name: 'Electronics.pdf',
url: 'https://example.com/digital-delivery',
type: '<string>',
size: 10000
}
]
})
};
fetch('https://services.leadconnectorhq.com/invoices/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/invoices/schedule"
payload = {
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "<string>",
"contactDetails": {
"id": "6578278e879ad2646715ba9c",
"name": "Alex",
"phoneNo": "+1234567890",
"email": "alex@example.com",
"additionalEmails": [{ "email": "alex@example.com" }],
"companyName": "ABC Corp.",
"address": {
"addressLine1": "9931 Beechwood",
"addressLine2": "Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "US",
"postalCode": "559-6993"
},
"customFields": ["<string>"]
},
"schedule": { "executeAt": "<string>" },
"liveMode": True,
"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
}
],
"discount": {
"type": "percentage",
"value": 10,
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"automaticTaxesEnabled": True,
"termsNotes": "<string>",
"title": "<string>",
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "<string>",
"size": 10000
}
]
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"invoices": [
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"amountPaid": 0,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"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"
},
"invoiceNumber": "19",
"currency": "USD",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"email": "alex@example.com",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"issueDate": "2023-01-01",
"dueDate": "2023-01-01",
"invoiceItems": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"amountDue": 999,
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"discount": {
"type": "percentage",
"value": 0
},
"automaticTaxesEnabled": true,
"automaticTaxesCalculated": true,
"paymentSchedule": {}
}
],
"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",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"email": "alex@example.com",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"items": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"termsNotes": "Confidential",
"compiledTermsNotes": "Confidential",
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"schedule": {
"executeAt": "<string>",
"rrule": {
"intervalType": "monthly",
"interval": 2,
"startDate": "2023-01-01",
"startTime": "20:45:00",
"endDate": "2029-11-01",
"endTime": "18:45:00",
"dayOfMonth": 15,
"dayOfWeek": "mo",
"numOfWeek": -1,
"monthOfYear": "jan",
"count": 10,
"daysBefore": 5,
"useStartAsPrimaryUserAccepted": true,
"endType": "by"
}
},
"discount": {
"type": "percentage",
"value": 0
}
}{
"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
2021-07-28 Body
location Id / company Id based on altType
"6578278e879ad2646715ba9c"
Alt Type
location "location"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Automatic taxes enabled for the Invoice
true
Show child attributes
Show child attributes
Show child attributes
Show child attributes
prefix for invoice number
"INV-"
Show child attributes
Show child attributes
attachments for the invoice
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Successful response
Schedule Id
"6578278e879ad2646715ba9c"
Schedule Status
"draft"
Live Mode
false
Location Id or Agency Id
"6578278e879ad2646715ba9c"
location Name of the invoice
"New Invoice"
List of invoices
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"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"
Show child attributes
Show child attributes
{
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"email": "alex@example.com",
"customFields": [],
"name": "Alex",
"address": { "countryCode": "US" }
}
Invoice Items
[
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
]
Total Amount
999
Title
"INVOICE"
Terms notes
"Confidential"
Compiled terms notes
"Confidential"
created at
"2023-12-12T09:27:42.355Z"
updated at
"2023-12-12T09:27:42.355Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{ "type": "percentage", "value": 0 }
Was this page helpful?
curl --request POST \
--url https://services.leadconnectorhq.com/invoices/schedule \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data @- <<EOF
{
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "<string>",
"contactDetails": {
"id": "6578278e879ad2646715ba9c",
"name": "Alex",
"phoneNo": "+1234567890",
"email": "alex@example.com",
"additionalEmails": [
{
"email": "alex@example.com"
}
],
"companyName": "ABC Corp.",
"address": {
"addressLine1": "9931 Beechwood",
"addressLine2": "Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "US",
"postalCode": "559-6993"
},
"customFields": [
"<string>"
]
},
"schedule": {
"executeAt": "<string>"
},
"liveMode": true,
"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
}
],
"discount": {
"type": "percentage",
"value": 10,
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"automaticTaxesEnabled": true,
"termsNotes": "<string>",
"title": "<string>",
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "<string>",
"size": 10000
}
]
}
EOFconst options = {
method: 'POST',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
altId: '6578278e879ad2646715ba9c',
altType: 'location',
name: '<string>',
contactDetails: {
id: '6578278e879ad2646715ba9c',
name: 'Alex',
phoneNo: '+1234567890',
email: 'alex@example.com',
additionalEmails: [{email: 'alex@example.com'}],
companyName: 'ABC Corp.',
address: {
addressLine1: '9931 Beechwood',
addressLine2: 'Beechwood',
city: 'St. Houston',
state: 'TX',
countryCode: 'US',
postalCode: '559-6993'
},
customFields: ['<string>']
},
schedule: {executeAt: '<string>'},
liveMode: true,
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
}
],
discount: {
type: 'percentage',
value: 10,
validOnProductIds: '[ \'6579751d56f60276e5bd4154\' ]'
},
automaticTaxesEnabled: true,
termsNotes: '<string>',
title: '<string>',
invoiceNumberPrefix: 'INV-',
attachments: [
{
id: '6241712be68f7a98102ba272',
name: 'Electronics.pdf',
url: 'https://example.com/digital-delivery',
type: '<string>',
size: 10000
}
]
})
};
fetch('https://services.leadconnectorhq.com/invoices/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/invoices/schedule"
payload = {
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "<string>",
"contactDetails": {
"id": "6578278e879ad2646715ba9c",
"name": "Alex",
"phoneNo": "+1234567890",
"email": "alex@example.com",
"additionalEmails": [{ "email": "alex@example.com" }],
"companyName": "ABC Corp.",
"address": {
"addressLine1": "9931 Beechwood",
"addressLine2": "Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "US",
"postalCode": "559-6993"
},
"customFields": ["<string>"]
},
"schedule": { "executeAt": "<string>" },
"liveMode": True,
"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
}
],
"discount": {
"type": "percentage",
"value": 10,
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"automaticTaxesEnabled": True,
"termsNotes": "<string>",
"title": "<string>",
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "<string>",
"size": 10000
}
]
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"invoices": [
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"amountPaid": 0,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"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"
},
"invoiceNumber": "19",
"currency": "USD",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"email": "alex@example.com",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"issueDate": "2023-01-01",
"dueDate": "2023-01-01",
"invoiceItems": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"amountDue": 999,
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"discount": {
"type": "percentage",
"value": 0
},
"automaticTaxesEnabled": true,
"automaticTaxesCalculated": true,
"paymentSchedule": {}
}
],
"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",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"email": "alex@example.com",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"items": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"termsNotes": "Confidential",
"compiledTermsNotes": "Confidential",
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"schedule": {
"executeAt": "<string>",
"rrule": {
"intervalType": "monthly",
"interval": 2,
"startDate": "2023-01-01",
"startTime": "20:45:00",
"endDate": "2029-11-01",
"endTime": "18:45:00",
"dayOfMonth": 15,
"dayOfWeek": "mo",
"numOfWeek": -1,
"monthOfYear": "jan",
"count": 10,
"daysBefore": 5,
"useStartAsPrimaryUserAccepted": true,
"endType": "by"
}
},
"discount": {
"type": "percentage",
"value": 0
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}