PUT
Change an account mapping
Organization space Accounting module For: Accountant · Permission: account_mappings.update Conditions
  • The accounting module must be included in the plan of the organization.
  • In the organization space the caller needs an accounting access grant on the book named in the URL.
  • Mapping updates are switched off by configuration (account_mapping_updates_enabled is false by default): once the request passes validation, the change is refused as forbidden until it is enabled.
  • The record must belong to the selected book.
  • accounting_account_id is required and must be an account of the same book.
  • A role without a third-party type needs an account that can receive entries; a role with a third-party type (customer, vendor, location and similar) needs a grouping account that cannot receive entries.
What else happens
  • Postings made afterwards for this role use the new account. Entries already posted are not changed.
Part of Set up the books.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

accountMapping
string
required

Identifier of the book (the organization or one of its companies), 27-character KSUID. The generated path names this segment after the resource; the route parameter is the book. The caller needs an access grant on it.

account_mapping
string
required

Identifier of the account mapping (27-character KSUID). It must belong to the book in the URL.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, owner_type, role, auxiliary_type, accounting_account_id, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: account.

Body

application/json
accounting_account_id
string
required

Identifier of the account to map the role to. It must be an account of the same book, one that receives entries for a role without a third-party type, or a grouping account for a role with one. Updates are refused while mapping updates are disabled by configuration.

Response

Resource (only with response=resource).

id

Identifier of the mapping (27-character KSUID).

owner_type

Type of book owning the mapping: organization, company or client.

role

Posting role the mapping serves, for example customer_receivable or sales_revenue. Each role is mapped once per book.

auxiliary_type

Type of third party the role posts to (customer, vendor, location and similar) when the role keeps one child account per third party; null when the role posts directly to the mapped account.

accounting_account_id

Identifier of the account the role is mapped to (27-character KSUID).

account
object

The mapped account, as an account object. Only present when selected with include and the caller has the accounting_accounts.retrieve permission.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).