Create a pre-authorization
Authorizes payment without capture (transaction_type=P).
Request Parameters
Content type: application/x-www-form-urlencoded
Required9 fields
Conditional: Provide one of:
card_number + card_exp_date OR card_id OR card_swipeProvide exactly one credential source. card_exp_date is required when using card_number.profile_idstringID issued by MerchantE
pattern=^\d{20}$ · maxLength=20
profile_keystringAPI password assigned by MerchantE
maxLength=32
transaction_typestringenumPre-Authorization transaction (P)
transaction_amountstringTransaction amount (decimal format)
pattern=^\d+\.\d{2}$ · maxLength=12
account_data_sourcestringenumIndicates where credentials came from:
- @ = Manually keyed, not Track capable
- Y = Credentials obtained from file (not from cardholder)
maxLength=1
card_numberstringPayment card number. Do not send if using card_id or card_swipe.
pattern=^\d{5,22}$ · minLength=5 · maxLength=22
card_idstringStored customer card information (token from Store Card request)
maxLength=32
card_swipestringContents of payment card read by electronic device. Always processed as card-present.
moto_ecommerce_indstringenumMail Order / Telephone Order / E-commerce indicator.
Common values:
- 1: MOTO (Mail Order/Telephone Order) - Single transaction
- 2: MOTO (Mail Order/Telephone Order) - Recurring
- 3: MOTO (Mail Order/Telephone Order) - Installment
- 7: E-commerce (Internet/Mobile)
maxLength=2
Recommended5 fields
card_exp_datestringCard expiration date, submit as MMYY. Required when using card_number.
pattern=^\d{4}$ · maxLength=4
cvv2stringCard Verification Value:
- Visa: CVV2
- Mastercard: CVC2
- Discover: CID
- American Express: CID (4 digits)
pattern=^\d{3,4}$ · minLength=3 · maxLength=4
cardholder_street_addressstringFirst 19 characters of cardholder's billing address
maxLength=19
cardholder_zipstringCardholder's ZIP code (5 or 9 digits)
pattern=^\d{5}(\d{4})?$
invoice_numberstringMerchant-defined invoice number (no special characters)
maxLength=20
Example request
Starter values are pre-filled; replace with your own credentials and test data.
profile_id: YOUR_PROFILE_ID_HERE profile_key: YOUR_PROFILE_KEY_HERE transaction_type: P account_data_source: "@" card_number: "4012301230121237" card_exp_date: "1225" cvv2: "999" transaction_amount: "100.00" cardholder_street_address: 456 Oak Ave cardholder_zip: "10001" moto_ecommerce_ind: "7"
Responses
200
Successful transaction response
Successful transaction response
Common3 fields
transaction_idstringUnique identifier for the transaction
error_codestringError/Response code:
- 000 = Approval
- 005 = Do Not Honor
- See full error code table in documentation
auth_response_textstringAuthorization response message
When Provided5 fields
auth_codestringAuthorization code (6 characters)
avs_resultstringAddress Verification Service result
- 0—AVS Error - Retry
- A—Address Match Only
- B—Address Match, Postal Code not verified
- C—No Match
- D—Address and Postal Code Match
- E—AVS Error - Ineligible
- F—Address and Postal Code Match (UK only)
- G—Non-US Issuer does not participate
- I—Address not verified, Postal Code not verified
- M—Address and Postal Code Match
- N—No Match
- P—Postal Code Match, Address not verified
- R—Issuer System Unavailable
- S—Service not Supported
- U—Address unavailable
- W—9-digit Postal Code Match, Address no match
- X—Exact match, 9-digit Postal Code
- Y—Address and 5-digit Postal Code Match
- Z—5-digit Postal Code Match, Address no match
cvv2_resultstringCVV2 verification result
- M—CVV2 Match
- N—CVV2 No Match
- P—Not Processed
- S—CVV2 should be on card but merchant indicates not present
- U—Issuer not certified
card_idstringPermanent token (stored card) identifier returned when store_card=Y is used
maxLength=32
batch_numberstringBatch number returned for Batch Close responses
maxLength=20
Other Fields12 fields
account_balancestringAccount balance (for prepaid cards)
batch_idstringBatch ID
batch_statusstringBatch status
card_exp_datestringCard expiration date (MMYY)
card_last_fourstringLast 4 digits of card number
card_typestringCard type (Visa, Mastercard, Discover, Amex, etc.)
commercial_cardstringCommercial card type
- B—Business Card
- R—Corporate Card
- S—Purchasing Card
- 0—Non-commercial card
extended_avs_resultstringExtended AVS result details
partial_auth_indicatorstringPartial authorization indicator
payment_account_referencestringPayment Account Reference returned by processor
product_levelstringProduct level code
transaction_feestringTransaction fee amount
Example response
transaction_id: 5fc24a2abe160c232a6dccd72ed8c5ba error_code: "000" auth_response_text: Approval T02786 avs_result: "0" cvv2_result: M auth_code: T02786
400
Bad request - invalid parameters
Bad request - invalid parameters
401
Unauthorized - invalid credentials
Unauthorized - invalid credentials
500
Server error
Server error
Error and result codes
The gateway response includes fields such as error_code,avs_result, andcvv2_result. Use the tables to interpret them.
Gateway error codes
visa
| Code | Meaning |
|---|---|
| 19 | Re-enter Transaction |
| 28 | File Temporarily Unavailable |
| 39 | No Credit Account |
| 58 | Transaction Not Permitted on Terminal |
| 68 | Response Received Too Late |
| 78 | Blocked - First Use |
| 82 | Negative CAM, dCVV, iCVV, or CVV results |
| 85 | No Reason to Decline |
| 91 | Issuer or Switch Inoperative |
| 92 | Routing Error |
| 93 | Violation of Law |
| 94 | Duplicate Transaction |
| 96 | System Malfunction |
| 000 | Approval |
| 005 | Do Not Honor |
| 012 | Invalid Transaction |
| 013 | Invalid Amount |
| 014 | Invalid Card Number |
| 015 | Invalid Issuer |
| 021 | Unable to Back Out Transaction |
| 023 | Unacceptable Transaction Fee |
| 025 | Unable to Locate Record |
| 041 | Lost Card |
| 043 | Stolen Card |
| 046 | Closed Account |
| 051 | Insufficient Funds |
| 052 | No Checking Account |
| 053 | No Savings Account |
| 054 | Expired Card |
| 055 | Incorrect PIN |
| 056 | No Card Record |
| 057 | Transaction Not Permitted to Cardholder |
| 061 | Exceeds Withdrawal Limit |
| 062 | Restricted Card |
| 063 | Security Violation |
| 065 | Exceeds withdrawal frequency |
| 075 | PIN Try Exceeded |
| 076 | Unable to Locate Previous Message |
| 0N4 | Exceeds Issuer Withdrawal Limit |
| 0N7 | CVV2 Failure |
| 0N0 | Unable to Authorize |
| 0P5 | PIN Change/Unblock Request Declined |
| 0Q1 | Invalid Card Authentication Data |
| 0R0 | Stop Payment Order |
| 0R1 | Revocation of Authorization Order |
| 0R3 | Revocation of All Authorizations Order |
| 0TA | Local Transaction; Time-Out at Issuer System Detected |
| 0XA | Forward to Issuer |
| 0XD | Forward to Issuer |
mastercard
| Code | Meaning |
|---|---|
| 19 | 22 Mer Not Qual or Re-enter Transaction |
| 28 | 22 Mer Not Qual or File Temporarily Unavailable |
| 39 | 22 Mer Not Qual or No Credit Account |
| 58 | Function Not Permitted to Merchant |
| 68 | Response Received Too Late |
| 78 | Blocked, First Used |
| 79 | Transaction Not Permitted to Acquirer/Terminal |
| 82 | Transaction Not Permitted to Acquirer/Terminal |
| 83 | Transaction Not Permitted to Acquirer/Terminal |
| 85 | No Reason to Decline |
| 91 | Issuer or Switch Inoperative |
| 92 | Routing Error |
| 94 | Duplicate Transaction |
| 96 | System Malfunction |
| 000 | Approval |
| 003 | 22 Mer Not Qual or Honor with Identification |
| 004 | Not used at this time |
| 005 | 22 Mer Not Qual or Do Not Honor |
| 012 | 22 Mer Not Qual or Invalid Transaction |
| 013 | 22 Mer Not Qual or Invalid Amount |
| 014 | 22 Mer Not Qual or Invalid Card Number |
| 015 | 22 Mer Not Qual or Invalid Issuer |
| 021 | 22 Mer Not Qual or Unable to Back Out Transaction |
| 025 | 22 Mer Not Qual or Unable to Locate Record On File |
| 041 | Lost Card - Pick Up (Fraud Account) |
| 043 | Stolen Card - Pick Up (Fraud Account) |
| 046 | Closed Account |
| 051 | Insufficient Funds |
| 052 | No Checking Account |
| 053 | No Savings Account |
| 054 | Expired Card |
| 055 | Incorrect PIN |
| 056 | No Card Record |
| 057 | Function Not Permitted to Cardholder |
| 061 | Exceeds Approval Amount Limit |
| 062 | Restricted Card |
| 063 | Security Violation |
| 065 | Exceeds Withdrawal Frequency Limit |
| 075 | Allowable number of PIN-Entry tries exceeded - Card Locked |
| 0N0 | Unable to Authorize |
| 0N3 | Cash Back Service Not Available |
| 0N4 | Exceeds Issuer Withdrawal Limit |
| 0N7 | CVV2 Failure |
| 0P5 | PIN Change/Unblock Request Declined |
| 0Q1 | Invalid Card Authentication Data |
| 0R0 | Stop Payment Order |
| 0R1 | Revocation of Authorization Order |
| 0R3 | Revocation of All Authorizations Order |
| 0XA | Forward to Issuer |
| 0XD | Forward to Issuer |
AVS result codes
| Code | Meaning |
|---|---|
| 0 | AVS Error - Retry, System unavailable or Timed out |
| A | Address Match Only |
| B | Address Match, Postal Code not verified |
| C | No Match |
| D | Address and Postal Code Match |
| E | AVS Error - Ineligible (not a mail/phone order) |
| F | Address and Postal Code Match (UK only) |
| G | Non-US Issuer does not participate |
| I | Address not verified, Postal Code not verified |
| M | Address and Postal Code Match |
| N | No Match |
| P | Postal Code Match, Address not verified |
| R | Issuer System Unavailable |
| S | Service not Supported |
| U | Address unavailable |
| W | 9-digit Postal Code Match, Address no match |
| X | Exact match, 9-digit Postal Code |
| Y | Address and 5-digit Postal Code Match |
| Z | 5-digit Postal Code Match, Address no match |
CVV result codes
| Code | Meaning |
|---|---|
| M | CVV2 Match |
| N | CVV2 No Match |
| P | Not Processed |
| S | CVV2 should be on card but merchant indicates not present |
| U | Issuer not certified |
Code samples
Copy-paste ready code in your preferred language for the Test environment.
API call
Copy/paste friendly
curl -X POST "https://cert.merchante-solutions.com/mes-api/transaction" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "profile_id=YOUR_PROFILE_ID_HERE" \
--data-urlencode "profile_key=YOUR_PROFILE_KEY_HERE" \
--data-urlencode "transaction_type=P" \
--data-urlencode "account_data_source=@" \
--data-urlencode "card_number=4012301230121237" \
--data-urlencode "card_exp_date=1225" \
--data-urlencode "cvv2=999" \
--data-urlencode "transaction_amount=100.00" \
--data-urlencode "cardholder_street_address=456 Oak Ave" \
--data-urlencode "cardholder_zip=10001" \
--data-urlencode "moto_ecommerce_ind=7"