Can we update an Order for which an Invoice has already been generated?

I need to generate Invoices in a draft state, and also periodically update them, based on an external system. The Square API requires that an Order be generated for each Invoice, which is fine, but there seems to be no documentation on how updating an Order affects an existing Invoice. If I add/remove list items from the Order, does the existing Invoice update automatically with it, or do I need to generate a new Invoice, or is it not even possible to update an Order with an existing Invoice? I am getting a vague 405 error trying to update the Order, but cannot tell why.

Probably a good thing to add to the Update documentation. Thanks

Currently once an order is associated to an invoice it can’t be updated. You will need to create a new order and invoice if you need to update the invoice. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team.

Also the error you should be getting if you try to update an order that is associated to an invoice is a 403:

{
    "errors": [
        {
            "code": "FORBIDDEN",
            "detail": "LineItems cannot be modified for orders owned by another application.",
            "field": "order.line_items",
            "category": "AUTHENTICATION_ERROR"
        }
    ]
}

I also have this scenario. I may be able to push to have the business processes changed to not generate the invoice/order until it’s time to publish, now that I am automating the process.

But if there was some indication in the docs for updating an invoice and/or order that an order cannot be updated once it is attached to an invoice, even if that invoice is still a draft, that would have saved me a few hours of work getting to this point.

:wave: We really appreciate you taking the time to share this feedback. I’ll be sure to share your request to the API product team. :slightly_smiling_face:

Thanks. We can work around this limitation for now, but it will prevent the development I planned for the future.

To clarify the scenario I hoped to set up in the future: currently we create an order in our internal systems, and take a deposit using Square. Later, we create an invoice in Square, list the deposit as a discount, and send the invoice to the customer to pay the remainder. I was hoping to clean up that process by creating the invoice in Square at the time we take the deposit, so the deposit could be listed as a payment on that invoice. While filling the order for the customer, there may be some small changes to individual line items, so we’d need the ability to update the order attached to the invoice and make another payment request.

Thanks for sharing the scenario you’re trying to solve for. I’m definitely going to pass this on to the team. :slightly_smiling_face: