Skip to main content

🤖 Analyze Transaction

Introduction​

This API allows users to send information via a POST request, and n8n will automatically generate an invoice based on that information. The API processes the content and returns an analysis based on the provided model.

Analyze Transaction​

Endpoint​

Use the following endpoint to submit the content for invoice generation:

POST https://n8n.lchatai.com/execute/analyze-transaction

Headers​

The API requires the following headers:

  • X-N8N-API-KEY - Your n8n API key for authentication
  • Content-Type: multipart/form-data

Request Parameters​

The API expects the following parameters as multipart/form-data fields:

  • model (string) - The AI model to use. Accepted values:

    ProviderModels
    OpenAIgpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-5.2, gpt-5.2-pro, gpt-5, gpt-5-mini, gpt-5-nano
    Geminigemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-lite, gemini-3-flash-preview, gemini-3.1-pro-preview
    Claudeclaude-sonnet-4-6, claude-opus-4-6, claude-opus-4-5-20251101, claude-haiku-4-5-20251001, claude-sonnet-4-5-20250929, claude-opus-4-1-20250805, claude-opus-4-20250514, claude-sonnet-4-20250514
  • prompt (string) - The specific prompt to provide for the invoice generation.

  • llmKey (string) - Your API key for the selected model.

  • content (string) - The information used to generate the invoice as plain text. Leave empty ("") when uploading a file via the file field.

  • file (file) - A PDF or document file to use as the basis for invoice generation. Leave empty ("") when using the content field.

warning

Exactly one of content or file must be provided per request. If you are sending text, pass file="". If you are uploading a file, pass content="".

Example Request​

Text Content

curl --location 'https://n8n.lchatai.com/execute/analyze-transaction' \
--header 'X-N8N-API-KEY: ey*********' \
--form 'model="gpt-4o-mini"' \
--form 'prompt="..."' \
--form 'content="Invoice information text here..."' \
--form 'llmKey="sk-proj-ERa23*******"' \
--form 'file=""'

File Upload

curl --location 'https://n8n.lchatai.com/execute/analyze-transaction' \
--header 'X-N8N-API-KEY: ey*********' \
--form 'model="gpt-4o-mini"' \
--form 'prompt="..."' \
--form 'content=""' \
--form 'llmKey="sk-proj-ERa23*******"' \
--form 'file=@"/path/to/invoice.pdf"'

Response​

The response body contains the following two keys:

  • response (string): The result of the invoice generation, which provides the generated invoice based on the provided information.
  • execution_id (integer): A unique identifier for the specific execution of the invoice generation workflow.
{
"response": ".....",
"execution_id": 778
}