Activity, Export, and Sync

Audit who did what on an order, export bulk data to CSV for reporting, and force a sync against connected channels.

Base URL

https://api.fenicia.io

All endpoints require Authorization: Bearer fkapi_.... Error catalog: Error Reference.


Order activity history

Returns the chronological trace of the order: creation events, state transitions, shipments, cancellations, refunds, etc. Requires orders:read.

200
{
  "data": {
    "entries": [
      {
        "id": "act_65f3a1b2c4d5e6f7a8b9c0f1",
        "timestamp": "2026-04-10T14:30:00.000Z",
        "action": "processing",
        "source": "api",
        "eventType": "status_change",
        "quotaImpact": false,
        "userId": "usr_123",
        "userName": "María López",
        "userEmail": "maria@merchant.example.com",
        "userRole": "admin",
        "previousStatus": "accepted",
        "newStatus": "processing"
      },
      {
        "timestamp": "2026-04-10T13:10:00.000Z",
        "source": "integration:shopify",
        "eventType": "created",
        "quotaImpact": true
      }
    ],
    "totalCount": 14,
    "hasMore": true,
    "pagination": { "limit": 50, "offset": 0, "nextOffset": 50 }
  }
}
curl "https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/activity-log?limit=100&offset=0" \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the order's activity trace (entries[]), the total entry count (totalCount), whether there are more pages (hasMore), and the pagination data (pagination).

Required permission: orders:read

Parameters

orderIdstringrequired

Order ID (path).

limitnumber

Maximum number of entries per page. Default: 50.

offsetnumber

Number of entries to skip from the start. Default: 0.

Real shape of an entry (per the Mongo schema, `src/model/schema.ts`)

A status-transition entry is { id?, timestamp, action?, source, eventType, quotaImpact, userId?, userName?, userEmail?, userRole?, previousStatus?, newStatus?, reason?, details?, isBulkOperation?, bulkOperationId?, integrationName?, channelId?, correlationId? }.

Three corrections to what this page's previous example got wrong:

  • There is no nested details with fromStatus/toStatus. The previous and new status live in the top-level fields previousStatus/newStatus. details (when present) is a free-text string (the options.details you sent on the transition), not an object.
  • eventType for a status transition is literally the constant string status_change (no trailing "d"), always the same value — it does not vary per action. What distinguishes the action is the action field (e.g. processing, fulfilled, cancelled). Other real eventType values in the catalog: comment (manual comment) and created/updated (order created or edited, e.g. on import from a channel) — there is no order_accepted.
  • id is optional: order created/updated entries don't always carry it (see the second example above).

Tip

To paginate forward, use pagination.nextOffset as the next offset. When hasMore is false, there are no more entries.


Export orders to CSV

Exports the orders matching the filters to a CSV file. Requires orders:export.

200The rest of the listing filters (see List Orders) also apply to this endpoint.
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="orders-export-2026-04-11.csv"
 
externalId,customerInfo.email,total,orderStatus
1001,ana@example.com,1500.00,accepted
1002,luis@example.com,780.50,fulfilled
curl "https://api.fenicia.io/orders/export?columns=externalId,customerInfo.email,total,orderStatus&startDate=2026-04-01&endDate=2026-04-30" \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -o pedidos.csv

Returns a raw CSV file (Content-Type: text/csv; charset=utf-8), not a JSON envelope. The filename is generated by the handler as orders-export-<today's-date>.csv — it is not configurable via a parameter.

Required permission: orders:export

Parameters

columnsstringrequired

Comma-separated list of column paths to include. Supports nested paths, e.g. customerInfo.email.

localestring

Locale used to format values in the CSV. Default: es.

maxRecordsnumber

Maximum number of records to export. Default: 10000.

startDatestring

ISO start date of the range (inclusive).

endDatestring

ISO end date of the range (inclusive).

orderStatusstring

Filter by order status. Also accepts the status alias. Accepted values: draft, new, accepted, cancelled, rejected, processing, packaging, picking, pickup-pending, in-transit, fulfilled, delivered, returned, partially-fulfilled, partially-delivered, not-delivered, exception.

