Expensify Component
Expensify provides an industry leading expense management system. Use the Expensify component to programmatically download expense report data for analysis or insertion into your accounting package, provision accounts for new hires, and much more.
Component key: Expensify
Description
Expensify provides an industry leading expense management system.
Use the Expensify component to programmatically download expense report data for analysis or insertion into your accounting package, provision accounts for new hires, and much more.
API Reference: Expensify API Reference
Connections
Basic Connection
Create a new authentication connection. Refer to the following guide for more information.
- Navigate to https://www.expensify.com/tools/integrations/ and select the option that creates a new set of credentials
- A pair of credentials:
partnerUserIDandpartnerUserSecretwill be generated and shown on the page.- Make sure to store the
partnerUserIDandpartnerUserSecretpair you're given in a secure location, as you won't be shown them again.
- Make sure to store the
- Enter the
partnerUserIDandpartnerUserSecretinto your connection's configuration
| Input | Notes | Example |
|---|---|---|
| Partner User ID | Provide a string value for the partnerUserID of your Expensify account. | _REPLACE_ |
| Partner User Secret | Provide a string value for the partnerUserSecret of your Expensify account. | _REPLACE_ |
Data Sources
List Cards
Returns all Cards. | key: listCards | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Domain | Specifies to the job that it has to list the Cards of a domain. | domain |
| Type | Specifies to the job that it has to list the Cards of a domain. | domainCardList |
List Policies
Returns all Policies. | key: listPolicies | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Type | Specifies to the job that it has to get a policy summary list. | policyList |
Actions
Create Expense
Allows you to create expenses in a user’s account. | key: createExpense
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Employee Email | The report will be created in that account. | |
| Transaction List | The transactions to add to the report. | |
| Type | Specifies to the job that it has to create expenses. | expenses |
{
"data": {
"responseCode": 200,
"transactionList": [
{
"amount": 1234,
"merchant": "Name Of Merchant 1",
"created": "2016-01-01",
"transactionID": "6720309558248016",
"currency": "USD"
},
{
"amount": 2211,
"merchant": "Name Of Merchant 2",
"created": "2016-01-31",
"transactionID": "6720309558248017",
"currency": "CAD"
}
]
}
}
Create Expense Rule
Create expense rules for a given employee on a given policy. | key: createExpenseRule
| Input | Notes | Example |
|---|---|---|
| Actions | The actions to perform on the expense rule. | |
| Connection | ||
| Employee Email | The report will be created in that account. | |
| Policy ID | The report will be created in that policy. | Any valid Expensify policy ID, owned or shared by the user |
| Type | Specifies to the job that it has to create an expense rule. | expenseRules |
Create Policy
Creates a policy. | key: createPolicy
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Plan | Specifies the plan of the policy. If not specified, the new policy will be created under the team plan. | |
| Policy Name | The name of the policy to create. | |
| Type | Specifies to the job that it has to create a policy. | policy |
{
"data": {
"responseCode": 200,
"policyID": "0123456789ABCDEF",
"policyName": "My New Policy"
}
}
Create Report
Creates a report, with transactions, in a user’s account. | key: createReport
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Employee Email | The report will be created in that account. | |
| Expenses | The expenses to add to the report. | |
| Policy ID | The report will be created in that policy. | Any valid Expensify policy ID, owned or shared by the user |
| Report | The report to create. | |
| Type | Specifies to the job that it has to create a report. | report |
{
"data": {
"responseCode": 200,
"reportName": "Name of the report",
"reportID": "R006AseGxMka"
}
}
Download Report
This job lets you download reports that were generated with the Report Exporter job. | key: downloadReport
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| File Name | The name of a file generated from the exporter job. | |
| File System | The name of a file generated from the exporter job. | integrationServer |
Export Report
Export expense or report data in a configurable format for analysis or insertion into your accounting package. | key: exportReport
| Input | Notes | Example |
|---|---|---|
| Approved After | 2016-01-01 | |
| Connection | ||
| Employee Email | The report will be created in that account. | |
| End Date | Filters out all reports submitted or created before the given date, whichever occurred last (inclusive). yyyy-mm-dd formatted date. | 2016-01-01 |
| File Basename | The name of the generated file(s) will start with this value, and a random part will be added to make each filename globally unique. If not specified, the default value export is use. | |
| File Extension | Specifies the format of the generated report. Note: if the 'pdf' option is chosen, one PDF file will be generated for each report exported. | json |
| Include Full Page Receipts PDF | Specifies whether generated PDFs should include full page receipts. This parameter is used only if fileExtension contains pdf | false |
| Limit | Maximum number of reports to export. | |
| Mark as Exported Label Filter | ||
| On Finish | You can configure the recipients list of email addresses that should receive a summary email of the changes made by the API. | |
| Policy ID List | The IDs of the policies to get information for. | |
| Report ID List | The IDs of the reports to get information for. | |
| Start Date | Filters out all reports submitted or created before the given date, whichever occurred last (inclusive). yyyy-mm-dd formatted date. | 2016-01-01 |
| Report State | The status to change the reports to. At the moment, only Reimbursed is supported. Only reports in the Approved status can be updated to Reimbursed. All other reports will be ignored. | REIMBURSED |
| Template | The template parameter is used to format the Expensify data as you wish. It is based on the Freemarker language's syntax. | |
| Test | If set to true, actions defined in onFinish will not be executed. | false |
{
"data": "exporteba3c95b-f302-4d74-a41a-6127c9088551-5650745444954548.pdf,exporteba3c95b-f302-4d74-a41a-6127c9088551-2050520975381833.pdf"
}
Get Policy
Gets specific information about listed policies. | key: getPolicy
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Fields | Specifies the fields of the policy to gather information for. | |
| Policy ID List | The IDs of the policies to get information for. | |
| Type | Specifies to the job that it has to get information specific to policies. | policy |
| User Email | Specifies the user to gather the policy list for. You must have been granted third-party access by that user/company domain beforehand. |
{
"data": {
"responseCode": 200,
"policyInfo": {
"4C6722D4BD2BD941": {
"reportFields": [
{
"values": [],
"name": "title",
"type": "formula"
},
{
"values": [
"Class 1",
"Class 2",
"Class 2:Sub class 2"
],
"name": "Classes",
"type": "dropdown"
},
{
"values": [
"Donatello",
"Leonardo",
"Michelangelo",
"Rafael"
],
"name": "Customers/Jobs",
"type": "dropdown"
}
],
"categories": [
{
"name": "Entertainment",
"enabled": true
},
{
"name": "Transportation",
"enabled": true
},
{
"name": "Phone",
"enabled": true
},
{
"name": "Fuel/Mileage",
"enabled": true
},
{
"name": "Lodging",
"enabled": true
},
{
"name": "Meals",
"enabled": true
},
{
"name": "Other",
"enabled": false
}
],
"tags": [
{
"glCode": "",
"name": "Enterprise",
"enabled": true
},
{
"glCode": "",
"name": "Enterprise:Jean-Luc Picard",
"enabled": true
},
{
"glCode": "",
"name": "Enterprise:Lt. Commander Data",
"enabled": true
},
{
"glCode": "",
"name": "Enterprise:William Riker",
"enabled": true
}
],
"tax": {
"default": "4",
"rates": [
{
"rate": 0,
"name": "EC Goods Zero-rated",
"rateID": "5"
},
{
"rate": 0,
"name": "EC Services Standard",
"rateID": "4"
},
{
"rate": 20,
"name": "Standard",
"rateID": "2"
},
{
"rate": 5,
"name": "Reduced",
"rateID": "9"
}
],
"name": "Tax"
}
},
"3F329EA1C3809E6C": {
"categories": [
{
"name": "Phone Costs",
"areCommentsRequired": false,
"enabled": false
},
{
"name": "Legal",
"areCommentsRequired": false,
"enabled": false
},
{
"name": "Agency Expense",
"areCommentsRequired": false,
"enabled": false
}
],
"reportFields": [
{
"values": [],
"name": "title",
"type": "formula"
}
],
"tags": [
{
"name": "Tags",
"tags": []
}
],
"tax": {},
"employees": [
{
"email": "admin@domain.com",
"role": "admin",
"submitsTo": "user@domain.com"
},
{
"email": "user@domain.com",
"role": "user",
"submitsTo": "admin@domain.com",
"employeeID": "Emp1",
"customField2": "custom information"
}
]
}
}
}
}
List Cards
Gets the list of credit cards that are assigned at the domain level. | key: listCards
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Domain | The name of the domain to get the cards for. | |
| Type | Specifies to the job that it has to list the cards of a domain. | domainCardList |
List Policies
Gets a list of policies with some relevant information about them. | key: listPolicies
| Input | Notes | Example |
|---|---|---|
| Admin Only | Whether or not to only get policies for which the user is an admin for. | false |
| Connection | ||
| Type | Specifies to the job that it has to get a policy summary list. | policyList |
| User Email | Specifies the user to gather the policy list for. You must have been granted third-party access by that user/company domain beforehand. |
{
"data": {
"policyList": [
{
"outputCurrency": "USD",
"owner": "admin@acmecorp.com",
"role": "user",
"name": "Acme Corp USA Policy",
"id": "DEADBEEF12345678",
"type": "corporate"
},
{
"outputCurrency": "EUR",
"owner": "admin@acmecorp.com",
"role": "auditor",
"name": "Acme Corp France Policy",
"id": "BA5EBA1187654321",
"type": "corporate"
},
{
"outputCurrency": "USD",
"owner": "hr@acmecorp.com",
"role": "admin",
"name": "ACME Corp Candidate Policy",
"id": "F005BA11000099999",
"type": "corporate"
}
],
"responseCode": 200
}
}
Raw Request
Send a raw HTTP request to the Expensify API | key: rawRequest
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} |
| Debug Request | Enabling this flag will log out the current request. | false |
| File Data | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] |
| File Data File Names | File names to apply to the file data inputs. Keys must match the file data keys above. | |
| Form Data | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] |
| Header | A list of headers to send with the request. | User-Agent: curl/7.64.1 |
| Max Retry Count | The maximum number of retries to attempt. Specify 0 for no retries. | 0 |
| Method | The HTTP method to use. | |
| Query Parameter | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | |
| Response Type | The type of data you expect in the response. You can request json, text, or binary data. | json |
| Retry On All Errors | If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors. | false |
| Retry Delay (ms) | The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled. | 0 |
| Timeout | The maximum time that a client will await a response to its request | 2000 |
| URL | This input is not required as the Expensify API is a single endpoint. | |
| Use Exponential Backoff | Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored. | false |
Update Employee
Add, update or remove policy members | key: updateEmployee
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Dry Run | If set to true, employees will not actually be provisioned or updated. Use this for development. | false |
| Employees | Replace or update the existing employees of the policy with the ones provided. If the employee does not exist, it will be created. | |
| On Finish | You can configure the recipients list of email addresses that should receive a summary email of the changes made by the API. | |
| Set Employee Primary Policy | Specifies the policy to set as the primary policy for the employee. If not specified, the employee will not have a primary policy. | none |
| Admin Only | Dictates whether Expensify will automatically invite managers (submitsTo), managers’ managers, and so on to policies where they approve reports, if it is not their primary policy. | true |
| Type | Specifies to the job that it has to update an employee | employees |
The advanced employee updater is designed to allow dynamic and customizable employee provisioning and de-provisioning in Expensify. It will allow you to:
- Provision employees into Expensify policies based on customizable fields, such as employee department, country, job code, etc.
- De-provision employees from Expensify, based on customizable fields, such as termination date
- Assign employees to Expensify domain groups based on customizable fields, such as employee department, country, job code, etc.
- Automatically invite managers to policies they have subordinates on
- Automatically detect employee email address changes, and merge both addresses into the same account
- Import additional information from the employee feed into Expensify, to reuse for custom data export
{
"data": {
"responseCode": 200,
"dry-run": false,
"updatedEmployeesCount": 3,
"diff": {
"diffToAdd": {
"0123456789ABCDEF": [
"employee1@domain.com",
"employee2@domain.com"
],
"ABCDEF0123456789": [
"employee3@domain.com"
]
},
"diffToRemove": {
"B1C7903C636F4A51": [
"terminatedEmployee@domain.com"
]
}
},
"securityGroupEmployeesMap": {
"407184": [
"employee1@domain.com",
"employee2@domain.com"
],
"830936": [
"employee3@domain.com"
]
},
"skippedEmployees": [
{
"email": "employee6@domain.com",
"reason": "No policy found for 'Marketing'"
},
{
"email": "employee7@domain.com",
"reason": "Invalid manager email address 'manager@domain '"
}
]
}
}
Update Expense Rules
Update a preexisting expense rule for a given employee on a given policy. | key: updateExpenseRule
| Input | Notes | Example |
|---|---|---|
| Actions | The actions to perform on the expense rule. | |
| Connection | ||
| Employee Email | The report will be created in that account. | |
| Policy ID | The report will be created in that policy. | Any valid Expensify policy ID, owned or shared by the user |
| Rule ID | The rule to update. | Any valid Expensify rule ID, owned or shared by the user |
| Type | Specifies to the job that it has to create an expense rule. | expenseRules |
Update Policy
manage categories, tags and report fields on a policy. | key: updatePolicy
| Input | Notes | Example |
|---|---|---|
| Categories | Replace or update the existing categories of the policy with the ones provided. | |
| Connection | ||
| Policy ID | The report will be created in that policy. | Any valid Expensify policy ID, owned or shared by the user |
| Policy ID List | The IDs of the policies to get information for. | |
| Report Fields | Replace or update the existing report fields of the policy with the ones provided. | |
| Tags | Replace the existing tags of the policy with the ones provided. | |
| Type | Specifies to the job that it has to update a policy. | policy |
Update Report Status
Update the status of a report. | key: updateReportStatus
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Filters | The filters to apply to the report list. | |
| Status | The status to change the reports to. At the moment, only Reimbursed is supported. Only reports in the Approved status can be updated to Reimbursed. All other reports will be ignored. | REIMBURSED |
| Type | Specifies to the job that it has to update the status of a list of reports. | reportStatus |
{
"data": {
"responseCode": 200,
"reportIDs": [
"R006AseGxMka",
"R00bCluvcO4T"
]
}
}