Skip to main content
PATCH
/
invoices
/
{id}
Update an invoice
curl --request PATCH \
  --url https://api.corebill.io/v1/invoices/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "sent",
  "notes": "Invoice sent to client via email"
}
'
{
  "data": {
    "id": "inv_m3n4o5p6q7r8",
    "invoice_number": "INV-2025-000001",
    "customer_id": "cus_a1b2c3d4e5f6",
    "status": "sent",
    "issue_date": "2025-04-01",
    "due_date": "2025-05-01",
    "total": 5220,
    "amount_paid": 0,
    "amount_due": 5220,
    "currency": "USD",
    "created_at": "2025-04-01T10:00:00.000Z",
    "subtotal": 5000,
    "discount_type": "percentage",
    "discount_value": 10,
    "discount_amount": 500,
    "subtotal_after_discount": 4500,
    "tax_rate": 16,
    "tax_amount": 720,
    "notes": "Net 30 payment terms",
    "payment_terms": "Net 30",
    "updated_at": "2025-04-01T10:05:00.000Z",
    "customer": {
      "id": "cus_a1b2c3d4e5f6",
      "name": "John Doe",
      "contact_email": "[email protected]"
    },
    "public_token": "1713182400000-k8x2m9p4q7w1",
    "items": [
      {
        "id": "di_y5z6a7b8c9d0",
        "item_name": "Web Development",
        "quantity": 40,
        "unit_price": 150,
        "subtotal": 6000,
        "total": 6000,
        "sort_order": 0,
        "description": "Full-stack web application development",
        "unit": "hour"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Generate keys from the Corebill dashboard under the Developers section.

Example: Authorization: Bearer sk_live_abc123def456

Path Parameters

id
string
required

The invoice ID

Query Parameters

company_id
string
required

The company ID to scope the request to

Body

application/json

Fields available for update depend on invoice status. Draft invoices allow all fields. Non-draft invoices only allow notes, payment_terms, and status.

customer_id
string

Customer ID (draft only)

Example:

"cus_a1b2c3d4e5f6"

issue_date
string<date>

Invoice issue date (draft only)

Example:

"2025-04-20"

due_date
string<date>

Payment due date (draft only)

Example:

"2025-05-20"

currency
string

Currency code (draft only)

Example:

"USD"

notes
string

Invoice notes visible to the customer

Example:

"Updated payment instructions"

payment_terms
string

Payment terms description

Example:

"Net 15"

status
enum<string>

Invoice status

Available options:
draft,
sent,
viewed,
in_review,
partial,
paid,
overdue,
cancelled
Example:

"sent"

subtotal
number<double>

Subtotal before discount (draft only)

Example:

5000

discount_type
enum<string>

Discount type (draft only)

Available options:
percentage,
fixed
Example:

"percentage"

discount_value
number

Discount value (draft only)

Example:

10

discount_amount
number<double>

Calculated discount amount (draft only)

Example:

500

subtotal_after_discount
number<double>

Subtotal minus discount (draft only)

Example:

4500

tax_rate
number

Tax rate as percentage (draft only)

Example:

16

tax_id
string

Tax identifier (draft only)

Example:

"VAT"

tax_amount
number<double>

Calculated tax amount (draft only)

Example:

720

total
number<double>

Final total (draft only). Updates amount_due automatically.

Example:

5220

Response

Invoice updated successfully

data
object
required

Full invoice object including items and public_token (returned by GET /invoices/{id} and POST /invoices)