I have a requirement to create many quotes via a batch process. It’s clear and I have done it for invoices with no issues but I notice that there is no PUT support in REST for quotes.
I have compared the database records for a quote and an invoice and as far as I can tell, the only difference is the field “invoice_type_id” which for invoice=1 and quote=2.
If there is no better way to do it, is it feasible to load to the system as invoices and then do a sql update direct on the field to set as a quote?
I’m hesitant for 3 reasons:
Strongly prefer not to update DB outside of the app
Uncertain if there any other reference records or control totals which would be made inconsistent
Invoice load always appear to create in status “SENT” and my preference would be “DRAFT”
I will be trying REST to see if that lets me address #3 but would appreciate any guidance overall.
Apologies… I have tried many times but the following snippet (Double quotes are there but hidden when I copied - the command runs without error) results in a perfectly formed invoice rather than quote. Can you spot my error?
curl -X POST http://192.168.0.53:8053/api/v1/invoices -H Content-Type:application/json -d ‘{client_id: 166, invoice_date: 2020-02-26, due_date: 2021-02-26, public_notes: Weekly lessons for Bill and Ted, invoice_type_id:2, invoice_items:[{product_key: SPN-30-G, qty:1}, {product_key: SPN-30-G, qty:1}]}’ -H X-Ninja-Token: vrmorcp0xtojgabzn7btoucy1jlpcxry