channelIdsstring

Filter by one or more channels.

metafieldsstring

Additional filter by metafields, in JSON format.

There is no format parameter

This endpoint always returns raw CSV (Content-Type: text/csv), never JSON. There is no format parameter to choose another output — if you send one, it's ignored. columns is required: without it, the API responds with a validation error.

The date range uses startDate / endDate, not from / to

This endpoint reuses the same filter normalizer as GET /orders (see List Orders). The date range is filtered with startDate and endDate — the names from/to don't exist in this API.


List orders with overdue settlement

Paginated list of orders whose channel settlement is overdue beyond the configured grace period. Requires orders:read.

200
{
  "data": [
    {
      "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
      "externalId": "FEN-10042",
      "channelId": "chn_shopify_01",
      "orderStatus": "delivered",
      "totalAmount": 1986.26
    }
  ],
  "meta": {
    "pagination": { "page": 0, "limit": 20, "total": 6, "totalPages": 1, "hasMore": false }
  }
}

Returns the paginated list of orders with overdue settlement, wrapped in data, with pagination in meta.pagination. Each element is the full order (Order), not a 4-field summary — the amount field is totalAmount (not total), same as the rest of the Orders domain.

Required permission: orders:read

Parameters

pagenumber

Page number.

limitnumber

Items per page.

gracePeriodDaysnumber

Grace period in days before a settlement is considered overdue.

channelIdstring

Filter by channel.

startDatestring

ISO start date of the range (inclusive).

endDatestring

ISO end date of the range (inclusive).

Previously undocumented endpoint

This endpoint exists and works in the public API, but had no documentation until this page. Unlike the abandoned carts listing, it follows the domain's standard envelope: { data: [...], meta: { pagination } }.


Export orders with overdue settlement

Exports to CSV the orders with overdue settlement, with the same filters as the listing. Requires orders:export.

200Analogous to GET /orders/export.
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="payment-issues-export-2026-04-11.csv"

Returns a raw CSV file (Content-Type: text/csv; charset=utf-8), analogous to GET /orders/export. The filename is generated by the handler as payment-issues-export-<today's-date>.csv.

Required permission: orders:export

Parameters

gracePeriodDaysnumber

Grace period in days before a settlement is considered overdue.

channelIdstring

Filter by channel.

startDatestring

ISO start date of the range (inclusive).

endDatestring

ISO end date of the range (inclusive).

Previously undocumented endpoint

Same as GET /orders/settlement-overdue, this endpoint exists and works but had no documentation until this page.


Sync all orders

Queues an asynchronous sync of orders from all connected, active channels. Requires orders:manage.

{}
202
{
  "data": {
    "message": "Sync initiated",
    "status": "processing",
    "channelCount": 4
  }
}
curl -X POST https://api.fenicia.io/orders/sync \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns a 202 Accepted with the number of channels queued (channelCount) and the operation status (status).

Required permission: orders:manage

No body required; the message travels in English

This endpoint doesn't read any field from the body — send {} or no body at all, it makes no difference. The real response carries channelCount (number of channels queued), not channelsQueued, and the message field is literally "Sync initiated" (in English, exactly as the handler returns it) — don't translate it when showing it to your end user without first confirming it's a data value, not an i18n key. It also always includes status: "processing".


Sync a single order

Forces the sync of a specific order against its source channel. Requires orders:manage.

{}
202
{
  "data": {
    "message": "Order sync initiated",
    "status": "processing",
    "orderId": "65f3a1b2c4d5e6f7a8b9c0d1"
  }
}
404
{ "error": { "code": "sync:channel_not_found", "message": "Cannot sync order 65f3a1b2c4d5e6f7a8b9c0d1" } }
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/sync \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns a 202 Accepted confirming the order's sync was queued.

Required permission: orders:manage

Parameters

orderIdstringrequired

Order ID.

Tip

Both sync endpoints are asynchronous. Subscribe to the order.updated webhook or poll GET /orders/{orderId} again to detect when it finishes.

Next steps