Skip to main content
POST
/
invoices
/
{invoice}
/
pay
Pay an invoice
curl --request POST \
  --url https://api.chargeapi.co/v1/invoices/{invoice}/pay \
  --header 'Content-Type: application/json' \
  --data '{
  "payment_method": "pm_1Nv9F6IJvEtkwdCNYmOCc123"
}'
{
  "id": null,
  "object": null,
  "amount_due": null,
  "amount_paid": null,
  "created": null,
  "currency": null,
  "due_date": null,
  "line_items": null,
  "paid_at": null,
  "period_end": null,
  "period_start": null,
  "status": null
}

Path Parameters

invoice
string
required

ID of the open invoice to pay.

Body

application/json
payment_method
string

Override the default payment method with a specific Payment Method ID.

Response

Returns the Invoice object with status updated to paid, amount_paid populated, and paid_at set to the payment timestamp. Raises an error if the invoice is already paid, void, or no default payment method is available.

id
string

Unique identifier for the invoice object.

Example:

null

object
string

String representing the object’s type. Always invoice.

Example:

null

amount_due
integer | null

Total amount due on the invoice, in the smallest currency unit (e.g., cents).

Example:

null

amount_paid
integer | null

Total amount paid toward the invoice.

Example:

null

created
integer

Time at which the invoice was created.

Example:

null

currency
string

ISO 4217 three-letter currency code (e.g., usd).

Example:

null

due_date
integer | null

Timestamp when the invoice is due.

Example:

null

line_items
object[] | null

Array of individual line items included in the invoice.

Example:

null

paid_at
integer | null

Timestamp when the invoice was fully paid, if applicable.

Example:

null

period_end
integer | null

End of the billing period this invoice covers.

Example:

null

period_start
integer | null

Start of the billing period this invoice covers.

Example:

null

status
enum<string> | null

Current status of the invoice.

Available options:
draft,
open,
paid,
overdue,
void
Example:

null