Invoices API
See the Invoices guide for a full walkthrough. This page covers the API endpoints.
Create an Invoice
POST /v1/invoices
| Parameter | Type | Description |
|---|---|---|
customer required | string | Customer to invoice. |
auto_advance | boolean | If false, stays as draft. Default: true. |
collection_method | string | charge_automatically or send_invoice. |
days_until_due | integer | Days until the invoice is due (for send_invoice). |
description | string | Description shown on the invoice. |
curl https://api.meridian.dev/v1/invoices \
-u sk_test_4eC39HqL...: \
-d customer=cus_Nk3mHXq7ViGwMz \
-d auto_advance=false \
-d collection_method=send_invoice \
-d days_until_due=30
Finalize an Invoice
POST /v1/invoices/:id/finalize
Moves a draft invoice to open. No further line items can be added.
curl -X POST https://api.meridian.dev/v1/invoices/in_InvoiceId/finalize \
-u sk_test_4eC39HqL...:
Send an Invoice
POST /v1/invoices/:id/send
Sends the invoice email to the customer with a hosted payment link.
Pay an Invoice
POST /v1/invoices/:id/pay
Attempts to pay the invoice immediately, or marks it paid out-of-band:
curl -X POST https://api.meridian.dev/v1/invoices/in_InvoiceId/pay \
-u sk_test_4eC39HqL...: \
-d paid_out_of_band=true
Void an Invoice
POST /v1/invoices/:id/void
Marks an open invoice as void. Irreversible.
Retrieve an Invoice
GET /v1/invoices/:id
List all Invoices
GET /v1/invoices
Filter by customer, status, subscription, or created date range.
Upcoming Invoice
GET /v1/invoices/upcoming
Preview the next invoice for a customer or subscription before it is generated.
curl "https://api.meridian.dev/v1/invoices/upcoming?customer=cus_Nk3mHXq7ViGwMz" \
-u sk_test_4eC39HqL...: