Skip to main content
Skip table of contents

Submit Level 2 and Level 3 Data with Transactions

To take advantage of lower interchange rates, you must submit Level 2 and Level 3 data along with the transaction. This ensures the customer’s card brand network can receive and assess the data to determine which interchange rate the transaction will receive.

If you’re not sure what data each interchange level requires, visit Understanding Interchange Data Requirements.

Before You Begin

Before you begin submitting Level 2 or Level 3 data, we recommend checking each card’s Level 2 and Level 3 processing eligibility. This process involves tokenizing the card and checking its bank identification number (BIN) for information about the card brand and card type.

Create a Card Token

You can query the BIN of a customer’s card only if the card has been tokenized. To create a token for the customer’s card:

  1. Send a POST https://test-api.payrix.com/tokens request with the following payload, adjusting the value for each parameter in the request body:

JSON
{
  "customer": "{customerID}",
  "payment": {
	"number": "{customerCardNumber}",
	"cvv": "{customerCardCVV}"
  },
  "expiration": "{MMYY}"
}

The following table describes the required request body parameters:

Required Parameter

Type

Description

Valid Values and Format

customer

string

The unique identifier of the customer.

Example: t1_cus_67a2358248336fb7f543214

payment

object

The payment method associated with the customer, including the card details.

Not applicable

number

string

The card number of the credit card associated with the payment method.

Example: 4242424242424242

cvv

string

The card verification value (CVV) of the credit card associated with the payment method.

This field is expressed as a three-digit string.

expiration

string

The expiration date of the payment method (in this case, a credit card) associated with the payment method.

This field is stored as a text string in MMYY format, where MM is the number of a month and YY is the last two digits of a year. For example, 0623 for June 2023.

  1. In the response, copy the auto-generated token identifier in the token field returned by the endpoint. You'll need this value in subsequent API calls. The following example shows the structure of a successful response with tokenized payment method information:

JSON
{
  "response": {
    "data": [
      {
        "payment": {},
        "token": "01234ab56c7890d1e293b456cfd7f8be"
      }
    ],
    "details": {},
    "errors": []
  }
}

Identify the Card Type

Visa and MasterCard are the only card brands that can receive additional data to influence their interchange rates. In contrast, American Express and Discover don’t offer direct data submission options for Level 2 or 3 data to obtain lower interchange rates. As a result, we recommend verifying the card brand before submitting data with the intention of reducing interchange rates.

To identify the card type:

  1. Send a GET https://test-api.payrix.com/tokens?expand[payment][bin][] request. A successful request returns an array of tokenized payment methods, each of which includes the method (card brand), type (debit, credit, or both), and category (such as personal or corporate card) in a payment.bin object.

  2. In the response, locate the object in the data array where the token property matches the card’s token identifier. To qualify for interchange data submission, verify that you meet one of each of the following response values listed in the table:

Required Parameter

Acceptable Values

payment.bin.method

  • 2: Visa

  • 3: MasterCard

payment.bin.type

  • credit: Credit Card

  • debit: Debit Card

  • debitCredit: Debit or Credit Card

  • charge: Purchasing or Charge Card

payment.bin.category

  • business: Business credit or debit card.

  • corporate: Corporate credit or debit card.

Note: The sandbox API only returns a null value.

Click here for a response example with parameter descriptions.

In the response, look specifically for the payment.bin.method, payment.bin.type, and payment.bin.category values. These values will help you determine if the card brand network supports lower interchange rates or Level 2 or Level 3 data submissions before submitting the additional data with a payment transaction.

JSON
{
  "response": {
    "data": [
      {
        "payment": {
          "bin": {
            "bin": "123456",
            "method": 2,
            "type": "credit",
            "category": "business",
            "name": "Big Bank",
            "address": "123 Golden Ave",
            "city": "Denver",
            "state": "CO",
            "country": "USA",
            "zip": "12345",
            "locationType": "branch",
            "newBin": "123455",
            "website": "https://website.com/",
            "phone": "5555555555",
            "transferEnabled": 0,
            "numberLength": 0,
            "debitOverCreditEnabled": 0,
            "billPayEnabled": 0,
            "pinlessSupport": "none"
          }
        },
        "token": "01234ab56c7890d1e293b456cfd7f8be"
      }
    ],
    "details": {},
    "errors": []
  }
}

The following table describes the parameters in the payment.bin object:

Parameters

Type

