Balance Inquiry

Request to retrieve the balance available to spend on a card. You can use this operation to request: The balance available on a gift card, or The balance available to spend by redeeming rewards earned using a card enrolled in a rewards program. For gift cards, only the balance available is returned. For credit or debit cards, additional details such as the reward points available to redeem and the conversion rate used to determine the available balance are also returned.

URL https://na.gateway.mastercard.com/api/nvp/version/79
HTTP Method POST
Authentication This operation requires authentication via one of the following methods:
  • Certificate authentication.
  • To authenticate to the API two additional NVP parameters must be supplied in the request. Provide 'merchant.<your gateway merchant ID>' in the apiUsername field and your API password in the apiPassword field.

Request Parameters

apiOperation  String =BALANCE_INQUIRY FIXED

Existence
FIXED
Fixed value
BALANCE_INQUIRY
Validation Rules
Any sequence of zero or more unicode characters.
XSD type
string

merchant  Alphanumeric + additional characters = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
XSD type
string
minimum length
1
maximum length
40

order.currency  Upper case alphabetic text = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

sourceOfFunds   = COMPULSORY

Depending on the payment type the source of the funds can be a debit or credit card, bank account, or account with a browser payment provider (such as PayPal).

For card payments the source of funds information may be represented by combining one or more of the following: explicitly provided card details, a session identifier which the gateway will use to look up the card details and/or a card token. Precedence rules will be applied in that explicitly provided card details will override session card details which will override card token details. Each of these may represent partial card details, however the combination must result in a full and complete set of card details. See Using Multiple Sources of Card Details for examples.
Fixed value

sourceOfFunds.token  Alphanumeric = OPTIONAL

The account identifier details stored against this token will be used to process the request.
If account identifier details are also contained in the request, or the request contains a session with account identifier details, these take precedence over the details stored against the token.
Existence
OPTIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z
XSD type
string
minimum length
1
maximum length
40

sourceOfFunds.type  Enumeration = COMPULSORY

If you are passing card data (in any form) on the API, then you need to set this value, and also provide the card details in the sourceOfFunds.provided.card group. In the case of digital wallets or device payment methods, you must also populate the order.walletProvider field.

If you are making a payment with a gateway token, then you can leave this field unset, and only populate the sourceOfFunds.token field. However you can set this to CARD if you want to overwrite or augment the token data with a card security code, expiry date, or cardholder name.
Existence
COMPULSORY
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
CARD
Use this value for payments that obtained the card details either directly from the card, or from a POS terminal, or from a wallet, or through a device payment method.
GIFT_CARD
Use this value for gift cards.

apiOperation  String =BALANCE_INQUIRY FIXED

Existence
FIXED
Fixed value
BALANCE_INQUIRY
Validation Rules
Any sequence of zero or more unicode characters.
XSD type
string

correlationId  String = OPTIONAL

The value provided is not validated, does not persist in the gateway, and is returned as provided in the response to the request.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

merchant  Alphanumeric + additional characters = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
XSD type
string
minimum length
1
maximum length
40

order.currency  Upper case alphabetic text = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant   = OPTIONAL

These merchants are referred to as your sub-merchants. The sub-merchant's details you provide may be displayed on the payer's cardholder statement. Note that your acquirer may require you to register with the card scheme(s) before allowing you to submit sub-merchant details with a transaction. This data must be on the initial transaction of an order, subsequent transactions with sub-merchant will be rejected.
Fixed value

order.subMerchant.address   = OPTIONAL

The sub-merchant's address.
Fixed value

order.subMerchant.address.city  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.company  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.country  Upper case alphabetic text = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant.address.postcodeZip  Alphanumeric + additional characters = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, ' ', '-'
XSD type
string
minimum length
1
maximum length
10

order.subMerchant.address.stateProvince  String = OPTIONAL

For an address in the United States provide the 2-letter ISO 3166-2 state code. For US military bases provide one of AE, AA, AP.

For an address in Canada provide the 2-letter ISO 3166-2 province code.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
20

order.subMerchant.address.street  String = OPTIONAL

For example, this may be the street name and number, or the Post Office Box details.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.street2  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.bankIndustryCode  Digits = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
4
maximum length
4

order.subMerchant.disputeContactPhone  Telephone Number = OPTIONAL

