Organization orders

Review orders across the organization's merchants from the Dashboard — list and filter them and open one for full detail.

These endpoints roll up orders from every merchant in the organization into one place: filter by merchant, status, or time, and open an order to see its items and the transactions that paid for it.

It is the org-wide counterpart to the merchant orders screen — same order records, aggregated across merchants for reporting and support.

These endpoints power the Tokeflow Dashboard UI at the organization level. They are session-authenticated (JWT bearer) — the token comes from signing in to the Dashboard, not from an sk_/pk_ API key. Requests also carry the x-organization-id header, and the signed-in user must be a member of that organization.


Endpoints

GET/api/v1/org/orders

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

List orders for organization.

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.
statusarrayNoComma-separated list of order statuses
order_typestringNoFilter by order type
recurrencestringNoFilter by recurrence
currencystringNoFilter by currency (ISO 4217)
searchstringNoSearch by order ID, customer name, email, or external order ID
start_datestringNoStart date (ISO 8601)
end_datestringNoEnd date (ISO 8601)
modestringNolive or test. Only orders whose most recent payment that reached a provider ran on a live (or test) connector. An order with no such payment matches neither.
subscription_idstringNoFilter by subscription ID

Example request

curl -G https://api.tokeflow.com/api/v1/org/orders \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20" \
  --data-urlencode "status=['active']" \
  --data-urlencode "order_type=api"

GET/api/v1/org/orders/:id

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get order by ID.

The order detail includes the transactions that paid for it and each of their attempts. Each order and each transaction carries a mode (live, test, or null when no payment reached a provider), and each attempt carries is_test_mode. A failed attempt also shows decline_reason — Tokeflow's reason for the failure, the same value whichever provider answered — next to psp_decline_code and psp_error_type, the provider's own code and error class as it reported them.

Path parameters

FieldTypeRequiredDescription
idstringYes—

Example request

curl https://api.tokeflow.com/api/v1/org/orders/obj_1a2b3c4d \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3"

GET/api/v1/org/orders/:id/attempts/:attemptId/raw-response

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get raw PSP response for an attempt.

Path parameters

FieldTypeRequiredDescription
idstringYes—
attemptIdstringYes—

Example request

curl https://api.tokeflow.com/api/v1/org/orders/obj_1a2b3c4d/attempts/123/raw-response \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3"

POST/api/v1/org/orders/:id/refund

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Refund an order.

Path parameters

FieldTypeRequiredDescription
idstringYes—

Request fields

FieldTypeRequiredDescription
amountnumberNoAmount to refund in minor units (partial refund). Omit for full refund.
reasonstringNoReason for refund. One of duplicate, fraudulent, requested_by_customer.

Example request

curl -X POST https://api.tokeflow.com/api/v1/org/orders/obj_1a2b3c4d/refund \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 15000,
    "reason": "requested_by_customer"
  }'

GET/api/v1/org/orders/:id/refunds

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

List refunds for an order.

Path parameters

FieldTypeRequiredDescription
idstringYes—

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.

Example request

curl -G https://api.tokeflow.com/api/v1/org/orders/obj_1a2b3c4d/refunds \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20"

Errors

Errors use the standard envelope. The most common cases here:

HTTPMeaning
400Invalid parameters or a state that does not allow this operation.
401Missing, expired, or invalid Dashboard session token.
403Authenticated, but the signed-in user lacks access to this entity.
404The record does not exist or is not visible to this entity.

On this page