Submit Payment
POST ?action=submit_payment
Records a payment against a work order. Only valid for orders in pending_payment status. Moves the order to payment_submitted regardless of whether the payment is full or partial — admin reviews all payments and resets to pending_payment if a balance remains.
Authentication
Two auth modes are accepted. Provide one:
- confirmation_token — string — Token returned by create_work_order.
- reference_code + customer_email — The order reference code and the customer email on the order.
Request Parameters
confirmation_token — string — Optional*. Confirmation token from create_work_order.
reference_code — string — Optional*. Work order reference code.
customer_email — string — Optional*. Required when using reference_code auth.
payment_transaction_id — string — Optional. Your transaction or order ID.
customer_note — string — Optional. Note from the customer.
amount — float — Optional. Amount being paid. When omitted, the order is moved to payment_submitted with no amount recorded (legacy behaviour). When provided, the amount is added to any previous payments and a payment history entry is created.
Response Fields
work_order_id — integer — Work order ID
reference_code — string — Work order reference code
status — string — Always payment_submitted
fully_paid — boolean — Whether total received meets or exceeds the order total
amount_paid — float — Cumulative total paid (only present when amount was provided)
balance_due — float — Remaining balance (only present when amount was provided)
Example
curl -X POST "https://YOUR_DOMAIN/api/api.php?action=submit_payment" \
-H "X-Panelr-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"confirmation_token": "abc123def456...",
"payment_transaction_id": "wc_order_abc123",
"amount": 9.99
}'