Skip to main content
PUT
Create or replace an accounting mapping

Authorizations

X-API-Key
string
header
required

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.

Pattern: ^le_[a-zA-Z0-9]+$

Body

application/json

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.

source
AccountingMappingSource · object
required

What a mapping keys on.

dimensionKey
string
required

The dimension to code, a key from GET /v2/accounting/dimensions that is enabled and mappable on the connection.

Required string length: 1 - 255
Example:

"account"

connectionId
string

The connection to write to. Optional when the legal entity has exactly one connection; required when it has several.

Example:

"accounting_connection_2rj4l7hmrrrcv"

valueId
string

An enabled value of that dimension, from GET /v2/accounting/dimensions/{dimensionKey}/values. Not accepted for custom-field dimensions.

Required string length: 1 - 255
Example:

"accounting_account_2rj4l7hmrrrcv"

customFieldValue

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.

Required string length: 1 - 255
applyToExistingEntries
boolean
default:false

Also 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.

id
string
required

Mapping id with the accounting_mapping_ prefix.

Example:

"accounting_mapping_2rj4l7hmrrrcv"

connectionId
string
required

The connection the mapping belongs to.

Example:

"accounting_connection_2rj4l7hmrrrcv"

source
AccountingMappingSource · object
required

What a mapping keys on.

dimensionKey
string
required

The dimension this mapping codes, a key from GET /v2/accounting/dimensions.

Example:

"account"

createdAt
string<date-time>
required
valueId
string

The dimension value applied, from GET /v2/accounting/dimensions/{dimensionKey}/values. Absent on custom-field mappings, which carry customFieldValue instead.

Example:

"accounting_account_2rj4l7hmrrrcv"

customFieldValue

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.

createdBy
enum<string>

user for mappings written by people or the API, ai for mappings the accounting intelligence agent proposed and applied.

Available options:
user,
ai