/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 tokenThe 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:

queryStringoptionalA search term used to query orders based on various attributes such as merchant name or payer name.
status Int32optionalAn 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"
fromDateTimeoptionalThe starting date and time for the range of orders to retrieve.
UTC format
toDateTimeoptionalThe ending date and time for the range of orders to retrieve.
UTC format
midStringoptionalMerchant ID used to filter orders by specific merchants.
orderByStringoptionalThe field by which to order the results (e.g., createdOn, amount).
sortStringoptionalThe sorting direction of the results (asc for ascending, desc for descending).
pageSizeInt32optionalNumber of items per page (default is 10).
pageNumberInt32optionalThe page number to retrieve in a paginated result set.

Try it right now:




Response


Orders Object

firstItemOnPageIntegerThe index of the first item on the current page.
hasNextPageBooleanIndicates if there is a next page.
hasPreviousPageBooleanIndicates if there is a previous page.
isFirstPageBooleanIndicates if the current page is the first.
isLastPageBooleanIndicates if the current page is the last.
lastItemOnPageIntegerThe index of the last item on the current page.
pageCountIntegerThe total number of pages.
pageNumberIntegerThe current page number.
pageSizeIntegerThe number of items per page.
totalItemCountIntegerThe total number of items across all pages.
rowsArrayAn array of objects, each representing an order with detailed attributes such as id, isGhostMode, payerName, merchantName, and more.

Additional Attributes

orderStatusesObjectAn object mapping status codes to their descriptive names.
successBooleanIndicates whether the API call was successful.
errorsArrayAn array containing any errors that occurred during the API call.
customPropertiesObjectAn 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": {}
}