---
title: "Rule Verification"
method: POST
path: "/rule/verify"
tags: ["Rule"]
---

# Rule Verification

`POST /rule/verify`

Used to check for various processing rules such as surcharge eligibility.

 **Integration Methods:**
- Host Direct

See the [Integration Methods](/guides/quickstart#integration-methods) and [URLs Section](/guides/quickstart#urls) sections of the Development Quick Start guide for details regarding each processing option.

See the [JSON Body Schemas](/guides/quickstart#json-body-schemas) for more details on the various JSON body formats.

## Headers

- `InterfaceVersion` string, required
- `InterfaceName` string, required
- `CompanyName` string, required
- `AccessToken` string, uuid, required

## Request body

- union
  - RulesVerifyTokenGtv
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `card` object, required
      - `expirationDate` integer — **Conditional: Send only when card data is manually entered or when using a token. This field should not be specified when using an encrypted device.** Card expiration date in MMYY format. This value should only be populated in the initial sale/authorization request.
      - `token` CardTokenRequired, required
        - `value` string, required — This field is used to specify a card token. Whenever CHD is sent in a request, a card token will be returned in this field. Your interface should be designed to store this card token for future use. The latest card token received should be used in any subsequent request that references the same card data.
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyP2peIdtech
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `p2pe` P2PEType0102IDTECH, required
      - `data` string, required — The full output of a P2PE keypad/magnetic swipe reader (MSR).
      - `format` '01' | '02', required — Classifies the type of payment device being used for P2PE. Value|Description -----|----------- 01 | IDTech Enhanced Encryption format (Keyboard Mode) 02 | IDTech Enhanced Encryption format (USB HID Mode)
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyP2peTdesdukptEmv
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `p2pe` P2PEType05TDESDUKPTEMV, required — See [P2PE Format 05 TDES DUKPT](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05) for more information.
      - `format` '05', required — Classifies the type of payment device being used for P2PE. Value|Description -----|----------- 05 | [Shift4 TDES DUKPT format](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05)
      - `ksn` string, required — The key serial number which was used to encrypt the P2PE data.
    - `emv` EMVEncryptedTagsOnly, required — Encrypted EMV tags
      - `tlvData` string, required — This field contains the P2PE encrypted tags (5A and 57) in standard TLV format. The P2PE encrypted tags (5A and 57) will have the entire TLV string encrypted and the encrypted data will be in a TLV format using the same tag. For example, tag 5A would look like the following: - Encrypted: `5A181CF757386DE00BC2DE05F965DB1E96D867C2009CA8C3179` - Decrypted: `5A084761739001010010`
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyP2peTdesdukptMsr
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `p2pe` P2PEType05TDESDUKPTMSR, required — See [P2PE Format 05 TDES DUKPT](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05) for more information.
      - `data` string, required — The full output of a P2PE keypad/magnetic swipe reader (MSR).
      - `format` '05', required — Classifies the type of payment device being used for P2PE. Value|Description -----|----------- 05 | [Shift4 TDES DUKPT format](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05)
      - `ksn` string, required — The key serial number which was used to encrypt the P2PE data.
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyP2peOnguardsdeEmv
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `p2pe` P2PEType03OnguardSDEEMV, required — See [P2PE Format 03 Ingenico On-Guard SDE](/guides/core-concepts/p2pe-format#ingenico-on-guard-sde---format-03) for more information.
      - `data` string, required — EMV TLV Data for tags 5A and 57 encrypted with AES 256 DUKPT. Contains the following information, separated by colons: Value | Description ----------------|------------ ksn | The key serial number (24 byte hex) track indicator | `E` indicating EMV TLV Data length | The length of the encrypted data encrypted data | Encrypted TLV containing tags 57 and 5A Example: `FFFF495A0000000200000002:E:0032:E0AB94F7704E77AB37F81A7E236A1ABC1465C6DFCE43A506240D6E7D6DDA7EA9`
      - `format` '03', required — Classifies the type of payment device being used for P2PE. Value|Description -----|----------- 03 | Ingenico Onguard SDE Format
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyP2peOnguardsdeMsr
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `p2pe` P2PEType03OnguardSDEMSR, required — See [P2PE Format 03 Ingenico On-Guard SDE](/guides/core-concepts/p2pe-format#ingenico-on-guard-sde---format-03) for more information.
      - `data` string, required — Track information encrypted with AES 256 DUKPT. Contains the following information, separated by colons: |Value | Description |----------------|------------ |ksn | The key serial number (24 byte hex) |track indicator | `1` = track 1 only<br />`2` = track 2 only<br />`3` = manual entry<br />`4` = dual track<br /> |length | The length of the encrypted data |encrypted data | Encrypted track/manual entry data Dual Track Example: `FFFF495A0000000200000005:4:0128:F48C880DE0DAF549E642C5CC25E65ADF9947E7EB0636DB80C4A490B4C0930AEF64B7201505343CED533A2AE9AFABFE6453875F705519A8109362197CA3BD8DA0FE90DB3F954B9CDA0DB58BDA3330862ADD28CB31EFDA7C641575E33D395D8BFF72EBF0B1FF9630DB0EAB080FE8C9B2FAC28127CDC48CA9F7D532D5BDE4CCE270` Manual entry Example: `FFFF495A0000000200000006:3:0032:E394820DB97AF927B9B5E05F356750BBF5DFCCB3BC18B87E8FC3C9BC596229E7`
      - `format` '03', required — Classifies the type of payment device being used for P2PE. Value|Description -----|----------- 03 | Ingenico Onguard SDE Format
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
  - RulesVerifyUnencryptedcard
    - `dateTime` string, ISO 8601, required — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` AmountTotalOnly, required — Object containing information regarding the amount being requested. The `total` field within the object is required and specifies the amount being requested. Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
      - `total` number, required — The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    - `ruleCheck` string[], required — Specifies which rule checks are being requested: | Value | Description | |-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | SURCHARGE | Checks to see if a card is eligible for surcharging. If eligible the `surcharge` object will be returned containing the surcharge percentage that can be applied. |
    - `transaction` TransactionRuleVerify, required
      - `invoice` string, required — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
    - `card` object, required
      - `number` string, required — The payment card number entered in an initial authorization/sale request. This field will always be masked when returned in a response.
      - `expirationDate` integer, required — **Conditional: Send only when card data is manually entered or when using a token. This field should not be specified when using an encrypted device.** Card expiration date in MMYY format. This value should only be populated in the initial sale/authorization request.
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.

## Response `200`

Request was processed

- object
  - `result` object[]
    - `dateTime` string, ISO 8601 — The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    - `amount` object
      - `total` number — The total amount being charged for a particular transaction. If the `ruleCheck` array contained `SURCHARGE` in the request and the card is surcharge eligible the `amount.total` value will be incremented by the `amount.surcharge` value. For example, if the rule verification request had `amount.total = 100` and the `surcharge.percentage` was 1.5%, the rule verification response would include `amount.total = 101.50` and `amount.surcharge = 1.50`
      - `surcharge` number — **Conditional: Returned if the `ruleCheck` array contained `SURCHARGE` in the request and the card is surcharge eligible.** The surcharge fee amount that can be applied to the transaction. The fee amount is also added into `amount.total`. For example, if the rule verification request had `amount.total = 100` and the `surcharge.percentage` was 1.5%, the rule verification response would include `amount.total = 101.50` and `amount.surcharge = 1.50`
    - `card` object
      - `number` string — The card number field will always be masked when returned in a response.
      - `token` CardTokenResponse
        - `value` string — This field is used to specify a card token. Whenever CHD is sent in a request, a card token will be returned in this field. Your interface should be designed to store this card token for future use. The latest card token received should be used in any subsequent request that references the same card data.
      - `type` 'AX' | 'AP' | 'BC' | 'CI' | 'DB' | 'GC' | 'JC' | 'MC' | 'NS' | 'PL' | 'SC' | 'VS' | 'WP' | 'YC' — An abbreviation used to specify the type of card that was used when processing a transaction. Value| Description -----|------------ AX | American Express AP | Alipay BC | Backed Card CI | Citgo DB | Debit card GC | Gift Card JC | JCB MC | Mastercard NS | Discover/JCB/Novus PL | Private Label SC | Sears Canada VS | Visa WP | WeChat Pay YC | IT’S YOUR CARD
    - `surcharge` object — Returned if the `ruleCheck` array contained `SURCHARGE` in the request.
      - `result` 'P' | 'F' — Result of the surcharge eligibility check: | Value | Description | |-------|---------------------------------------------| | P | Pass - Card is eligible for surcharging | | F | Fail - Card is not eligible for surcharging |
      - `transactionId` string — Transaction ID for the rule check
      - `percentage` number — The surcharge percentage that can be applied to a transaction.
    - `transaction` object
      - `invoice` string — 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. **Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.** **For processing outside of the US and Canada alpha characters are allowed.**
      - `vendorReference` string — Optional field for information that can be searched in the merchant portal.
      - `authSource` 'E' | 'O' | 'A' | 'F' — In a response, a code returned by the processor to indicate which host issued the response. Value | Description -------|---------------------------- E | Engine (Online) O | Offline A | APM (Online) F | Payment Platform (Online)
    - `merchant` MerchantResponse
      - `mid` number — The merchant ID associated with the merchant account.
      - `name` string — The merchant’s business name as configured with Shift4.
    - `clerk` ClerkOptional
      - `numericId` integer — A number used to identify the point-of-sale (POS) or property management system (PMS) clerk or user. The value cannot be 0. An interface must be able to dynamically populate this field (not use a hardcoded value), unless the interface will be used exclusively for e-commerce.
    - `currencyCode` string, ISO 4217 3 Character Alphabetic Code — Transaction currency code. See the [Currency Codes](/guides/appendices/currency-codes) section for details. **Note: This is currently supported when processing for a merchant outside of the US and Canada. If processing for a US or Canadian merchant then this field will be ignored and the transaction will process in the merchant's configured currency.**
    - `universalToken` UniversalToken
      - `value` string — An identifier for a card or payment account across all Shift4 merchants.
    - `server` Server
      - `name` string — The name of the server that processed the request.

## Other responses

- `400` — Error
- `504` — Timeout

---

[API](https://skmtc.dev/shift4/apis/shift4-payment-api.md) · [All operations](https://skmtc.dev/shift4/apis/shift4-payment-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/shift4/shift4-payment-api/revisions/2f85c87cc9e5/schema)
