Logic4

Logic4 API - Response format

Terug naar beginpagina

Introduction

This document describes the format of the body returned by Logic4 API endpoints. The response format has changed with the move to version 3 endpoints.

From V3.0

From V3.0 onwards, the response body of endpoints contains unformatted JSON with the following attributes:

Note that some endpoints return no body on success.

This compact JSON reduces overhead, resulting in faster response times and decreased network usage.

Problem details

Endpoints from V3.0 onwards use RFC 9457 for unsuccessful repsonses. This standard describes various fields and values, the Logic4 API uses the following:

Example response:

{
  "type": "tag:api.logic4.nl,2025-08-16:InvalidRequest",
  "title": "The request has invalid parameters",
  "status": 400,
  "detail": "Geen orderregels gevonden om uit te leveren voor OrderId 300234",
  "operationId": "5e151dcea819025c0a829b0cd98f220a",
}

type

The type field identifies the problem type. It is intended to be parsed by a computer to identify a specific error.

The Logic4 API uses a non-dereferenceable tag URI as specified by RFC 4151. The structure is: tag:authorityName,date:specific.

Change policy

The type URI is fixed for any given error and will not change within the same version of a specific endpoint. However, under some circumstances the specific error returned might change without notice according to the following policy:

title

The title field is a human-readable summary of the problem type, in English. Examples:

status

The status field is always equal to the status code of the HTTP response.

detail

The detail field is a human-readable explanation specific to this occurrence of the problem, in Dutch. It may help to correct the problem, for instance specifying the Id or name of a product, order customer etc. Examples:

operationId

The custom field operationId can be used by Logic4 to find the request in our logging system.

Legacy

Endpoints before V3.0 differ in the following ways:

Wrapper examples

Logic4Repsonse:

{
  "Value": 1,
  "ValidationMessages": []
}

Logic4ResponseList:

{
  "Records": [
    {
      "OrderId": 3
    }
  ],
  "RecordsCounter": 1,
  "ValidationMessages": []
}

Formatted JSON format

Legacy endpoints optionally support formatted JSON output containing:

To request the formatted JSON output, specify X-LOGIC4-FormattedJson in the request header (without a value). Note that this is not supported in V3.0+ endpoints.

We recommend against using this option because the output is larger, resulting in longer response times and increased network usage.