NNarya Developers

Syncing data

If your system works with many Narya records at once, such as for reports, exports or reconciliation, keep a copy of those records in your own system. After the first sync, each sync fetches only the records that changed since the last one, including deletions.

This is faster for you and uses far fewer requests. An export of 100,000 transactions that looks up the trading of each one makes about 100,000 requests every time it runs. With a synced copy, each run makes a few.

Narya/{list}?updated_after=…&include_deleted=true⋮updated 08:47updated 09:31updated 10:15deleted 10:42your sync positionFirst syncfrom the beginning, oldest change firstEvery sync after thatonly changes after your positionDeleted recordsarrive once with deleted_at; remove themYour copyrecords by id, and your positionno API callsReports and exportsread from your copyfirst synceach sync, as often as you liketime →
One request does both the first sync and every sync after it. Your reports read the copy, so their size does not change how many calls you make.

Syncing is available for enterprises, companies, tradings and acquirers.

How to sync

You store two things: your copy of the records, and your position, which is the updated_at and id of the last record you received.

Request the changes after your position.

GET /integration/v1/tradings?sort=updated_at&include_deleted=true&limit=100
    &updated_after=2026-10-22T08:14:02.481305Z
    &updated_after_id=0192f6c4-8a20-7d31-b4c5-d6e7f8a9b0c1

On your first sync you have no position. Leave out updated_after and updated_after_id to start from the beginning.

Update your copy. For each record in data, save it by its id, replacing any earlier version. If deleted_at is set, delete it from your copy instead.

Move your position to the last record in the page. Its updated_at and id are your new updated_after and updated_after_id. If the page is empty, nothing has changed: keep your position.

Repeat until has_more is false. Your copy is now up to date. Save your position, and use it to start your next sync.

The first sync and every later sync use the same request. Run it as often as your system needs: before each report, every few minutes, or once a day.

Example

Request, continuing from your saved position:

GET /integration/v1/tradings?sort=updated_at&include_deleted=true&limit=100
    &updated_after=2026-10-22T08:14:02.481305Z
    &updated_after_id=0192f6c4-8a20-7d31-b4c5-d6e7f8a9b0c1

Response, with most fields left out:

{
  "data": [
    {
      "id": "0192f6c4-9b31-7e42-a5d6-e7f8a9b0c1d2",
      "name": "Kedai Ali (Shah Alam)",
      "updated_at": "2026-10-22T08:20:11.902117Z",
      "deleted_at": null
    },
    {
      "id": "0192f6c4-9c02-7a11-b2c3-d4e5f6a7b8c9",
      "name": "Kedai Ali (Klang)",
      "updated_at": "2026-10-22T08:31:47.116842Z",
      "deleted_at": "2026-10-22T08:31:47.116842Z"
    }
  ],
  "page": 1,
  "limit": 100,
  "total_count": 2,
  "total_is_capped": false,
  "total_pages": 1,
  "has_more": false
}

What to do with it:

RecordAction
Kedai Ali (Shah Alam)Save it, replacing your earlier version.
Kedai Ali (Klang)deleted_at is set: delete it from your copy.
Your positionMove it to the last record: updated_after=2026-10-22T08:31:47.116842Z and updated_after_id=0192f6c4-9c02-7a11-b2c3-d4e5f6a7b8c9.

has_more is false, so your copy is up to date. The response has the same shape as any list. Here, total_count is the number of changes after your position.

Parameters

ParameterDescription
sort=updated_atReturns records in the order they changed, oldest first, ordered by updated_at and then id.
include_deleted=trueAlso returns deleted records, with deleted_at set. Without it, lists never include deleted records.
updated_afterReturns records changed after this time. Send updated_at exactly as you received it.
updated_after_idSent with updated_after, from the same record. Among records changed at exactly that time, returns only those after this id.
limitRecords per page, up to 100.

To start from a known time, for example when you already have a copy from an export, send updated_after on its own.

Good practices

  • Keep one position per list, and save it only after you have saved the page.
  • Identify records by id, not external_ref. A deleted record's external_ref can be given to a new record.
  • Use limit=100 to make as few requests as possible.
  • If you get 429, wait for the seconds in Retry-After and send the same request again. See Rate limits.

Each record carries its parents' ids: a company its enterprise_id, a trading its company_id and enterprise_id. Sync each list your system uses, and join them in your own system by id.

When to read a record directly

Fetch a single record by id when you need its state right now, for example to show it to a user or to check it just before you change it. Use your copy for work across many records.

Common questions

On this page