Orders Workflow

An order is how you request a report. You create it, poll it until it completes, and read the report from it or cancel it, if it qualifies.

OperationCall
Create OrderPOST /a4a/3.0/api/orders/create/
Get Order by IDGET /a4a/3.0/api/orders/id/{id}
Get Order by CodeGET /a4a/3.0/api/orders/code/{code}
Cancel OrderPOST /a4a/3.0/api/orders/cancel/

The three identifiers

IdentifierExampleWhat it isUse it with
Order id299The order's numeric IDGET /orders/id/{id}, Cancel Order
Order codeHFUEBSFQJGSRELUHThe order's unique alphanumeric codeGET /orders/code/{code}
icgidCY00001234406861The company's ICG ID, returned by SearchGET /report/{type}/code/{code}, and code on order items

Each item inside an order also has its own id and code (for example 1327 and HOXYBHRLCUWXYGYY) the item-level identifiers, distinct from the order-level ones.

Create an order

POST https://sandbox-v3.api4all.io/a4a/3.0/api/orders/create/
Authorization: Bearer {access_token}
Content-Type: application/json
{
  "reference": "123456",
  "items": [
    {
      "code": "CY00001234406861",
      "reference": "123456",
      "language": "EN",
      "product": "2200",
      "format": "JSON",
      "speed": "Normal",
      "freshinvestigation": 0,
      "comments": ""
    }
  ]
}

reference is yours: Any value you want for internal tracking. It appears on both the order and the item, and you'll need it again if you cancel.

An order can carry multiple items, so you can request several reports on different companies, or different products for the same company in a single call.

See Product Codes for every field and its allowed values.

The order object

Both Create Order and the two Get Order calls return the same shape:

{
  "messages": [],
  "searchdate": "2025-12-01 17:36:57.057",
  "searchtype": "id",
  "searchterm": "299",
  "records": 1,
  "orders": [
    {
      "id": "299",
      "code": "HFUEBSFQJGSRELUH",
      "reference": "123456",
      "dateplaced": "2025-12-01 17:36:46",
      "datestarted": "",
      "information": "",
      "comments": "",
      "items": "1",
      "status": "Received",
      "details": [
        {
          "id": "1327",
          "code": "HOXYBHRLCUWXYGYY",
          "reference": "123456",
          "icgid": "CY00001234406861",
          "name": "INFOCREDIT GROUP LIMITED",
          "reg_no": "C4404",
          "country": "CY",
          "product": "API4ALL - Structure Report",
          "format": "JSON",
          "speed": "Normal",
          "investigation": "0",
          "report": null,
          "dateplaced": "2025-12-01 17:36:56",
          "status": "Received"
        }
      ]
    }
  ]
}
FieldNotes
messagesArray of messages relating to the request
searchtypeHow the order was looked up
searchtermThe value that was looked up
recordsNumber of orders returned
itemsNumber of items on the order, as a string
statusOrder status
detailsThe order's items, each with its own status
reportThe report file, once ready. null while the order is still in progress

Note that the order carries a status and each item carries its own status.

Retrieve an order

By order ID:

GET https://sandbox-v3.api4all.io/a4a/3.0/api/orders/id/299
Authorization: Bearer {access_token}

By order code:

GET https://sandbox-v3.api4all.io/a4a/3.0/api/orders/code/HFUEBSFQJGSRELUH
Authorization: Bearer {access_token}

Both return the same order. The report is delivered as a binary file in the report field of the order detail once the order completes.

📘

Two ways to get the report. You can read it from the order's report field, or fetch it directly by company code from the matching report endpoint. For example GET /a4a/3.0/api/report/structure/code/CY00001234406861.

Order statuses

StatusMeaning
ReceivedThe order has been accepted and is queued
In progressThe order is in progress
ReadyThe order is ready
CancelledThe order was cancelled
FailedThe order has failed

Cancel an order

POST https://sandbox-v3.api4all.io/a4a/3.0/api/orders/cancel/
Authorization: Bearer {access_token}
Content-Type: application/json
{
  "orders": [
    {
      "id": 123,
      "reference": "123456",
      "comments": ""
    }
  ]
}
FieldTypeRequiredDescription
idintegerYesThe unique Order ID generated at the time of order creation
referencestringYesYour reference number for the order
commentsstringNoAny notes regarding the cancellation

When cancellation is possible

Cancellation only works when both conditions hold:

  1. The order was placed with fresh investigation enabled (freshinvestigation: 1), and
  2. The order status is still Received.

Once an investigation for data already on file (freshinvestigation: 1) is underway, the window for cancellation has closed.

The response is the order object with status updated to Cancelled, on both the order and its items.

Putting it together

Search ──► company_code (ICG ID)
             │
             ▼
      POST /orders/create/  ──►  order id + order code
             │
             ├──► GET /orders/id/{id}      ──► poll status
             ├──► GET /orders/code/{code}  ──► poll status
             │
             ├──► POST /orders/cancel/     ──► only if freshinvestigation = 1
             │                                  and status = Received
             ▼
      report ready ──► read `report` field
                   └─► or GET /report/{type}/code/{icgid}

Did this page help you?