Skip to content

Export Runs

Poll the status of a recurring export schedule's most recent run, and retrieve the frozen data snapshot it produced.


GET /export-runs/{scheduleId}/status

Returns the most recent export run for a given schedule. Use this to poll before retrieving the run's data — a run must reach completed before GET /export-runs/{scheduleId}/data will return results.

Path Parameters

Parameter Description
scheduleId The schedule's ID, returned from POST /schedules or GET /schedules.

Status Codes

Status Description
200 Export run record returned.
401 Missing or invalid API key.
404 No run found for this schedule.

Example Request

curl https://ext.arc-aegis.billtrust.com/api/v1/remittance-export/export-runs/8f2c1e40-1234-4abc-9def-000000000001/status \
  -H "X-API-Key: <your-api-key>"

Example Response — 200

{
  "runId": "1c9a2f10-5678-4bcd-8ef0-000000000002",
  "scheduleId": "8f2c1e40-1234-4abc-9def-000000000001",
  "status": "completed",
  "startedAt": "2026-07-14T02:00:00.000Z",
  "completedAt": "2026-07-14T02:03:41.000Z",
  "rowCount": 18420,
  "errorStage": null,
  "errorDetail": null
}

status is one of completed, failed — a run is only ever recorded once it finishes, so there is no pending/running state visible through this endpoint. When status is failed, errorStage and errorDetail describe what went wrong.


GET /export-runs/{scheduleId}/data

Returns cursor-paginated rows exactly as produced by a run for this schedule — a frozen point-in-time snapshot, not a live re-query. Snapshots are retained for 90 days.

By default this returns the most recent completed run. If your schedule fires again before you fetch the data, "most recent" can silently become a newer run than the one a webhook announced — pass runId to pin the exact run instead. See Webhooks for the recommended pairing.

Path Parameters

Parameter Description
scheduleId The schedule's ID.

Query Parameters

Parameter Type Description
runId string Pin the exact run to fetch — e.g. the runId from an export.completed webhook payload. Omit to fall back to the most recent completed run. Scoped to your tenant and this scheduleId; a runId from another tenant or schedule returns 404.
cursor string Opaque cursor token from a previous response. Omit to start from the beginning.
limit integer Rows per page, 1–100000. Defaults to 500.

Status Codes

Status Description
200 Paginated snapshot rows returned.
400 Validation error (e.g. invalid limit).
401 Missing or invalid API key.
404 No run found for this schedule, or (if runId is passed) no matching run for that runId/scheduleId/tenant combination.
409 The run's status is failed, so no data snapshot exists.

Example Request

curl "https://ext.arc-aegis.billtrust.com/api/v1/remittance-export/export-runs/8f2c1e40-1234-4abc-9def-000000000001/data?limit=500" \
  -H "X-API-Key: <your-api-key>"

Pin a specific run (e.g. one announced by a webhook delivery):

curl "https://ext.arc-aegis.billtrust.com/api/v1/remittance-export/export-runs/8f2c1e40-1234-4abc-9def-000000000001/data?runId=1c9a2f10-5678-4bcd-8ef0-000000000002" \
  -H "X-API-Key: <your-api-key>"

Example Response — 200

{
  "runId": "1c9a2f10-5678-4bcd-8ef0-000000000002",
  "data": [
    {
      "id": "pay_8f2c1e",
      "status": "Paid",
      "totalAmount": 1450.00,
      "currency": "USD",
      "createDateTime": "2026-06-14T09:12:00.000Z"
    }
  ],
  "pagination": {
    "cursor": null,
    "hasMore": false,
    "rowCount": 18420
  }
}

Example Response — 409

{
  "error": {
    "code": "RUN_NOT_COMPLETED",
    "message": "Export run is failed; no data available yet."
  }
}