Skip to main content

Settle a pending payment from credit (InvoicePaid)

POST 

/orders/:id/settle

Attempts to pay the WHMCS invoice of a pending (pending_payment / payment_failed) order from the reseller's balance. Triggered when the customer pays the invoice in the reseller's WHMCS (InvoicePaid hook). If the balance was insufficient at order time, once the reseller later loads balance it is settled here → the VPS install is queued (pending_provision).

Idempotent: For an order that is already paid (payment_applied=true) WHMCS is not touched at all; the current state is returned with already_applied=true. Therefore the Idempotency-Key header is NOT REQUIRED.

Result states (status):

  • pending_provision — credit applied, VPS install pending
  • pending_payment — balance still insufficient (notice=insufficient_credit), can be retried
  • payment_failed — WHMCS temporary error (5xx); retry later

Isolation: Another reseller's order id returns 404 order_not_found.

Request

Responses

Result of the settlement attempt (success, insufficient, or already paid)