Admin CSV export
The Driftstack admin API exposes a CSV export of crypto orders for bookkeeping, finance reconciliation, and audit. This page documents the request shape, the column contract, and the practical limits.
Endpoint
GET /v1/admin/crypto-orders.csv
Authorization: Bearer $ADMIN_KEY
Accept: text/csv
Requires an API key with the
driftstack_internal_admin scope. A key without
that scope receives 403 Forbidden.
Filters
The CSV endpoint accepts the same filter query params as the JSON list endpoint:
status— one ofpending,confirming,paid,failed,partial,cancelled.search— free-text match acrossorder_id,product, andcustomer_note.account_id— restrict to one account.created_after/created_before— ISO-8601 date-range filter (V-666.BY).created_beforemust be strictly greater thancreated_after; otherwise 400.limit— integer 1–1000. Defaults to 1000.
Filters compose with AND semantics. Omitting them all returns
every order the caller's scope can see, up to limit.
Columns
The first row is a header row; subsequent rows are one order per row in the order documented below. The header is stable — new columns are appended to the right; existing columns are not removed or reordered without a deprecation window.
order_id— Driftstack order ID (ord_*).account_id— owning account, or empty for pre-signup checkouts.product— SKU paid for.price_cents— fiat-equivalent price at order creation, in minor units.price_currency— three-letter currency (e.g.USD,EUR).status— terminal or in-flight status.payment_id— NowPayments invoice ID, empty if no IPN has hit.customer_note— customer-supplied note, empty if unset.internal_note— admin-only ops note, empty if unset.created_at— ISO-8601 UTC timestamp.updated_at— ISO-8601 UTC timestamp of the last state transition.
Quoting + encoding
The exporter follows RFC 4180:
- Fields containing
,,", or a newline are wrapped in double quotes; embedded"is doubled (""). - Line terminator is
\r\n. - Encoding is UTF-8 with no BOM. Spreadsheet apps that
default to Latin-1 should import explicitly as UTF-8 to
preserve non-ASCII characters in
customer_note/internal_note.
Limits
The CSV endpoint exports up to 1000 rows per request. If the filtered scan would return more than 1000 rows, the export is truncated to the most-recently-updated 1000 and a warning header is set:
X-Driftstack-Export-Truncated: 1 For full-history exports beyond 1000 rows, walk the cursor-paginated JSON list and stream rows yourself; the CSV endpoint is a convenience for ad-hoc reconciliation, not a bulk-export channel.
GUI download
The admin GUI (Crypto orders (admin) view) has a
Download CSV button that calls this endpoint
with whatever status and search
filters are currently active. The button mints a blob URL
client-side so the download honours the Bearer auth header.