In this case, provide a phone number that payers can use to contact the sub-merchant in case of a dispute. Where applicable, the issuer may display this phone number on the cardholder statement. The phone number must be provided in ITU-T E123 format.
Existence
OPTIONAL
Fixed value
Validation Rules
Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
XSD type
string
mandatory country code
true
maximum total digits
15

order.subMerchant.email  Email = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Ensures that the email address is longer than 3 characters and adheres to a generous subset of valid RFC 2822 email addresses
XSD type
string

order.subMerchant.governmentCountryCode  Upper case alphabetic text = OPTIONAL

A sub merchant is considered a government owned or controlled entity (government controlled merchant) if 50% or more of the sub merchant is owned by the government. Provide the ISO 3166 three-letter country code of the government country where this differs from the sub merchant's physical location country.
Existence
OPTIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant.identifier  Alphanumeric + additional characters = COMPULSORY

You can use this identifier in searches and reports in the gateway.
Existence
COMPULSORY
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_', ' ', '&', '+', '!', '$', '.'
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.marketplaceId  String = OPTIONAL

A sub merchant is considered a marketplace if they operate a platform (online commerce website or mobile application) where retailers can sell goods and services.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
11

order.subMerchant.phone  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
20

order.subMerchant.registeredName  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.tradingName  String = COMPULSORY

For MasterCard transactions the name must not exceed 21 characters. For American Express transactions the name must not exceed 27 characters (or 36 characters including the aggregator name). The trading name may be displayed on the payer's cardholder statement. Therefore if you need to shorten it, use an abbreviation that will be meaningful to the payer when displayed on their statement.
Existence
COMPULSORY
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

responseControls   = OPTIONAL

Container for fields that control the response returned for the request.
Fixed value

responseControls.sensitiveData  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
50

session.id  ASCII Text = OPTIONAL

Values provided in the request will override values contained in the session.
Existence
OPTIONAL
Fixed value
Validation Rules
Data consists of ASCII characters
XSD type
string
minimum length
31
maximum length
35

session.version  ASCII Text = OPTIONAL

Do this if you make business decisions based on data from the session and wish to ensure that the same data is being used for the request operation.

To use optimistic locking, record session.version when you make your decisions, and then pass that value in session.version when you submit your request operation to the gateway.

If session.version provided by you does not match that stored against the session, the gateway will reject the operation with error.cause=INVALID_REQUEST.

See Making Business Decisions Based on Session Content.
Existence
OPTIONAL
Fixed value
Validation Rules
Data consists of ASCII characters
XSD type
string
minimum length
10
maximum length
10

sourceOfFunds   = COMPULSORY

Depending on the payment type the source of the funds can be a debit or credit card, bank account, or account with a browser payment provider (such as PayPal).

For card payments the source of funds information may be represented by combining one or more of the following: explicitly provided card details, a session identifier which the gateway will use to look up the card details and/or a card token. Precedence rules will be applied in that explicitly provided card details will override session card details which will override card token details. Each of these may represent partial card details, however the combination must result in a full and complete set of card details. See Using Multiple Sources of Card Details for examples.
Fixed value

sourceOfFunds.provided   = OPTIONAL

For browser payments, the source of funds details are usually collected from the payer on the payment provider's website and provided to you when you retrieve the transaction details (for a successful transaction). However, for some payment types (such as giropay), you must collect the information from the payer and supply it here.
Fixed value

sourceOfFunds.provided.card   = OPTIONAL

Contains card details
Fixed value

sourceOfFunds.provided.card.accountType  Enumeration = OPTIONAL

Provide this information for Maestro cards.
Existence
OPTIONAL
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
CHECKING
SAVINGS

sourceOfFunds.provided.card.emvRequest  String = OPTIONAL

It contains selected EMV fields as provided by the terminal.

For the list of field tags to include (if provided by the terminal), see Card Present Payments. Requests with any other tags are rejected by the gateway.

Some of the tags represent data that can occur on explicit fields in this API. You can submit the value either in this field, or in both places. For example, the PAN can be presented as EMV tag 5A in this field, or included both the sourceOfFunds.provided.card.number API field and in EMV tag 5A in this field.

If you specify the EMV tag only, we can populate the explicit field in the API. Fields where this is supported have the text "This field corresponds to EMV tag <tag name>" in their field descriptions.

If you specify both places, there will be no population of the explicit field or validation that the data matches.

The API response will not contain PCI sensitive fields.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
250

sourceOfFunds.provided.card.expiry   = OPTIONAL

