Create a recurring series
curl --request POST \
--url https://api.talescria.com/v1/invoice-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountId": "<string>",
"customerId": "<string>",
"startDate": "2023-12-25",
"dueDays": 182,
"notify": true,
"template": {
"lines": [
{}
],
"tax": {},
"memo": "<string>",
"poNumber": "<string>",
"internalNote": "<string>",
"cc": [
"<string>"
]
},
"endDate": "2023-12-25"
}
'import requests
url = "https://api.talescria.com/v1/invoice-series"
payload = {
"accountId": "<string>",
"customerId": "<string>",
"startDate": "2023-12-25",
"dueDays": 182,
"notify": True,
"template": {
"lines": [{}],
"tax": {},
"memo": "<string>",
"poNumber": "<string>",
"internalNote": "<string>",
"cc": ["<string>"]
},
"endDate": "2023-12-25"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountId: '<string>',
customerId: '<string>',
startDate: '2023-12-25',
dueDays: 182,
notify: true,
template: {
lines: [{}],
tax: {},
memo: '<string>',
poNumber: '<string>',
internalNote: '<string>',
cc: ['<string>']
},
endDate: '2023-12-25'
})
};
fetch('https://api.talescria.com/v1/invoice-series', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"series": {
"id": "<string>",
"number": "S-0001",
"customer": {},
"accountId": "<string>",
"currency": "<string>",
"amount": {
"minorUnits": "125000",
"currency": "USD"
},
"frequency": "weekly",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dueDays": 123,
"notify": true,
"status": "active",
"nextIssueAt": 123,
"issuedCount": 123,
"lastError": "<string>",
"template": {},
"createdAt": 123,
"updatedAt": 123
},
"invoice": {
"id": "<string>",
"status": "unpaid",
"number": "INV-0001",
"total": {
"minorUnits": "125000",
"currency": "USD"
},
"issuedAt": 123,
"dueAt": 123,
"url": "<string>",
"document": {},
"accountId": "<string>",
"customer": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"deleted": true
},
"paidAt": 123,
"paymentInProgress": true,
"createdAt": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Invoices
Create a recurring series
Issues an invoice to a customer on a schedule: weekly, biweekly, monthly or quarterly from startDate, until endDate if you give one.
- Each invoice is issued at 09:00 UTC on its day and is due
dueDayslater. - Monthly and quarterly series keep the start date’s day, moved earlier in shorter months (the 31st becomes the 30th or 28th).
- A series starting today issues its first invoice straight away and returns it. If that first invoice fails, the series is cancelled and the error returned.
Requires the invoices:write scope.
POST
/
v1
/
invoice-series
Create a recurring series
curl --request POST \
--url https://api.talescria.com/v1/invoice-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountId": "<string>",
"customerId": "<string>",
"startDate": "2023-12-25",
"dueDays": 182,
"notify": true,
"template": {
"lines": [
{}
],
"tax": {},
"memo": "<string>",
"poNumber": "<string>",
"internalNote": "<string>",
"cc": [
"<string>"
]
},
"endDate": "2023-12-25"
}
'import requests
url = "https://api.talescria.com/v1/invoice-series"
payload = {
"accountId": "<string>",
"customerId": "<string>",
"startDate": "2023-12-25",
"dueDays": 182,
"notify": True,
"template": {
"lines": [{}],
"tax": {},
"memo": "<string>",
"poNumber": "<string>",
"internalNote": "<string>",
"cc": ["<string>"]
},
"endDate": "2023-12-25"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountId: '<string>',
customerId: '<string>',
startDate: '2023-12-25',
dueDays: 182,
notify: true,
template: {
lines: [{}],
tax: {},
memo: '<string>',
poNumber: '<string>',
internalNote: '<string>',
cc: ['<string>']
},
endDate: '2023-12-25'
})
};
fetch('https://api.talescria.com/v1/invoice-series', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"series": {
"id": "<string>",
"number": "S-0001",
"customer": {},
"accountId": "<string>",
"currency": "<string>",
"amount": {
"minorUnits": "125000",
"currency": "USD"
},
"frequency": "weekly",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"dueDays": 123,
"notify": true,
"status": "active",
"nextIssueAt": 123,
"issuedCount": 123,
"lastError": "<string>",
"template": {},
"createdAt": 123,
"updatedAt": 123
},
"invoice": {
"id": "<string>",
"status": "unpaid",
"number": "INV-0001",
"total": {
"minorUnits": "125000",
"currency": "USD"
},
"issuedAt": 123,
"dueAt": 123,
"url": "<string>",
"document": {},
"accountId": "<string>",
"customer": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"deleted": true
},
"paidAt": 123,
"paymentInProgress": true,
"createdAt": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Headers
Body
application/json