draft_status = 0 to issue a draft invoice — this assigns the official sequential invoice number and posts the invoice's payment journal entries. Use draft_status = 1 to move an issued invoice back to draft, which removes those payment journal entries.draft_status | Meaning |
|---|---|
| 0 | Issue the invoice (remove draft) |
| 1 | Set the invoice as draft |
400 when the change is not allowed — for example the invoice is already issued, it has completed payments (so it cannot be set back to draft), it has been refunded, or its date falls within a closed financial period.curl --location --globoff 'https://.daftra.com/api2/invoices/update_draft/2415/0.json' \
--header 'apikey: baa3e66560674148edc355ebac3d4aadd310eb0f' \
--header 'apikey: ' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data ''{
"result": "successful",
"code": 200,
"message": ""
}