POST
/
invoices
/
{invoice}
/
pay
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

Response

200
application/json

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.