Process a payment gateway transaction (raw)
Advanced: The Payment Gateway is implemented as a single endpoint. Use `transaction_type` to select the business operation (sale, refund, void, etc.).
Request
This raw endpoint has a large request schema (multiple transaction types). The table shows a shallow overview.
profile_id
profile_id
string
Yes
Validations
pattern=^\d{20}$ ยท maxLength=20
Description
ID issued by MerchantE
profile_key
profile_key
string
Yes
Validations
maxLength=32
Description
API password assigned by MerchantE
transaction_typeenum
transaction_type
string
Yes
Validations
D
Description
Sale transaction (D)
card_number
card_number
string
No
Validations
pattern=^\d{5,22}$ ยท minLength=5 ยท maxLength=22
Description
Payment card number. Do not send if using card_id or card_swipe.
card_id
card_id
string
No
Validations
maxLength=32
Description
Stored customer card information (token from Store Card request)
card_swipe
card_swipe
string
No
Validations
โ
Description
Contents of payment card read by electronic device. Always processed as card-present.
card_exp_date
card_exp_date
string
No
Validations
pattern=^\d{4}$ ยท maxLength=4
Description
Card expiration date, submit as MMYY. Required when using card_number.
cvv2
cvv2
string
No
Validations
pattern=^\d{3,4}$ ยท minLength=3 ยท maxLength=4
Description
Card Verification Value:
- Visa: CVV2
- Mastercard: CVC2
- Discover: CID
- American Express: CID (4 digits)
cardholder_name
cardholder_name
string
No
Validations
maxLength=64
Description
Cardholder's full name
cardholder_first_name
cardholder_first_name
string
No
Validations
maxLength=15
Description
Cardholder first name
cardholder_last_name
cardholder_last_name
string
No
Validations
maxLength=30
Description
Cardholder last name
cardholder_street_address
cardholder_street_address
string
No
Validations
maxLength=19
Description
First 19 characters of cardholder's billing address
cardholder_zip
cardholder_zip
string
No
Validations
pattern=^\d{5}(\d{4})?$
Description
Cardholder's ZIP code (5 or 9 digits)
cardholder_city
cardholder_city
string
No
Validations
maxLength=20
Description
Cardholder's city
cardholder_state
cardholder_state
string
No
Validations
maxLength=2
Description
Cardholder's state (2-letter code)
cardholder_country
cardholder_country
string
No
Validations
maxLength=2
Description
Cardholder's country code
cardholder_email
cardholder_email
string
No
Validations
format=email ยท maxLength=60
Description
Cardholder's billing email
cardholder_phone
cardholder_phone
string
No
Validations
pattern=^\d{10}$ ยท maxLength=10
Description
Cardholder's billing phone (digits only, no dashes)
card_on_fileenum
card_on_file
string
No
Validations
Y, N
Description
Indicates if the transaction is a card on file transaction
cit_mit_indicatorenum
cit_mit_indicator
string
No
Validations
C101, C102, C103, C104, M101, M102, M103, M104, M205, M206, M207, M208
Description
Card on File transaction indicator (Mastercard):
Cardholder-Initiated:
- C101 = Credential-on-File (ad-hoc)
- C102 = Standing Order (variable amount and fixed frequency)
- C103 = Subscription (fixed amount and frequency)
- C104 = Installment (single purchase with known amount and set frequency)
Merchant-Initiated Recurring/Installment:
- M101 = Unscheduled Credential-on-File (variable amount, no regular intervals)
- M102 = Standing Order (variable amount and fixed frequency at regular intervals)
- M103 = Subscription (fixed amount and frequency)
- M104 = Installment (single purchase with known amount and set frequency)
Merchant-Initiated Industry Practice:
- M205 = Partial Shipment
- M206 = Related/Delayed Charge
- M207 = No Show Charge
- M208 = Resubmission
store_cardenum
store_card
string
No
Validations
Y, y
Description
Store card for future use (creates permanent token)
transaction_amount
transaction_amount
string
Yes
Validations
pattern=^\d+\.\d{2}$ ยท maxLength=12
Description
Transaction amount (decimal format)
transaction_id
transaction_id
string
No
Validations
maxLength=32
Description
Unique identifier for the transaction (from previous transaction)
invoice_number
invoice_number
string
No
Validations
maxLength=20
Description
Merchant-defined invoice number (no special characters)
purchase_order
purchase_order
string
No
Validations
maxLength=20
Description
Purchase order number
purchase_id
purchase_id
string
No
Validations
maxLength=20
Description
Merchant-defined purchase identifier
tax_amount
tax_amount
string
No
Validations
pattern=^\d+\.\d{2}$ ยท maxLength=9
Description
Tax amount
shipping_amount
shipping_amount
string
No
Validations
pattern=^\d+\.\d{2}$ ยท maxLength=9
Description
Shipping/freight amount
tran_fee_amount
tran_fee_amount
string
No
Validations
pattern=^\d+\.\d{2}$ ยท maxLength=9
Description
Surcharge amount for transaction
currency_code
currency_code
string
No
Validations
maxLength=3
Description
ISO 4217 currency code (default 840 = USD)
moto_ecommerce_indenum
moto_ecommerce_ind
string
Yes
Validations
Z, 1, 2, 3, 5, 6, 7, 07, 8, A
Description
Mail 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)
retry_id
retry_id
string
No
Validations
maxLength=16
Description
Enables Inquiry transaction of this request
message_reason_code
message_reason_code
string
No
Validations
maxLength=4
Description
Message reason code for deferred authorizations
rctl_commercial_cardenum
rctl_commercial_card
string
No
Validations
Y, y
Description
Returns commercial card type identification
rctl_account_balanceenum
rctl_account_balance
string
No
Validations
Y, y
Description
Returns prepaid card balance (if offered by issuer)
rctl_partial_authenum
rctl_partial_auth
string
No
Validations
Y, y
Description
Enable partial authorization
rctl_product_levelenum
rctl_product_level
string
No
Validations
Y, y
Description
Returns product level information
rctl_extended_avsenum
rctl_extended_avs
string
No
Validations
Y, y
Description
Returns extended AVS information
merchant_name
merchant_name
string
No
Validations
maxLength=25
Description
DBA Name to appear on cardholder statement (* allowed, must have static prefix)
merchant_phone
merchant_phone
string
No
Validations
pattern=^\d{10}$ ยท maxLength=10
Description
Customer Service phone number (no dashes or special characters)
merchant_category_code
merchant_category_code
string
No
Validations
pattern=^\d{4}$ ยท maxLength=4
Description
Merchant Category Code (SIC)
merchant_city
merchant_city
string
No
Validations
maxLength=13
Description
โ
merchant_state
merchant_state
string
No
Validations
maxLength=3
Description
โ
merchant_zip
merchant_zip
string
No
Validations
maxLength=9
Description
โ
recurring_pmt_num
recurring_pmt_num
string
No
Validations
pattern=^\d{1,2}$ ยท maxLength=2
Description
Payment number of this transaction
recurring_pmt_count
recurring_pmt_count
string
No
Validations
pattern=^\d{1,2}$ ยท maxLength=2
Description
Total number of payments
hotel_folio_number
hotel_folio_number
string
No
Validations
maxLength=25
Description
Hotel folio number
hotel_check_out_date
hotel_check_out_date
string
No
Validations
pattern=^\d{6}$
Description
Check-out date (MMDDYY)
hotel_room_rate
hotel_room_rate
string
No
Validations
pattern=^\d+\.\d{2}$
Description
Daily room rate
hotel_room_tax
hotel_room_tax
string
No
Validations
pattern=^\d+\.\d{2}$
Description
Room tax amount
hotel_no_showenum
hotel_no_show
string
No
Validations
Y, N
Description
No show indicator
rental_agreement_number
rental_agreement_number
string
No
Validations
maxLength=20
Description
Rental agreement number
rental_date
rental_date
string
No
Validations
pattern=^\d{6}$
Description
Rental date
rental_return_date
rental_return_date
string
No
Validations
pattern=^\d{6}$
Description
Return date
rental_return_city
rental_return_city
string
No
Validations
maxLength=20
Description
Return city
rental_return_state
rental_return_state
string
No
Validations
maxLength=2
Description
Return state
rental_return_country
rental_return_country
string
No
Validations
maxLength=32
Description
Return country
payment_account_reference
payment_account_reference
string
No
Validations
maxLength=35
Description
Payment Account Reference (AMEX=35 chars with all 9s, Other cards=29 chars with all 9s)
account_data_sourceenum
account_data_source
string
Yes
Validations
@, Y
Description
Indicates where credentials came from:
- @ = Manually keyed, not Track capable
- Y = Credentials obtained from file (not from cardholder)
| Field | Type | Required | Validations |
|---|---|---|---|
profile_id profile_id ID issued by MerchantE | string | Yes | pattern=^\d{20}$ ยท maxLength=20 |
profile_key profile_key API password assigned by MerchantE | string | Yes | maxLength=32 |
transaction_typeenum transaction_type Sale transaction (D) | string | Yes | D |
card_number card_number Payment card number. Do not send if using card_id or card_swipe. | string | No | pattern=^\d{5,22}$ ยท minLength=5 ยท maxLength=22 |
card_id card_id Stored customer card information (token from Store Card request) | string | No | maxLength=32 |
card_swipe card_swipe Contents of payment card read by electronic device. Always processed as card-present. | string | No | โ |
card_exp_date card_exp_date Card expiration date, submit as MMYY. Required when using card_number. | string | No | pattern=^\d{4}$ ยท maxLength=4 |
cvv2 cvv2 Card Verification Value: - Visa: CVV2 - Mastercard: CVC2 - Discover: CID - American Express: CID (4 digits) | string | No | pattern=^\d{3,4}$ ยท minLength=3 ยท maxLength=4 |
cardholder_name cardholder_name Cardholder's full name | string | No | maxLength=64 |
cardholder_first_name cardholder_first_name Cardholder first name | string | No | maxLength=15 |
cardholder_last_name cardholder_last_name Cardholder last name | string | No | maxLength=30 |
cardholder_street_address cardholder_street_address First 19 characters of cardholder's billing address | string | No | maxLength=19 |
cardholder_zip cardholder_zip Cardholder's ZIP code (5 or 9 digits) | string | No | pattern=^\d{5}(\d{4})?$ |
cardholder_city cardholder_city Cardholder's city | string | No | maxLength=20 |
cardholder_state cardholder_state Cardholder's state (2-letter code) | string | No | maxLength=2 |
cardholder_country cardholder_country Cardholder's country code | string | No | maxLength=2 |
cardholder_email cardholder_email Cardholder's billing email | string | No | format=email ยท maxLength=60 |
cardholder_phone cardholder_phone Cardholder's billing phone (digits only, no dashes) | string | No | pattern=^\d{10}$ ยท maxLength=10 |
card_on_fileenum card_on_file Indicates if the transaction is a card on file transaction | string | No | Y, N |
cit_mit_indicatorenum cit_mit_indicator Card on File transaction indicator (Mastercard): Cardholder-Initiated: - C101 = Credential-on-File (ad-hoc) - C102 = Standing Order (variable amount and fixed frequency) - C103 = Subscription (fixed amount and frequency) - C104 = Installment (single purchase with known amount and set frequency) Merchant-Initiated Recurring/Installment: - M101 = Unscheduled Credential-on-File (variable amount, no regular intervals) - M102 = Standing Order (variable amount and fixed frequency at regular intervals) - M103 = Subscription (fixed amount and frequency) - M104 = Installment (single purchase with known amount and set frequency) Merchant-Initiated Industry Practice: - M205 = Partial Shipment - M206 = Related/Delayed Charge - M207 = No Show Charge - M208 = Resubmission | string | No | C101, C102, C103, C104, M101, M102, M103, M104, M205, M206, M207, M208 |
store_cardenum store_card Store card for future use (creates permanent token) | string | No | Y, y |
transaction_amount transaction_amount Transaction amount (decimal format) | string | Yes | pattern=^\d+\.\d{2}$ ยท maxLength=12 |
transaction_id transaction_id Unique identifier for the transaction (from previous transaction) | string | No | maxLength=32 |
invoice_number invoice_number Merchant-defined invoice number (no special characters) | string | No | maxLength=20 |
purchase_order purchase_order Purchase order number | string | No | maxLength=20 |
purchase_id purchase_id Merchant-defined purchase identifier | string | No | maxLength=20 |
tax_amount tax_amount Tax amount | string | No | pattern=^\d+\.\d{2}$ ยท maxLength=9 |
shipping_amount shipping_amount Shipping/freight amount | string | No | pattern=^\d+\.\d{2}$ ยท maxLength=9 |
tran_fee_amount tran_fee_amount Surcharge amount for transaction | string | No | pattern=^\d+\.\d{2}$ ยท maxLength=9 |
currency_code currency_code ISO 4217 currency code (default 840 = USD) | string | No | maxLength=3 |
moto_ecommerce_indenum moto_ecommerce_ind Mail 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) | string | Yes | Z, 1, 2, 3, 5, 6, 7, 07, 8, A |
retry_id retry_id Enables Inquiry transaction of this request | string | No | maxLength=16 |
message_reason_code message_reason_code Message reason code for deferred authorizations | string | No | maxLength=4 |
rctl_commercial_cardenum rctl_commercial_card Returns commercial card type identification | string | No | Y, y |
rctl_account_balanceenum rctl_account_balance Returns prepaid card balance (if offered by issuer) | string | No | Y, y |
rctl_partial_authenum rctl_partial_auth Enable partial authorization | string | No | Y, y |
rctl_product_levelenum rctl_product_level Returns product level information | string | No | Y, y |
rctl_extended_avsenum rctl_extended_avs Returns extended AVS information | string | No | Y, y |
merchant_name merchant_name DBA Name to appear on cardholder statement (* allowed, must have static prefix) | string | No | maxLength=25 |
merchant_phone merchant_phone Customer Service phone number (no dashes or special characters) | string | No | pattern=^\d{10}$ ยท maxLength=10 |
merchant_category_code merchant_category_code Merchant Category Code (SIC) | string | No | pattern=^\d{4}$ ยท maxLength=4 |
merchant_city merchant_city โ | string | No | maxLength=13 |
merchant_state merchant_state โ | string | No | maxLength=3 |
merchant_zip merchant_zip โ | string | No | maxLength=9 |
recurring_pmt_num recurring_pmt_num Payment number of this transaction | string | No | pattern=^\d{1,2}$ ยท maxLength=2 |
recurring_pmt_count recurring_pmt_count Total number of payments | string | No | pattern=^\d{1,2}$ ยท maxLength=2 |
hotel_folio_number hotel_folio_number Hotel folio number | string | No | maxLength=25 |
hotel_check_out_date hotel_check_out_date Check-out date (MMDDYY) | string | No | pattern=^\d{6}$ |
hotel_room_rate hotel_room_rate Daily room rate | string | No | pattern=^\d+\.\d{2}$ |
hotel_room_tax hotel_room_tax Room tax amount | string | No | pattern=^\d+\.\d{2}$ |
hotel_no_showenum hotel_no_show No show indicator | string | No | Y, N |
rental_agreement_number rental_agreement_number Rental agreement number | string | No | maxLength=20 |
rental_date rental_date Rental date | string | No | pattern=^\d{6}$ |
rental_return_date rental_return_date Return date | string | No | pattern=^\d{6}$ |
rental_return_city rental_return_city Return city | string | No | maxLength=20 |
rental_return_state rental_return_state Return state | string | No | maxLength=2 |
rental_return_country rental_return_country Return country | string | No | maxLength=32 |
payment_account_reference payment_account_reference Payment Account Reference (AMEX=35 chars with all 9s, Other cards=29 chars with all 9s) | string | No | maxLength=35 |
account_data_sourceenum account_data_source Indicates where credentials came from: - @ = Manually keyed, not Track capable - Y = Credentials obtained from file (not from cardholder) | string | Yes | @, Y |
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"