Description

Valid Values and Format

bin

string

The bank identification number (BIN) and first 6 digits of the card used in a Transaction.

Example: 424242

method

string

The type of payment method used for a transaction.

  • 0: Unknown Payment Method

  • 1: American Express

  • 2: Visa

  • 3: MasterCard

  • 4: Diners Club

  • 5: Discover

  • 6: PayPal

  • 7: Debit card

  • 8: Checking account

  • 9: Savings account

  • 10: Corporate checking account

  • 11: Corporate savings account

  • 12: Gift card

  • 13: EBT (Electronic Benefits Transfer) Card

  • 14: WIC (Women, Infants and Children) Card

type

string

The type of the card used in the Transaction.

  • credit: Credit Card

  • debit: Debit Card

  • debitCredit: Debit or Credit Card

  • charge: Purchasing or Charge Card

  • prepaid: Prepaid Debit Card

  • bankAccount: Bank Account Card

category

integer

The card type category for the account.

  • classic: Classic credit or debit card.

  • business: Business credit or debit card.

  • corporate: Corporate credit or debit card.

  • fleet: Fleet card for transportation related expenses.

  • hsaFsa: HSA (Health Savings Account) or FSA (Flexible Spending Account) card.

  • platinum: Platinum credit card.

  • prepaid: Prepaid card.

  • coreCard: Core card.

  • personal: Personal account.

  • standard: Standard account.

  • other: Other type of account.

name

string

The name of the bank that issued the card used in the Transaction.

Example: Big Bank

address

string

The issuing bank street address.

Example: 123 Main St

city

string

The city of issuing bank.

Example: Denver

state

string

The 2-digit issuing bank state or province code.

Example: CO for Colorado

country

string

The 3-digit missing bank country code.

  • USA: United States

  • CAN: Canada

Default is USA.

zip

string

The 5-digit issuing bank postal code.

Example: 12345

locationType

string

The type of location of the issuing bank.

  • branch: Branch location

  • main: Main headquarters

newBin

string

The BIN or routing number that replaces or supersedes the bin field value (where applicable).

Example: 123455

website

string

The website of the bank that issued the card used in the Transaction.

Example: https://website.com/

phone

string

The phone number of the bank that issued the card used in the Transaction.

Example: 18005554224

transferEnabled

integer

Whether push-to-card transfer is enabled.

  • 0: Push-to-card transfer disabled.

  • 1: Push-to-card transfer enabled.

numberLength

string

The number of digits expected for account numbers with this BIN.

Example: 0

debitOverCreditEnabled

integer

Whether this debit card may be charged as credit over the credit networks.

  • 0: Debit charge as credit disabled.

  • 1: Debit charge as credit enabled.

billPayEnabled

integer

Whether this card may be used for bill pay features.

  • 0: Bill pay capability disabled.

  • 1: Bill pay capability enabled.

pinlessSupport

string

What type of pinless charging is allowed on this debit card.

  • none: No pinless support, PIN (Personal Identification Number) must always be provided.

  • restricted: Some pinless support, PIN (Personal Identification Number) may not always be necessary.

  • full: Full pinless support, PIN (Personal Identification Number) may be omitted for pinless payments.

Tip

You can also view a card type, BIN, and additional card information in the Portal for previous transactions through the Payment Details tab on the Transaction Details page for the associated card type.


Submit Level 2 and Level 3 Data

You have multiple methods for submitting Level 2 or Level 3 data. Read through the basic methods in the following sections to find the best workflow for your business.

Portal

The Portal offers a simple way to manually enter and submit Level 2 and Level 3 values with payment transactions. Read the following steps to learn more:

Submit Level 2 Data Using the Portal

To submit Level 2 transaction data using the Create Payments page:

  1. Navigate to the Create Payment page under Payments

  2. Enter all applicable data. Then, under Customer Details, select Submit this transaction as LEVEL 2 PROCESSING to reveal Level 2 fields.

  3. Enter the TAX and ORDER NUMBER values.

    • Note: If the entity is tax-exempt, you may enter 0. See the steps below to enable tax-exempt status.

    • Note: If you are not a tax-exempt entity, you must adhere to Visa, Mastercard, and local government sales tax rates and regulations to receive lower Level 2 interchange rates.

  4. (Optional) Follow the steps below to also include Level 3 data.

  5. Click Process Payment to complete the submission.

Enable Tax-exempt Status Using the Portal

