FoxPost COD settlement — endpoints, storage, rights
The FoxPost endpoints, the client’s own credentials, the settlement table, invoice linking, the bulk query and permissions.
The FoxPost cash-on-delivery settlement is handled in the bank import module. It calls the foxpost library with the client's own FoxPost credentials, saves the result to a settlement table and links it to invoices (bank/foxpost model).
Endpoints
| Endpoint | Behaviour |
|---|---|
foxposttest | connection test (number of rows in the last 7 days) |
foxpostfetch | fetch the COD settlement for a period, save it and link invoices |
foxpostcsv | CSV import; the library's normaliser processes the file |
foxpostaccount, foxpostaccountsave | load and save the client's FoxPost account; saving also assigns the Drive “foxpost” company folder (system/emailtask::addCompanyFolder) |
foxpostqueryall | runs for every active FoxPost account in scope (or the filtered client); summary and failure reasons — called by the invoice list's “FoxPost query” button |
Data model
Table names carry the installation's own prefix in the database: foxpost (client account: API key or basic user), cod_settlement (settlement rows with invoice link). A global setting can be used if the client has no account.
Checks
- Client > 0 and within content scope (
getAllowedCompanyIds); library configured (error_fox_not_configured); dates or CSV required (error_fox_input,error_fox_csv); for the bulk query without accountserror_fox_no_accounts. - Step B of the recognition engine uses the FoxPost settlement for suggestions (“collected − fee = transfer”).
Permissions
- The FoxPost endpoints check the
bank/bankimport::runkey together with coremodify;foxposttestandfoxpostaccountcheck only the function right. - The invoice list's “FoxPost query” button also shows on the
bank/bankimport::runkey (the controller never checksfinance/invoice::run).