Invoices API

Create, retrieve, update, and manage invoices via the API.

When should I read this?

Read this if you need to programmatically manage invoices or integrate with accounting systems.

Endpoints

Method Endpoint Description
GET /v1/invoices List all invoices
POST /v1/invoices Create an invoice
GET /v1/invoices/:id Retrieve an invoice
PATCH /v1/invoices/:id Update a draft invoice
POST /v1/invoices/:id/finalize Finalize and send
POST /v1/invoices/:id/void Void an invoice

The Invoice object

{
  "id": "inv_abc123",
  "customer_id": "cus_abc123",
  "status": "posted",
  "number": "INV-0001",
  "amount_due": 9900,
  "amount_paid": 0,
  "currency": "usd",
  "due_date": "2024-02-15",
  "line_items": [
    {
      "description": "Pro Plan - Monthly",
      "quantity": 1,
      "unit_amount": 9900,
      "amount": 9900
    }
  ],
  "created_at": "2024-01-15T10:30:00Z"
}

[!NOTE] Amounts are in cents (9900 = $99.00)

Create an invoice

curl https://api.floatless.com/v1/invoices \
  -H "Authorization: Bearer fl_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_abc123",
    "line_items": [
      {
        "description": "Consulting services",
        "quantity": 5,
        "unit_amount": 15000
      }
    ]
  }'

Parameters

Parameter Type Required Description
customer_id string Yes Customer to invoice
line_items array Yes Items to bill
due_date string No Payment due date
metadata object No Custom key-value data

List invoices

curl https://api.floatless.com/v1/invoices \
  -H "Authorization: Bearer fl_live_..."

Query parameters

Parameter Type Description
customer_id string Filter by customer
status string Filter by status
limit integer Number of results
offset integer Pagination offset

Finalize an invoice

Finalize a draft invoice to send it to the customer:

curl https://api.floatless.com/v1/invoices/inv_abc123/finalize \
  -H "Authorization: Bearer fl_live_..." \
  -X POST

Void an invoice

Cancel an invoice that shouldn't be paid:

curl https://api.floatless.com/v1/invoices/inv_abc123/void \
  -H "Authorization: Bearer fl_live_..." \
  -X POST

Invoice statuses

Status Description
draft Being prepared
posted Sent to customer
paid Payment received
overdue Past due date
void Canceled

Next steps