POST /bms/ar-billing/setup¶
What it does¶
/bms/ar-billing/setup accepts POST and is declared in app/systems/BMS/ar-billing/api_routes.php:267 as a path.
The route handler delegates to bmsArBillingSaveSetup(). That function is the owner of
this behaviour; the route entry is only dispatch.
Call chain:
- →
bmsArBillingSaveSetup()—app/systems/BMS/ar-billing/setup_write_helper.php:317 - ↳
bmsArBillingNormalizeUuid()—app/systems/BMS/ar-billing/foundation_helper.php:53
Who calls it¶
Called from:
public/assets/js/modules/bms/billing-setup.js
A caller is the strongest available evidence of the intended use.
Input¶
No named input key is visible in the handler or its owner function. The endpoint
either takes no parameters or reads them through a shared helper in app/shared/api/.
Output¶
The response is produced by a shared helper, so the key set is not visible at the route. Read the owner function to confirm the shape before writing a client.
SQL executed¶
UPDATE T_BILLING_SETUP SET REVISION = ?, CONFIG_SCHEMA_VERSION = 4, CONFIG_JSON = ?, ACTIVE = 1 WHERE CLIENT_ID = ? AND TENANT_ID = UUID_TO_BIN(?) AND UUID = UUID_TO_BIN(?) AND REVISION = ? AND DELETED_AT IS NULL
SELECT HEX(UUID) AS UUID_HEX, REVISION FROM T_BILLING_SETUP WHERE CLIENT_ID = ? AND TENANT_ID = UUID_TO_BIN(?) AND BILLING_COMPANY_UUID = UUID_TO_BIN(?) AND DELETED_AT IS NULL
Data¶
Tables reached from the owner function:
T_BILLING_PACKAGE_RATE_REVISIONT_BILLING_SETUPT_BILLING_SETUP_HISTORY
Access¶
- module-gated on
bms.transaction, so tenant module access applies
Validation and failure messages¶
- Customer and expected revision are required.
- Billing customer is unavailable for this tenant.
- VERSION_CONFLICT
- INVOICE_GROUPING_NOT_CONFIGURED
These strings come from the owner function and are the messages a client can receive. They are also the cheapest way to tell a rejected request from a broken one.