# JPMC-PDP Documentation from https://developer.payments.jpmorgan.com # Resources ## Response Types Real-Time Payments supports the following response types for the status of a payment: - RECEIVED - ACCEPTED - PROCESSING - CANCELED - REJECTED - COMPLETED - RETURNED For additional detail on status and sub-status responses, refer to [Status response and error codes](/api/treasury/global-payments/global-payments-2/error-codes). ## Purpose codes Select markets require a purpose code for successful transactions. A purpose code is issued by a market’s Clearing house and identifies the purpose of a transaction. The following tables list supported purpose code values for Real-Time Payments in select regions. Markets that do not appear on this page do not require purpose codes. ### Canada (Interac e-Transfer) The following table contains the supported purpose codes for *Interac* e-Transfer: **Canada purpose codes** | Region | Purpose code | Name | Description | | --- | --- | --- | --- | | NA | BONU | Bonus Payment | Payment of a bonus. | | CASH | Cash Management Transfer | General cash-management instruction. | | CCRD | Credit Card Payment | Payment of a credit card. | | DCRD | Debit Card Payment | Payment of a debit card. | | DIVID | Dividend | Payment of a dividend. | | GOVT | Government Payment | Payment to or from a government department. | | HEDG | Hedging | Payment of a hedging operation. | | ICCP | Irrevocable Credit Card Payment | Reimbursement of a credit-card payment. | | IDCP | Irrevocable Debit Card Payment | Reimbursement of a debit-card payment. | | INTC | Intra-Company Payment | Intra-company payment, or a payment between two companies that belong to the same group. | | INTE | Interest | Payment of interest. | | LOAN | Loan | Transfer of a loan to a borrower. | | OTHR | Other Payment | Other payment purpose. | | PENS | Pension Payment | Payment of a pension. | | SALA | Salary Payment | Payment of salaries. | | SECU | Securities | Payment of securities. | | SSBE | Social Security Benefit | Payment of a Social Security benefit. | | TAXS | Tax Payment | Payment of taxes. | | TRAD | Trade Services | Payment of a trade finance transaction. | | TREA | Treasury Payment | Payment related to treasury operations, such as a financial contract settlement. | | VATX | Value Added Tax Payment | Payment of value added tax. | | WHLD | Withholding Tax | Payment of withholding tax. | | AIRB | Air | Payment for air transport-related business. | | BUSB | Bus | Payment for bus transport-related business. | | FERB | Ferry | Payment for ferry-related business. | | RLWY | Railway | Payment for railway transport-related business. | | CBTV | CableTV Bill | Payment of cable TV bill. | | ELEC | Electricity Bill | Payment of electricity bill. | | ENRG | Energies | Payment related to a utility operation. | | GASB | Gas Bill | Payment of gas bill. | | NWCH | Network Charge | Payment of network charges. | | NWCM | Network Communication | Payment of network communication. | | OTLC | Other Telecom Related Bill | Payment of other telecom-related bill. | | PHON | Telephone Bill | Payment of telephone bill. | | UBIL | Utilities | Payment to common utility provider that provides gas, water, and/or electricity. | | WTER | Water Bill | Payment of water bill. | | BOND | Bonds | Securities Lending-Settlement of Bond. | | COLL | Collateral Management | Relates to collateral management. | | 240 | ANN/REN Annuity | | | 260 | INV/PLA Investment | | | 308 | CCB/ACE Canada Child Benefit | | | 311 | OAS/SV Old Age Security | | | 318 | EI/AE Employment Insurance | | | 330 | INS/ASS Insurance | | | 370 | MTG/HYP Mortgage | | | 400 | RLS/LOY Rent/Leases | | | 430 | BPY/FAC Bill Payment | | | 452 | EXP/RDD Expense Payment | | | 460 | AP/CC Accounts Payable | | | 480 | DON/DON Donations | | ### Hong Kong (FPS) **Hong Kong (FPS) Pay-to-account purpose codes and descriptions** | Purpose code | Description | | --- | --- | | CXSALA | Salary and benefits payment Not applicable to dividend payment. For dividend payment, it would be classified as general business payment (“CXBSNS”) | | CXBSNS | General business payment | **Hong Kong (FPS) Pay-to-proxy purpose codes and descriptions** | Purpose code | Description | | --- | --- | | CXSALA | Salary and benefits payment Not applicable to dividend payment. For dividend payment, it would be classified as general business payment (“CXBSNS”) | | CXBSNS | General business payment | | CXMRCH | FPS merchant payment | | CXTOPU | Account top-up payment | ### Malaysia (RPP) **Malaysia (RPP) purpose codes and descriptions** | Purpose code | Description | | --- | --- | | 00000 | Food and live animals | | 01000 | Beverages and tobacco | | 02000 | Crude materials, inedible, except fuels | | 03000 | Mineral fuels, lubricants, and related materials | | 04000 | Animal and vegetable oils, fat, and waxes | | 05000 | Chemicals and related products, not classified elsewhere | | 06000 | Manufactured goods | | 07000 | Machinery, non-customized packaged software, and transport equipment | | 07100 | Power lines, pipelines, and undersea communication cables | | 08000 | Miscellaneous manufactured articles | | 09000 | Commodities and transactions not classified elsewhere | | 09100 | Refunds relating to goods transactions | | 09700 | Non-monetary gold | | 16711 | Merchanting trade in Malaysia | | 16712 | Merchanting trade abroad | | 10010 | Goods for processing (manufacturing services) | | 12500 | Repair and maintenance of aircraft, ships, and other transport equipment | | 11110 | Freight by air | | 11120 | Freight by sea | | 11130 | Freight by other modes of transportation | | 11210 | Passenger fare by air | | 11220 | Passenger fare by sea | | 11230 | Passenger fare by other modes of transportation | | 12110 | Airport services | | 12120 | Port services | | 12130 | Other terminal facilities | | 12210 | Charter of aircraft (with crews) | | 12220 | Charter of ships and vessels (with crews) | | 12230 | Charter of other modes of transport (with crews) | | 12140 | Postal and courier services | | 12400 | Fees for salvage operations | | 13110 | Goods and services purchase by travelers | | 13300 | Travel for pilgrimage and religious observances | | 13400 | Travel for medical treatment | | 13500 | Education-related | | 13210 | Goods and services purchased through business and official travel | | 13220 | Goods and services purchase by short-term workers | | 16210 | Construction and installation services In Malaysia | | 16220 | Construction and installation services abroad | | 16311 | Premium paid/received on high-risk insurance/Takaful relating to fire, marine, aviation, etc. | | 16312 | Premium paid/received on other general insurance/Takaful | | 16313 | Premium paid/received on life insurance/Takaful | | 16314 | Premium paid/received on reinsurance/Retakaful | | 16315 | Premium paid/received on insurance/Takaful on goods | | 16321 | Claims settlements on high-risk insurance/Takaful relating to fire, marine, aviation, etc. | | 16322 | Claims settlements on other general insurance/Takaful | | 16323 | Claims settlements on life insurance/Takaful | | 16324 | Claims paid/received on reinsurance/Retakaful | | 16325 | Claims paid/received on insurance/Takaful on goods | | 16332 | Auxiliary insurance services | | 16410 | Explicitly charged financial services | | 16420 | Explicit margins on the buying and selling of financial instruments | | 16430 | Explicitly charged asset management services | | 16440 | Financial intermediation service charges indirectly measured (FISIM) | | 16610 | Charges associated with intellectual property rights | | 16620 | License fees to reproduce and distribute intellectual property | | 16100 | Telecommunication services | | 16510 | Computer services | | 16520 | Information services | | 12310 | Rentals/operating leasing of aircraft (without crews) | | 12320 | Rentals/operating leasing of ships and vessels (without crews) | | 12330 | Rentals/operating leasing of other transport equipment (without crews) | | 16780 | Rentals/operating leasing of dwellings, other buildings and machinery | | 16720 | Sharing of administrative expenses | | 16730 | Research and development services | | 16740 | Architectural, engineering, and other technical services | | 16750 | Agricultural, mining, and on-site processing | | 16791 | Trade-related services | | 16792 | Waste treatment services | | 16793 | Other business services | | 16760 | Advertising, market research and public opinion polling services | | 16771 | Legal services | | 16772 | Accounting services | | 16773 | Management consulting services | | 16810 | Audio-visual and artistic related services | | 16820 | Health services | | 16830 | Education services | | 16840 | Heritage and recreational services | | 16850 | Other personal services | | 16900 | Other services transactions | | 16910 | Refunds relating to services transactions | | 14310 | Wages and salaries in cash | | 14320 | Wages and salaries in kind/benefits attributable to employees | | 14330 | Employer's social contributions | | 14410 | Taxes on products and productions | | 14420 | Subsidies on products and productions | | 14430 | Rental on natural resources | ### Singapore (FAST) **Singapore (FAST) purpose codes and descriptions** | Purpose code | Description | | --- | --- | | BEXP | Business expenses | | BONU | Employee bonus | | CBTV | Cable TV bill | | CCRD | Credit card payment | | CHAR | Charity | | COLL | Collection of funds initiated via a credit transfer or direct debit | | COMM | Commission | | CPKC | Car park charges | | CSDB | Cash disbursement | | DCRD | Debit card payment | | DIVD | Dividends payment | | DNTS | Dental services | | EDUC | Study/tuition fees | | FCPM | Late fees and charges | | FWLV | Foreign Worker Levy payment | | GDDS | Purchase and sale of goods | | GOVI | Government insurance | | GSTX | Goods and services tax | | HSPC | Hospital care services | | IHRP | Installment/hire-purchase agreement | | INSU | Insurance premium | | INTC | Intra-company payment | | INTE | Interest payment | | INVS | Mutual funds, investment products, and shares | | IVPT | Invoices | | LOAN | Transfer of a loan to a borrower | | MDCS | Medical care services | | NITX | Net income tax | | OTHR | Other payment purposes | | PHON | Telephone bill | | PTXP | Property tax | | RDTX | Road tax | | REBT | Rebate | | REFU | Refund | | RENT | Rent | | SALA | Salaries | | STDY | Study/tuition costs | | SUPP | Payment to a supplier | | TAXS | Taxes | | TBIL | Telecommunications-related bills | | TCSC | Charges levied by a town council | | TRAD | Trade services operation | | TREA | Treasury operations | | TRPT | Payment to top-up prepaid card and electronic road pricing for the purpose of transportation | | UBIL | Payment to common utility providers that provide gas, water, and/or electricity | | WHLD | Withholding tax | ### Thailand (PromptPay) – Bank of Thailand code **Thailand (PromptPay)** | Purpose code | Description | | --- | --- | | 318004 | Freight charges or goods transport fees | | 318005 | Premiums for goods-in-transit insurance and reinsurance | | 318006 | Insurance claims for goods damaged in transit | | 318007 | Other international freight-related expenses | | 318009 | Passenger fares and related transport fees | | 318010 | Vehicle fuel for international transport; non-freight fees | | 318012 | Accommodation, food, hotel services, fares, lump-sum travel | | 318013 | Student school fees, accommodation, food, fares, personal expenses | | 318014 | Travel expenses for non-travelers/students (field trips, trainings, seminars) | | 318015 | Medical fees, cosmetic surgery, Thai massage services | | 318016 | Sale or buyback of remaining travel funds | | 318017 | Membership fees and card-based expenses (credit/debit) | | 318018 | Expenses of public servants and Thai/foreign embassy officers | | 318023 | Telecoms, postal, and related service fees; equipment maintenance | | 318024 | Construction and installation service fees | | 318025 | Fees to use intangible assets and original works under contract | | 318026 | Non-goods insurance premiums (life, accident, fire) | | 318027 | Insurance claims not related to goods | | 318028 | Professional and consulting fees; specialists; directors; technical assistance | | 318029 | Treasury, brokerage, front-end, commitment, guarantee, custodian, loan-guarantee fees | | 318030 | Intermediary fees for trades | | 318031 | News and information services (databases, journals, memberships) | | 318032 | Representative office expenses abroad (staff, salaries, utilities) | | 318033 | Dissemination and public relations fees | | 318034 | Rental of machines, equipment, or residential property | | 318036 | Other service fees not in listed categories (incl. personal, cultural, sports, entertainment; machinery/electrical assistance; IT operations) | | 318037 | Fees for manufacturing or processing of goods | | 318042 | Profits from investments or shareholdings in private businesses | | 318043 | Dividends from investments or shareholdings in private businesses | | 318044 | Interest on loans | | 318045 | Interest other than loan interest (deposits, bonds, IRS) | | 318052 | Repatriated savings/family allowances; government grants to/from foreigners | | 318062 | Non-resident investment in Thai affiliates returned (closure, reduction, withdrawal, sale) | | 318065 | Resident investment in affiliates (Thailand/abroad) returned (closure, reduction, withdrawal, sale) | | 318068 | Investments for purchase or lease of immovable property in Thailand made by/brought back by a non-resident | | 318076 | Non-resident investment in Thai-issued securities returned | | 318083 | Loans from or principal repaid to non-residents or licensed FX institutions | | 318086 | Resident loans or principal repaid to investors in foreign-currency debt securities | | 318090 | Resident loans to, or principal received from, non-residents | | 318093 | Resident loans to, or principal received from, non-resident investors in foreign-currency debt securities | | 318113 | Funds for reserved expenses or advance-payment returns; non-resident expenses abroad on behalf of the institution | | 318116 | Advance service payments from abroad or returns (net of fees) | | 318122 | Return of unused or excess loan/investment transfers | | 318125 | Funds for representative/trade office expenses abroad; advance payments from non-residents; expenses in Thailand on behalf of the institution | | 318128 | Advance payments for services abroad or returned (net of fees) | | 318131 | Other funds not in listed categories | | 318212 | Settlement of derivative transactions | | 318213 | Resident investment in foreign securities returned | | 318216 | Resident investment in Thai securities returned | | 318224 | Residents’ foreign-currency deposits abroad for future investments or returns | | 318225 | Residents’ other foreign-currency deposits abroad | | 318231 | Goods payments incl. advances, agency, cross-border orders, leases with transfer of ownership | | 318232 | Discounts, deposits, refunds, excess, and other goods-related payments (non-gold) | | 318233 | Payments for gold with onshore or offshore counterparties | | 318040 | Salaries, wages, and employee benefits | ## Payment limits Real-Time Payments are subject to maximum payment amounts, which vary per market. The bank and the schemes periodically review these limits in response to market demands and conditions. > If a transaction amount is greater than the supported payment limit for that region, the transaction is rejected with a 10005 error code. For more information, see [Error Codes](/api/treasury/global-payments/global-payments-2/error-codes). > **Supported markets and payment limits (per transaction)** | Market / Scheme | Payment limits (per transaction) | | --- | --- | | Australia (NPP) | AUD 100,000 | | Brazil (PIX) | BRL No limit | | Canada (Interac e-Transfer) | CAD 25,000 | | Hong Kong (FPS) | - HKD 999,999 - CNY 999,999 | | India (IMPS) | INR 500,000 | | Malaysia (RPP) | MYR 10,000,000 | | Mexico (SPEI) | Monday to Friday: - 6 AM–6 PM: No limit - 6 PM–6 AM: MXN 11,400 Saturday & Sunday: MXN 11,400 | | [SEPA Zone](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html) (SEPA Instant) | EUR 100,000 | | Singapore (FAST) | SGD 200,000 | | United Kingdom (UK FPS) | GBP 1,000,000 | | United States (TCH) | USD 1,000,000 | | United States (FedNow) | USD 500,000 | ## Beneficiary banks A beneficiary bank is the bank that holds the account you are sending money to. The following table can help you identify a beneficiary bank in the region of your choice: **Beneficiary banks by region** | Region | Reference link | Notes | | --- | --- | --- | | Australia (NPP) | [https://nppa.com.au/find-an-institution/](https://nppa.com.au/find-an-institution/) | | | Brazil (PIX) | [https://www.bcb.gov.br/content/estabilidadefinanceira/pix/ListadeparticipantesdoPix.pdf](https://www.bcb.gov.br/content/estabilidadefinanceira/pix/ListadeparticipantesdoPix.pdf) | | | Canada (Interac e-Transfer) | [https://www.payments.ca/payment-resources/directories?field_directory_type=11](https://www.payments.ca/payment-resources/directories?field_directory_type=11) | | | Hong Kong (FPS) | [https://www.hkicl.com.hk/eng/information_centre/clearing_code_and_branch_code_list.php](https://www.hkicl.com.hk/eng/information_centre/clearing_code_and_branch_code_list.php) | | | India (IMPS) | [https://www.npci.org.in/what-we-do/imps/live-members](https://www.npci.org.in/what-we-do/imps/live-members) | | | Malaysia (RPP) | [https://www.duitnow.my/Transfer/index.html](https://www.duitnow.my/Transfer/index.html) | | | Mexico (SPEI) | [https://www.banxico.org.mx/cep-scl/listaInstituciones.do](https://www.banxico.org.mx/cep-scl/listaInstituciones.do) | Accounts in Mexico, known as CLABE accounts, have 18 digits. The first three numbers indicate the beneficiary bank code. However, on Banxico´s web page, the bank codes are the last three digits of the institution code. | | [SEPA Zone](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html) (SEPA Instant) | [https://www.ebaclearing.eu/services/rt1/participants/](https://www.ebaclearing.eu/services/rt1/participants/) and [https://www.ecb.europa.eu/paym/target/tips/facts/html/index.en.html](https://www.ecb.europa.eu/paym/target/tips/facts/html/index.en.html) | The bottom of each page contains a link to download a CSV file of all registered participants. | | Singapore (FAST) | [https://abs.org.sg/consumer-banking/fast](https://abs.org.sg/consumer-banking/fast) | | | United Kingdom (UK FPS) | [https://www.wearepay.uk/participants-list/](https://www.wearepay.uk/participants-list/) | Filter be "FPS". | | United States (TCH) | [https://www.theclearinghouse.org/payment-systems/rtp/rtp-participating-financial-institutions](https://www.theclearinghouse.org/payment-systems/rtp/rtp-participating-financial-institutions) | | | United States (FedNow) | [https://www.frbservices.org/financial-services/fednow/organizations](https://www.frbservices.org/financial-services/fednow/organizations) | | ## Duplicate logic Real-Time Payments transactions are irrevocable. If the same transaction is sent twice, the status of the original transaction is returned. To confirm the status of any transaction, [get the status of a Real-Time Payments request](/docs/treasury/global-payments/capabilities/global-payments-2/real-time-payments/how-to/get-real-time-payments-transaction-status). ### How we handle duplicate transactions The Global Payments API supports the ability for [idempotent calls](/api/treasury/global-payments/overview#idempotency-logic). This is useful in various scenarios, such as initiating payments or attempting to retry a failed request (for instance, due to network issues). A Real-Time Payments transaction is deemed to be a duplicate by the Global Payments API if the original transaction has the same `endToEndId`. If two transactions are sent with the same `endToEndId` within 60 days, the transaction is identified as duplicate, and the status of the original transaction is returned. ### How we handle duplicate transactions for Canada Interac e-Transfer The Global Payments API supports the ability for [idempotent calls](/api/treasury/global-payments/overview#idempotency-logic), which is useful when you initiate a payment, create a client, make a change, or retry a failed request for some reason, such as a network issue. If an *Interac* e-Transfer payment has the same `endToEndId ` and debtor.account.accountNumber as another *Interac* e-Transfer payment within the last 30 days, the Global Payments API deems it duplicative. ## Sanctions screening J.P. Morgan screens all payment information to comply with United States OFAC regulations, applicable non-United States sanctions, and national and international anti-terrorism laws. ## Character set restrictions ### UK FPS The UK Faster Payment System (FPS) character set is restricted to the following: **UK FPS character set** | Character | Note | | --- | --- | | A to Z | Uppercase | | a to z | Lowercase | | 0 to 9 | | | / | Forward slash | | - | Minus sign | | ? | Question mark | | : | Colon | | ( | Left parantheses | | ) | Right parantheses | | . | Point | | , | Comma | | ’ | Right single quote | | ' | Apostrophe | | + | Plus sign | | SPACE | | | # | Hash | | = | Equals | | ! | Exclamation mark | | ” | Right double quote | | % | Percentage | | & | Ampersand | | * | Asterick | | < | Less than | | > | Greater than | | ; | Semicolon | | { | Left curly bracket | | @ | Commercial at | ### Mexico (SPEI) **Valid characters** **Supported special characters set for Mexico (SPEI)** | Code | Character | Code | Character | Code | Character | Code | Character | | --- | --- | --- | --- | --- | --- | --- | --- | | 32 | Espacio | 56 | 8 | 83 | S | 111 | o | | 33 | ! | 57 | 9 | 84 | T | 112 | p | | 34 | " | 58 | : | 85 | U | 113 | q | | 35 | # | 59 | ; | 86 | V | 114 | r | | 36 | $ | 63 | ? | 87 | W | 115 | s | | 37 | % | 64 | @ | 88 | X | 116 | t | | 38 | & | 65 | A | 89 | Y | 117 | u | | 39 | ' | 66 | B | 90 | Z | 118 | v | | 40 | ( | 67 | V | 92 | \ | 119 | w | | 41 | ) | 68 | D | 95 | _ | 120 | x | | 42 | * | 69 | E | 97 | a | 121 | y | | 43 | + | 70 | F | 98 | b | 122 | z | | 44 | , | 71 | G | 99 | c | | | | 45 | - | 72 | H | 100 | d | | | | 46 | . | 73 | I | 101 | e | | | | 47 | / | 74 | J | 102 | f | | | | 48 | 0 | 75 | K | 103 | g | | | | 49 | 1 | 76 | L | 104 | h | | | | 50 | 2 | 77 | M | 105 | i | | | | 51 | 3 | 78 | N | 106 | j | | | | 52 | 4 | 79 | O | 107 | k | | | | 53 | 5 | 80 | P | 108 | l | | | | 54 | 6 | 81 | Q | 109 | m | | | | 55 | 7 | 82 | R | 110 | n | | | **Invalid characters** **Characters not supported** | Code | Character | | --- | --- | | 130 | é | | 160 | á | | 161 | í | | 162 | ó | | 163 | ú | | 164 | ñ | | 165 | Ñ | | 168 | ¿ | | 173 | ¡ | ## Payment options (Canada Interac e-Transfer) *Interac* e-Transfer payments can be sent to a beneficiary's fully formed bank account number, email address, or Canadian mobile phone number. The following table provides more information about each of these options: **Payment options for Interac e-Transfer** | Payment option | Notes | | --- | --- | | Canadian bank account number | - Available if beneficiary's bank participates in account number-based routing. Otherwise, the payment is rejected. - Should include a bank ID, transit number, and account number. - Account number shouldn't include leading zeroes. | | Email address or Canadian mobile phone number | - If a beneficiary didn't register an alias for Autodeposit, Interac e-Transfer requires the beneficiary to correctly answer a payment verification question and then select a financial institution to receive the deposit. The payment verification question and encrypted answer must be provided to us in the payment request so that Interac can validate the response. In the meantime, the funds are deducted from your account. If the beneficiary correctly answers the question, a callback notification is sent to you. If the beneficiary incorrectly responds to the question, declines the payment, or lets the payment expire, the funds are restored to your account with a rejected callback. For more information, see [Global Payments 2 status responses and error codes](/api/treasury/global-payments/global-payments-2/error-codes). - If a beneficiary registered an alias for Autodeposit, Interac e-Transfer payments are directly deposited into the designated account. - If a payment is sent to an invalid alias schema, the payment is rejected. | ## Payment validation question and response When sending an Interac e-Transfer payment to a beneficiary’s email address or Canadian mobile phone number, you must provide a payment validation question and response. The question may be sent in clear text, but the response must comply with the processing rules described in the following sections: **Input requirements** The answer to the security question (as provided by the customer) must: - Be a single word, minimum 3 characters, up to 25 characters. - Only include letters (a-z, A-Z), digits (0-9), hyphens, and French characters. Both lower- and upper-case letters are allowed. - Must not include leading or trailing whitespace (trim before processing). **Disallowed Values** The answer must not contain: - Spaces or multiple words. - Special characters (except hyphens) are not allowed. - Any form of code or URLs (e.g., “http:”, “https:”, “JavaScript”, “function”, “return”, “www”) **Processing the Security Response** - Trim leading and trailing whitespace from the answer. - Convert the answer to uppercase. - Append the hashSalt (if present) to the answer. - Encode the result using ISO-8859-1. - Hash the encoded string using Secure Hash Algorithm (SHA2). - Base64 encode the hash output. - The final security answer should be sent as: Base64(SHA-256(ISO-8859-1(Uppercase(answer)) + Hashsalt)) - The resulting encoded string can be up to 64 characters. **Hash salt** We will provide the salt. Contact your implementation manager for the current hash salt value. Hash salt may change over time; ensure your implementation can accommodate updates. **Example** - Question: What is your policy number? - Answer: ABC123 - Hash salt: 98765421 - Encrypted answer: l88fqsH39/P2m7NaRZRB/Ko6DHXP2f24oNoFrBPhHyk= #### Sample code for security responses The following sample Java code illustrates the use of SHA2. The sample isn't created by us and without warranty, doesn't include validation and exception handling that would be expected in production. Sample Java code to generate and encode the password using SHA2 algorithm ```java package com.acxsys.emt.interacServices; import org.apache.commons.codec.binary.Base64; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; /* * This is a sample Java code to generate password (such as Answer) using SHA2 */ public class SHA2Encoder { private final static int SALT_BYTE_SIZE = 32; public static void main(String args[]){ String pwd = "testPwd"; String salt = null; String encodedPwd = null; Charset = Charset.defaultCharset(); System.out.println(" def charset:"+ charset.name()); try { salt = getSalt(); encodedPwd = encodeSHA2(pwd.toUpperCase(), salt); } catch(Exception e){ System.out.println(" Exception encoding pwd." +e.getMessage()); e.printStackTrace(); } System.out.println("encodedPwd: "+ encodedPwd); } /* * This method will encode the password using SHA2 algorithm. The hash is encoded using charset ISO-8859-1 * */ public static String encodeSHA2(String password, String saltString) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md = MessageDigest.getInstance("SHA-256"); System.out.println("using salt: "+saltString); String encodedPwd= null; encodedPwd = new String( Base64.encodeBase64( md.digest( (password+saltString).getBytes("ISO-8859-1") ) ) ,"ISO-8859-1"); System.out.println("encodedPwd: "+ encodedPwd); return encodedPwd; ```