Skip to main content

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.

  1. Navigate to https://www.expensify.com/tools/integrations/ and select the option that creates a new set of credentials
  2. A pair of credentials: partnerUserID and partnerUserSecret will be generated and shown on the page.
    1. Make sure to store the partnerUserID and partnerUserSecret pair you're given in a secure location, as you won't be shown them again.
  3. Enter the partnerUserID and partnerUserSecret into the connection configuration of your Prismatic integration
InputNotesExample
Partner User ID
string
/ Required
partnerUserID
Provide a string value for the partnerUserID of your Expensify account.
_REPLACE_
Partner User Secret
string
/ Required
partnerUserSecret
Provide a string value for the partnerUserSecret of your Expensify account.
_REPLACE_

Data Sources

List Cards

Returns all Cards. | key: listCards | type: picklist

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Domain
string
/ Required
domain
domain
Specifies to the job that it has to list the Cards of a domain.
Type
string
/ Required
type
domainCardList
Specifies to the job that it has to list the Cards of a domain.

List Policies

Returns all Policies. | key: listPolicies | type: picklist

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Type
string
/ Required
type
policyList
Specifies to the job that it has to get a policy summary list.

Actions

Create Expense

Allows you to create expenses in a user’s account. | key: createExpense

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Employee Email
string
/ Required
employeeEmail
The report will be created in that account.
Transaction List
code
/ Required
transactionList
The transactions to add to the report.
Type
string
/ Required
type
expenses
Specifies to the job that it has to create 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

InputDefaultNotesExample
Actions
code
/ Required
actions
The actions to perform on the expense rule.
 
Connection
connection
/ Required
connectionInput
 
 
 
Employee Email
string
/ Required
employeeEmail
The report will be created in that account.
 
Policy ID
string
/ Required
policyId
The report will be created in that policy.
Any valid Expensify policy ID, owned or shared by the user
Type
string
/ Required
type
expenseRules
Specifies to the job that it has to create an expense rule.
 

Create Policy

Creates a policy. | key: createPolicy

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Plan
string
plan
Specifies the plan of the policy. If not specified, the new policy will be created under the team plan.
Policy Name
string
/ Required
policyName
The name of the policy to create.
Type
string
/ Required
type
policy
Specifies to the job that it has to create a policy.

{
"data": {
"responseCode": 200,
"policyID": "0123456789ABCDEF",
"policyName": "My New Policy"
}
}

Create Report

Creates a report, with transactions, in a user’s account. | key: createReport

InputDefaultNotesExample
Connection
connection
/ Required
connectionInput
 
 
 
Employee Email
string
/ Required
employeeEmail
The report will be created in that account.
 
Expenses
code
/ Required
expenses
The expenses to add to the report.
 
Policy ID
string
/ Required
policyId
The report will be created in that policy.
Any valid Expensify policy ID, owned or shared by the user
Report
code
/ Required
report
The report to create.
 
Type
string
/ Required
type
report
Specifies to the job that it has to create a 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

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
File Name
string
/ Required
fileName
The name of a file generated from the exporter job.
File System
string
fileSystem
integrationServer
The name of a file generated from the exporter job.

Export Report

Export expense or report data in a configurable format for analysis or insertion into your accounting package. | key: exportReport

InputDefaultNotesExample
Approved After
string
approvedAfter
 
2016-01-01
Connection
connection
/ Required
connectionInput
 
 
 
Employee Email
string
employeeEmail
The report will be created in that account.
 
End Date
string
endDate
2016-01-01
Filters out all reports submitted or created before the given date, whichever occurred last (inclusive). yyyy-mm-dd formatted date.
 
File Basename
string
fileBasename
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
string
/ Required
fileExtension
json
Specifies the format of the generated report. Note: if the 'pdf' option is chosen, one PDF file will be generated for each report exported.
 
Include Full Page Receipts PDF
boolean
includeFullPageReceiptsPdf
Specifies whether generated PDFs should include full page receipts. This parameter is used only if fileExtension contains pdf
 
Limit
string
limit
Maximum number of reports to export.
 
Mark as Exported Label Filter
string
markAsExportedFilter
 
 
On Finish
code
onFinish
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
string
Value List
policyIDList
The IDs of the policies to get information for.
 
Report ID List
string
Value List
reportIdList
The IDs of the reports to get information for.
 
Start Date
string
startDate
2016-01-01
Filters out all reports submitted or created before the given date, whichever occurred last (inclusive). yyyy-mm-dd formatted date.
 
Report State
string
status
REIMBURSED
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.
 
Template
code
templateName
The template parameter is used to format the Expensify data as you wish. It is based on the Freemarker language's syntax.
 
Test
boolean
test
If set to true, actions defined in onFinish will not be executed.
 

