Wocart
Wocart API

Driver Payments

Server

Create driver payment

POST
https://api.wocart.store
/api/driver-payments
X-API-Key (header)

Record a payment that settles delivered shipments of one driver. Each shipment has two parts to settle, once each: the cash the driver collected and the driver's fee.

  • cod_remittance — the driver hands over the cash: settles the cash part; the driver's pendingCash drops and totalPaid rises by the cash total.
  • fee_payment — the store pays the driver's fees: settles the fee part; the cash counters do not move.
  • net_settlement — both at once: the driver hands over the cash less the fees.

The amount is computed, never sent: the shipments' frozen codAmount and driverFee give sum(codAmount), sum(driverFee) or their difference. The payment, its lines and the driver's counters are one atomic write; a part already settled — even by a payment recorded at the same moment — refuses the whole payment.

createdBy and createdByName come from the authenticated user.

Create driver payment › Request Body

driverId
​string · minLength: 1 · required

The UUID of the driver receiving or making the payment

type
​string · enum · required

'cod_remittance' (the driver hands over the cash collected), 'fee_payment' (the store pays the driver's fees), or 'net_settlement' (both at once: the cash less the fees)

Enum values:
cod_remittance
fee_payment
net_settlement
shipmentIds
​string[] · minItems: 1 · maxItems: 500 · required

The driver's delivered shipments this payment settles

notes
​string

Internal notes about this payment record

Create driver payment › Responses

Payment recorded. Returns the new payment record.

success
​boolean · required
​DriverPayment · required
message
​string · required

List driver payment history

GET
https://api.wocart.store
/api/driver-payments/{driverId}
X-API-Key (header)

All payment records of a driver, newest first; an empty array when there are none or the driver does not exist.

List driver payment history › path Parameters

driverId
​string · required

UUID of the driver

UUID of the driver

List driver payment history › Responses

200

Payment history

success
​boolean · required
​DriverPayment[] · required

List shipments awaiting settlement

GET
https://api.wocart.store
/api/driver-payments/{driverId}/pending
X-API-Key (header)

The driver's delivered shipments with a part still to settle — the cash (codPaymentId null), the fee (feePaymentId null), or both — newest delivery first. Use it to prepare a payment.

List shipments awaiting settlement › path Parameters

driverId
​string · required

UUID of the driver

UUID of the driver

List shipments awaiting settlement › Responses

200

Shipments awaiting settlement (empty array when none)

success
​boolean · required
​PendingSettlement[] · required