Synchronization schedule

Synchronization schedule configuration

The configuration you submit to Codat includes the start date, sync hour, time zone, and frequency of the regular data syncs:

"schedule": {
    "selectedFrequency": "Daily",
    "frequencyOptions": [
        "Daily",
        "Monthly"
    ],
    "startDate": "2022-06-15",
    "syncHourUtc": 2,
    "timeZone": "Europe/London"
}

Property

Type

Description

Required

Selected frequency (selectedFrequency)

string

The sync frequency selected by the merchant.

Required

Frequency options (frequencyOptions)

string

The available options for sync frequency provided by Codat.

Required

Start date (startDate)

ISO 8601 datetime

The date from which commerce data syncing should start (only applies to the first sync).

Required

Sync hour (syncHourUtc)

Number
Integers from 0 to 23 inclusive

The hour of the day that will mark the start/end of any sync period.

Optional, set to 0 by default

Time zone (timeZone)

string of IANA time zones or
null (defaults to Etc/UTC)

The time zone applied to the start date and sync hour.

Optional, set to “ETC/Utc” by default

After you POST your config JSON document, or it is submitted by the no-code merchant configuration flow, Codat uses it to determine the sync period – the period for which commerce data will be synced in one run of the sync service. To determine the sync period, we first establish the following values internally:

  • The sync due date: the datetime a sync becomes due based on the provided sync hour. It will mark the end of one sync period and the beginning of the next.
  • The sync run date which is the datetime of the next sync execution.

🚧

Due date and the run date are not similar. Codat manages the run date according to the system load and other factors. The time gap between the sync due date and the sync run date depends on multiple factors and may differ from one sync to another.

❗️

Sync hour should be specified according to your local time zone.

The start date and sync hour determine the beginning of the first sync period. Starting from the second one, every sync starts at the due date of the previous successful sync.

Here is an example of a typical first sync:

  • Now it’s July 13, 4 pm
  • The start date is set to May 1
  • The sync hour is set to 4 am with the sync frequency set to daily
  • The sync due date (determined by Codat) is 4 am on July 14
  • The sync run date (determined by Codat) may be several hours later, for example, at 11 am on July 14
  • The first sync period will be from the start date May 1 (4 am) to the sync due date July 14 (4 am)
  • The next sync period will be from July 14 (4 am), or the last successful sync date to July 15 (4 am), the next sync due date

Daily synchronization

If you set the synchronization schedule to daily, the data from the previous 24-hour period will be triggered to sync at the scheduled day and hour, your local time zone.

To help you understand how daily synchronization works, let’s look at this example:

  • Now it’s July 13, 4 pm.
  • The sync hour is set to 4 am, and the frequency is daily.
  • The start date is set for July 13 (today).

In this example, the sync will be due at 4 am on July 14. The sync will run at the run date determined by Codat and will grab the data from 13 July, 4 am (start date) to 14 July, 4 am.

Consider another example:

  • Now it’s July 13, 4 pm.
  • The sync hour is set to 4 am, and the frequency is daily.
  • The start date is set for July 14 (tomorrow).

In this example, the sync will be triggered at 4 am on July 15 and will grab the data from 14 July, 4 am (start date) to 15 July, 4 am.

Monthly synchronization

If you set the synchronization schedule to monthly, the data from the previous month’s period will be synced at the scheduled day and hour.
Consider this example:

  • Now it’s July 13, 4 pm.
  • The sync schedule is set to 4 am monthly.
  • The start date is set for July 13 (today).

In this example, the sync will be due at 4 am on August 13 and will grab the data from 13 July, 4 am (start date) to August 13, 4 am.

🚧

The due date for the next sync is calculated by adding a calendar month to the previous due date. While in most cases this means that the date will stay the same with every next sync, it may shift slightly.
For example:

  • Now it’s January 31.
  • The sync is scheduled to start today and happen monthly.
  • As there are only 28 or 29 days in February, the next sync date shifts to February 28.
  • The sync after that will be scheduled for March 28.

Sync scheduler takes into account the practice of advancing clocks, also known as daylight saving time or summer time. In this scenario, the sync period will be extended to 25 hours. When the clocks are set back, the sync period will be reduced to 23 hours.


Did this page help you?