Purchase orders
Read the legacy template type setting
/a/PurchaseOrders_templateTypeGet
Read the account-level po-type setting without generating an order document.
When to use this endpoint
Use to inspect the legacy account setting. Current order PDF generation uses the header’s selected type-5 form through PurchaseOrder_getPdf; this getter is not that renderer.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session requests use dispatcher CSRF protection when configured. API keys use their owner’s identity.
Purchase Order View is required on the singular or plural page. Records must be active and inside the configured TeamAccess or legacy Department Based Filter boundary; administrators are exempt from record restrictions. API-key requests use their owner’s identity. Related display names require the corresponding page View and record visibility.
Parameters
This endpoint has no operation-specific parameters.
Example request
$result = FM_api('PurchaseOrders_templateTypeGet');
Example response
"0"
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Returns settingGet’s value directly, not {ok,value}. Normal stored scalars are strings; unset/blank data falls back to a packaged setting file if one exists, otherwise empty string. Values beginning with a valid JSON object/array are decoded by the shared setting helper.
- Uses the authenticated tenant parent and the shared setting cache (normally up to 600 seconds). A matching settingSet invalidates the tenant cache. There is no order ID, field projection or paging.
- The value is opaque legacy configuration; this endpoint does not download a PDF or define a supported type-code allowlist.
Side effects
- Reads the setting and may populate its shared disk/in-process cache. It does not change an order, approval, template value or document history.
See it in Fieldmotion
CRM1
No direct CRM1 literal caller was found in the searched client source.
CRM2
No direct CRM2 literal caller was found in the searched client source.
Related endpoints
PurchaseOrder_getPdf— Render the current order document from its selected form.PurchaseOrder_setForm— Select the modern type-5 order form.