Disclosure: As an Amazon Associate, CardWise earns from qualifying purchases at no additional cost to you. This does not affect our recommendations.

GPO vs GENERATE AC — The Two APDUs That Run Contactless Payments

Every EMV contactless transaction — whether you tap a Visa, Mastercard, or Amex — involves two critical APDU commands: GET PROCESSING OPTIONS (GPO) and GENERATE AC. GPO is the terminal asking the card "what do you need from me?" GENERATE AC is the terminal saying "prove this transaction is genuine." Together, they form the backbone of the EMV contactless protocol.

This guide compares these two commands in detail: their roles, APDU structure, data exchange, cryptogram types, and the decision logic that determines whether a transaction goes online or completes offline.

The EMV Contactless Transaction Flow

1. SELECT AID (e.g., A0000000041010 for Visa Debit)
   → Card returns PDOL (Processing Options Data Object List)

2. GET PROCESSING OPTIONS (GPO)
   → Terminal sends PDOL data (amount, terminal country, etc.)
   ← Card returns AIP + AFL

3. READ RECORD (for each AFL entry)
   → Terminal reads card data records
   ← Card returns TLV data (PAN, expiry, CDOL1, CDOL2)

4. DATA AUTHENTICATION (SDA/DDA/CDA)
   → Terminal verifies card's static/dynamic data

5. GENERATE AC (First AC)
   → Terminal sends CDOL1 data + requests cryptogram
   ← Card returns ARQC (online) or TC (offline) or AAC (decline)

6. [If online] EXTERNAL AUTHENTICATE
   → Terminal sends issuer's ARPC response
   ← Card verifies issuer authorization

7. [If online] GENERATE AC (Second AC)
   → Terminal requests final cryptogram
   ← Card returns TC (approved) or AAC (declined)

GPO: GET PROCESSING OPTIONS

GPO is the terminal's way of asking the card what data it requires to process the transaction. The card's response tells the terminal which application data records to read and what capabilities the card supports.

GPO Command APDU

CLA: 80
INS: A8
P1:  00
P2:  00
Lc:  [length of PDOL data]
Data: [PDOL data — amount, terminal country code, etc.]
Le:  00

Example (Visa payWave):
80 A8 00 00 23 83 21
  00 00 00 00 10 00     // Amount = $1.00
  00 00                // Terminal country code
  00 00 00             // Terminal type, etc.
  00                   // Transaction currency code

GPO Response

Response TLV:
  80 [length] [AIP (2 bytes)] [AFL (variable)]

AIP (Application Interchange Profile):
  Bit 8-7: SDA support
  Bit 6: DDA support
  Bit 5: CDA support
  Bit 4: Online PIN
  Bit 3: Offline PIN (plaintext)
  Bit 2: Offline PIN (enciphered)
  Bit 1: No CDA

AFL (Application File Locator):
  Points to the card's data records to be read
  Format: [SFI] [Record start] [Record end] [Offline auth]

GPO is the negotiation step. The card says "I support these features (AIP) and here's where my data lives (AFL). The terminal then reads the records pointed to by the AFL to get the PAN, expiry date, certificates, and CDOLs (Cardholder Verification Data Object Lists).

GENERATE AC: The Cryptogram Request

After reading all card data and performing risk checks, the terminal sends GENERATE AC to request a cryptogram. This is the security-critical step — the card signs the transaction data with its secret key.

GENERATE AC Command APDU

CLA: 80
INS: AE
P1:  [cryptogram type requested]
     00 = AAC (decline)
     40 = TC (offline approval)
     80 = ARQC (online authorization)
P2:  00
Lc:  [length of CDOL1 data]
Data: [CDOL1 data — amount, ATC, unpredictable number, etc.]
Le:  00

The card computes:
  AC = MAC(K_card, [transaction data] || [ATC] || [P1])
  using the card's unique key K_card (derived from master key)

Cryptogram Types

CryptogramP1 ValueMeaningAction
ARQC80Authorization Request CryptogramSend to issuer for online approval
TC40Transaction CertificateOffline approval by terminal
AAC00Application Authentication CryptogramDecline (terminal or card rejected)
AAR60Authorization Request ResponseCard requests issuer referral
Who decides: online or offline? The card makes the decision based on the terminal's risk management data and the card's own risk parameters. If the amount is under the terminal's floor limit and the card's risk counters are normal, the card may generate a TC (offline approval). If the amount exceeds the floor limit or the card detects anomalies, it generates an ARQC (requesting online authorization from the issuer).

GPO vs GENERATE AC Comparison

DimensionGPOGENERATE AC
RoleNegotiation: "what do you need?"Cryptographic proof: "prove it"
INS byteA8AE
InputPDOL data (terminal capabilities)CDOL data (transaction details)
OutputAIP + AFL (card capabilities + data locations)Cryptogram (ARQC/TC/AAC) + card data
Cryptographic OperationNone (data exchange only)AES/3DES MAC with card's secret key
When in FlowStep 2 (before reading records)Step 5 (after risk assessment)
Can Complete Offline?N/A (always executed)Yes (if card returns TC)
Security ImpactLow (informational)Critical (transaction integrity proof)

Visa payWave vs Mastercard Contactless Flow Differences

The two major card networks have slightly different contactless implementations:

AspectVisa payWave (qVSDC)Mastercard (PayPass/MCHIP)
GPOStandard GPO with PDOLGPO with PDOL (same)
Data AuthenticationDDA or CDASDA, DDA, or CDA
First GENERATE ACAlways ARQC (online)ARQC or TC (card decides)
Offline ApprovalLimited (fCSDA)Common (TC for small amounts)
Risk ManagementTerminal + card riskTerminal + card risk
ACR122U NFC Reader ACR122U NFC Reader — Send GPO and GENERATE AC APDUs to real payment cards for EMV development and testing. PC/SC compatible. — Check Price on Amazon

Why Understanding GPO and GENERATE AC Matters

Related Comparisons

Summary

GPO negotiates; GENERATE AC proves. GPO is the informational handshake where the card and terminal exchange capabilities and data locations. GENERATE AC is the cryptographic commitment where the card signs the transaction with its secret key, producing the cryptogram that the issuer verifies. Together, they form the core of every EMV contactless payment.

Want to simulate an EMV contactless flow? Try our Contactless Activation Flow Simulator or the EMV Cryptogram Decoder.