/orders

GET /orders to retrieve the status of a multiple orders at once.



This endpoint allows to retrieve a listing of orders processed by FlexFactor, filtering the results by criteria such as date ranges, order statuses, or specific customer details.

It's commonly used for reconciliation across merchants.




Request


Required key

bearer token

The auth token returned by /oauth2/token


Query fields

The following fields can be included in the API request to filter orders based on specific criteria:

query

String

optional

A search term used to query orders based on various attributes such as merchant name or payer name.

status

Int32

optional

An array of integers representing the order statuses to filter by.
"0": "Draft",
"1": "Onhold",
"2": "Cancelled",
"3": "Problem",
"4": "Processing",
"5": "Capturerequired",
"6": "Returned",
"7": "Completed"

from

DateTime

optional

The starting date and time for the range of orders to retrieve.
UTC format

to

DateTime

optional

The ending date and time for the range of orders to retrieve.
UTC format

mid

String

optional

Merchant ID used to filter orders by specific merchants.

orderBy

String

optional

The field by which to order the results (e.g., createdOn, amount).

sort

String

optional

The sorting direction of the results (asc for ascending, desc for descending).

pageSize

Int32

optional

Number of items per page (default is 10).

pageNumber

Int32

optional

The page number to retrieve in a paginated result set.


Try it right now:




Response


Orders Object

firstItemOnPage

Integer

The index of the first item on the current page.

hasNextPage

Boolean

Indicates if there is a next page.

hasPreviousPage

Boolean

Indicates if there is a previous page.

isFirstPage

Boolean

Indicates if the current page is the first.

isLastPage

Boolean

Indicates if the current page is the last.

lastItemOnPage

Integer

The index of the last item on the current page.

pageCount

Integer

The total number of pages.

pageNumber

Integer

The current page number.

pageSize

Integer

The number of items per page.

totalItemCount

Integer

The total number of items across all pages.

rows

Array

An array of objects, each representing an order with detailed attributes such as

id

,

isGhostMode

,

payerName

,

merchantName

, and more.

Additional Attributes

orderStatuses

Object

An object mapping status codes to their descriptive names.

success

Boolean

Indicates whether the API call was successful.

errors

Array

An array containing any errors that occurred during the API call.

customProperties

Object

An object containing any additional data related to the response.



Payload examples

Request


curl --request GET \
     --url 'https://api-sandbox.flex-charge.com/v1/orders?orders?status=7&from=2024-03-01T00:00:00Z&to=2024-03-31T23:59:59Z&&pageSize=10&pageNumber=1' \
     --header 'Authorization: bearer {the token returned by /oauth2}' \
     --header 'accept: application/json'

This example call fetches orders that were completed in March 2024, showing results on the first page with up to 10 orders per page.


Response


{
  "orders": {
    "firstItemOnPage": 1,
    "hasNextPage": false,
    "hasPreviousPage": false,
    "isFirstPage": true,
    "isLastPage": true,
    "lastItemOnPage": 2,
    "pageCount": 1,
    "pageNumber": 1,
    "pageSize": 10,
    "totalItemCount": 2,
    "rows": [
      {
        "id": "12345678-abcd-1234-efgh-ijklmnopqrst",
        "isGhostMode": false,
        "payerName": "John Appleseed",
        "merchantName": "GenericStore",
        "merchantId": "abcd-efgh-ijkl-mnop-qrstuvwx1234",
        "referenceNumber": "ref1234567890",
        "storeName": "Example Store",
        "storeId": "store123",
        "status": 7,
        "statusName": "completed",
        "amount": 45.65,
        "formattedAmount": "$45.65",
        "currencyCode": "USD",
        "currencySymbol": "$",
        "createdOn": "2024-03-06T10:09:18.437947Z",
        "orderPlacedDate": "2024-03-06T10:09:25.337202Z",
        "expiryDate": null,
        "payoutStatus": null,
        "refundsAmount": 0,
        "descriptor": "product-description",
        "paymentInstrumentToken": "token12345678901234567890",
        "isMIT": false,
        "siteId": "site1234567"
      },
      {
        "id": "abcdef12-3456-7890-abcd-efghijklmnop",
        "isGhostMode": false,
        "payerName": "Jane Doe",
        "merchantName": "GenericStore",
        "merchantId": "abcd-efgh-ijkl-mnop-qrstuvwx1234",
        "referenceNumber": "ref0987654321",
        "storeName": "Example Store",
        "storeId": "store123",
        "status": 7,
        "statusName": "completed",
        "amount": 3,
        "formattedAmount": "$3",
        "currencyCode": "USD",
        "currencySymbol": "$",
        "createdOn": "2024-03-06T09:43:07.387804Z",
        "orderPlacedDate": "2024-03-06T09:43:24.254865Z",
        "expiryDate": null,
        "payoutStatus": null,
        "refundsAmount": 0,
        "descriptor": "product-description",
        "paymentInstrumentToken": "token12345678901234567890",
        "isMIT": false,
        "siteId": "site1234567"
      }
    ]
  },
  "orderStatuses": {
    "0": "Draft",
    "1": "Onhold",
    "2": "Cancelled",
    "3": "Problem",
    "4": "Processing",
    "5": "Capturerequired",
    "6": "Returned",
    "7": "Completed"
  },
  "success": true,
  "result": null,
  "status": null,
  "statusCode": null,
  "errors": [],
  "customProperties": {}
}