apidays LIVE Jakarta 2021 - Accelerating Digitisation
February 24, 2021
5 ways to make your integration more resilient
Jenks Guo, Developer Evangelist at Xero
9. The ability of an app
to recover from
certain types of
failure and remain
functional from the
customer perspective
PHOTO BY ROMAIN VIGNES ON UNSPLASH
Resilienc
e
API INTEGRATION
12. API calls per month
850m
Users of Xero
API
75k+
Registered apps
30k+
Subscribers
2m+
1st cloud
accounting API
2007
Webhook batches
2.3m
API endpoints available
and growing
40+
Certi
fi
ed app
partners
800+
Delivering
an API
Program
at Scale
13.
14. 5 ways to
improve API
ef
fi
ciency
If-modified-since
Filter
Batching Paging Webhooks
16. Paging GET https://api.xero.com/api.xro/
2.0/Invoices
Get all invoices in summary
"LineItems": [],
Get one invoice in great details
"LineItems":
[
{
"Description": "Company car park (month in advance)"
,
"UnitAmount": 135
,
"TaxType": "INPUT"
,
"TaxAmount": 13.5
,
"LineAmount": 135
,
"AccountCode": "449"
,
"Tracking": []
,
"Quantity": 1
,
"LineItemID": "c997b810-
b637-439d-9036-93fd4319011f"
,
"ValidationErrors": [
]
}],
GET https://api.xero.com/api.xro/2.0/Invoices/
243216c5-369e-4056-ac67-05388f86dc81
getting
information in
batches
17. Paging
Get the 1st 100 invoices with details:
"LineItems":
[
{
"Description": "Company car park (month in advance)"
,
"UnitAmount": 135
,
"TaxType": "INPUT"
,
"TaxAmount": 13.5
,
"LineAmount": 135
,
"AccountCode": "449"
,
"Tracking": []
,
"Quantity": 1
,
"LineItemID": "c997b810-b637-439d-9036-93fd4319011f"
,
"ValidationErrors": [
]
}],
GET https://api.xero.com/api.xro/2.0/Invoices?
page=1
x 100
page=1
x 100
page=2
x 100
page=3
x 23
page=n
getting
information in
batches
18. Filters
Retrieve all unpaid Invoices against a particular contact?
read all
invoices
GET https://.../Invoices?page=1&ContactIDs=3138017f-8ddc-420e-a159-
e7e1cf9e643d&Statuses=AUTHORISED
check contacts
& status
read each invoice
for details ?
getting
information in a
smart way
23. Webhooks Webhook
An invoice has been paid full
:
Status: Authorised -> Paid
Send GET request for
complete invoice details
API
GET
Store payment info and
invoice status
Send noti
fi
cation to user
Your App