Create or replace an accounting mapping
Automatically code one dimension for everything from a source, such as a card or merchant. Replaces any existing mapping for the same source and dimension. Set applyToExistingEntries to also recode entries still in review. On platforms that keep account mappings per subsidiary, such as NetSuite, an account mapping for an account or accounts_payable source applies to the connection’s default subsidiary; every other mapping applies to the whole connection.
Authorizations
User API key authentication. Create a key under Settings → API keys in the Slash dashboard (https://app.slash.com/global-settings/api-keys) and send the x-legal-entity header naming the legal entity to act on with every request. Keys scoped to a legal entity are rejected with 403 user_api_key_required.
Headers
The legal entity to act on. Required on every request; a user API key can act on any legal entity its user has access to.
^le_[a-zA-Z0-9]+$Body
Create or replace the mapping of one source for one dimension. Exactly one of valueId (platform and generic dimensions) or customFieldValue (custom-field dimensions) is required.
What a mapping keys on.
The dimension to code, a key from GET /v2/accounting/dimensions that is enabled and mappable on the connection.
1 - 255"account"
The connection to write to. Optional when the legal entity has exactly one connection; required when it has several.
"accounting_connection_2rj4l7hmrrrcv"
An enabled value of that dimension, from GET /v2/accounting/dimensions/{dimensionKey}/values. Not accepted for custom-field dimensions.
1 - 255"accounting_account_2rj4l7hmrrrcv"
The value to set on a custom_field dimension, shaped by its fieldType: an option value for select, a non-empty list of option values for multiselect, otherwise a boolean, string or number. Not accepted for other dimensions.
1 - 255Also re-code existing entries whose transactions match the source, in the background. Only entries still in_review change; anything already synced or ready to sync is left alone. Has no effect on an accounts_payable mapping, which is read when a bill syncs. Defaults to false, which only affects entries created from now on.
Response
The mapping as stored.
A rule that codes one dimension automatically: whenever an entry's transaction involves the source, the entry gets the mapped value for dimensionKey. An account source codes the fixed, cash-side line of its transactions; every other source codes the editable lines, and accounts_payable sets the account bills are posted to when they sync. Sources are things you can already list through the API (accounts, cards, merchants, contacts, ...); the value is a dimension value id, or for custom-field dimensions the raw field value. One source maps each dimension at most once, so writing the same source and dimension again replaces the earlier mapping.
Mapping id with the accounting_mapping_ prefix.
"accounting_mapping_2rj4l7hmrrrcv"
The connection the mapping belongs to.
"accounting_connection_2rj4l7hmrrrcv"
What a mapping keys on.
The dimension this mapping codes, a key from GET /v2/accounting/dimensions.
"account"
The dimension value applied, from GET /v2/accounting/dimensions/{dimensionKey}/values. Absent on custom-field mappings, which carry customFieldValue instead.
"accounting_account_2rj4l7hmrrrcv"
The custom field value applied, present only when dimensionKey is a custom_field dimension. Its shape follows the field's fieldType: an option value for select, a list of option values for multiselect, otherwise a boolean, string or number.
user for mappings written by people or the API, ai for mappings the accounting intelligence agent proposed and applied.
user, ai