Non-profit and Governmental entities that qualify for tax-exempt status can apply this setting to their platform entity. This provides the proper mapping for Level 2 data submission when tax amounts are set to 0%.

Important!

To display the Parameters tab and Auto Tax Exempt Enabled parameter for your Groups, contact your Payrix Pro representative to enable visibility.

To apply tax-exempt status to non-profit entity groups from the Groups page:

  1. Access the Groups page under the Management section.

  2. Select the desired group (or Add a new Group if needed) and enter the Group Profile page.

  3. Select the Parameters tab, then click ADD PARAMETERS.

  4. Click the edit icon in the upper-right corner, then select Auto Tax Exempt Enabled and confirm.

  5. Return to the Group Profile page, then click ADD MEMBERS to Add the Merchant as a Member.

  6. Click Save to complete the Merchant enrollment in the Tax Exempt Group.


Tax Exempt Exceptions:

A tax-exempt merchant can qualify for Level 3 rates for both MasterCard and Visa.

Warning

Visa does not allow tax-exempt Merchants to qualify for Level 2 interchange regardless of MCC code.

MasterCard allows the MCCs listed in the following table to qualify for Level 2 interchange rates if the business is 100% tax-exempt:

MCC

Type / Description

4111

Transportation—Suburban and Local Commuter Passenger, including Ferries

4131

Bus Lines

4215

Courier Services

4468

Marinas, Marine Service/Supplies

4784

Bridge and Road Fees, Tolls

5499

Misc Food Stores

5541

Service Stations

5542

Automated Fuel Dispenser

5983

Fuel Dealers

8211

Elementary and Secondary Schools

8220

Colleges

8398

Charities

8661

Religious Orgs

9211

Court Costs

9222

Gov’t Fines

9311

Tax Payments

9399

Gov’t Services Not Elsewhere Classified

9402

Gov’t Postal Services

Submit Level 3 Data Using the Portal

To submit Level 3 transaction data using the Create Payments page:

  1. Complete steps 1–3 from the Level 2 submission section above.

  2. Select Submit this transaction as LEVEL 3 PROCESSING (All fields must be completed) to reveal Level 3 fields.

  3. Enter the SHIPPING AMOUNT, DUTY AMOUNT, and ORDER DISCOUNT value.

  4. Under Order Items, enter the DESCRIPTION, COMMODITY CODE, PRODUCT CODE, ITEM PRICE, ITEM DISCOUNT, QUANTITY, UNIT OF MEASURE, and ITEM TOTAL for each item.

  5. (Optional) Add additional Order Items as needed by clicking Add Item at the bottom of each new item form. Each additional item must have all the fields above for Level 3 Transaction Processing.

  6. Click Process Payment to complete the submission.


API

The Payrix Pro API provides a straightforward method of submitting Level 2 and Level 3 data values alongside transactions. Read the following information to learn more:

Submit Level 2 Data Using the Payrix Pro API

To submit Level 2 transaction data using the /txns endpoint, send the following request:

CODE
POST https://test-api.payrix.com/txns
JSON
{
   "merchant": "{yourMerchantID}",
   "token": "01234ab56c7890d1e293b456cfd7f8be",
   "origin": 2,
   "type": 2,
   "order": "INVOICE#1",
   "total": 7799,
   "tax": 100
}

Important!

Tax rates must be set according to status and regulation:

  • If you are a tax-exempt entity, you may enter 0 in the tax field. See the steps below to enable tax-exempt status.

  • If you are not a tax-exempt entity, you must adhere to Visa, Mastercard, and local government sales tax rates and regulations to receive lower Level 2 interchange rates.

Required Parameters

Type

Description

Valid Values and Format

merchant

string

The identifier of the Merchant associated with this Transaction.

Example: t1_mer_12ab34567c332e1f1fa8354

token

string

The token associated with this Transaction.

Example: 01234ab56c7890d1e293b456cfd7f8be

origin

integer

The origin of this Transaction.

  • 1: Originated at a credit card terminal.

  • 2: Originated through an eCommerce system.

  • 3: Originated as a mail order or telephone order transaction.

  • 4: Originated with Apple Pay.

  • 5: Originated as a Successful 3D Secure transaction.

  • 6: Originated as an Attempted 3D Secure transaction.

  • 7: Originated as a recurring transaction on the card.

  • 8: Originated in a PayFrame.

  • 9: Originated as a transaction where authorization was received in writing.

