Create an invoice
curl --request POST \
--url https://api.talescria.com/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountId": "<string>",
"customerId": "<string>",
"dueAt": 123,
"lines": [
{
"description": "<string>",
"quantity": 2,
"unitPrice": "<string>"
}
],
"memo": "<string>",
"issuedAt": 123,
"poNumber": "<string>",
"internalNote": "<string>",
"notify": true,
"cc": [
"[email protected]"
]
}
'import requests
url = "https://api.talescria.com/v1/invoices"
payload = {
"accountId": "<string>",
"customerId": "<string>",
"dueAt": 123,
"lines": [
{
"description": "<string>",
"quantity": 2,
"unitPrice": "<string>"
}
],
"memo": "<string>",
"issuedAt": 123,
"poNumber": "<string>",
"internalNote": "<string>",
"notify": True,
"cc": ["[email protected]"]
}
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>',
dueAt: 123,
lines: [{description: '<string>', quantity: 2, unitPrice: '<string>'}],
memo: '<string>',
issuedAt: 123,
poNumber: '<string>',
internalNote: '<string>',
notify: true,
cc: ['[email protected]']
})
};
fetch('https://api.talescria.com/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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
},
"emailed": true
}{
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Invoices
Create an invoice
Issues an invoice to one of your customers and, unless notify is false, emails it with a link to pay by card.
- Send the lines; Talescria computes the subtotal, tax and total. Each line is
quantity × unitPrice, and tax is the subtotal ×rateBasisPoints, rounded half up to a minor unit. - The receiving account follows the payment link rules: USD, GBP or EUR, able to take card payments.
- Your business details must be complete, because they go on the invoice (
409 PROFILE_INCOMPLETEotherwise).
An issued invoice can’t be edited. To correct one, void it and issue a new one. If the email fails, the invoice still exists and emailed is false; use Resend.
Requires the invoices:write scope.
POST
/
v1
/
invoices
Create an invoice
curl --request POST \
--url https://api.talescria.com/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountId": "<string>",
"customerId": "<string>",
"dueAt": 123,
"lines": [
{
"description": "<string>",
"quantity": 2,
"unitPrice": "<string>"
}
],
"memo": "<string>",
"issuedAt": 123,
"poNumber": "<string>",
"internalNote": "<string>",
"notify": true,
"cc": [
"[email protected]"
]
}
'import requests
url = "https://api.talescria.com/v1/invoices"
payload = {
"accountId": "<string>",
"customerId": "<string>",
"dueAt": 123,
"lines": [
{
"description": "<string>",
"quantity": 2,
"unitPrice": "<string>"
}
],
"memo": "<string>",
"issuedAt": 123,
"poNumber": "<string>",
"internalNote": "<string>",
"notify": True,
"cc": ["[email protected]"]
}
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>',
dueAt: 123,
lines: [{description: '<string>', quantity: 2, unitPrice: '<string>'}],
memo: '<string>',
issuedAt: 123,
poNumber: '<string>',
internalNote: '<string>',
notify: true,
cc: ['[email protected]']
})
};
fetch('https://api.talescria.com/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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
},
"emailed": true
}{
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Headers
Body
application/json