API User Guide

What are invoices?

Invoices are official documents that record a transaction between a service provider and a customer. They include details such as:

  • Services or products delivered
  • Quantity and pricing
  • Total cost and payment terms
  • They serve as a formal request for payment from the customer.

    How are invoices created?

    Currently, invoices are generated from multiple sources

    📋 Work order: Once a technician finishes a work order with parts and labor, an invoice is automatically created.

    📋 Contract: When a preventive or corrective contract is set up with parts, invoices will be automatically generated based on the recurrence schedule

    📋 Manual: The customer can create invoice manually via the Portal

    When do we need to change an invoice status via API?

    When importing invoices from Wello into your ERP system, you can use the Wello API to retrieve all invoices that have not yet been imported — typically those with the status "Ready for ERP". For each retrieved invoice, attempt to import it into your ERP system.

    ✅ If the import is successful, update the invoice with the ERP invoice number and change its status to "ERP Imported".

    ❌ If the import fails, update the status to "ERP Error" and include an error message to explain why the import failed. Once the issue is verified and resolved, change the status to "Ready for ERP" to trigger a re-send.

    The invoice lifecycle is managed through its status. By referring to this lifecycle, you can determine which statuses an invoice can transition to at each stage

    How can we change an invoice status via API?

    Endpoint:

    HTTP POST : api/Invoice/ChangeStatusId

    Request body:

    Params:

    • invoice_id: The id of invoice that need to switch status (mandatory)
    • target_status_id: The target status (mandatory)
    • erp_invoice_number: ERP invoice number (only required when the target status is 'ERP Imported')
    • error_message: Error message (only required when the target status is 'ERP Error')

    Sample 1: Change status invoice to 'Ready for ERP'

    
        {
        "invoice_id":"2044B92D-6F7D-460E-AEDA-00E69B68BAC7",
        "target_status_id":"284B65D7-D5C8-419F-91D5-10A2F5132BAB"
        }
    

    Sample 2: Change status invoice to 'ERP Imported'

    
        {
        "invoice_id":"2044B92D-6F7D-460E-AEDA-00E69B68BAC7",
        "target_status_id":"AE838A69-AEA7-4F31-ABDD-EAFC577DDC5C",
        "erp_invoice_number":"INV2025-001"
        }
    

    Sample 3: Change status invoice to 'ERP Error'

    
        {
        "invoice_id":"2044B92D-6F7D-460E-AEDA-00E69B68BAC7",
        "target_status_id":"B47EB12C-8F28-4CDE-B8F8-32428F4BEC03",
        "error_message":"Account is blocked in ERP"
        }