Managing customer invoices
A customer invoice (inv_…) is what you bill your customer (shipper) for a shipment — the accounts-receivable side. This page covers creating invoices, adding line items and documents, and reading them back.
This is the AR (money in) side. For submitting carrier invoices (money out, AP), see Submitting carrier invoices via API. For the relationship between these objects, see Core concepts & data model.
Prerequisites
- An API key — see Authentication.
- A customer (
cus_…) and a shipment (shi_…) already synced to Upwell. See Syncing foundation entities.
Create an invoice
POST /api/rest/invoices creates a customer invoice. The invoice is tied to a shipment and a customer:
Fields
| Field | Required | Notes |
|---|---|---|
balance | Yes | Outstanding balance in integer cents. For a new invoice, equals totalAmount. NOT NULL with no server default — omitting it is a 400. |
customerId | Recommended | Links the invoice to a customer (cus_…). |
invoiceShipments | Recommended | Links the invoice to one or more shipments via a nested relation: { "data": [{ "shipmentId": "shi_…" }] }. |
number | Recommended | Your invoice number. |
totalAmount | Recommended | Invoice total in integer cents. $4,500.00 → 450000. |
currency | No | ISO code, defaults to USD. |
issueDate | Recommended | The date on the invoice (YYYY-MM-DD). |
dueDate | Recommended | Payment due date (YYYY-MM-DD). Drives aging and reminder scheduling. |
sourceSystem / sourceSystemId | Recommended | External key pair — unique per tenant. See Integration patterns. |
customerPoNumber, billOfLadingNumber | No | Reference numbers. |
status | No | See Invoice lifecycle for the full list. Defaults to CREATED for new invoices. |
Add line items
POST /api/rest/invoice_line_items adds a line item to an existing invoice:
| Field | Notes |
|---|---|
invoiceId | Required. The invoice this line item belongs to (inv_…). |
lineNumber | Line sequence (string). |
item | Short description (e.g. charge type). |
description | Longer description. |
quantity | Quantity (numeric). |
unitPrice | Per-unit price in integer cents. |
totalAmount | Line total in integer cents. |
sourceSystem / sourceSystemId | Your external key for this line item. |
PATCH /api/rest/invoice_line_items/{id}. Delete with DELETE /api/rest/invoice_line_items/{id}.
Attach documents to an invoice
Attach supporting documents (the invoice PDF, BOLs, PODs) to a customer invoice using the same presigned-upload flow as carrier invoices:Request a presigned URL
POST /api/rest/generate-upload-presigned-url with associationType: "INVOICE" and associationId set to the invoice ID.Alternatively,
POST /api/rest/invoices/{invoiceId}/documents accepts base64-encoded documents directly — convenient for smaller files. For large documents, the presigned-URL flow avoids payload size limits.Read invoices back
Search by source system
POST /api/rest/invoices/search finds invoices by their external key:
where filter (plus orderBy, limit, offset). The response includes nested invoiceLineItems so you can read the full invoice in one call.
List an invoice’s documents
Update an invoice
PUT /api/rest/invoices/{id} updates by Upwell ID. PUT /api/rest/invoices (without an ID) updates by sourceSystem + sourceSystemId in the body.
Invoice lifecycle
Invoices move through these statuses:| Status | Meaning |
|---|---|
CREATED | Invoice record exists but hasn’t been finalized. |
OPEN | Invoice is finalized and ready for delivery. |
APPROVED | Invoice has been approved for sending. |
PROCESSING | Invoice is being processed for delivery. |
SENT | Invoice has been delivered to the customer. |
DELIVERED | Invoice delivery has been confirmed. |
VIEWED | Customer has viewed the invoice (online portal). |
OVERDUE | Past due date with an outstanding balance. |
PART_PAID | Partially paid — balance is between 0 and totalAmount. |
PAID | Fully paid — balance is 0. |
DISPUTED | Customer has raised a dispute. |
PORTAL_EXCEPTION | The invoice hit an exception during portal delivery. |
PORTAL_RESOLVED | A portal exception has been resolved. |
REJECTED | Invoice was rejected. |
CANCELLED | Invoice was cancelled. |
WRITE_OFF | Written off as uncollectable. |
REFUNDED | A refund was issued. |
SEND_ERROR | Invoice delivery failed. |
Webhook events
Subscribe to invoice events in the Upwell dashboard to get notified of status changes:| Trigger | Fires when |
|---|---|
create.invoice | An invoice is created. |
update.invoice | Any field change on an invoice. |
update.invoice.status.SENT | The invoice was sent to the customer. |
update.invoice.status.PORTAL_EXCEPTION | The invoice hit an exception. |
What’s next
Customer payments
Record remittances applied to these invoices.
Statements & reminders
Automated follow-up on outstanding invoices.
Receivables management
The AR dashboard and reconciliation workflow.
Shipment documents
Attach supporting docs to shipments (shared with linked invoices).