type

integer

The type of transaction.

  • 1: Credit Card Only: Sale Transaction. Processes a sale and charges the customer.

  • 2: Credit Card Only: Auth Transaction. Authorizes and holds the requested total on the credit card.

  • 3: Credit Card Only: Capture Transaction. Finalizes a prior Auth Transaction and charges the customer.

  • 4: Credit Card Only: Reverse Authorization. Reverses a prior Auth or Sale Transaction and releases the credit hold.

  • 5: Credit Card Only: Refund Transaction. Refunds a prior Capture or Sale Transaction (total may be specified for a partial refund).

  • 7: eCheck Only: eCheck Sale Transaction. Sale Transaction for eCheck payment.

  • 8: eCheck Only: eCheck Refund Transaction. Refund Transaction for prior eCheck Sale Transaction.

  • 11: eCheck Only: eCheck Redeposit Transaction. Attempt to redeposit a prior failed eCheck Sale Transaction.

  • 12: eCheck Only: eCheck Account Verification Transaction. Attempt to verify eCheck payment details.

order

string

The order number associated with this Transaction.

Any string up to 1,000 characters long.

total

number

The total amount of this Transaction.

This field is specified as an integer in cents.

tax

integer

The total sum of this Transaction’s tax amount.

This field is specified as an integer in cents.

Enable Tax-exempt Status Using the Payrix Pro API

Non-profit and Governmental entities that qualify for tax-exempt status can apply this setting to their platform entity. This option properly maps for Level 2 data submission when tax amounts are set to 0%.

Important!

  • Tax-exempt status is available for Commercial Retail and Commercial Card-Not-Present transactions only.

  • To enable the /parameters endpoint and autoTaxExemptEnabled parameter for your Groups, contact your Payrix Pro representative.

To apply tax-exempt status to non-profit entity groups using the /parameters endpoint, send the following request:

CODE
POST https://test-api.payrix.com/parameters
JSON
{
  "login": "{{yourLoginID}}",
  "org":" {{merchantsOrg/GroupID}}",
  "autoTaxExemptEnabled": "1",
  "inactive": "0",
  "frozen": "0"
}

Tax Exempt Exceptions:

A tax-exempt merchant can qualify for Level 3 rates for both MasterCard and Visa.

Important!

Visa does not allow tax-exempt Merchants to qualify for Level 2 interchange regardless of MCC code.

MasterCard allows the MCCs listed in the following table to qualify for Level 2 interchange rates if the business is 100% tax-exempt:

MCC

Type / Description

4111

Transportation—Suburban and Local Commuter Passenger, including Ferries

4131

Bus Lines

4215

Courier Services

4468

Marinas, Marine Service/Supplies

4784

Bridge and Road Fees, Tolls

5499

Misc Food Stores

5541

Service Stations

5542

Automated Fuel Dispenser

5983

Fuel Dealers

8211

Elementary and Secondary Schools

8220

Colleges

8398

Charities

8661

Religious Orgs

9211

Court Costs

9222

Gov’t Fines

9311

Tax Payments

9399

Gov’t Services Not Elsewhere Classified

9402

Gov’t Postal Services


If you do not first contact your Payrix Pro representative to enable access to the /parameters endpoint, you will receive the following error:

JSON
{
    "errors": [
        {
            "code": 23,
            "severity": 2,
            "msg": "Invalid request for this type of user authentication"
        }
    ]
}

Your successful response should look like the following:

