---
title: "Preview coding defaults for a location + vendor"
method: GET
path: "/coding-defaults"
tags: ["codingDefaults"]
---

# Preview coding defaults for a location + vendor

`GET /coding-defaults`

Returns the GL and dimension coding defaults for the given `ottimate_location_id` and `erp_vendor_id`, without creating an invoice. Use this to pre-fill an invoice-capture UI before calling `POST /invoices` — pass the returned `erp_dimension_id` values through to that endpoint's `dimensions` field to persist them. This preview only covers header-level defaults; individual line items may still be affected by catalog/item-level mapping rules not shown here.

## Query parameters

- `ottimate_location_id` integer, required
- `erp_vendor_id` string, required
- `applies_to` 'header'

## Headers

- `Authorization` string, required
- `X-Api-Key` string, required
- `X-API-Version` string

## Response `200`

Successful response with coding defaults

- CodingDefaultsGetCodingDefaultsRootResponse200
  - `ottimate_location_id` integer, required — The location ID this response was resolved for
  - `erp_vendor_id` string, required — The ERP vendor ID this response was resolved for
  - `accounting_mode` 'enhanced_dimensions' | 'legacy_gl', required — Whether this location uses Enhanced Dimensions or legacy GL accounting
  - `header_dimensions` CodingDefaultsGetResponsesContentApplicationJsonSchemaHeaderDimensions, required — Header-level dimension defaults, keyed by dimension type (e.g. 'DEPARTMENT', 'CLASS'). Empty when accounting_mode is legacy_gl or no default applies.
  - `default_gl` CodingDefaultsGetResponsesContentApplicationJsonSchemaDefaultGl — Default GL account. Populated for legacy_gl accounts, and also for enhanced_dimensions accounts that auto-map to a global default GL (source: 'default') — that path is not gated by accounting_mode.
    - `erp_dimension_id` string, required — GL account number / external ID
    - `code` string, nullable
    - `name` string, nullable
    - `source` 'configured' | 'default', required
    - `rule_id` string, nullable — Always null here — no mapping rule is involved for GL defaults.
  - `vendor_coding` CodingDefaultsGetResponsesContentApplicationJsonSchemaVendorCoding, required — Vendor-level coding defaults for this location + vendor, regardless of accounting mode.
    - `erp_vendor_id` string, required
    - `ottimate_vendor_id` integer, nullable
    - `accounting_class` CodingDefaultsGetResponsesContentApplicationJsonSchemaVendorCodingAccountingClass
      - `erp_dimension_id` string
      - `code` string, nullable
      - `name` string, nullable
      - `source` 'configured'
      - `rule_id` string, nullable — Always null here — no mapping rule is involved for vendor coding.
    - `default_department` CodingDefaultsGetResponsesContentApplicationJsonSchemaVendorCodingDefaultDepartment
      - `erp_dimension_id` string
      - `code` string, nullable
      - `name` string, nullable
      - `source` 'configured'
      - `rule_id` string, nullable — Always null here — no mapping rule is involved for vendor coding.
    - `source` 'configured' | 'not_configured', required — not_configured when no vendor coding exists yet for this location + vendor.
  - `warnings` string[] — Response-specific caveats, e.g. a matched value that couldn't be resolved to a usable ID. Empty when nothing unusual applies to this particular location/vendor pair.

## Other responses

- `400` — Bad request - Invalid parameters or request format
- `403` — Forbidden - Access denied or insufficient permissions
- `404` — Not found - Resource does not exist

---

[API](https://skmtc.dev/ottimate/apis/api-reference.md) · [All operations](https://skmtc.dev/ottimate/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ottimate/api-reference/revisions/ba91ff4c6969/schema)
