Skip to main content

Sync for Commerce data model

Important configuration properties required to enable data synchronization

Company configuration

FieldTypeDescription
companyIduuid, read-onlyCodat identifier for the company to which this configuration belongs.
accountingSoftwareCompanyNamestring, read-onlyName of the company as recorded in the linked accounting software.
enabledbooleanWhether synchronization is turned on or off.
scheduleSee ScheduleSync frequency and timing.
configurationSee Synchronization configurationConfiguration of sync accounts and grouping.

Schedule

FieldTypeDescription
selectedFrequencystring (must appear in frequencyOptions)Interval, from frequencyOptions, at which the synchronization should run.
frequencyOptionsArray of string, read-onlyValid options for selectedFrequency.
startDateDateTimeDate on which the first synchronization starts. If no time is specified, the sync time is 00:00. The first sync runs in the first syncHourUtc after the start date.
Attempting to queue a sync before the start date produces a 500 error. The synchronization start date can't be backdated.
syncHourUtcintegerHour of the day in which the synchronization runs. This is the earliest the synchronization can begin, but due to processing time it may not run exactly on the hour.

Synchronization configuration

FieldTypeDescription
salesSalesMapping configuration for sales data.
paymentsPaymentsMapping configuration for payments data.
feesFeesMapping configuration for fees data.

Sales

FieldTypeDescription
syncSalesbooleanWhether or not sales data is synchronized to accounting software. This must be turned on to enable payments data synchronization.
accountsDictionary of AccountType to AccountNominal account to push to for each type of sales data.
invoiceStatusInvoiceStatusStatus invoices are raised as.
salesCustomerSalesCustomerCustomer invoices are raised against.
taxRatesDictionary of decimal to TaxRatesMapping of numeric tax rates to rates defined within the accounting software. The key represents the numeric rate. For example, 17.5% tax is expressed as a key of "17.5".
groupingGroupingSpecification of how sales data is grouped when pushing to accounting software.

Invoice status

FieldTypeDescription
selectedInvoiceStatusstringChosen initial status for invoices created in the accounting software to represent sales transactions.
invoiceStatusOptionsArray of string, read-onlyList of the possible initial statuses for invoices created in the accounting software.

Sales customer

FieldTypeDescription
selectedCustomerIdstring (must be an id contained in customerOptions)ID of the chosen customer from the accounting software. The ID is linked to created invoices, which represent sales transactions.
customerOptionsArray of Options, read-onlyList of possible customers from the accounting software.

Tax rates

FieldTypeDescription
selectedTaxRateIdstring (Must be an id contained in taxRateOptions)ID of the tax rate selected from the taxRateOptions.
taxRateOptionsArray of Options, read-onlyList of names and corresponding IDs for tax rates in the destination accounting package.

Options

FieldTypeDescription
namestring, read-onlyDisplay name of the option. In an HTML implementation, this must be contained in the body of an <option\> tag.
idstring, read-onlyIdentifier for the option which is posted back to the configuration. In an HTML implementation, this must be contained in the value attribute of an <\option> tag.
classificationstring, read-only
Only returned for Account options.
Type of the account, either nominal or bank.

Groupings

FieldTypeDescription
groupingPeriodGroupingPeriod
groupingLevelsGroupingLevelType of the account, either nominal or bank.

Grouping periods

The grouping period specifies the time interval at which to create invoices, and assumes that if this value is set, it is more frequent than the specified sync frequency.

FieldTypeDescription
selectedGroupingPeriodstring (Must be contained in groupingPeriodOptions)A single text value selected from the groupingPeriodOptions, which represents the frequency at which to generate separate invoices.
groupingPeriodOptionsArray of stringList of valid grouping period options. Currently the only option available is daily.

Grouping levels

There are two levels at which grouping can be performed:

  • Invoice level specifies the criteria for grouping purchases on a single invoice.
  • Invoice line level specifies how each invoice is then be subdivided.

Only optional grouping levels are included as options. Required grouping levels, such as currency and tax rate are set by default and so are not listed as possible options.

The structure for both of these sections is the same:

FieldTypeDescription
selectedGroupByOptionsList of the chosen options which represents a subset of the available groupByOptions. An empty list represents that no additional parameters have been specified to group by.
groupByOptionsList of available options for each of the selectedGroupByOptions.

Payments

FieldTypeDescription
syncPaymentsbooleanWhether or not payments data is synchronized to accounting software.
accountsDictionary of AccountType to AccountAccount to push to for each payment type.

Fees

FieldTypeDescription
syncFeesbooleanWhether or not to synchronize fees data to the accounting software.
accountsDictionary of AccountType to AccountAccount to push to for each fee type.

Account types

This is an enum of different types of nominal or bank accounts that are created and synchronized within the accounting software. Depending on which sales or payment types your system is creating, you must configure accounts within the accounting software for each of these data types.
Configure an existing account by selecting the account ID within the relevant section of the configuration.
Create new accounts by calling the New Account Endpoint with accountType set to the relevant enum value.

NameSection
salesSales
gratuitySales
refundSales
cashPayments
cardPayments
invoicePayments
onlineCardPayments
swishPayments
vippsPayments
mobilePayments
storeCreditPayments
paypalPayments
customPayments
paymentFeeFees
paymentFeeRefundFees
loanPayments
loanFeeFees
cashbackPayments
prePaidPayments

Accounts

FieldTypeDescription
labelTextstring, read-onlyDisplay name for this account.
descriptionTextstring, read-onlyFriendly description of the data pushed to this account.
selectedAccountIdstring (Must be an id contained in accountOptions)ID of the account in the accountancy package selected from the options that correspond to this account.
accountOptionsArray of Options, read-onlyThe list of available accounts. See AccountOptions

Was this page useful?
❤️
👍
🤔
👎
😭