JSON
{
    "id": "t1_par_1abc2d34ef5g6h7ij89kl01",
    "created": "2023-10-05T13:00:33.442Z",
    "modified": "2023-10-05T13:00:33.442Z",
    "creator": "t1_log_1abc2d34ef5g6h7ij89kl01",
    "modifier": "t1_log_1abc2d34ef5g6h7ij89kl01",
    "login": "t1_log_1abc2d34ef5g6h7ij89kl01",
    "org": "t1_org_1abc2d34ef5g6h7ij89kl01",
    "division": "t1_div_1abc2d34ef5g6h7ij89kl01",
    "partition": "t1__1abc2d34ef5g6h7ij89kl01",
    "autoTaxExemptEnabled": "1",
    "inactive": "0",
    "frozen": "0",
    "minTxnTotal": "null",
    "maxTxnTotal": "null",
    "maxTxnDailyTotal": "null",
    "maxTxnDailyNum": "null",
    "maxTxnMonthlyTotal": "null",
    "maxTxnMonthlyNum": "null",
    "maxSubscriptionFailures": "null",
    "minPayoutCreditTotal": "0001",
    "maxPayoutCreditTotal": "null",
    "minPayoutDebitTotal": "-0001",
    "maxPayoutDebitTotal": "null",
    "minAvailableFunds": "null",
    "minStatementDebitPayoutDelay": "5",
    "minFundsPayoutTotal": "500",
    "minPayoutDelay": "3",
    "minFirstPayoutDelay": "3",
    "payoutDelayIncludeOffDays": "0",
    "payoutIncludePending": "0",
    "amexEnabled": "0",
    "optBlueEnabled": "0",
    "discoverEnabled": "0",
    "discoverAcquiredEnabled": "0",
    "mc3dsEnabled": "0",
    "visa3dsEnabled": "0",
    "amex3dsEnabled": "0",
    "discover3dsEnabled": "0",
    "eCheckEnabled": "0",
    "fundingEnabled": "0",
    "debtRepaymentEnabled": "0",
    "verifyDisabled": "0",
    "verifyForBoardingNotRequired": "0",
    "verifyForPayoutNotRequired": "0",
    "refundReleasesReserve": "0",
    "vendorFeesEnabled": "0",
    "vendorFeesExternal": "0",
    "visaMisuseSettlement": "10",
    "visaMisuseTravelAutoSettlement": "20",
    "visaMisuseCardPresentReversal": "24",
    "visaMisuseCardNotPresentReversal": "168",
    "mcMisuseSettlement": "120",
    "minEcheckCaptureDelay": "0",
    "minDebitProcessingDelay": "5",
    "minBoardingOwnership": "0",
    "boardingExemptionsDisabled": "0",
    "mcMisuseCardPresentReversal": "24",
    "mcMisuseCardNotPresentReversal": "72",
    "mcMisuseTravelAutoReversal": "480",
    "boardingDisabled": "0",
    "autoReboardDays": "60",
    "surchargeEnabled": "0",
    "mcInstantPayoutsEnabled": "0",
    "visaInstantPayoutsEnabled": "0",
    "mcInstantPayoutMin": "0",
    "mcInstantPayoutMax": "7500000",
    "visaInstantPayoutMin": "0",
    "visaInstantPayoutMax": "5000000",
    "sameDayPayoutsEnabled": "0",
    "applePayEnabled": "0",
    "googlePayEnabled": "0",
    "sameDayPayoutsDailyMax": "null",
    "minSameDayPayoutCreditTotal": "null",
    "maxSameDayPayoutCreditTotal": "null",
    "minSameDayPayoutDebitTotal": "null",
    "maxSameDayPayoutDebitTotal": "null",
    "accountUpdaterEnabled": "0",
    "updateAllTokensEnabled": "0",
    "accountUpdaterFrequency": "30",
    "minDebitedAvailableFunds": "0",
    "getParametersEnabled": "0",
    "payoutCutoffTime": "null",
    "declineNotificationEmail": "0",
    "decisionMicroserviceEnabled": "0",
    "holdMessagesDisabled": "0",
    "txnDecisionMicroserviceEnabled": "0",
    "omniTokenEnabled": "0",
    "passTokenEnabled": "0",
    "debitGracePeriod": "null",
    "negativeBalanceLimit": "null",
    "negativeBalanceEmail": "0",
    "positiveBalanceEmail": "0"
}

Note

All other non-applicable response parameters above are set with their default values. See the API documentation to read more about the other available response fields' descriptions.

See the descriptions below for the applicable response parameters.

Parameter

Description

Notes

id

The Org parameter configurations ID.

Recall this ID if you want to enable, change, or disable any individual org parameter.

created

The date and time at which this resource was created.

None

modified

The date and time at which this resource was modified.

None

creator

The identifier of the Login that created this resource.

None

modifier

The identifier of the Login that last modified this resource.

None

login

The Login that owns this resource.

None

org

The identifier of the Org resource that this Parameter resource is associated with.

None

autoTaxExemptEnabled

Whether to assume a transaction is tax-exempt if no tax is set for Level 2 processing.

Valid values:

  • 0: Disabled

  • 1: Enabled


Ineligible Merchant Types (MCCs) for Tax Exempt Level 2 Interchange Rates