This field corresponds to EMV tag 5F24
Fixed value

sourceOfFunds.provided.card.expiry.month  Digits = COMPULSORY

Months are numbered January=1, through to December=12.
Existence
COMPULSORY
Fixed value
Validation Rules
Data is a number between 1 and 12 represented as a string.
XSD type
string

sourceOfFunds.provided.card.expiry.year  Digits = COMPULSORY

The Common Era year is 2000 plus this value.
Existence
COMPULSORY
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
2
maximum length
2

sourceOfFunds.provided.card.maskedFpan  Masked digits = OPTIONAL

You should use this value for display on confirmation or receipt pages presented to the payer.

RequestNormally you do not need to populate this field, as the gateway will populate this field in the session, and populate it into the payment request when you submit the payment using the session. You would only provide this value, if you had access to FPAN information that was not available to the gateway. On responses, the gateway populates it with a form that the payer would recognize (also explained in more detail below).

Retrieve session response

The gateway always populates this field with its best understanding of the masked FPAN.If you are showing PAN data from the session to the payer, then use this field rather than sourceOfFunds.provided.card.number from the session. This is because this field contains a PAN that the payer will recognize whereas sourceOfFunds.provided.card.number could contain a scheme token, or device PAN which the payer will not recognize. After the payment is processed, the gateway will populate the sourceOfFunds.provided.card.number in the payment response with its best understanding of the masked FPAN. You can show this value to the payer after the payment is complete. This logic also applies to the maskedFpanExpiry field.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9, plus 'x' for masking
XSD type
string
minimum length
9
maximum length
19

sourceOfFunds.provided.card.maskedFpanExpiry   = OPTIONAL

Expiry date, The expiry date of the Funding Primary Account Number (FPAN) in sourceOfFunds.provided.card.maskedFpan.
Fixed value

sourceOfFunds.provided.card.maskedFpanExpiry.month  Digits = OPTIONAL

Months are numbered January=1, through to December=12.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a number between 1 and 12 represented as a string.
XSD type
string

sourceOfFunds.provided.card.maskedFpanExpiry.year  Digits = OPTIONAL

The Common Era year is 2000 plus this value.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
2
maximum length
2

sourceOfFunds.provided.card.mobileWallet   = OPTIONAL

Use this parameter group when accepting payments from mobile wallet providers such as Apple Pay, Android Pay or Samsung Pay.
Fixed value

sourceOfFunds.provided.card.mobileWallet.3DSecure   = OPTIONAL

Cryptogram data for mobile wallet payments provided in 3DSecure format.
Fixed value

sourceOfFunds.provided.card.mobileWallet.3DSecure.eciIndicator  Digits = OPTIONAL

It indicates the level of security and authentication of the transaction.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
1
maximum length
2

sourceOfFunds.provided.card.mobileWallet.3DSecure.onlinePaymentCryptogram  Base64 = COMPULSORY

This will be in Base64 format for MasterCard and Visa transactions and binary format for American Express transactions.
Existence
COMPULSORY
Fixed value
Validation Rules
Data is Base64 encoded
XSD type
string
minimum length
1
maximum length
128

sourceOfFunds.provided.card.mobileWallet.cryptogramFormat  Enumeration = COMPULSORY

You must provide the cryptogram format when you decrypt the payment token and provide the payment details (including the online payment cryptogram) in the transaction request.
Existence
COMPULSORY
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
3DSECURE
The payment data keys for the online payment cryptogram are provided using the 3-D Secure format.
EMV
The payment data keys for the online payment cryptogram are provided using the EMV format.

sourceOfFunds.provided.card.nameOnCard  String = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
256

sourceOfFunds.provided.card.number  Digits = OPTIONAL

On requests, provide the number in the form that you receive it (as explained below). On responses, the gateway populates it with a form that the payer would recognize (also explained in more detail below).

  • Request

    On request, populate this field based on the payment method you are using for the payment:
    • • Card: the account number embossed onto the card. This field corresponds to EMV tag 5A.
    • • Device payment methods such as Apple Pay, Android Pay, Samsung Pay, or Google Pay. Normally for device payments, you would populate sourceOfFunds.provided.card.devicePayment.paymentToken and the gateway will decrypt and extract this field. However, you can populate this field if you decrypt the payment token yourself. In this case use the Device PAN (DPAN) provided in the payment token.
    • • Digital wallets such as Masterpass, Visa Checkout or Amex Express Checkout. In this case, provide the PAN retrieved from the wallet.
    • • Scheme tokens such as MDES (Mastercard Digital Enablement Service). Supply the value called the "Token PAN".
  • Response

    On return, the card number will be populated in 6.4 masking format, for example, 000000xxxxxx0000. If you wish to return unmasked card numbers, you must have the requisite permission, set responseControls.sensitiveData field to UNMASK, and authenticate your call to the API using certificate authentication.

    When a DPAN or scheme token was provided in the transaction request, then this field will represent the PAN of the associated payer's account (when supported by the acquirer). This is also referred to as the Funding PAN (FPAN).
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
9
maximum length
19

