acuamitca.com logo ACUAMITCA
~/blog/article

Creating Sales Invoices in Acumatica via API

Acumatica ERP 11 mins read August 25, 2026
 

The Acumatica contract-based REST API provides comprehensive capabilities for creating and managing sales invoices programmatically. Whether you're automating billing workflows, integrating with a point-of-sale system, or processing orders from an e-commerce platform, the API enables seamless invoice creation with full control over line items, tax details, and applications.

⚡ Key Insight: The SalesInvoice entity is mapped to the Invoices (SO303000) form and supports creation and update operations through the PUT method with $expand parameters for including details and applications.


Understanding the SalesInvoice Entity

The SalesInvoice entity is the primary endpoint for creating and managing sales invoices via the Acumatica REST API. It corresponds to the Invoices (SO303000) form and supports a wide range of fields and nested objects.

The key components of a SalesInvoice entity include:

  • Invoice Header: Customer ID, Type, Date, Hold status
  • Details: Line items with InventoryID, Quantity, Unit Price, and UOM
  • Applications: Payment applications and credit memos
  • Addresses: Bill-to and ship-to address overrides

Creating a Sales Invoice from a Sales Order

You can create a sales invoice directly from a sales order by specifying the order details in the invoice request.

Request Example

PUT /entity/Default/25.200.001/SalesInvoice?$expand=Details HTTP/1.1
Host: https://my.acumatica.com/MyInstance
Accept: application/json
Content-Type: application/json
{
    "CustomerID": { "value": "CAKEADO" },
    "Type": { "value": "Invoice" },
    "Hold": { "value": false },
    "Details": [
        {
            "OrderType": { "value": "SO" },
            "OrderNbr": { "value": "000066" },
            "OrderLineNbr": { "value": 1 },
            "Branch": { "value": "RETAIL" },
            "InventoryID": { "value": "APJAM08" },
            "Qty": { "value": 1 },
            "UOM": { "value": "PIECE" }
        }
    ]
}

💡 Pro Tip: To include an item from a line of a sales order in a sales invoice, you need to specify OrderType, OrderNbr, and OrderLineNbr for the corresponding detail line of the sales invoice.


Creating a Direct Sales Invoice

Direct sales invoices are invoices for which neither a sales order nor a shipment has been created. This is a typical scenario for integration with point-of-sale (POS) systems or when creating invoices for services.

Request Example

PUT /entity/Default/24.200.001/SalesInvoice?$expand=ApplicationsInvoice,Details HTTP/1.1
Host: https://my.acumatica.com/MyInstance
Accept: application/json
Content-Type: application/json
{
    "CustomerID": { "value": "FRUITICO" },
    "Type": { "value": "Invoice" },
    "Hold": { "value": false },
    "BillToAddressOverride": { "value": true },
    "BillToAddress": {
        "AddressLine1": { "value": "123 Fillmore Str" },
        "City": { "value": "San Francisco" },
        "Country": { "value": "CA" }
    },
    "Details": [
        {
            "Branch": { "value": "HEADOFFICE" },
            "InventoryID": { "value": "CHERJAM32" },
            "Qty": { "value": 1 },
            "UOM": { "value": "PIECE" }
        },
        {
            "Branch": { "value": "HEADOFFICE" },
            "InventoryID": { "value": "ADVERT" },
            "Qty": { "value": 1000 },
            "UOM": { "value": "DAY" }
        }
    ],
    "ApplicationsInvoice": [
        {
            "DocType": { "value": "Payment" },
            "DocNbr": { "value": "000076" },
            "AppliedToOrderAmt": { "value": 1235.27 }
        }
    ]
}

⚠️ Important: Direct sales invoices are only available in Acumatica versions 24.200.001 and later. For earlier versions, consider using the Sales Order to create and release the Invoice.


Creating Invoices from Shipments

You can prepare a sales invoice directly from a confirmed shipment using the PrepareInvoice action. This is the most efficient way to create invoices for fulfilled orders.

POST /entity/Default/25.200.001/Shipment/PrepareInvoice HTTP/1.1
Host: https://my.acumatica.com/MyInstance
Accept: application/json
Content-Type: application/json
{
    "entity": {
        "ShipmentNbr": { "value": "000067" }
    }
}

If the shipment is outgoing, the system generates a sales invoice of the Invoice type. If it's a return (incoming shipment), it generates a Credit Memo.


Releasing Invoices

After creating an invoice, you can release it using the ReleaseInvoice action. This is a long-running operation that finalizes the invoice in the system.

Request Example

POST /entity/Default/25.200.001/Invoice/ReleaseInvoice HTTP/1.1
Host: https://my.acumatica.com/MyInstance
Accept: application/json
Content-Type: application/json
{
    "entity": {
        "id": "8beb2af9-fa58-ec11-9e16-9828a61840c3"
    }
}

💡 Pro Tip: To release an invoice, you need to provide the RefNoteID value of the invoice in the id field of the request body. This ID can be obtained from the database or by retrieving the invoice through the API.


Managing Invoice Lifecycle

Invoice Statuses

  • Hold: Invoice is on hold and cannot be released
  • Balanced: Invoice is ready for release
  • Released: Invoice has been finalized in the system
  • Closed: Invoice has been fully paid

Handling Invoice Holds

To place an invoice on hold during creation, set the Hold field to true. This prevents accidental release until the invoice is reviewed.

{
    "CustomerID": { "value": "FRUITICO" },
    "Type": { "value": "Invoice" },
    "Hold": { "value": true }
}

Best Practices

✅ Use Proper ReturnBehavior

Set ReturnBehavior = ReturnBehavior.OnlySpecified to limit fields returned and improve performance.

✅ Handle Long-Running Operations

The ReleaseInvoice action is a long-running operation. Monitor its status using the appropriate methods.

✅ Validate Before Creation

Ensure all required fields (CustomerID, Type, Details) are provided before making the API call.

✅ Use Proper Error Handling

Implement proper error handling and retry logic for failed API calls, especially for the ReleaseInvoice action.


Common API Endpoints Summary

Operation Method Endpoint
Create Invoice from Sales Order PUT /SalesInvoice
Create Direct Sales Invoice PUT /SalesInvoice
Prepare Invoice from Shipment POST /Shipment/PrepareInvoice
Release Invoice POST /Invoice/ReleaseInvoice

Conclusion

The Acumatica contract-based REST API provides flexible, powerful capabilities for creating and managing sales invoices programmatically. Whether you're automating billing workflows, integrating with a POS system, or processing orders from an e-commerce platform, the API supports:

  • Creating invoices from sales orders with line item details
  • Creating direct sales invoices for POS and other integrations
  • Preparing invoices from confirmed shipments
  • Releasing invoices with long-running operations
  • Managing invoice holds and statuses

📌 Key Takeaway: The SalesInvoice entity is your primary gateway for programmatic billing in Acumatica. By leveraging the PUT method with $expand parameters, you can create complex invoices with all necessary details in a single API call.

🔍 Further Reading: Review the Acumatica Developer Network (ADN) for detailed endpoint documentation and additional examples. Consider extending the default endpoint when you need custom fields or actions in your API workflows.