Ineligible MCCs

Descriptions of Merchant Type

3000–3999

Airlines/Car Rental Companies/Hotels

4112

Passenger Railways

4411

Steamship and Cruise Lines

4468

Marinas, Marine Service, and Supplies

4511

Airlines and Air Carriers

4722

Travel Agencies and Tour Operators

5499

Misc Food Stores - Speciality Markets and Convenience

5541

Gas/Service Stations with/without Ancillary Services

5542

Automated Fuel Dispensers

5812

Eating Places and Restaurants

5814

Fast Food Restaurants

5962

Direct Marketing – Travel Related Arrangements Services (High Risk)

5966

Direct Marketing – Outbound Telemarketing Merchant (High Risk)

5967

Direct Marketing – Inbound Teleservices Merchant (High Risk)

5983

Fuel Dealers - Fuel, Oil, Wood, Coal, Lique

7011

Lodging – Hotels, Motels, and Resorts

7512

Automobile Rental Agency

7513

Truck & Utility Trailer Rentals

Submit Level 3 Data Using the Payrix Pro API

To submit Level 3 transaction data using the /txns endpoint, send the following request:

CODE
POST https://test-api.payrix.com/txns
JSON
{
   "merchant": "{yourMerchantID}",
   "token": "01234ab56c7890d1e293b456cfd7f8be",
   "origin": 2,
   "type": 2,
   "order": "INVOICE#1",
   "total": 7799,
   "tax": 100,
   "items": [
      {
         "item": "Line Item #1",
         "description": "Line Item Description"
         "quantity": 1,
         "price": 7799,
         "um": "EACH",
         "commodityCode": "1111999",
         "total": 5799,
         "discount": 2000,
         "productCode": "UPC12345"
      }
   ]
}

Note

Descriptions for Level 2 data shown here are available in the Submit Level 2 data using the Payrix Pro API section above.

Required Parameters

Type

Description

Valid Values and Format

items

array of objects

The item or list of items associated with the transaction.

Not applicable

item

string

The line-item name.

Max length: 500 characters

description

string

The line-item description.

Max length: 500 characters

quantity

integer

The total number of units for the line item.

This field accepts integers between 0 and 999999.

price

number

The individual line-item price.

This field is specified as an integer in cents.

um

string

The line-item units of measure.

Example: pounds, days, hours.

Max length: 100 characters

commodityCode

string

The commodity code for this Item.

Max length: 12 characters

total

integer

The total price for the line item.

This field is specified as an integer in cents.

discount

integer

The discount for the line item.

This field is specified as an integer in cents.

productCode

string

The product code for this Item such as UPC, catalog number, or inventory number.

Max length: 100 characters


PayFields

PayFields is a unique offering that seamlessly integrates a payment gateway into your existing HTML website package and eliminates PCI Compliance risk. You can submit Level 2 and Level 3 data values by adding new fields. Read the following information to learn more:

Submit Level 2 Data Using PayFields
  1. Under your <script> tag containing PayFields.fields add the following to add new Tax and Order fields to the PayFields

CODE
<script>
  PayFields.fields = [
    {type: "number", element: "#number"},
    {type: "cvv", element: "#cvv"},
    {type: "name", element: "#name"},
    {type: "address", element: "#address"},
    {type: "expiration", element: "#expiration"}
    {type: "tax", element: "#tax"}
    {type: "order", element: "#order"}
  ];
</script>
  1. Under a new <script> tag, add the API Key, Merchant ID, and Transaction Amount:

HTML
<script>
  PayFields.config.apiKey = "ab123c4def5g6hijkl7890m12345no6p";
  PayFields.config.merchant = "t1_mer_123ab4c567defg8h90123i45";
  PayFields.config.amount = {Transaction Amount};
  <!---- continued by Step 3 ----> 
  1. Under the same <script> tag as Step 2, add the Order Field, Tax Field, and Billing Address:

JS
<!---- preceeded by Step 2 ---->
  PayFields.config.order = {order number};
  PayFields.config.tax = {tax number};
  PayFields.config.billingAddress = {
    address: '123 Madison Street',
    city: 'New York',
    state: 'NY',
    zip: '12345',
    email: '',
    phone: '5555555555',
    address2: 'Suite 555',
    company: 'Essential Co',
    country: 'USA'
  };
  PayFields.config.invoiceResult = {Invoice Object}
