MsgId

The unique identifier of an ISO 20022 message inside its GroupHdr.

MsgId is the unique identifier of an ISO 20022 message, set inside <GrpHdr>/<MsgId> on pain.001, pain.008, pain.002, and most other "I am a discrete message" envelopes. It is a 35-character free-text field but conventionally constrained to letters, digits, hyphens, and underscores.

The reason it matters in production: banks deduplicate on MsgId. If you submit two pain.001 envelopes with the same MsgId your bank's inbound channel will silently ignore the second one (and may or may not return a pain.002 explaining that). Conversely, if your code regenerates a MsgId on every retry you will produce duplicate payrolls when an upstream timeout retries a successfully-submitted batch.

iso-compliant derives MsgId deterministically from the request's idempotency key + tenant ID, so the same logical request always yields the same MsgId. The derivation lives at apps/api/src/lib/msgId.ts. The customer can override it via the msg_id request field when they want to align with their own batch identifier.

Related terms

← All terms