The Xero Accounting API offers a powerful gateway to access and manipulate financial data within Xero. Leveraging Pipedream's capabilities, developers can build custom workflows that streamline accounting processes, sync financial data with external systems, and trigger actions based on financial events. This API allows for the automation of tasks such as invoicing, bank reconciliation, bill payments, and reporting, which can lead to significant time savings and enhanced data accuracy.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
xero_accounting_api: {
type: "app",
app: "xero_accounting_api",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.xero.com/connections`,
headers: {
Authorization: `Bearer ${this.xero_accounting_api.$auth.oauth_access_token}`,
},
})
},
})
Automated Invoice Processing: Trigger a workflow when new invoices are created in Xero to send email notifications using SendGrid, thus keeping stakeholders informed in real-time about billing activities.
Expense Tracking and Approval Workflow: Integrate Xero with Slack using Pipedream to automatically post messages to a designated channel for new expense claims, allowing for quick review and approval by the finance team.
Synchronized Customer Management: When a new contact is added to Xero, use Pipedream to trigger a workflow that creates or updates that contact in a CRM like Salesforce, ensuring consistent client information across business platforms.
Xero supports webhooks for instant notifications of specific event changes.
To create and use a webhook with Pipedream:
Webhook Key
prop empty in this step.For more information, please read Xero's Creating a Webhook Guide.
If you have issues with this integration, please join our public Slack and ask for help.
Emit new notifications when you create a new or update existing contact
Emit new notifications when you create a new or update existing invoice
Emit new event for each incoming webhook notification. To create a Xero Webhook, please follow the instructions here.
Xero Accounting uses OAuth authentication. When you connect your Xero Accounting account, Pipedream will open a popup window where you can sign into Xero Accounting and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Xero Accounting API.
Pipedream requests the following authorization scopes when you connect your account:
offline_access
openid
profile
email
accounting.transactions
accounting.reports.read
accounting.settings
accounting.settings.read
accounting.contacts
accounting.attachments
accounting.journals.read
GET
https://login.xero.com/identity/connect/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://identity.xero.com/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://identity.xero.com/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}