</script>
  1. Add each new applicable field to your HTML file using the following <div> format:

CODE
<div>     
  <label for="tax">Tax:</label>     
    <!-- Div for tax field iframe  -->     
    <div id="tax" class="form-row">     
    </div>   
</div>

Result: Example HTML File

HTML
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript" src="https://test-api.payrix.com/payFieldsScript"></script>
  <title>PayFields Test</title>
</head>
<body>
<input type="button" id="submit" value="Pay"></input>
  <!-- Button needed for PayFrame -->
<script>
    PayFields.button = {element: "#submit", value: "Pay"};
</script>
<script>
  PayFields.fields = [
    {type: "number", element: "#number"},
    {type: "cvv", element: "#cvv"},
    {type: "name", element: "#name"},
    {type: "address", element: "#address"},
    {type: "expiration", element: "#expiration"},
    {type: "tax", element: "#tax"},
    {type: "order", element: "#order"},
  ];
</script>
<script>
  PayFields.config.apiKey = "ab123c4def5g6hijkl7890m12345no6p";
  PayFields.config.merchant = "t1_mer_123ab4c567defg8h90123i45";
  PayFields.config.amount = 500;
  PayFields.config.order = {orderNumber};
  PayFields.config.tax = {taxNumber};
  PayFields.config.billingAddress = {
    address: '123 Madison Street',
    city: 'New York',
    state: 'NY',
    zip: '12345',
    email: '',
    phone: '5555555555',
    address2: 'Suite 555',
    company: 'Essential Co',
    country: 'USA'
  };
  PayFields.config.invoiceResult = {invoiceObject}
</script>
</body>
</html>
Submit Level 3 Data Using PayFields
  1. Complete steps 1–3 above.

  2. Under your <script> tag containing PayFields.fields add the following to include Discount, Shipping, Duty, and Item [details] Objects fields in your PayField:

HTML
<script>
  PayFields.fields = [
    {type: "discount", element: "#discount"},
    {type: "shipping", element: "#shipping"},
    {type: "duty", element: "#duty"},
    {type: "items", element: "#items"}    
  ];
</script>
  1. Under your <script> tag containing PayFields.config add the following:

CODE
<script>
  PayFields.config.discount = {discount number};
  PayFields.config.additionalData.shipping = {shipping number};
  PayFields.config.additionalData.duty = {duty number};
  PayFields.config.items = {items Object}
</script>
  1. Add each new applicable field to your HTML file using the following <div> format:

CODE
<div>     
  <label for="tax">Tax:</label>     
    <!-- Div for tax field iframe  -->     
    <div id="tax" class="form-row">     
    </div>   
</div>

Result: Example HTML File

HTML
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript" src="https://test-api.payrix.com/payFieldsScript"></script>
  <title>PayFields Test</title>
</head>
<body>
<input type="button" id="submit" value="Pay"></input>
  <!-- Button needed for PayFrame -->
<script>
    PayFields.button = {element: "#submit", value: "Pay"};
</script>
<script>
  PayFields.fields = [
    {type: "number", element: "#number"},
    {type: "cvv", element: "#cvv"},
    {type: "name", element: "#name"},
    {type: "address", element: "#address"},
    {type: "expiration", element: "#expiration"},
    {type: "tax", element: "#tax"},
    {type: "order", element: "#order"},
    {type: "discount", element: "#discount"},
    {type: "shipping", element: "#shipping"},
    {type: "duty", element: "#duty"},
    {type: "items", element: "#items"}
  ];
</script>
<script>
  PayFields.config.apiKey = "ab123c4def5g6hijkl7890m12345no6p";
  PayFields.config.merchant = "t1_mer_123ab4c567defg8h90123i45";
  PayFields.config.amount = 500;
  PayFields.config.order = {orderNumber};
  PayFields.config.tax = {taxRatePercent};
  PayFields.config.discount = {discountNumber};
  PayFields.config.additionalData.shipping = {shippingNumber};
  PayFields.config.additionalData.duty = {duty number};
  PayFields.config.items = {items Object};
  PayFields.config.billingAddress = {
    address: '123 Madison Street',
    city: 'New York',
    state: 'NY',
    zip: '12345',
    email: '',
    phone: '5555555555',
    address2: 'Suite 555',
    company: 'Essential Co',
    country: 'USA'
  };
  PayFields.config.invoiceResult = {invoiceObject}
</script>
</body>
</html>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.