Quick overview
This workflow receives a posted invoice XML file via webhook, parses it into JSON, and for each invoice searches and updates a matching GoHighLevel (LeadConnector) opportunity with invoiced amount, pipeline stage, and custom field values.
How it works
- Receives a POST request to an n8n webhook containing a binary invoice XML file.
- Extracts and decodes the XML content from the uploaded binary file.
- Converts the raw XML string into a structured JSON object.
- Iterates through each invoice record in the parsed payload.
- Calls the GoHighLevel (LeadConnector) Opportunities Search API to find an opportunity by order reference (configured as a test query).
- Updates the matched GoHighLevel opportunity with monetary value, pipeline and stage IDs, and custom fields such as invoiced amount and transaction date.
Setup
- Configure the source system (warehouse ERP or middleware) to POST the invoice XML file to the webhook URL for the
invoice-webhook path.
- Add your GoHighLevel (LeadConnector) Private Integration token and replace
YOUR_GHL_API_TOKEN in both HTTP requests.
- Replace
YOUR_GHL_LOCATION_ID, YOUR_GHL_PIPELINE_ID, YOUR_GHL_PIPELINE_STAGE_ID, and the three custom field IDs in the update request body.
- Update the opportunity search payload to use the real order reference from the parsed invoice instead of the placeholder
YOUR_TEST_ORDER_REF.
- Send a sample XML invoice to the webhook to verify parsing and updates, then activate the workflow.