Automated Accounts Payable Processing via Docsumo and Xero (Make.com)

Streamline invoice extraction and bill creation using Make.com’s advanced data transformation and array handling.

Tools: DocsumoXero

Platform: Make.com

Short Answer

A fully automated workflow in Make.com that triggers upon document validation in Docsumo. It intelligently matches vendors, handles complex line items via iterators, creates a draft bill in Xero, and attaches the original document for audit compliance.

The Problem

Manual data entry of invoices into Xero is time-consuming and prone to human error, especially when dealing with multi-line item bills. Businesses struggle with backlogs and mismatched totals when processing high volumes of paper or PDF receipts.

The Outcome

A fully automated workflow in Make.com that triggers upon document validation in Docsumo. It intelligently matches vendors, handles complex line items via iterators, creates a draft bill in Xero, and attaches the original document for audit compliance.

Step-by-Step Guide

1. **Create Webhook in Make.com**: Add a 'Docsumo - Watch V2 Documents' module. Copy the unique Webhook URL provided. 2. **Configure Docsumo**: Log in to Docsumo, go to 'Settings > Integrations', and paste the Make.com Webhook URL under the 'Post Requests' section for the 'Validated' event. 3. **Extract Sample Data**: Run the Make scenario once and process a document in Docsumo to populate the data structure in Make. 4. **Search Xero Contact**: Add the 'Xero - List Contacts' module. Use a filter in the module settings to search by name: `Name = {{1.vendor_name}}`. 5. **Handle Vendor Logic**: Add a 'Router'. If the Xero contact search returns 0 results, add a 'Xero - Create a Contact' module. Otherwise, proceed to the next step. 6. **Iterate Line Items**: Docsumo sends items as an array. Add a 'Make - Iterator' module and map the `Line Items[]` array from Docsumo into it. This allows Xero to process each row individually. 7. **Transform Dates**: In the 'Xero - Create a Bill' module, use the `parseDate()` function to ensure Docsumo's date format (e.g., YYYY-MM-DD) matches Xero's requirements: `parseDate(1.date; "YYYY-MM-DD")`. 8. **Map Bill Fields**: In the 'Create a Bill' module, map 'Contact ID' from the previous search/create steps, and use the Iterator's output for the 'Line Items' fields (Description, Quantity, Unit Amount). 9. **Attach Original File**: Add 'Xero - Upload an Attachment' module. Use the 'Document ID' from the bill creation and the 'Original File URL' from Docsumo to link the source PDF to the Xero record. 10. **Error Handling**: Right-click the Xero Bill module and select 'Add error handler'. Use a 'Break' or 'Rollback' instruction to prevent partial data entry if the API connection drops.

Data Mapping

| Docsumo Field | Xero Target Field | Make.com Transformation/Note | | :--- | :--- | :--- | | `vendor_name` | Contact Name | Used in 'List Contacts' search query | | `invoice_number` | Reference | Required; use `trim()` to remove whitespace | | `date_of_issue` | Date | `parseDate(date; "YYYY-MM-DD")` | | `due_date` | Due Date | Optional; ensure it is a valid date object | | `currency` | Currency Code | e.g., 'USD' or 'GBP' (Standard ISO) | | `line_items[]` | Line Items (Array) | Use **Iterator** module to map sub-fields | | `tax_amount` | Tax Amount | Map to Xero Tax Type based on your Chart of Accounts | | `doc_url` | Attachment | Use 'Upload an Attachment' module after Bill creation |

Gotchas & Failure Modes

* **Array Mapping**: Do not attempt to map Docsumo line items directly to Xero without an Iterator; Make.com requires you to map the specific output of an Iterator to the Xero 'Line Items' collection. * **Rate Limiting**: Xero has a limit of 60 requests per minute. If processing bulk uploads, use a 'Sleep' module or set the scenario to 'Sequential' execution. * **Currency Mismatches**: If the currency extracted by Docsumo is not enabled in your Xero settings, the 'Create Bill' module will fail with a 400 error. * **Duplicate References**: Xero prevents duplicate Invoice Numbers for the same vendor. Ensure Docsumo extraction is accurate to avoid 409 Conflict errors.

Verification Checklist

- [ ] **Webhook Pulse**: Trigger the scenario and confirm the 'Watch V2 Documents' module receives the JSON bundle. - [ ] **Data Inspection**: Use the 'Download execution' feature in Make to verify that the Iterator is correctly splitting line items. - [ ] **Draft Check**: Confirm that a 'Draft' bill appears in Xero with the status 'Draft' (to avoid accidental bookkeeping before review). - [ ] **Attachment Audit**: Open the Bill in Xero and verify the 'Files' icon shows the original PDF from Docsumo. - [ ] **Error Path**: Manually change a date to an invalid format in a test run to ensure the Error Handler triggers correctly.

Ready to Automate?

Build this automation with Make.com in minutes.