sourceOfFunds.provided.card.p2pe   = OPTIONAL

This holds the PAN in the case where it is encrypted by the terminal using DUKPT key exchange.
Fixed value

sourceOfFunds.provided.card.p2pe.cardBin  Digits = OPTIONAL

If you provide this, the gateway will check that the decrypted PAN has these leading six digits. If the check fails, the gateway will reject the transaction.

If you do not provided this, the gateway will not perform this check.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
1
maximum length
6

sourceOfFunds.provided.card.p2pe.encryptionState  String = OPTIONAL

INVALID means the terminal detected some form of error in the encryption process. The gateway will decline transactions with INVALID encryption state. This field may be omitted when the value is VALID.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
5
maximum length
7

sourceOfFunds.provided.card.p2pe.initializationVector  Hex = OPTIONAL

Omit this value if the terminal is not using an initialization vector to seed encryption.
Existence
OPTIONAL
Fixed value
Validation Rules
Data is hexadecimal encoded
XSD type
string
minimum length
16
maximum length
16

sourceOfFunds.provided.card.p2pe.keySerialNumber  Hex = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data is hexadecimal encoded
XSD type
string
minimum length
20
maximum length
20

sourceOfFunds.provided.card.p2pe.payload  Hex = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data is hexadecimal encoded
XSD type
string
minimum length
32
maximum length
1024

sourceOfFunds.provided.card.pin   = OPTIONAL

Provide this data in the case were you want the PIN verified online by the issuer. The gateway supports PINs encoded in ISO 9564-1 formats 0, 1 and 3.
Fixed value

sourceOfFunds.provided.card.pin.encryptionState  Enumeration = OPTIONAL

INVALID means the terminal detected some form of error in the encryption process. The gateway will decline transactions with INVALID encryption state. This field may be omitted when the value is VALID.
Existence
OPTIONAL
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
INVALID
The encryption state is invalid.
VALID
The encryption state is valid.

sourceOfFunds.provided.card.pin.keySerialNumber  Hex = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data is hexadecimal encoded
XSD type
string
minimum length
20
maximum length
20

sourceOfFunds.provided.card.pin.payload  Hex = COMPULSORY

Existence
COMPULSORY
Fixed value
Validation Rules
Data is hexadecimal encoded
XSD type
string
minimum length
16
maximum length
16

sourceOfFunds.provided.card.securityCode  Digits = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
3
maximum length
4

sourceOfFunds.provided.card.sequenceNumber  Digits = OPTIONAL

This field corresponds to EMV tag 5F34
Existence
OPTIONAL
Fixed value
Validation Rules
Data is a number between 0 and 999 represented as a string.
XSD type
string

sourceOfFunds.provided.card.storedOnFile  Enumeration = OPTIONAL

If you store using gateway tokenization then you can ignore this field, unless you do payments with both stored and non-stored cards. If you do both, then you must supply the NOT_STORED value for the non-stored case.

If you use Scheme Tokenization services like MDES and store the tokens provided, you have to provide the value STORED and if you pass the token value with out storing them, provide the value NOT_STORED.

If you store yourself, you have to provide the TO_BE_STORED or STORED values for all payments.
Existence
OPTIONAL
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
NOT_STORED
Set this value if the card or token details provided will not be stored. This is the default value for merchants without tokenization.
STORED
Set this value if the card or token details provided have been stored previously. This is the default value when paying with a gateway token.
TO_BE_STORED
Set this value if this is the first transaction using the card and you intend to store the card or token details on success. This is the default value for tokenization merchants who present a payment with a PAN.

sourceOfFunds.provided.card.track1  Track 1 Data = OPTIONAL

You may optionally include the start and end sentinels and LRC.

Provide this for stripe and EMV fallback to stripe cases.