{
"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

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Fields
string
/ Required
Value List
fields
Specifies the fields of the policy to gather information for.
Policy ID List
string
/ Required
Value List
policyIDList
The IDs of the policies to get information for.
Type
string
/ Required
type
policy
Specifies to the job that it has to get information specific to policies.
User Email
string
userEmail
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

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Domain
string
/ Required
domain
The name of the domain to get the cards for.
Type
string
/ Required
type
domainCardList
Specifies to the job that it has to list the cards of a domain.

List Policies

Gets a list of policies with some relevant information about them. | key: listPolicies

InputDefaultNotes
Admin Only
boolean
adminOnly
false
Whether or not to only get policies for which the user is an admin for.
Connection
connection
/ Required
connectionInput
 
 
Type
string
/ Required
type
policyList
Specifies to the job that it has to get a policy summary list.
User Email
string
userEmail
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

InputDefaultNotesExample
Connection
connection
/ Required
connectionInput
 
 
 
Data
string
data
The HTTP body payload to send to the URL.
{"exampleKey": "Example Data"}
Debug Request
boolean
debugRequest
false
Enabling this flag will log out the current request.
 
File Data
string
Key Value List
fileData
File Data to be sent as a multipart form upload.
[{key: "example.txt", value: "My File Contents"}]
File Data File Names
string
Key Value List
fileDataFileNames
File names to apply to the file data inputs. Keys must match the file data keys above.
 
Form Data
string
Key Value List
formData
The Form Data to be sent as a multipart form upload.
[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header
string
Key Value List
headers
A list of headers to send with the request.
User-Agent: curl/7.64.1
Max Retry Count
string
maxRetries
0
The maximum number of retries to attempt.
 
Method
string
/ Required
method
The HTTP method to use.
 
Query Parameter
string
Key Value List
queryParams
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
string
/ Required
responseType
json
The type of data you expect in the response. You can request json, text, or binary data.
 
Retry On All Errors
boolean
retryAllErrors
false
If true, retries on all erroneous responses regardless of type.
 
Retry Delay (ms)
string
retryDelayMS
0
The delay in milliseconds between retries.
 
Timeout
string
timeout
The maximum time that a client will await a response to its request
2000
URL
string
url
This input is not required as the Expensify API is a single endpoint.
Use Exponential Backoff
boolean
useExponentialBackoff
false
Specifies whether to use a pre-defined exponential backoff strategy for retries.
 

Update Employee

Add, update or remove policy members | key: updateEmployee

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Dry Run
boolean
dryRun
false
If set to true, employees will not actually be provisioned or updated. Use this for development.
Employees
code
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
code
onFinish
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
string
setEmployeePrimaryPolicy
none
Specifies the policy to set as the primary policy for the employee. If not specified, the employee will not have a primary policy.
Admin Only
boolean
shouldFixApprovalChains
true
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.
Type
string
/ Required
type
employees
Specifies to the job that it has to update an employee

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

InputDefaultNotesExample
Actions
code
/ Required
actions
The actions to perform on the expense rule.
 
Connection
connection
/ Required
connectionInput
 
 
 
Employee Email
string
/ Required
employeeEmail
The report will be created in that account.
 
Policy ID
string
/ Required
policyId
The report will be created in that policy.
Any valid Expensify policy ID, owned or shared by the user
Rule ID
string
/ Required
ruleId
The rule to update.
Any valid Expensify rule ID, owned or shared by the user
Type
string
/ Required
type
expenseRules
Specifies to the job that it has to create an expense rule.
 

Update Policy

manage categories, tags and report fields on a policy. | key: updatePolicy

InputDefaultNotesExample
Categories
code
categories
Replace or update the existing categories of the policy with the ones provided.
 
Connection
connection
/ Required
connectionInput
 
 
 
Policy ID
string
/ Required
policyId
The report will be created in that policy.
Any valid Expensify policy ID, owned or shared by the user
Policy ID List
string
Value List
policyIDList
The IDs of the policies to get information for.
 
Report Fields
code
reportFields
Replace or update the existing report fields of the policy with the ones provided.
 
Tags
code
tags
Replace the existing tags of the policy with the ones provided.
 
Type
string
/ Required
type
policy
Specifies to the job that it has to update a policy.
 

Update Report Status

Update the status of a report. | key: updateReportStatus

InputDefaultNotes
Connection
connection
/ Required
connectionInput
 
 
Filters
code
filters
The filters to apply to the report list.
Status
string
/ Required
status
REIMBURSED
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.
Type
string
/ Required
type
reportStatus
Specifies to the job that it has to update the status of a list of reports.

{
"data": {
"responseCode": 200,
"reportIDs": [
"R006AseGxMka",
"R00bCluvcO4T"
]
}
}