Invoices

Update Invoice

Update a draft invoice. You can change status, dates, and line items. Non-draft invoices return a validation error.

POST
/invoices/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Path Parameters

id*string

Invoice ID

Match^inv_[A-Za-z0-9]{22}$

Request Body

application/json

status?string
Value in"draft" | "issued"
currency?string|null
issueDate?string|null
Formatdate-time
dueDate?string|null
Formatdate-time
lineItems?
deletedLineItemIds?array<string>

Line item IDs to delete (only valid for draft invoices).

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.getlumen.dev/v1/invoices/string" \  -H "Content-Type: application/json" \  -d '{    "status": "draft",    "lineItems": [      {        "description": "Extra seats",        "quantity": 5,        "unitAmountCents": 300,        "type": "per_unit"      }    ],    "deletedLineItemIds": [      "inv_item_old123"    ]  }'
{
  "id": "inv_c9MBd7QfJH5s2r4aLvXK",
  "customerInvoiceNumber": "LO4XGG-001",
  "customerId": "string",
  "subscriptionId": "string",
  "status": "draft",
  "totalAmountCents": 0,
  "subtotalCents": 0,
  "taxAmountCents": 0,
  "effectiveTaxRate": "0.0875",
  "taxJurisdiction": "string",
  "taxCalculationMethod": "auto",
  "currency": "USD",
  "dueDate": "2019-08-24T14:15:22Z",
  "issueDate": "2019-08-24T14:15:22Z",
  "paidDate": "2019-08-24T14:15:22Z",
  "billingPeriodStart": "2019-08-24T14:15:22Z",
  "billingPeriodEnd": "2019-08-24T14:15:22Z",
  "pdfUrl": "http://example.com",
  "hasPdf": true,
  "taxLineItemDescriptions": [
    "string"
  ],
  "notes": "string",
  "documentType": "standard",
  "originalInvoiceId": "string",
  "cancellationOrCreditReason": "string",
  "lineItems": [
    {
      "id": "string",
      "type": "string",
      "componentId": "string",
      "metricId": "string",
      "description": "string",
      "quantity": 0,
      "unitAmountCents": 0,
      "subtotalCents": 0,
      "taxMetadata": {},
      "billingPeriodStart": "2019-08-24T14:15:22Z",
      "billingPeriodEnd": "2019-08-24T14:15:22Z",
      "usagePeriodStart": "2019-08-24T14:15:22Z",
      "usagePeriodEnd": "2019-08-24T14:15:22Z",
      "prorationType": "string",
      "prorationPeriodStart": "2019-08-24T14:15:22Z",
      "prorationPeriodEnd": "2019-08-24T14:15:22Z",
      "discountCode": "string",
      "discountType": "string",
      "discountPercent": 0,
      "discountAppliedToComponents": [
        "string"
      ]
    }
  ],
  "adjustmentInvoices": [
    {
      "id": "string",
      "customerInvoiceNumber": "string",
      "documentType": "string",
      "totalAmountCents": 0,
      "currency": "string",
      "issueDate": "2019-08-24T14:15:22Z",
      "hasPdf": true
    }
  ],
  "paymentId": "string",
  "createdAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Cannot update non-draft invoice. Current status: issued"
}
{
  "error": "Invoice not found"
}
{
  "error": "Failed to fetch invoice"
}