This field corresponds to EMV tag 56
Existence
OPTIONAL
Fixed value
Validation Rules
Data must comply with ISO 7811-2 track 1 data character set.
Data may consist of the characters: ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ]]>
XSD type
string
minimum length
2
maximum length
79

sourceOfFunds.provided.card.track2  Track 2 Data = OPTIONAL

You may optionally include the start and end sentinels and LRC.

Provide this for stripe and EMV fallback to stripe cases.

The contents of this field must match the PAN and expiry fields included in the Transaction Request.

This field corresponds to EMV tag 57
Existence
OPTIONAL
Fixed value
Validation Rules
Data must comply with ISO 7811-2 track 2 data character set.
Data may consist of the characters: ? ]]>
XSD type
string
minimum length
2
maximum length
40

sourceOfFunds.provided.giftCard   = OPTIONAL

Contains gift card details
Fixed value

sourceOfFunds.provided.giftCard.expectedLocalBrand  String = OPTIONAL

The field is required, if your gift card numbers do not use ISO BIN rules and therefore not allowing the gateway to identify the local brand.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
4
maximum length
50

sourceOfFunds.provided.giftCard.number  Digits = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
9
maximum length
19

sourceOfFunds.provided.giftCard.pin  Digits = OPTIONAL

Existence
OPTIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
4
maximum length
8

sourceOfFunds.token  Alphanumeric = OPTIONAL

The account identifier details stored against this token will be used to process the request.
If account identifier details are also contained in the request, or the request contains a session with account identifier details, these take precedence over the details stored against the token.
Existence
OPTIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z
XSD type
string
minimum length
1
maximum length
40

sourceOfFunds.type  Enumeration = COMPULSORY

If you are passing card data (in any form) on the API, then you need to set this value, and also provide the card details in the sourceOfFunds.provided.card group. In the case of digital wallets or device payment methods, you must also populate the order.walletProvider field.

If you are making a payment with a gateway token, then you can leave this field unset, and only populate the sourceOfFunds.token field. However you can set this to CARD if you want to overwrite or augment the token data with a card security code, expiry date, or cardholder name.
Existence
COMPULSORY
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
CARD
Use this value for payments that obtained the card details either directly from the card, or from a POS terminal, or from a wallet, or through a device payment method.
GIFT_CARD
Use this value for gift cards.

Response Parameters

merchant  Alphanumeric + additional characters = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
XSD type
string
minimum length
1
maximum length
40

order.currency  Upper case alphabetic text = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

response   = Always Provided

Value as generated by the acquirer that summarizes the success or otherwise of the proposed operation.
Fixed value

response.gatewayCode  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
BALANCE_AVAILABLE
A balance amount is available for the card, and the payer can redeem points.
BALANCE_UNKNOWN
A balance amount might be available for the card. Points redemption should be offered to the payer.
NO_BALANCE
A balance amount is not available for the card. The payer cannot redeem points.
TIMED_OUT
The gateway has timed out the request to the acquirer because it did not receive a response. Points redemption should not be offered to the payer.

result  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
FAILURE
The operation was declined or rejected by the gateway, acquirer or issuer
PENDING
The operation is currently in progress or pending processing
SUCCESS
The operation was successfully processed
UNKNOWN
The result of the operation is unknown

sourceOfFunds   = Always Provided

Fixed value

sourceOfFunds.token  Alphanumeric = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z
XSD type
string
minimum length
1
maximum length
40

availableBalance   = Always Provided

Information about the rewards currently available to redeem for the card.
Fixed value

availableBalance.funds.amount  Decimal = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.funds.currency  Upper case alphabetic text = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

availableBalance.reward   = CONDITIONAL

Fixed value

availableBalance.reward.amount  Decimal = CONDITIONAL

This amount is the rewards points available for the card (availableBalance.reward.points) divided by the conversion rate (availableBalance.reward.conversionRate). For example, if the payer has 1500 points available and the conversion rate is 10 then the currency equivalent amount is 150.
Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.conversionRate  Decimal = CONDITIONAL

For example, if the payer has 1500 points available and the conversion rate is 10 then the currency equivalent amount is 150.
Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.currency  Upper case alphabetic text = CONDITIONAL

Expressed as an ISO 4217 alpha code, e.g. USD.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

availableBalance.reward.incrementalSpendAmount  Decimal = CONDITIONAL

