API to get list of schedules
GET https://services.leadconnectorhq.com/invoices/schedule
Authorization
Query parameters
Responses
200 - Successful response
schedules (object[], required)
_id (string, required): Schedule Id Example: 6578278e879ad2646715ba9c
status (object, required): Schedule Status Example: draft
liveMode (boolean, required): Live Mode Example: False
altId (string, required): Account Id or Agency Id Example: 6578278e879ad2646715ba9c
altType (string, required): Possible values: 'account'
name (string, required): Name of the invoice Example: New Invoice
schedule (object)
rrule (object)
intervalType (string, required): Possible values: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'minutely', 'secondly' Example: monthly
interval (number, required): Example: 2
startDate (string, required): Start date in YYYY-MM-DD format Example: 2023-01-01
startTime (string): Start time in HH:mm:ss format Example: 20:45:00
endDate (string): End date in YYYY-MM-DD format Example: 2029-11-01
endTime (string): End time in HH:mm:ss format Example: 18:45:00
dayOfMonth (number): -1, 1, 2, 3, ..., 27, 28 Example: 15
dayOfWeek (string): Possible values: 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su' Example: mo
numOfWeek (number): -1, 1, 2, 3, 4 Example: -1
monthOfYear (string): Possible values: 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' Example: jan
count (number): Max number of task executions Example: 10
daysBefore (number): Execute task number of days before Example: 5
useStartAsPrimaryUserAccepted (boolean): Start as primary user accepted date Example: True
endType (string): End type like after, by, count Example: by
invoices (object[], required): List of invoices
_id (string, required): Invoice Id Example: 6578278e879ad2646715ba9c
status (string, required): Invoice Status Possible values: 'draft', 'sent', 'payment_processing', 'paid', 'void', 'partially_paid' Example: draft
liveMode (boolean, required): Live Mode Example: False
amountPaid (number, required): Amount Paid Example: 0
altId (string, required): Account Id or Agency Id Example: 6578278e879ad2646715ba9c
altType (string, required): Possible values: 'account'
name (string, required): Name of the invoice Example: New Invoice
businessDetails (object, required): Business Details
invoiceNumber (number, required): Invoice Number Example: 19
currency (string, required): Currency Example: USD
contactDetails (object, required): Contact Details
issueDate (string, required): Issue date in YYYY-MM-DD format Example: 2023-01-01
dueDate (string, required): Due date in YYYY-MM-DD format Example: 2023-01-01
discount (object): Discount
invoiceItems (string[], required): Invoice Items
total (number, required): Total Amount Example: 999
title (string, required): Title Example: INVOICE
amountDue (number, required): Total Amount Due Example: 999
createdAt (string, required): created at Example: 2023-12-12T09:27:42.355Z
updatedAt (string, required): updated at Example: 2023-12-12T09:27:42.355Z
automaticTaxesEnabled (boolean): Automatic taxes enabled for the Invoice Example: True
automaticTaxesCalculated (boolean): Is Automatic taxes calculated for the Invoice items Example: True
paymentSchedule (object): split invoice into payment schedule summing up to full invoice amount
businessDetails (object, required): Business Details
currency (string, required): Currency Example: USD
contactDetails (object, required): Contact Details
discount (object): Discount
items (string[], required): Invoice Items
total (number, required): Total Amount Example: 999
title (string, required): Title Example: INVOICE
termsNotes (string, required): Terms notes Example: Confidential
compiledTermsNotes (string, required): Compiled terms notes Example: Confidential
createdAt (string, required): created at Example: 2023-12-12T09:27:42.355Z
updatedAt (string, required): updated at Example: 2023-12-12T09:27:42.355Z
total (number, required): Total number of Schedules Example: 100
{
"schedules": [
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "New Invoice",
"schedule": {
"executeAt": "string",
"rrule": {}
},
"invoices": [
{}
],
"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"
}
},
// truncado: 26 lineas mas
}
400 - Bad Request
401 - Unauthorized
422 - Unprocessable Entity
Example
curl -X GET 'https://services.leadconnectorhq.com/invoices/schedule' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'
const response = await fetch('https://services.leadconnectorhq.com/invoices/schedule', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();
import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/invoices/schedule',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/schedule');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);