POST https://services.leadconnectorhq.com/invoices/schedule
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Versión de la API.
Body
account Id / company Id based on altType
Alt Type Posibles valores: ‘account’
Show propiedades
Show propiedades
Contact ID
Contact Name
Contact Phone Number
Contact Email
Secondary email addresses for the contact to be saved
Show cada item
Show cada item
Contact Company Name
Custom Values
Show propiedades
Show propiedades
Show propiedades
Show propiedades
Posibles valores: ‘yearly’, ‘monthly’, ‘weekly’, ‘daily’, ‘hourly’, ‘minutely’, ‘secondly’
Start date in YYYY-MM-DD format
Start time in HH:mm:ss format
End date in YYYY-MM-DD format
End time in HH:mm:ss format
-1, 1, 2, 3, …, 27, 28
Posibles valores: ‘mo’, ‘tu’, ‘we’, ‘th’, ‘fr’, ‘sa’, ‘su’
-1, 1, 2, 3, 4
Posibles valores: ‘jan’, ‘feb’, ‘mar’, ‘apr’, ‘may’, ‘jun’, ‘jul’, ‘aug’, ‘sep’, ‘oct’, ‘nov’, ‘dec’
Max number of task executions
Execute task number of days before
Start as primary user accepted date
End type like after, by, count
Show propiedades
Show propiedades
Business Logo URL
Business Name
Business Phone Number
Business Address
Business Website Link
Custom Values
Show cada item
Show cada item
Invoice Item Name
Invoice descriptions
Product Id
Price Id
Currency
Product amount
Product Quantity
Tax category id for calculating automatic tax
Setupfee item, only created when 1st invoice of recurring schedule is generated
Price type of the item Posibles valores: ‘one_time’, ‘recurring’
true if item amount is tax inclusive
Automatic taxes enabled for the Invoice
Configuration for tips on invoices
Late fees configuration for the invoices
prefix for invoice number
Payment Methods for Invoices
attachments for the invoice
Show cada item
Show cada item
miscellaneous charges for the invoice
Respuestas
200 - Successful response
200 - Successful response
Schedule Id
Schedule Status
Live Mode
Account Id or Agency Id
Posibles valores: ‘account’
Name of the invoice
Show propiedades
Show propiedades
Show propiedades
Show propiedades
Posibles valores: ‘yearly’, ‘monthly’, ‘weekly’, ‘daily’, ‘hourly’, ‘minutely’, ‘secondly’
Start date in YYYY-MM-DD format
Start time in HH:mm:ss format
End date in YYYY-MM-DD format
End time in HH:mm:ss format
-1, 1, 2, 3, …, 27, 28
Posibles valores: ‘mo’, ‘tu’, ‘we’, ‘th’, ‘fr’, ‘sa’, ‘su’
-1, 1, 2, 3, 4
Posibles valores: ‘jan’, ‘feb’, ‘mar’, ‘apr’, ‘may’, ‘jun’, ‘jul’, ‘aug’, ‘sep’, ‘oct’, ‘nov’, ‘dec’
Max number of task executions
Execute task number of days before
Start as primary user accepted date
End type like after, by, count
List of invoices
Show cada item
Show cada item
Invoice Id
Invoice Status Posibles valores: ‘draft’, ‘sent’, ‘payment_processing’, ‘paid’, ‘void’, ‘partially_paid’
Live Mode
Amount Paid
Account Id or Agency Id
Posibles valores: ‘account’
Name of the invoice
Business Details
Invoice Number
Currency
Contact Details
Issue date in YYYY-MM-DD format
Due date in YYYY-MM-DD format
Discount
Invoice Items
Total Amount
Title
Total Amount Due
created at
updated at
Automatic taxes enabled for the Invoice
Is Automatic taxes calculated for the Invoice items
split invoice into payment schedule summing up to full invoice amount
Business Details
Currency
Contact Details
Discount
Invoice Items
Total Amount
Title
Terms notes
Compiled terms notes
created at
updated at
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "New Invoice",
"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"
}
},
"invoices": [
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"amountPaid": 0,
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "New Invoice",
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
// truncado: 94 lineas mas
}
400 - Bad Request
400 - Bad Request
{}
401 - Unauthorized
401 - Unauthorized
{}
422 - Unprocessable Entity
422 - Unprocessable Entity
{}
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/invoices/schedule' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"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",
"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"
}
},
"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",
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"currency": "USD",
"amount": 999,
"qty": 1,
"taxes": [
{}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": true,
"type": "one_time",
"taxInclusive": true
}
],
"automaticTaxesEnabled": true,
"discount": {
"value": 10,
"type": "percentage",
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"termsNotes": "string",
"title": "string",
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "string",
"size": 10000
}
]
}'
const response = await fetch('https://services.leadconnectorhq.com/invoices/schedule', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "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", "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"}}, "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", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true}], "automaticTaxesEnabled": true, "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "termsNotes": "string", "title": "string", "invoiceNumberPrefix": "INV-", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}]}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/invoices/schedule',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "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", "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"}}, "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", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true}], "automaticTaxesEnabled": true, "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "termsNotes": "string", "title": "string", "invoiceNumberPrefix": "INV-", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/schedule');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', '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', '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'}}, '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', 'description': 'ABC Corp.', 'productId': '6578278e879ad2646715ba9c', 'priceId': '6578278e879ad2646715ba9c', 'currency': 'USD', 'amount': 999, 'qty': 1, 'taxes': [{}], 'automaticTaxCategoryId': '6578278e879ad2646715ba9c', 'isSetupFeeItem': true, 'type': 'one_time', 'taxInclusive': true}], 'automaticTaxesEnabled': true, 'discount': {'value': 10, 'type': 'percentage', 'validOnProductIds': '[ '6579751d56f60276e5bd4154' ]'}, 'termsNotes': 'string', 'title': 'string', 'invoiceNumberPrefix': 'INV-', 'attachments': [{'id': '6241712be68f7a98102ba272', 'name': 'Electronics.pdf', 'url': 'https://example.com/digital-delivery', 'type': 'string', 'size': 10000}]}),
]);
$data = json_decode(curl_exec($ch), true);

