---
title: "Set configuration"
method: POST
path: "/config/companies/{companyId}/sync/commerce"
tags: ["Advanced controls"]
---

# Set configuration

`POST /config/companies/{companyId}/sync/commerce`

Sets a company's commerce sync configuration.

## Path parameters

- `companyId` string, uuid, required — Unique identifier for your SMB in Codat.

## Response `200`

Success

- Configuration
  - `sales` Sales
    - `syncSales` boolean — Boolean indicator for syncing sales.
    - `accounts` object, nullable
    - `invoiceStatus` InvoiceStatus
      - `selectedInvoiceStatus` string, nullable — Selected option for invoice status for invoice to be synced.
      - `invoiceStatusOptions` string[], nullable — Options for invoice statuses.
    - `salesCustomer` Customer
      - `selectedCustomerId` string, nullable — Selected customer id from the list of customer records on the accounting software.
      - `customerOptions` Option[], nullable — List of customer options from the list of customer records on the accounting software.
        - `name` string, nullable — Name value of the option.
        - `id` string — Unique identifier for the option.
    - `taxRates` object, nullable
    - `newTaxRates` NewTaxRates
      - `accountingTaxRateOptions` Option[], nullable — Array of accounting tax rate options.
        - `name` string, nullable — Name value of the option.
        - `id` string — Unique identifier for the option.
      - `commerceTaxRateOptions` Option[], nullable — Array of tax component options.
        - `name` string, nullable — Name value of the option.
        - `id` string — Unique identifier for the option.
      - `taxRateMappings` TaxRateMapping[], nullable — Array of tax component to rate mapppings.
        - `selectedCommerceTaxRateIds` string[], nullable — Selected tax component id from the list of tax components on the commerce software.
        - `selectedAccountingTaxRateId` string, nullable — Selected tax rate id from the list of tax rates on the accounting software.
      - `selectedDefaultZeroTaxRateId` string, nullable — Default tax rate selected for sync.
      - `defaultZeroTaxRateOptions` Option[], nullable — Default zero tax rate selected for sync.
        - `name` string, nullable — Name value of the option.
        - `id` string — Unique identifier for the option.
    - `grouping` Grouping
      - `groupingPeriod` GroupingPeriod
        - `selectedGroupingPeriod` string, nullable — Grouping period i.e. Daily sales.
        - `groupingPeriodOptions` string[], nullable — Array of grouping period options.
      - `groupingLevels` GroupingLevels
        - `invoiceLevel` InvoiceLevelSelection
          - `selectedGroupByOptions` string[], nullable — Selected array of grouping options.
          - `groupByOptions` string[], nullable — Options for grouping sales.
        - `invoiceLineLevel` InvoiceLineLevelSelection
          - `selectedGroupByOptions` string[], nullable — Invoice line level selection.
          - `groupByOptions` string[], nullable — Options for grouping on invoice lines.
  - `payments` Payments
    - `syncPayments` boolean — Boolean indicator for syncing sales.
    - `accounts` object, nullable
  - `newPayments` NewPayments
    - `syncPayments` boolean — Boolean indicator for syncing payments.
    - `accounts` object, nullable
  - `fees` Fees
    - `feesSupplier` FeesSupplier
      - `selectedSupplierId` string, nullable — Selected supplier id from the list of supplier records on the accounting software.
      - `supplierOptions` Option[], nullable — List of supplier options from the list of supplier records on the accounting software.
        - `name` string, nullable — Name value of the option.
        - `id` string — Unique identifier for the option.
    - `syncFees` boolean — Boolean indicator to enable syncing fees.
    - `accounts` object, nullable

## Other responses

- `400` — The request made is not valid.
- `401` — Your API request was not properly authorized.
- `402` — An account limit has been exceeded. The type of limit is described in the error property: - You have exceeded the 50-company limit that applies to a Free plan. Delete any companies you no longer need and retry the request. - The requested sync schedule is not allowed. You requested an hourly sync schedule but this functionality is not included in the Free plan. - Your Free account is older than 365 days and has expired. Contact support@codat.io.
- `403` — You are using an outdated API key or a key not associated with that resource.
- `404` — One or more of the resources you referenced could not be found. This might be because your company or data connection id is wrong, or was already deleted.
- `409` — The data type's dataset has not been requested or is still syncing.
- `429` — Too many requests were made in a given amount of time. Wait a short period and then try again.
- `500` — There is a problem with our server. Please try again later.
- `503` — The Codat API is temporarily offline for maintenance. Please try again later.

## Changes

- **2023-10-23** `83c1801e91f7` — 9 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `402`
  - added the non-success response with the status `403`
  - …5 more

[Change history](https://skmtc.dev/codatio/apis/codat-sync-commerce/changes/config/companies/:companyId/sync/commerce/post.md)

---

[API](https://skmtc.dev/codatio/apis/codat-sync-commerce.md) · [All operations](https://skmtc.dev/codatio/apis/codat-sync-commerce/llms.txt) · [OpenAPI document](https://skmtc.dev/codatio/apis/codat-sync-commerce/revisions/a5aefe1f126c?raw)
