This API endpoint allows you to update an invoice. You can update the general ledger ID, approval status, and paid status.

When setting approved to true, the invoice will be marked as approved with the current timestamp and user. When setting approved to false, the approval information will be cleared.

The paid status can be toggled between true and false to reflect payment status.

Note: Invoices that are already paid or approved may have restrictions on what fields can be updated.

Supported Formats

json

Errors

Code Description
404 Not found.
400 Invalid request.
500 Server crashed.

Examples

# Update all fields in a single request
curl "https://app.octopi.co/api/v1/invoices/353388.json" -X PUT -d '{ "invoice": { "general_ledger_id": "C8191", "approved": true, "paid": true } }' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
# Update only specific fields as needed
curl "https://app.octopi.co/api/v1/invoices/353388.json" -X PUT -d '{ "invoice": { "approved": true } }' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{
   "invoice" : {
      "id" : "222",
      "number": "5",
      "general_ledger_id": "1231",
      "created_at": "2016-11-28T19:01:41.936-05:00",
      "invoiced_at": "2016-11-28T19:01:41.936-05:00",
      "approved": true,
      "approved_at": "2016-11-28T19:05:41.936-05:00",
      "approved_by": "Admin User",
      "paid": true,
      "total": 1231.00
   }
}

Params

Param name Description
id
required

Validations:

  • Must be a String

invoice
required

Validations:

  • Must be a Hash

invoice[general_ledger_id]
optional

The general ledger ID for the invoice

Validations:

  • Must be a String

invoice[approved]
optional

Set to true to approve the invoice, false to unapprove it

Validations:

  • Must be one of: true, false, 1, 0.

invoice[paid]
optional

Set to true to mark the invoice as paid, false to mark as unpaid

Validations:

  • Must be one of: true, false, 1, 0.