MatchAPI Specification v1.0.0

MatchAPI Specification v1.0

Overview

MatchAPI is a schema designed for defining financial messaging APIs across a variety of protocol encodings. It provides a structured and extensible model for describing message formats, fields, data types, and hierarchical relationships between message elements. The specification aims to support interoperability, extensibility, and tooling across different environments where financial messaging is critical.

Version

Purpose

This document defines the structure and semantics of all elements available in the MatchAPI schema. It is intended to be a comprehensive reference for users who wish to define, consume, or transform API message definitions using MatchAPI.


Table of Contents

  1. Schema Metadata

  2. Element Definitions

  3. Classification Structures

  4. Key Constraints

  5. Annotations


Schema Metadata

Properties

  • name: Name of the API.
  • id: Identifier (UUID or URL).
  • url: External reference for further info.
  • version: API version.
  • protocolVersion: Underlying protocol version.
  • endianness: Either big or little (for binary encodings).

Example

{
  "name": "Example Trading API",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "version": "1.0.0",
  "protocolVersion": "FIX.4.4",
  "endianness": "big"
}

Element Definitions

Messages (message)

Messages represent API operations (requests, responses, events). Defined as complex elements containing fields, groups, or components.

Properties

  • msgType: Application-level type.
  • msgCategory: Logical grouping (session, application, etc.).
  • direction: in, out, or both.
  • content: List of child elements (fieldRef, groupRef, componentRef).
  • contentComposition: allOf or oneOf.
  • contentOrdering: ordered or unordered.

Example

{
  "name": "Logon",
  "msgType": "A",
  "msgCategory": "session",
  "direction": "in",
  "content": [
    { "refType": "field", "refKey": { "name": "EncryptMethod" } },
    { "refType": "field", "refKey": { "name": "HeartBtInt" } }
  ]
}

Components (component)

Reusable groups of fields or other elements.

Properties

  • Same structure as messages (except without msgType, etc.)

Example

{
  "name": "StandardHeader",
  "content": [
    { "refType": "field", "refKey": { "name": "BeginString" } },
    { "refType": "field", "refKey": { "name": "BodyLength" } }
  ]
}

Groups (group)

Defines a repeating structure.

Properties

  • Inherits from complexElement
  • headerRef: Points to the field/component that indicates group repetition count.
  • minInstances, maxInstances

Example

{
  "name": "NoPartyIDs",
  "headerRef": { "name": "NoPartyIDs" },
  "content": [
    { "refType": "field", "refKey": { "name": "PartyID" } },
    { "refType": "field", "refKey": { "name": "PartyRole" } }
  ]
}

Fields (field)

Basic atomic values, typically associated with a dataType.

Properties

  • typeRef: Required reference to a dataType.
  • allowOtherValues: Boolean.
  • valuePattern: Regex.
  • terminatingChar, paddingChar, paddingSide
  • minValue, maxValue, minLength, maxLength
  • charSet, lengthHeaderRef, byteLength
  • value: Default or constant.

Example

{
  "name": "ClOrdID",
  "typeRef": { "name": "String" },
  "minLength": 1,
  "maxLength": 20
}

Data Types

Data types describe the format and constraints for field values.

dataType (Primitive)

{
  "name": "String",
  "type": "primitive",
  "charSet": "ASCII"
}

derivedDataType

{
  "name": "UserID",
  "type": "derived",
  "baseTypeRef": { "name": "String" },
  "maxLength": 64
}

enumDataType

{
  "name": "Side",
  "type": "enum",
  "baseTypeRef": { "name": "char" },
  "values": [
    { "name": "Buy", "value": "1" },
    { "name": "Sell", "value": "2" }
  ]
}

arrayDataType

{
  "name": "StringList",
  "type": "array",
  "baseTypeRef": { "name": "String" },
  "elementsOrdered": true,
  "elementsUnique": false
}

compositeDataType

{
  "name": "SessionInfo",
  "type": "composite",
  "content": [
    {
      "name": "SessionID",
      "typeRef": { "name": "String" },
      "presence": "required"
    },
    {
      "name": "Timeout",
      "typeRef": { "name": "int" },
      "presence": "optional"
    }
  ]
}

bitsetDataType

{
  "name": "Flags",
  "type": "bitset",
  "bitLength": 8,
  "content": [
    {
      "name": "UrgentFlag",
      "bitOffset": 0,
      "bitLength": 1,
      "presence": "required"
    },
    {
      "name": "RetryCount",
      "bitOffset": 1,
      "bitLength": 3,
      "presence": "optional"
    }
  ]
}

Classification Structures

Variants

Used to define variations of an element (e.g. for different environments).

Example

{
  "name": "NewOrder",
  "variant": "production"
}

Categories

Group elements logically under a common domain.

Example

{
  "name": "OrderEntry",
  "componentType": "message",
  "includeFile": "components"
}

Sections

Group categories into documentation or logical blocks.

Example

{
  "name": "Trading",
  "description": "Messages related to trade entry and execution."
}

Key Constraints

Key Definitions (optional overrides)

{
  "fields": {
    "primaryKey": ["name"],
    "alternateKeys": [["id"]]
  },
  "dataTypes": {
    "primaryKey": ["name"],
    "alternateKeys": [["id"]]
  }
}

Annotations

Documentation

{
  "documentation": [
    {
      "role": "summary",
      "text": "This message initiates the session."
    }
  ]
}

Additional Data

{
  "additionalData": [
    {
      "role": "implementationNote",
      "data": "Used only by internal systems."
    }
  ]
}

Change Log

{
  "changeLog": [
    {
      "changeType": "added",
      "version": "1.1.0",
      "description": "Initial release of the NewOrder message"
    }
  ]
}

Compliance and Conformance

MatchAPI does not prescribe a runtime behavior but rather focuses on:

  • Enabling schema validation
  • Standardizing documentation
  • Supporting encoding-specific mapping
  • Tooling for generation, transformation, and UI visualization

Future Extensions

MatchAPI is designed to evolve. Future versions may introduce:

  • Runtime validation logic
  • Encoding-specific enhancements
  • Support for protocol-specific annotations (e.g. FIX, SBE, JSON)

References


This specification is open for community feedback and contribution.