ISO 8583 & Response Codes: Payment Messaging Overview
Last Updated: 2026-12-01 Status: Complete
Every card authorization, however friendly the JSON API in front of it, eventually becomes a structured message in ISO 8583 and returns an answer in a two-character response code. This category explains both halves: the message format that carries the request, and the codes that describe the outcome.
Engineers who understand these layers can debug an unexplained decline from the raw fields, design a decline taxonomy that does not collapse every failure into "card declined", and avoid retry behavior that the card networks penalize.
Quick Reference
| Topic | Key facts |
|---|---|
| Message format | ISO 8583 editions 1987, 1993, 2003 (withdrawn July 2023) and 2023 (current); networks use proprietary dialects |
| Message type | Four-digit MTI: version, class, function, origin |
| Field layout | Bitmap announces which of up to 128 data elements are present |
| Outcome | Data element 39 carries the response code |
| Decline handling | Classify as soft or hard; networks publish category rules |
| Sensitive fields | DE 2, 14, 35, 45 and 52 carry cardholder or sensitive authentication data and must never be logged |
How the Pieces Fit
The gateway translates JSON to ISO 8583 on the way out and translates a network response code into an internal decision on the way back. Most engineering judgment in this category lives at those two translation points.
Learning Objectives
After completing this category you should be able to:
- Decode an MTI and a hexadecimal bitmap by hand and identify which data elements are present.
- Explain how STAN, RRN and network transaction ID differ and how requests, responses and reversals are matched.
- Map gateway API fields to ISO 8583 data elements and explain why DE 22 influences risk and interchange.
- Distinguish soft declines from hard declines using Visa decline categories and Mastercard Merchant Advice Codes.
- Design an internal decline taxonomy and decide what to show the customer versus what to log.
- Recognize that a timeout is not a decline and route it to reversal and recovery logic.
Topics
- ISO 8583 Explained: MTIs, Bitmaps and Data Elements: message anatomy, bitmap decoding, key data elements, matching identifiers and a parser sketch.
- Card Decline Codes: Response Codes, Soft vs Hard Declines: the DE 39 reference table, network decline categories, and a TypeScript mapping to an internal taxonomy.
- Messaging Quiz: scenario questions to test your judgment.
Retry scheduling and limits are covered in Retry Strategy. Authorization types and reversals are covered in Authorization Types.
Related Topics
- Transaction Lifecycle Overview: the conceptual flow that these messages implement.
- Transaction Routing: how BINs steer a message to the correct issuer.
- Chargeback Reason Codes: a different code family that should not be confused with authorization response codes.
- Key Numbers: current values for time-sensitive network rules.