Skip to main content

AI-Process Credit Card in n8n

AI-Process Credit Card is a PDF4me node action in n8n that reads a credit card image or PDF and returns the card details as structured JSON fields. Use it to capture cardholder name, card number, expiry, and issuing bank from a scan or photo instead of retyping them into a form by hand.

What this node does

PDF4me: AI-Process Credit Card takes a card file from Binary Data, a Base64 String, or a URL and applies vision AI to return a creditCardData object holding the individual card fields. It accepts PDF, PNG, JPG, and JPEG. Because it returns discrete values rather than a blob of text, the next workflow step can act on a single field, and you can choose deliberately which of those values are worth keeping.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate extraction requests securely.

Important Facts You Should Not Miss

Extracting is not the same as storing
Card numbers and security codes are regulated data. Decide field by field what the workflow persists, and drop the rest before anything reaches storage or logs.
Empty strings, not missing keys
Fields the model cannot read come back as "" rather than being absent, so test for empty values instead of checking whether a key exists.
Image quality drives accuracy
Glare, angle, and embossed digits all reduce OCR reliability. Use the warnings array and fallbackUsed to route doubtful results to review.
PDF4me AI-Process Credit Card node in n8n, reading a credit card file and returning structured card fields

PDF4me AI-Process Credit Card action in n8n

Card OCR vs a Generic Document Parser

PDF4me ships both a card-specific action and a general parser. The card action knows what a card looks like; the general parser is told what to look for.

AspectAI-Process Credit CardAI Document Parser
Field setA fixed card schema returned as creditCardDataWhatever fields you define for the document
Setup effortNone, the card fields are already knownYou describe the fields you want extracted
Best fitPayment cards specificallyAny document shape the card action does not cover
Extending itCustom Field Keys for extras beyond the card schemaFully defined by you from the start

What Parameters Does AI-Process Credit Card Need?

Required: Action, Input Data Type, the field matching that input type, and Credit Card Name. Custom Field Keys is optional.

ParameterRequiredWhat it doesExample
ActionRequiredSelects the PDF4me node action to run. Choose AI-Process Credit Card.AI-Process Credit Card
Input Data TypeRequiredFormat of the source card input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the card file. Required when Input Data Type is Binary Data. Defaults to data.data
Base64 Credit Card ContentConditionalBase64-encoded content of the card file. Required when Input Data Type is Base64 String.JVBERi0xLjQKJ...
Credit Card URLConditionalPublicly reachable HTTPS URL to the card file. Required when Input Data Type is URL.https://example.com/card.jpg
Credit Card NameRequiredFilename of the input file, used for format detection. Accepts .pdf, .png, .jpg, and .jpeg extensions, so give it the extension the file actually is.card.jpg
Custom Field KeysOptionalList of extra field keys to pull beyond the standard card schema. Leave empty unless the source carries values the built-in fields do not cover.["loyaltyId", "branchCode"]

Output Fields

The node returns JSON rather than a file. The card values live inside the creditCardData object.

FieldTypeWhat it contains
creditCardDataObjectThe extracted card fields. See the field breakdown below.
jobIdStringIdentifier for the AI processing job, useful when reporting an extraction problem.
jobIdExtStringExternal job identifier for third-party integration, null when unused.
successBooleanTrue when extraction completed. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

Fields Inside creditCardData

Any field the model cannot read on a given image comes back as an empty string.

FieldTypeWhat it contains
cardholderNameStringName as it appears on the card.
cardNumberStringThe primary account number. Regulated data, so handle deliberately.
expiryDateStringExpiry date, typically MM/YY.
validFromStringValid-from date where the card shows one.
validThruStringValid-through date, often the same as expiryDate.
cvvStringCard security code. The PCI DSS standard prohibits retaining this after authorisation.
cardTypeStringCard type where detected, such as credit or debit.
cardBrandStringCard brand where detected, such as Visa or MasterCard.
bankNameStringBank name printed on the card.
issuingBankStringIssuing bank where it can be determined separately from bankName.
accountNumberStringAssociated account number when the source is a statement rather than a card face.
warningsArrayMessages about data quality or extraction difficulty on this file.
fallbackUsedBooleanWhether an alternative extraction path was used. A useful low-confidence signal.

