### Basic Employee Feed Example Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater A minimal employee feed example showing essential fields for provisioning. ```json [ { "employeeEmail": "employee@domain.com", "managerEmail": "manager@domain.com", "policyID": "0123456789ABCDEF", "employeeID": "12345" }, { "employeeEmail": "manager@domain.com", "managerEmail": "ceo@domain.com", "policyID": "0123456789ABCDEF", "employeeID": "34567" } ] ``` -------------------------------- ### Comprehensive Employee Feed Example Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater An example of a detailed employee feed with numerous optional fields for advanced provisioning. ```json [ { "employeeEmail": "employee@domain.com", "managerEmail": "manager@domain.com", "policyID": "0123456789ABCDEF", "employeeID": "12345", "firstName": "John", "lastName": "Doe", "customField2": "ABC123", "approvalLimit": 12300, "overLimitApprover": "audit@domain.com", "isTerminated": false, "workerStatus": "On Leave", "additionalPolicyIDs": ["ABCDEF0123456789", "456789ABCDEF0123"], "defaultTags": ["Engineering", "North America"] }, { "employeeEmail": "manager@domain.com", "managerEmail": "ceo@domain.com", "policyID": "0123456789ABCDEF", "employeeID": "34567", "firstName": "Michael", "lastName": "Scott", "customField1": "ZZZ333", "customField2": "BCD345", "isTerminated": false } ] ``` -------------------------------- ### Get Policy List Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this cURL command to request a list of policies associated with a user or domain. Ensure you replace placeholder credentials. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"get", "credentials":{ "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings":{ "type":"policyList", "adminOnly":true, "userEmail":"employee@youraccessibledomain.com" } }' ``` -------------------------------- ### Get Policy Information Request Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this cURL command to send a POST request to the Expensify Integrations server to retrieve policy details. Ensure you replace placeholder credentials and provide a valid policy ID list and desired fields. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"get", "credentials":{ "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings":{ "type":"policy", "fields": ["tax"], "policyIDList": ["0123456789ABCDEF","DEADBEEF01234567","BA5EBA11BA5EBA11"], "userEmail":"employee@youraccessibledomain.com" } }' ``` -------------------------------- ### Export Reports by Date Range with Actions to XLSX Source: https://integrations.expensify.com/Integration-Server/doc/index.html This example exports approved and reimbursed reports within a specified date range to an XLSX file. It also demonstrates marking reports as exported and sending an email notification upon completion. Reports already marked are ignored. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"file", "credentials":{ "partnerUserID":"_REPLACE_", "partnerUserSecret":"_REPLACE_" }, "onReceive":{ "immediateResponse":["returnRandomFileName"] }, "inputSettings":{ "type":"combinedReportData", "reportState":"APPROVED,REIMBURSED", "limit":"10", "filters":{ "startDate":"2016-01-01", "endDate":"2016-02-01", "markedAsExported":"Expensify Export" } }, "outputSettings":{ "fileExtension":"xlsx", "fileBasename":"myExport" }, "onFinish":[ {"actionName":"markAsExported","label":"Expensify Export"}, {"actionName":"email","recipients":"manager@domain.com,finances@domain.com", "message":"Report is ready."} ] }' \ --data-urlencode 'template@expensify_template.ftl' ``` -------------------------------- ### Employee Update Request (SFTP Data Source) using cURL Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater Example cURL command to send an employee update request with data sourced from an SFTP server. The 'requestJobDescription' is passed as a POST body. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={"type": "update", "dry-run" : false, "credentials": { "partnerUserID": "aa_api_domain_com", "partnerUserSecret": "xxx", "sftp": { "host": "sftp.domain.com", "login": "expensify", "password": "[xxx]", "port": 22, "filename": "/path/to/employeeFile.json" } }, "dataSource" : "sftp", "inputSettings": { "type": "employees", "entity": "generic" }, "onFinish":[ {"actionName": "email", "recipients":"admin1@domain.com,admin2@domain.com"} ]}' ``` -------------------------------- ### Get Domain Card List Source: https://integrations.expensify.com/Integration-Server/doc/index.html This cURL command retrieves a list of credit cards assigned at the domain level. Replace placeholders for credentials and specify the domain. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"get", "credentials":{ "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "domainCardList", "domain": "domain.tld" } }' ``` -------------------------------- ### Dependent Multi-Level Tags CSV Format Source: https://integrations.expensify.com/Integration-Server/doc/index.html This example shows the CSV format required for passing dependent multi-level tags with GL Codes and tag level names. Each row represents a specific tag hierarchy. ```csv State,State GL,Region,Region GL,City,City GL California,100,North,20,San Francisco,1 California,100,North,20,Oakland,2 California,100,South,30,Los Angeles,3 ``` -------------------------------- ### Error Response for Malformed Date Source: https://integrations.expensify.com/Integration-Server/doc/index.html This example shows an error response when the date format is incorrect. The response code indicates an error, and the message specifies the expected date format. ```json { "responseMessage" : "Malformed date '16-01-01'. Expected format is yyyy-MM-dd", "responseCode" : 410 } ``` -------------------------------- ### Employee Update Request (URL Data Source) using cURL Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater Example cURL command to send an employee update request with data sourced from a URL. The request job description is passed as a POST body. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={"type": "update", "dry-run" : false, "credentials": { "partnerUserID": "aa_api_domain_com", "partnerUserSecret": "xxx", "feedUrl": "https://somedomain.com/path/to/employeeData.json", "feedUser": "expensify", "feedPassword": "xxx" }, "dataSource" : "download", "inputSettings": { "type": "employees", "entity": "generic" }, "onFinish":[ {"actionName": "email", "recipients":"admin1@domain.com,admin2@domain.com"} ]}' ``` -------------------------------- ### Successful Policy Information Response Source: https://integrations.expensify.com/Integration-Server/doc/index.html A successful response includes a responseCode of 200 and a policyInfo object containing the requested details for the specified policies. This example shows detailed information for two policies, including report fields, categories, tags, and tax configurations. ```json { "responseCode": 200, "policyInfo": { "4C6722D4BD2 বাহBD2BD941": { "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", }] } } } ``` -------------------------------- ### Employee Update Request (Direct Data) using cURL Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater Example cURL command to send an employee update request with data provided directly via the 'data' parameter. The 'requestJobDescription' is sent as a POST body. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={"type": "update", "dry-run" : false, "credentials": { "partnerUserID": "aa_api_domain_com", "partnerUserSecret": "xxx" }, "dataSource" : "request", "inputSettings": { "type": "employees", "entity": "generic" }, "onFinish":[ {"actionName": "email", "recipients":"admin1@domain.com,admin2@domain.com"} ]}' \ --data-urlencode 'data@myEmployeeData.json' ``` -------------------------------- ### Expensify Reconciliation Template Skeleton Source: https://integrations.expensify.com/Integration-Server/doc/index.html This is a basic iterative skeleton for reconciliation templates, showing the nested structure for iterating through cards, reports, and expenses. It serves as a starting point for custom template creation. ```freemarker <#list cards as card, reports> <#-- Properties to print per card --> <#list reports as report> <#-- Properties to print per report --> <#list report.transactionList as expense> <#-- Properties to print per expense --> ``` -------------------------------- ### Expensify Downloader Job Request Source: https://integrations.expensify.com/Integration-Server/doc/index.html This cURL command demonstrates how to initiate a download job from the Expensify Integration Server. It specifies the job type as 'download' and includes necessary credentials and file details. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"download", "credentials":{ "partnerUserID":"_REPLACE_", "partnerUserSecret":"_REPLACE_" }, "fileName":"myFile.csv", "fileSystem":"integrationServer" }' ``` -------------------------------- ### Full Employee Data CSV Sample Source: https://integrations.expensify.com/Integration-Server/doc/index.html A sample CSV file with all supported fields for employee data, including optional fields like User ID, Payroll ID, and Forward Manager Email. ```csv EmployeeEmail,ManagerEmail,Admin,ForwardManagerEmail,EmployeeUserId,EmployeePayrollId user1@domain.com,manager1@domain.com,false,cfo@domain.com,User1ID,User1PayrollID user2@domain.com,manager1@domain.com,true,cfo@domain.com,,User2PayrollID manager2@domain.com,manager1@domain.com,true,,Manager1ID, ``` -------------------------------- ### Employee Update Error Response Source: https://integrations.expensify.com/Integration-Server/doc/index.html An example of an error response from the employee update API, detailing the issue encountered, such as a missing column in the CSV header. ```json { "responseMessage": "Column EmployeeEmail not found in CSV header", "responseCode": 500 } ``` -------------------------------- ### Create a Report with Transactions Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this cURL command to send a POST request to the Expensify Integration Server to create a new report with expense details. Ensure you replace placeholder values with your actual credentials and desired report information. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type": "create", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "report", "policyID": "0123456789ABCDEF", "report": { "title": "Name of the report", "fields":{ "reason_of_trip": "Business trip", "employees": "3" } }, "employeeEmail": "user@domain.com", "expenses": [ { "date": "yyyy-mm-dd", "currency": "USD", "merchant": "Name of merchant", "amount": 1234 }, { "date": "yyyy-mm-dd", "currency": "CAD", "merchant": "Name of merchant", "amount": 2211 } ] } }' ``` -------------------------------- ### Expensify JSON Output Template Sample Source: https://integrations.expensify.com/Integration-Server/doc/index.html This template sample demonstrates how to format Expensify data as a JSON array. It iterates through nested data structures and constructs JSON objects with key-value pairs for each expense. ```freemarker [<#lt> <#list cards as card, reports> <#list reports as report> <#list report.transactionList as expense> {<#lt> "Original Merchant": "${expense.originalMerchant}",<#lt> "Posted date": "${expense.posted}",<#lt> "Sales date": "${expense.originalCreated}",<#lt> "Modified Salesdate": "${expense.modifiedCreated}",<#lt> "Original Amount": ${(-expense.originalAmount/100)?string("0.00")},<#lt> "Modified Amount": ${expense.amountModified?then((-expense.originalAmount/100)?string("0.00"), "")}<#lt> }<#sep>,<#lt> ] ``` -------------------------------- ### Expensify Export Template Sample Source: https://integrations.expensify.com/Integration-Server/doc/index.html A sample FreeMarker template for customizing the format of exported report data. It includes conditional headers and iterates through reports and expenses to extract specific fields. ```ftl <#if addHeader == true> Merchant,Original Amount,Category,Report number,Expense number<#lt> <#assign reportNumber = 1> <#assign expenseNumber = 1> <#list reports as report> <#list report.transactionList as expense> ${expense.merchant},<#t> <#-- note: expense.amount prints the original amount only --> ${expense.amount},<#t> ${expense.category},<#t> ${reportNumber},<#t> ${expenseNumber}<#lt> <#assign expenseNumber = expenseNumber + 1> <#assign reportNumber = reportNumber + 1> ``` -------------------------------- ### Basic Employee Data CSV Sample Source: https://integrations.expensify.com/Integration-Server/doc/index.html A sample CSV file containing basic employee information including email, manager email, and admin status. ```csv EmployeeEmail,ManagerEmail,Admin user1@domain.com,manager1@domain.com,false user2@domain.com,manager1@domain.com,true manager2@domain.com,manager1@domain.com,true ``` -------------------------------- ### Basic Reconciliation Template Skeleton Source: https://integrations.expensify.com/Integration-Server/doc/index.html This Freemarker template skeleton demonstrates the basic structure for iterating through cards, reports, and expenses in a reconciliation process. It includes conditional logic for headers and footers. ```freemarker <#-- Header Line --> <#if addHeader> <#-- Print header information here --> <#list cards as card, reports> <#-- Print information on a per card basis here --> <#list reports as report> <#-- Print information on a per report basis here --> <#list report.transactionList as expense> <#-- Print information on a per expense basis here --> <#if addHeader> <#-- Print footer information here --> ``` -------------------------------- ### Expensify Reconciliation Template Sample Source: https://integrations.expensify.com/Integration-Server/doc/index.html This template sample demonstrates how to format reconciliation data, including an optional header line and iterating through cards, reports, and expenses. It uses Freemarker syntax for conditional logic and data extraction. ```freemarker <#-- Header Line --> <#if addHeader> Original Merchant,<#t> Posted date,<#t> Sales date,<#t> Modified Sales date,<#t> Original Amount,<#t> Modified Amount,<#lt> <#list cards as card, reports> <#list reports as report> <#list report.transactionList as expense> ${expense.originalMerchant},<#t> ${expense.posted},<#t> ${expense.originalCreated},<#t> ${expense.modifiedCreated},<#t> ${(-expense.originalAmount/100)?string("0.00")},<#t> ${expense.amountModified?then((-expense.originalAmount/100)?string("0.00"), "")},<#lt> ``` -------------------------------- ### Create Expense Request Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this cURL command to send a POST request to create expenses. Ensure you replace placeholder credentials and provide a valid transaction list. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type":"create", "credentials":{ "partnerUserID":"_REPLACE_", "partnerUserSecret":"_REPLACE_" }, "inputSettings":{ "type":"expenses", "employeeEmail":"user@domain.com", "transactionList": [ { "created": "2016-01-01", "currency": "USD", "merchant": "Name of merchant 1", "amount": 1234 }, { "created": "2016-01-21", "currency": "EUR", "merchant": "Name of merchant 2", "amount": 2211, "policyID": "E40D9B8DF456E233", "tax": { "rateID":"id_TAX_OPTION_16" } }, { "created": "2016-01-31", "currency": "CAD", "merchant": "Name of merchant 3", "amount": 2211, "reportID": "R006AseGxMka", "tax": { "rateID":"id_TAX_OPTION_16", "amount":600 } } ] } }' ``` -------------------------------- ### Update Policy Report Fields with Object Values Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this to update policy report fields where values are represented as objects, allowing for more detailed configurations like external IDs and enabled status. This example targets multiple policies. ```curl curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type": "update", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "policy", "policyIDList": ["F07C5A1A53D4198B", "81A4013E273DF7A1"] }, "reportFields": { "action": "merge", "data": [ { "name": "Report field 1", "type": "dropdown", "values": [ { "name": "value 1", "externalID": "1" }, { "name": "value 2", "enabled": false }, { "name": "value 3", "externalID": "3", "enabled": true } ] } ] } }' ``` -------------------------------- ### Create Policy Request Source: https://integrations.expensify.com/Integration-Server/doc/index.html Use this cURL command to send a POST request to create a new policy. Ensure you replace placeholder credentials and specify the policy name. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type": "create", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "policy", "policyName": "My New Policy" } }' ``` -------------------------------- ### Create Expense Rule Request Source: https://integrations.expensify.com/Integration-Server/doc/index.html This cURL command demonstrates how to create expense rules for a specific employee on a given policy. It requires policy ID, employee email, and defined actions. ```bash curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={ "type": "create", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "expenseRules", "policyID": "0123456789ABCDEF", "employeeEmail": "employee@domain.com", "actions": { "tag": "Tag Name" } } }' ``` -------------------------------- ### Update Policy with CSV Data Source: https://integrations.expensify.com/Integration-Server/doc/index.html This snippet demonstrates how to send a POST request to the Expensify Integrations server to update a policy. It includes a sample CSV file and a JSON request body specifying the update type, credentials, input settings, and tags configuration. ```bash curl -X POST "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations" \ -d 'requestJobDescription={ "type": "update", "credentials": { "partnerUserID":"...", "partnerUserSecret":"..." }, "inputSettings": { "type": "policy", "policyID": "0123456789ABCDEF" }, "tags": { "action": "replace", "source":"file", "config": { "dependency":true, "glCodes":true, "header":true, "setRequired":true, "fileType":"csv" } } }' \ --data-urlencode 'file@tags.csv' ``` -------------------------------- ### API Request Format Source: https://integrations.expensify.com/Integration-Server/doc/index.html This is the standard format for making requests to the Expensify API. The `requestJobDescription` parameter contains the job details. ```shell curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={...}' ``` -------------------------------- ### Update Employees via SFTP Source: https://integrations.expensify.com/Integration-Server/doc/employeeUpdater This method allows you to update employee data by hosting the data on an SFTP server. Expensify will connect to the SFTP server to retrieve the file. ```APIDOC ## POST https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations ### Description Updates employee data by fetching it from a specified SFTP server location. ### Method POST ### Endpoint https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations ### Parameters #### Request Body - **requestJobDescription** (object) - Required - The job description for the update. - **type** (string) - Required - Must be "update". - **dry-run** (boolean) - Optional - If true, performs a dry run without making actual changes. - **credentials** (object) - Required - Authentication and SFTP server details. - **partnerUserID** (string) - Required - Your Expensify partner User ID. - **partnerUserSecret** (string) - Required - Your Expensify partner User Secret. - **sftp** (object) - Required - SFTP server connection details. - **host** (string) - Required - The SFTP server hostname or IP address. - **login** (string) - Required - The SFTP username. - **password** (string) - Required - The SFTP password. - **port** (integer) - Optional - The SFTP port (defaults to 22). - **filename** (string) - Required - The path to the employee data file on the SFTP server. - **dataSource** (string) - Required - Must be "sftp". - **inputSettings** (object) - Required - Specifies the type and entity of the input data. - **type** (string) - Required - Must be "employees". - **entity** (string) - Required - Must be "generic". - **onFinish** (array) - Optional - Actions to perform after the job completes. - **actionName** (string) - Required - The name of the action (e.g., "email"). - **recipients** (string) - Required - Comma-separated list of recipients for email actions. ### Request Example ```json { "type": "update", "dry-run" : false, "credentials": { "partnerUserID": "aa_api_domain_com", "partnerUserSecret": "xxx", "sftp": { "host": "sftp.domain.com", "login": "expensify", "password": "[xxx]", "port": 22, "filename": "/path/to/employeeFile.json" } }, "dataSource" : "sftp", "inputSettings": { "type": "employees", "entity": "generic" }, "onFinish":[ {"actionName": "email", "recipients":"admin1@domain.com,admin2@domain.com"} ] } ``` ### Request Example (cURL) ```bash curl -X POST "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations" \ -d 'requestJobDescription={"type": "update", "dry-run" : false, "credentials": {"partnerUserID": "aa_api_domain_com", "partnerUserSecret": "xxx", "sftp": {"host": "sftp.domain.com", "login": "expensify", "password": "[xxx]", "port": 22, "filename": "/path/to/employeeFile.json"}}, "dataSource" : "sftp", "inputSettings": {"type": "employees", "entity": "generic"}, "onFinish":[{"actionName": "email", "recipients":"admin1@domain.com,admin2@domain.com"}]}' ``` ``` -------------------------------- ### Create Report Source: https://integrations.expensify.com/Integration-Server/doc/index.html This endpoint creates a new expense report with specified details and transactions. It requires administrative privileges and prior enablement of the functionality for your domain. ```APIDOC ## POST /Integration-Server/ExpensifyIntegrations ### Description Creates a new expense report with transactions in a user's account. This functionality must be enabled by contacting concierge@expensify.com and requires domain and policy admin privileges. ### Method POST ### Endpoint https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations ### Parameters #### Request Body - **requestJobDescription** (JSON Object) - Required - The description of the job to be performed. - **type** (String) - Required - Specifies the job type. Must be "create". - **credentials** (JSON Object) - Required - User authentication credentials. - **partnerUserID** (String) - Required - Your Expensify User ID. - **partnerUserSecret** (String) - Required - Your Expensify User Secret. - **inputSettings** (JSON Object) - Required - Settings for the input data. - **type** (String) - Required - Must be "report". - **policyID** (String) - Required - The ID of the policy where the report will be created. - **employeeEmail** (String) - Required - The email address of the employee for whom the report is created. - **report** (JSON Object) - Required - Details of the report. - **title** (String) - Required - The title of the report. - **fields** (JSON Object) - Optional - Custom fields for the report. Keys should be field names with non-alphanumerical characters replaced by underscores. - **expenses** (JSON Array) - Required - A list of expense objects. - **merchant** (String) - Required - The name of the merchant. - **currency** (String) - Required - Three-letter currency code (e.g., "USD"). - **date** (Date) - Required - The date of the expense in "yyyy-mm-dd" format. - **amount** (Integer) - Required - The amount of the transaction in cents. ### Request Example ```json { "type": "create", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "report", "policyID": "0123456789ABCDEF", "report": { "title": "Name of the report", "fields":{ "reason_of_trip": "Business trip", "employees": "3" } }, "employeeEmail": "user@domain.com", "expenses": [ { "date": "2023-10-27", "currency": "USD", "merchant": "Name of merchant", "amount": 1234 }, { "date": "2023-10-27", "currency": "CAD", "merchant": "Name of merchant", "amount": 2211 } ] } } ``` ### Response #### Success Response (200) - **responseCode** (Integer) - 200 - **reportName** (String) - The name of the generated report. - **reportID** (String) - The ID of the generated report on Expensify. #### Response Example ```json { "responseCode": 200, "reportName": "Name of the report", "reportID": "R006AseGxMka" } ``` #### Error Response - **responseMessage** (String) - Description of the error. - **responseCode** (Integer) - Error code (e.g., 500). #### Error Response Example ```json { "responseMessage": "Not authorized to authenticate as user user@domain.com", "responseCode": 500 } ``` ``` -------------------------------- ### Policy Creation Success Response Source: https://integrations.expensify.com/Integration-Server/doc/index.html A successful policy creation returns a 200 response code along with the ID and name of the newly created policy. ```json { "responseCode": 200, "policyID": "0123456789ABCDEF", "policyName": "My New Policy" } ``` -------------------------------- ### Policy Creator Source: https://integrations.expensify.com/Integration-Server/doc/index.html Creates a new policy within Expensify. Requires credentials and specifies the policy name. Supports optional plan selection. ```APIDOC ## POST /Integration-Server/ExpensifyIntegrations ### Description Creates a new policy in Expensify. ### Method POST ### Endpoint https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations ### Parameters #### Request Body - **type** (string) - Required - Specifies the job type as "create". - **credentials** (object) - Required - Contains user authentication details. - **partnerUserID** (string) - Required - Your partner user ID. - **partnerUserSecret** (string) - Required - Your partner user secret. - **inputSettings** (object) - Required - Settings for the creation job. - **type** (string) - Required - Must be "policy". - **policyName** (string) - Required - The name for the new policy. - **plan** (string) - Optional - The plan type for the policy. Valid values: "team", "corporate". Defaults to "team" if not specified. ### Request Example ```json { "type": "create", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "policy", "policyName": "My New Policy" } } ``` ### Response #### Success Response (200) - **responseCode** (integer) - Indicates success. - **policyID** (string) - The ID of the newly created policy. - **policyName** (string) - The name of the created policy. #### Response Example ```json { "responseCode": 200, "policyID": "0123456789ABCDEF", "policyName": "My New Policy" } ``` #### Error Response - **responseMessage** (string) - Description of the error. - **responseCode** (integer) - Indicates an error occurred. #### Error Example ```json { "responseMessage": "Required parameter 'policyName' is missing", "responseCode": 500 } ``` ``` -------------------------------- ### Policy Getter Source: https://integrations.expensify.com/Integration-Server/doc/index.html Retrieves detailed information for specified Expensify policies. You can select which fields (e.g., 'categories', 'reportFields', 'tax') to include in the response. ```APIDOC ## POST /Integration-Server/ExpensifyIntegrations ### Description Retrieves specific information about listed Expensify policies. You can specify which fields of the policy to gather information for. ### Method POST ### Endpoint https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations ### Parameters #### Request Body - **type** (string) - Required - Specifies to the job that it has to get information specific to policies. Must be "policy". - **credentials** (object) - Required - Contains user authentication details. - **partnerUserID** (string) - Required - The User ID for authentication. - **partnerUserSecret** (string) - Required - The User Secret for authentication. - **inputSettings** (object) - Required - Contains settings for the policy retrieval job. - **type** (string) - Required - Must be "policy". - **policyIDList** (JSON Array) - Required - The IDs of the policies to get information for. - **fields** (JSON Array) - Optional - Specifies the fields of the policy to gather information for. Valid values include: "categories", "reportFields", "tags", "tax", "employees". - **userEmail** (string) - Optional - The email of the user associated with the policy. ### Request Example ```json { "type": "get", "credentials": { "partnerUserID": "_REPLACE_", "partnerUserSecret": "_REPLACE_" }, "inputSettings": { "type": "policy", "fields": ["tax"], "policyIDList": ["0123456789ABCDEF", "DEADBEEF01234567", "BA5EBA11BA5EBA11"], "userEmail": "employee@youraccessibledomain.com" } } ``` ### Response #### Success Response (200) - **responseCode** (integer) - Indicates a successful request. Should be 200. - **policyInfo** (object) - Contains information for the requested policies. - Keys are policy IDs (string). - Values are objects containing policy details like `reportFields`, `categories`, `tags`, `tax`, `employees`. #### Response Example ```json { "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 } ], "tags": [ { "glCode": "", "name": "Enterprise", "enabled": true } ], "tax": { "default": "4", "rates": [ { "rate": 0, "name": "EC Goods Zero-rated", "rateID": "5" } ], "name": "Tax" } } } } ``` #### Error Response (410) - **responseCode** (integer) - Indicates an error. Typically 410 for missing parameters. - **responseMessage** (string) - A message describing the error. #### Error Response Example ```json { "responseMessage": "Required parameter 'policyIDList' is missing", "responseCode": 410 } ``` ``` -------------------------------- ### Successful Domain Card List Response Source: https://integrations.expensify.com/Integration-Server/doc/index.html A successful response returns a `responseCode` of 200 and a `domainCardList` array with details for each card. ```json { "domainCardList": [ { "bank": "citibank.com", "cardID": 5312342, "cardName": "John Doe - 1979", "cardNumber": "1234XXXXXXXX1979", "created": "2018-01-01 12:34:56", "email": "john.doe@domain.com", "externalEmployeeID": "1234567", "lastImport": "2018-07-03 23:45:01", "lastImportResult": 200, "reimbursable": false, "scrapeMinDate": "" }, { "bank": "gl1025", "cardID": 6234183, "cardName": "Corporate card", "cardNumber": "2345XXXXXXXX6789", "created": "2018-06-01 00:11:22", "email": "employee@domain.tld", "externalEmployeeID": "5678901", "lastImport": "", "lastImportResult": 200, "reimbursable": false, "scrapeMinDate": "2018-01-01 12:00:00" } ], "responseCode": 200 } ```