This additional amount is the incremental spend amount. For example, if the minimum spend amount is $100, the maximum spend amount is $500, and the incremental spend amount is $20, then the payer can redeem points for purchases between $100 and $500 in increments of $20. If the purchase is for $155 they can redeem $140 from rewards points and will need to pay the balance of $15 on their card.
Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.maximumSpendAmount  Decimal = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.minimumSpendAmount  Decimal = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.payerNominatedAmount  Boolean = CONDITIONAL

If the value is 'true' then you must provide the amount to be redeemed in order.reward.amount when you submit an Authorize or Pay operation, if 'false', then you may not.
Existence
CONDITIONAL
Fixed value
Validation Rules
The values 'true' or 'false'. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#boolean.)
XSD type
boolean

availableBalance.reward.points  Decimal = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
A sequence of digits 0-9 separated by a '.' as a decimal indicator. Leading and trailing zeroes are optional. If the fractional part is zero, the '.' and following zero(es) can be omitted. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#decimal.)
XSD type
decimal
maximum value
1000000000
minimum value
0
maximum post-decimal digits
3

availableBalance.reward.program  Enumeration = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
AMERICAN_EXPRESS_MEMBERSHIP_REWARDS
American Express Membership Rewards.
BANCOMER_MEMBERSHIP_REWARDS
Bancomer Membership Rewards.

balanceId  Alphanumeric + additional characters = CONDITIONAL

It is only returned when a card is eligible for rewards redemption. When redeeming rewards, include this value in the order.reward.balanceId field in the AUTHORIZE or PAY request.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_', ' ', '&', '+', '!', '$', '%', '.'
XSD type
string
minimum length
1
maximum length
100

correlationId  String = CONDITIONAL

The value provided is not validated, does not persist in the gateway, and is returned as provided in the response to the request.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

merchant  Alphanumeric + additional characters = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
XSD type
string
minimum length
1
maximum length
40

order.currency  Upper case alphabetic text = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant   = CONDITIONAL

These merchants are referred to as your sub-merchants. The sub-merchant's details you provide may be displayed on the payer's cardholder statement. Note that your acquirer may require you to register with the card scheme(s) before allowing you to submit sub-merchant details with a transaction. This data must be on the initial transaction of an order, subsequent transactions with sub-merchant will be rejected.
Fixed value

order.subMerchant.address   = CONDITIONAL

The sub-merchant's address.
Fixed value

order.subMerchant.address.city  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.company  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.country  Upper case alphabetic text = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant.address.postcodeZip  Alphanumeric + additional characters = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, ' ', '-'
XSD type
string
minimum length
1
maximum length
10

order.subMerchant.address.stateProvince  String = CONDITIONAL

For an address in the United States provide the 2-letter ISO 3166-2 state code. For US military bases provide one of AE, AA, AP.

For an address in Canada provide the 2-letter ISO 3166-2 province code.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
20

order.subMerchant.address.street  String = CONDITIONAL

For example, this may be the street name and number, or the Post Office Box details.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.address.street2  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.bankIndustryCode  Digits = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9.
XSD type
string
minimum length
4
maximum length
4

order.subMerchant.disputeContactPhone  Telephone Number = CONDITIONAL

In this case, provide a phone number that payers can use to contact the sub-merchant in case of a dispute. Where applicable, the issuer may display this phone number on the cardholder statement. The phone number must be provided in ITU-T E123 format.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
XSD type
string
mandatory country code
true
maximum total digits
15

order.subMerchant.email  Email = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Ensures that the email address is longer than 3 characters and adheres to a generous subset of valid RFC 2822 email addresses
XSD type
string

order.subMerchant.governmentCountryCode  Upper case alphabetic text = CONDITIONAL

A sub merchant is considered a government owned or controlled entity (government controlled merchant) if 50% or more of the sub merchant is owned by the government. Provide the ISO 3166 three-letter country code of the government country where this differs from the sub merchant's physical location country.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data must consist of the characters A-Z
XSD type
string
minimum length
3
maximum length
3

order.subMerchant.identifier  Alphanumeric + additional characters = Always Provided

You can use this identifier in searches and reports in the gateway.
Existence
Always Provided
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_', ' ', '&', '+', '!', '$', '.'
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.marketplaceId  String = CONDITIONAL

A sub merchant is considered a marketplace if they operate a platform (online commerce website or mobile application) where retailers can sell goods and services.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
11

order.subMerchant.phone  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
20