How Do I Set Up AI-Process Credit Card in n8n?

  1. Add PDF4me to your n8n workflow and choose the AI-Process Credit Card action.
  2. In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
  3. Set Input Data Type to Binary Data (default), Base64 String, or URL and supply the matching card file field.
  4. Set Credit Card Name with the correct extension, for example card.jpg or statement.pdf.
  5. Optionally add Custom Field Keys for values beyond the standard card schema.
  6. Execute the node and read the creditCardData object from the response.
  7. Before storing anything, select just the fields you actually need and drop the rest.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using AI-Process Credit Card.
Onboarding without retyping
  1. A customer uploads a photo of their card during sign-up.
  2. AI-Process Credit Card reads the cardholder name and expiry.
  3. Only the non-sensitive fields are used to prefill the form for confirmation.
Route low-confidence reads to a human
  1. The node processes an uploaded card image.
  2. An IF node checks the warnings array and fallbackUsed flag.
  3. Anything doubtful goes to a review queue instead of straight through.
Expiry monitoring on file
  1. A card image is processed once at capture time.
  2. Only expiryDate and the cardholder name are retained.
  3. A scheduled workflow flags cards approaching expiry for renewal outreach.
Match a statement to an account
  1. A card statement PDF arrives in a shared mailbox.
  2. The node extracts bankName and accountNumber.
  3. The statement is filed against the matching account record.

Practical Tips

Drop what you do not need immediately
Select the handful of fields the workflow actually uses in the very next node, so the full card payload never reaches storage, logs, or an error notification.
Give the filename its real extension
Credit Card Name drives format detection. Calling a JPEG card.pdf invites a failed or degraded read.
Check warnings before trusting a value
The warnings array and fallbackUsed are the cheapest confidence signal available. Branch on them rather than assuming a clean read.
Test for empty strings, not missing keys
Unread fields return as empty strings, so a key-existence check will pass on a field that holds nothing.
Improve the input before blaming the model
A flat, evenly lit, high resolution capture beats any amount of downstream correction, especially on embossed digits.
Use Custom Field Keys sparingly
The standard schema covers the card face. Reach for custom keys only when the source genuinely carries something extra.

Cheat Sheet

FieldValue
ActionAI-Process Credit Card
Input Data TypeBinary Data
Input Binary Fielddata
Credit Card Namecard.jpg
Custom Field Keys(empty)
Accepted formatsPDF, PNG, JPG, JPEG
ReturnsJSON with a creditCardData object
CredentialsPDF4me API credential

Common Questions

What file formats can the node read a credit card from?+
PDF, PNG, JPG, and JPEG. Set Credit Card Name with the matching extension so the format is detected correctly, for example card.jpg for a photo or statement.pdf for a document.
Which fields come back, and why are some empty?+
The creditCardData object carries fields such as cardholderName, cardNumber, expiryDate, validThru, bankName, and cvv. Fields the model cannot read on a given image come back as empty strings rather than being omitted, so check for empty values instead of assuming every key is populated.
Should I store the extracted card number and CVV?+
Treat that decision carefully. A primary account number and security code are exactly the data the PCI Security Standards Council governs through PCI DSS, and the standard prohibits retaining the card verification code after authorisation. Extracting a field in a workflow does not mean you should persist it, so drop what you do not need before writing anything to storage or logs, and confirm your own obligations against the current standard.
What are the warnings and fallbackUsed fields for?+
warnings is an array of messages about data quality or extraction difficulty on that file, and fallbackUsed indicates whether an alternative extraction path was taken. Both are useful signals for routing low-confidence results to a human review branch in your n8n flow logic instead of straight through.
How accurate is OCR on a photographed card?+
Accuracy depends heavily on the source image. Embossed numbers at an angle, glare, and low resolution all reduce it. Check the success flag and the warnings array, and route anything doubtful to manual review rather than trusting a single pass on a photograph.

Same Task on Other Platforms

Get Help