Header Metadata

Top-level object

Every CWR-JSON file is a single JSON object. The reference implementation emits:

{
  "header": { ... },
  "works":  [ ... ]
}

For interchange, a root $schema URL may be added (recommended; see Schema Validation).

KeyTypeReqDescription
$schemastringOURL of the JSON Schema used to validate this file (recommended for exchange)
headerobjectOFile-level metadata from the CWR HDR record
worksarrayMOne object per NWR / REV transaction

File-level validation

RuleRejection
File must be parseable as valid JSONER
works must be present and an arrayER
Each work must include messages (with schema and schemaDescription in v1.0 Playground output)TR / RR
Transactions from multiple submitters cannot be co-mingled in one logical submissionER

CWR-JSON is a JSON document, not a sequence of EDI records. Validation refers to JSON structure and semantics, not “first line = HDR”.


HDR → header

The header object is derived from the CWR HDR record. The Playground currently maps these fields:

FieldTypeReqCWR SourceDescription
senderIdentifierstringOSenderIdentifierTransmitter Code of the sender
senderNamestringOSenderNameLegal name of the sending entity
creationDatestringOCreationDateFormat: YYYYMMDD
creationTimestringOCreationTimeFormat: HHMMSS
versionstringOVersionCWR EDI version from the source file (e.g. "2.1", "2.2") — not the CWR-JSON format version
softwarePackagestringOSoftwarePackageSoftware that generated the source file

Additional HDR fields (transmissionDate, characterSet, revision, softwarePackageVersion) are defined in the TypeScript model and JSON Schema but are not yet populated by the mapper — see Changelog.

Example

"header": {
  "senderIdentifier": "EMI",
  "senderName": "EMI MUSIC PUBLISHING LTD",
  "creationDate": "20260101",
  "creationTime": "120000",
  "version": "2.1",
  "softwarePackage": "CWR-JSON Playground"
}

Field-level validation

  • creationDate and creationTime, when present, must conform to YYYYMMDD / HHMMSS. (FR)
  • version, when present, should be a recognised CWR EDI version string from the source transmission. (FR)

Data element types

All field values follow these type rules:

CodeJSON typeRules
AstringValid UTF-8. Alphabetic codes in UPPER CASE.
Bbooleantrue or false (not "Y" / "N")
DstringDate format YYYYMMDD. Use "00000000" when no date is available.
NnumberDecimal percentage, e.g., 50.00. Omit if null and optional.
TstringTime/duration format HHMMSS (24-hour). Omit if null and optional.
LstringLookup value. Valid values from a code table — see Role Codes & related tables.

Optional fields

Optional fields (Req = O) must be omitted from the JSON object if they have no value — do not include them as null.

// ✅ Correct — omit optional fields with no value
{ "senderIdentifier": "EMI", "creationDate": "20260101" }

// ❌ Wrong — do not include null optional fields
{ "senderIdentifier": "EMI", "creationDate": "20260101", "characterSet": null }