order.subMerchant.registeredName  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

order.subMerchant.tradingName  String = Always Provided

For MasterCard transactions the name must not exceed 21 characters. For American Express transactions the name must not exceed 27 characters (or 36 characters including the aggregator name). The trading name may be displayed on the payer's cardholder statement. Therefore if you need to shorten it, use an abbreviation that will be meaningful to the payer when displayed on their statement.
Existence
Always Provided
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

response   = Always Provided

Value as generated by the acquirer that summarizes the success or otherwise of the proposed operation.
Fixed value

response.acquirerCode  ASCII Text = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data consists of ASCII characters
XSD type
string
minimum length
1
maximum length
100

response.acquirerMessage  ASCII Text = CONDITIONAL

This field is used in addition to response.acquirerCode for some acquirers where additional information needs to be communicated. For example, contact details to allow the merchant to contact the issuer directly to seek authorisation for the transaction.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data consists of ASCII characters
XSD type
string
minimum length
1
maximum length
255

response.gatewayCode  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
BALANCE_AVAILABLE
A balance amount is available for the card, and the payer can redeem points.
BALANCE_UNKNOWN
A balance amount might be available for the card. Points redemption should be offered to the payer.
NO_BALANCE
A balance amount is not available for the card. The payer cannot redeem points.
TIMED_OUT
The gateway has timed out the request to the acquirer because it did not receive a response. Points redemption should not be offered to the payer.

result  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
FAILURE
The operation was declined or rejected by the gateway, acquirer or issuer
PENDING
The operation is currently in progress or pending processing
SUCCESS
The operation was successfully processed
UNKNOWN
The result of the operation is unknown

sourceOfFunds   = Always Provided

Fixed value

sourceOfFunds.provided   = CONDITIONAL

For browser payments, the source of funds details are usually collected from the payer on the payment provider's website and provided to you when you retrieve the transaction details (for a successful transaction). However, for some payment types (such as giropay), you must collect the information from the payer and supply it here.
Fixed value

sourceOfFunds.provided.giftCard   = CONDITIONAL

Contains gift card details
Fixed value

sourceOfFunds.provided.giftCard.brand  Enumeration = Always Provided

For many major card types this will match the scheme name.
Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
LOCAL_BRAND_ONLY
The card does not have a global brand.

sourceOfFunds.provided.giftCard.localBrand  String = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
50

sourceOfFunds.provided.giftCard.number  Masked digits = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9, plus 'x' for masking
XSD type
string
minimum length
9
maximum length
19

sourceOfFunds.provided.giftCard.pin  Masked digits = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data is a string that consists of the characters 0-9, plus 'x' for masking
XSD type
string
minimum length
4
maximum length
8

sourceOfFunds.provided.giftCard.scheme  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
OTHER
The scheme of the card used in the transaction could not be identified.

sourceOfFunds.token  Alphanumeric = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z
XSD type
string
minimum length
1
maximum length
40

sourceOfFunds.type  Enumeration = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
CARD
Use this value for payments that obtained the card details either directly from the card, or from a POS terminal, or from a wallet, or through a device payment method.
GIFT_CARD
Use this value for gift cards.

error   = CONDITIONAL

Information on possible error conditions that may occur while processing an operation using the API.
Fixed value

error.cause  Enumeration = CONDITIONAL

For example, errors may occur due to invalid requests or internal system failures.
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
INVALID_REQUEST
The request was rejected because it did not conform to the API protocol.
REQUEST_REJECTED
The request was rejected due to security reasons such as firewall rules, expired certificate, etc.
SERVER_BUSY
The server did not have enough resources to process the request at the moment.
SERVER_FAILED
There was an internal system failure.

error.explanation  String = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST or SERVER_BUSY.
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
1000

error.field  String = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST and a field level validation error was encountered.
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

error.supportCode  String = CONDITIONAL

This field is returned only if the cause is SERVER_FAILED or REQUEST_REJECTED.
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

error.validationType  Enumeration = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST and a field level validation error was encountered.
Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
INVALID
The request contained a field with a value that did not pass validation.
MISSING
The request was missing a mandatory field.
UNSUPPORTED
The request contained a field that is unsupported.

result  Enumeration = CONDITIONAL

Fixed value
Validation Rules
XSD type
string
Value must be a member of the following list. The values are case sensitive.
ERROR
The operation resulted in an error and hence cannot be processed.

Copyright © 2023 Mastercard