Create or replace an accounting mapping

Changed on

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.

put/v2/accounting/mappings

Request

  • Base URL
    https://api.slash.com
  • URL
    https://api.slash.com/v2/accounting/mappings
  • Auth
    API key in header X-API-Key

Request body

connectionIdstring

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

dimensionKeystring required

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

valueIdstring

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

applyToExistingEntriesboolean

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.

Example request

{
  "connectionId": "accounting_connection_2rj4l7hmrrrcv",
  "source": {
    "id": "c_2rj4l7hmrrrcv"
  },
  "dimensionKey": "account",
  "valueId": "accounting_account_2rj4l7hmrrrcv"
}

Response

The mapping as stored.

idstring required

Mapping id with the accounting_mapping_ prefix.

connectionIdstring required

The connection the mapping belongs to.

dimensionKeystring required

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

valueIdstring

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

createdBy'user' | 'ai'

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

createdAtstring date-time required

Example response

{
  "id": "accounting_mapping_2rj4l7hmrrrcv",
  "connectionId": "accounting_connection_2rj4l7hmrrrcv",
  "source": {
    "id": "c_2rj4l7hmrrrcv"
  },
  "dimensionKey": "account",
  "valueId": "accounting_account_2rj4l7hmrrrcv"
}

Changes