Skip to main content

AP Configuration

Read, validate and save the Accounts Payable configuration: bill sources, legal entities, the NetSuite references used on posting, and PO-required kinds.

The AP configuration says where bills come from and how they map onto NetSuite records. Every key is optional; defaults read the Money Found bindings of the workspace. GET /v1/ap/config returns the saved configuration, or an empty one with saved: false when none is saved. PUT /v1/ap/config replaces the stored configuration with the one in the body. The write needs the write scope and a key whose person is a member or above.

The configuration is validated on every write: bill_sources must name Money Found roles, entities and NetSuite references need id and name, and default_terms_days is 0 to 365. A rejected configuration returns 400 and stores nothing. With dry_run: true the configuration is only checked, the response has saved: false, and the stored configuration is unchanged. Run a dry run first whenever the configuration is generated by a script.

GET/v1/ap/config

Response fields

configobjectThe configuration; see the body fields of PUT.
savedbooleanFalse when no configuration is stored.
updated_atdatetime | nullWhen it was last saved.
PUT/v1/ap/config

Body fields

config*objectThe configuration.
dry_runbooleanCheck the configuration without saving it.

config fields (all optional)

bill_sources[]arrayWhere bills come from: role (a Money Found role), kinds, exclude_kinds, and map (bill field to the role's field). The default is the ap_invoices role without purchase orders.
contract_registerobject | nullA reference table giving entity and cost centre per contract: reference_data_id and columns { contract_id, entity, cost_centre }.
entitiesobjectLegal entities by code: name, system (the system of record shown on the bill, for example NetSuite), netsuite_subsidiary and netsuite_class as { id, name }.
netsuiteobjectaccount (sandbox label), ap_account, currencies (ISO code to NetSuite currency id), terms (by net days), accounts_by_kind, default_account, tax_account, departments (by cost centre), vendors (by normalized vendor name) and item_lines.
po_required_kindsstring[]Kinds that must carry a PO number; a bill of one without it is held.
default_terms_daysintegerPayment terms in days when a bill states none, 0 to 365.

cURL: Check a configuration without saving

curl -X PUT "https://api.talonic.com/v1/ap/config" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dry_run": true,
    "config": {
      "entities": {
        "US01": { "name": "Acme Inc.", "system": "NetSuite", "netsuite_subsidiary": { "id": "3", "name": "Acme Inc." } }
      },
      "netsuite": {
        "account": "SANDBOX-1",
        "ap_account": { "id": "210", "name": "Accounts Payable" },
        "default_account": { "id": "540", "name": "Operating expenses" }
      },
      "po_required_kinds": ["freight"],
      "default_terms_days": 30
    }
  }'

Response: Checked, not saved

{ "config": { "entities": { "US01": { "name": "Acme Inc.", "system": "NetSuite" } }, "default_terms_days": 30 }, "saved": false }
A bill whose entity is not configured as a NetSuite subsidiary has netsuite: null and is skipped by the preview and the export when entities is configured at all. When netsuite.vendors is set, a bill whose vendor has no record there is held as vendor_unknown.

Frequently asked questions

Does PUT merge with the stored configuration?+
No. The whole configuration replaces the stored one. To change one key, read the configuration with GET, change it, and send the whole object back.
What does dry_run do?+
It validates the configuration exactly as a save would and returns it with saved set to false. Nothing is stored. A configuration that fails validation returns 400 whether or not dry_run is set.
Why is a role in bill_sources rejected?+
Each source must name a Money Found role, because bills are read through the binding that the workspace's Money Found configuration holds for that role. Use a role that the workspace has bound there.