# Card Payments, SCA & APP Scam Rules API > Pure-compute card PAN checks and masking, EU/US interchange cap prechecks, PSD2 SCA exemption evaluation, UK APP scam reimbursement splits, and PSD2 eIDAS certificate role parsing from caller input. Each paid operation uses a fixed USDC price on Base with the x402 exact scheme. Unpaid GET, HEAD, and POST return 402 payment terms (POST validates the body only after payment terms are satisfied). A request that carries payment-signature is not yet charged: settlement happens only after a successful (2xx) result. HTTP 4xx/5xx are not charged. Coverage bodies with status complete, partial, or failed all return HTTP 200 and are charged at the full listed price. Settled 2xx responses include a payment-response header; 4xx/5xx do not. Follow https://www.brainiac.software/agent-instructions.txt for install, payment pins, idempotency, and billing rules. - Product: https://www.brainiac.software/api/card-payments - Docs: https://www.brainiac.software/api/card-payments/docs - OpenAPI: https://www.brainiac.software/api/card-payments/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/card-payments/pan-check $0.01 USDC. Check card number length and Luhn check digit. Never echoes the full PAN; returns masked form and last4 only. Inputs: pan Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-pan-check Example request: ```json { "pan": "4111111111111111" } ``` Example response: ```json { "length": 16, "luhnValid": true, "last4": "1111", "masked": "411111******1111", "sources": [ { "source": "ISO/IEC 7812-1 Annex B Luhn (mod 10)", "url": "https://www.iso.org/standard/70484.html", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Luhn and length only; does not identify the brand or confirm the card exists.", "Not legal advice. Outputs are lookups or prechecks for human review." ] } ``` ### POST /api/v1/card-payments/pan-mask $0.01 USDC. PCI DSS display masking for a single PAN, or find and redact Luhn-valid PANs in free text. Inputs: pan?, text?, binLength? Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-pan-mask Example request: ```json { "pan": "4111111111111111", "binLength": 6 } ``` Example response: ```json { "masked": "411111******1111", "sources": [ { "source": "PCI DSS v4.0.1 Req 3.4.1 / FAQ #1492", "url": "https://www.pcisecuritystandards.org/faqs", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Display masking only; storage truncation formats are out of scope.", "Not legal advice. Outputs are lookups or prechecks for human review." ] } ``` ### POST /api/v1/card-payments/interchange-cap-check $0.02 USDC. Compute regulated maximum interchange under EU IFR consumer caps or US Reg II debit caps and flag fees above the cap. Inputs: regime, cardType, amount, currency, actualFee?, regulatedIssuer?, fraudAdjustmentEligible?, domesticCapOverride? Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-interchange-cap-check Example request: ```json { "regime": "EU_IFR", "cardType": "consumer_debit", "amount": 10000, "currency": "EUR", "actualFee": 30 } ``` Example response: ```json { "capMinor": 20, "capExact": 20, "capFormula": "0.2% × 10000", "exceedsCap": true, "excessMinor": 10, "sources": [ { "source": "Regulation (EU) 2015/751 Arts 3–4", "url": "https://www.legislation.gov.uk/eur/2015/751/article/3/adopted", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Member State domestic lower caps are not bundled; pass domesticCapOverride when needed.", "Rounding uses floor(capExact); regulations do not specify rounding.", "…" ] } ``` ### POST /api/v1/card-payments/sca-exemption-evaluate $0.03 USDC. Decide which PSD2 RTS SCA exemptions may apply to a remote or contactless payment from caller-supplied facts. Inputs: channel, instrument, amountEur, sinceLastSca?, trustedBeneficiary?, trustedBeneficiaryListChanging?, recurringSameAmountSamePayee?, firstInSeries?, sameOwnerSameAspsp?, tra? Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-sca-exemption-evaluate Example request: ```json { "channel": "remote", "instrument": "card", "amountEur": 25, "sinceLastSca": { "cumulativeEur": 40, "count": 2 } } ``` Example response: ```json { "scaRequired": false, "exemptions": [ { "article": "16", "name": "remote_low_value", "applies": true } ], "evaluated": [ { "article": "11", "name": "contactless_pos", "applies": false, "reason": "channel is not contactless_pos" }, { "article": "13", "name": "trusted_beneficiaries", "applies": false, "reason": "payee is not a trusted beneficiary" }, "…" ], "sources": [ { "source": "Commission Delegated Regulation (EU) 2018/389", "url": "https://www.legislation.gov.uk/eur/2018/389/contents/adopted", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Applying an exemption is the PSP's choice; liability rules (PSD2 Art 74) still apply.", "Art 16/11 use previous transactions excluding the current one (literal article wording); some issuers also count the cu…", "…" ] } ``` ### POST /api/v1/card-payments/app-scam-reimbursement $0.03 USDC. Calculate the UK mandatory APP scam reimbursement amount and 50:50 receiving-PSP contributions under PSR rules. Inputs: scheme, payments, claimDate, excessApplied?, vulnerable?, exceptionsAsserted? Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-app-scam-reimbursement Example request: ```json { "scheme": "FPS", "payments": [ { "date": "2026-09-01", "amount": 6000000, "receivingPsp": "BANK_A" }, { "date": "2026-09-03", "amount": 3000000, "receivingPsp": "BANK_B" } ], "claimDate": "2026-10-01", "excessApplied": 10000, "vulnerable": false } ``` Example response: ```json { "eligible": true, "claimValue": 9000000, "cappedValue": 8500000, "excess": 10000, "requiredReimbursement": 8490000, "receivingPspShares": [ { "psp": "BANK_A", "attributable": 5660000, "contribution": 2830000, "maxDeductionForUnappliedExcess": 0 }, { "psp": "BANK_B", "attributable": 2830000, "contribution": 1415000, "maxDeductionForUnappliedExcess": 0 } ], "notes": [], "sources": [ { "source": "PSR Specific Requirement 1 (July 2024)", "url": "https://www.psr.org.uk/media/xenefhgp/amended-specific-requirement-1-july-2024-corrected.pdf", "retrievedAt": "2026-11-14", "status": "ok" }, { "source": "PSR PS25/5 (May 2025)", "url": "https://www.psr.org.uk/media/rhelv4op/ps25-5-app-scams-reimbursement-consolidated-policy-statement-may-2025.pdf", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Maximum reimbursement £85,000; maximum excess £100. Vulnerable consumers: excess and gross-negligence exception not app…", "Not legal advice. Outputs are lookups or prechecks for human review." ] } ``` ### POST /api/v1/card-payments/psd2-certificate-roles $0.03 USDC. Parse a TPP QWAC/QSealC certificate for PSD2 roles, NCA and authorisation number. Does not verify the chain. Inputs: certificatePem Docs: https://www.brainiac.software/api/card-payments/docs#card-payments-psd2-certificate-roles Example request: ```json { "certificatePem": "-----BEGIN CERTIFICATE-----\nMIIBkTCB+wIJAKHBlv7example000000000000000000000000000000\n-----END CERTIFICATE-----" } ``` Example response: ```json { "subject": "CN=Test TPP\nO=Test TPP Ltd\norganizationIdentifier=PSDPL-PFSA-1234567890", "issuer": "CN=Test TPP\nO=Test TPP Ltd\norganizationIdentifier=PSDPL-PFSA-1234567890", "notBefore": "2024-01-01T00:00:00.000Z", "notAfter": "2030-01-01T00:00:00.000Z", "organizationIdentifier": "PSDPL-PFSA-1234567890", "authorisation": { "country": "PL", "nca": "PFSA", "number": "1234567890" }, "psd2": { "present": true, "roles": [ { "oid": "0.4.0.19495.1.2", "name": "PSP_PI", "nameMatchesOid": true }, { "oid": "0.4.0.19495.1.3", "name": "PSP_AI", "nameMatchesOid": true } ], "ncaName": "PFSA", "ncaId": "PL-PFSA" }, "issues": [], "sources": [ { "source": "ETSI TS 119 495 V1.7.1 (2024-07)", "url": "https://www.etsi.org/deliver/etsi_ts/119400_119499/119495/01.07.01_60/ts_119495v010701p.pdf", "retrievedAt": "2026-11-14", "status": "ok" } ], "limitations": [ "Parses the certificate only; does not verify the chain, revocation, or the EBA/NCA register.", "Not legal advice. Outputs are lookups or prechecks for human review." ] } ```