getneo
  1. Technical topics
getneo
  • Introduction
  • API examples
  • Technical topics
    • API structure
    • HTTP headers
    • Decoupled responses
    • Validation failures (418)
  • Endpoints
    • Auth
      • Get service bearer token (password)
        GET
      • Change tenant
        GET
      • End session
        GET
    • Counterparties
      • Get all counterparties
        GET
      • Get counterparty by ID
        GET
      • Get draft counterparty by ID
        GET
      • Submit counterparty draft
        POST
      • Update counterparty draft
        POST
      • Delete a counterparty draft
        DELETE
      • Add account to counterparty
        POST
      • Update counterparty account
        PATCH
      • Export counterparty data
        POST
    • Payments
      • Get all payments
        GET
      • Get a payment by ID
        GET
      • Make a payment (deposit, withdrawal or internal)
        POST
  1. Technical topics

Validation failures (418)

The Neo FX Hub provides different response status between an API request containing an invalid body structure (400), for example, the wrong type specified for a property, and a request with a valid structure that can't be processed due to invalid data (418), for example, missing a required value or referencing an item that can't be found.
The short rule is that a 400 response means that the request needs to be reviewed technically and a 418 means that the data of the request may need adjusting.
In addition, a 418 will always include a detailed response body of what needs adjusting, while a 400 may not, as it may not be possible to know why the body is invalid.

Example#

If the API endpoint is documented to receive:
{
  "id": "string", // Length 8; alphanumeric
  "count": "number", // Must match length of items array
  "items": [ "string" ] // Between 1 and 10
}
The following request will give a 400 response with no body:
{
  "id": "abcd1234", // Okay
  "count": "some", // Invalid
  "items": "value" // Invalid
}
While the next request will give a 418 with a body:
{
  "id": "abcd*", // Too short and non-alphanumeric
  "count": 9, // Doesn't match items length
  "items": [ ] // Can't be empty
}
{
  "id": [
    {
      "error": "bad_length",
      "params": {
        "len": 8 // Expected length
      }
    },
    {
      "error": "invalid" // The value can't be used
    }
  ],
  "count": [
    {
      "error": "invalid",
      "params": {
        "len": 1 // Minimum value
      }
    }
  ],
  "items": [
    {
      "error": "invalid",
      "params": {
        "len": 1 // Minimum length
      }
    }
  ]
}
Endpoints should specify the possible list of error codes per field and their specific meaning. Many codes (such as "invalid") are overloaded based on scenario.
Modified at 2025-07-24 14:08:00
Previous
Decoupled responses
Next
Auth
Built with