How to Integrate Miva

Kount allows you to grow your business and protect against sophisticated digital fraud by using Kount next-generation artificial intelligence (AI), combining machine learning with 12 years of experience analyzing billions of transactions across 180 plus countries and multiple payment networks all from the convenience of the Miva admin.

With Kount, each order is given an Approve or Decline from Kount in real-time giving you the tools to decide which orders to ship and which orders to decline.

Setup and Configuration

  1. Download the Kount module from the Miva App Store.

  2. Upload the module under Modules, and then assign it to your store under Logging Settings.

Creating an item

Kount requires an item to be created and assigned to the following two pages:

  • OSEL

  • OPAY


This item is used to output the JavaScript tracking code for Kount. This tracking code is used to initialize the Device Data Collector (DDC), which collects information about the device which is used by Kount in its fraud decision.

Example Code:

<script type="text/javascript" src=""></script> 
<script type="text/javascript">
  var client=new ka.ClientSDK(); 

NOTE: The test URL is

Page Template Changes

The following page template changes are required on both OSEL and OPAY to enable to Device Data Collector JS to be output and run:

  1. Add the following to the body tag:

    class='kaxsdc' data-event='load'
  2. Add this item right above the close body tag:

    <mvt:item name="kount" />

Kount Settings

Fill in the Kount Integration section from the Logging Settings page using the following list as a reference.

  • Merchant ID: This is given to you via your Kount welcome email. Contact your Kount Customer Service Representative to get this value if you do not have it.

  • Site: This is the Website ID you create in the Kount interface under Add Website (Fraud Control > Websites > Add Website).

  • API Key: This is created in Kount. Refer to How to Create an API Key for Authentication to Kount for additional information.

  • Environment: Sandbox or Production

  • Pre or Post-Authorization: This setting determines when the order data is sent to Kount. Pre-Authorization sends the order data before the payment has been sent to the gateway for authorization. Things like the card number, AVS and CVV are not sent to Kount. Post-Authorization sends the order data including any available payment data to Kount.

  • KHASH: This value is required if you are using Post-Authorization as it's used to encrypt the card data (if available). Contact your Kount rep to get this value.

  • Notification Email: Leave blank if you do not want any notification email. If populated, you will receive a simple text email for each order approved by Kount.

  • Automatically Cancel Declined Orders: When set to yes, if Kount sends back a decline status for an order, the order is updated to a cancelled status in Miva.

    NOTE: This process does not automatically refund the order. Any refunds or voids need to be processed manually in the Miva admin. If you are using Pre-Authentication with this setting set to true and Kount sends back a Decline as the status, the customer's payment is not sent to the gateway for authorization. Instead the customer sees a generic "Your Order has been declined" error message.

  • Kount ENS URL: This is a URL specific to your store which gets created once the module is installed. You use this URL when you are creating the website in Kount.


    The URL has the following format:

    Kount ENS stands for Event Notification System. When order data is sent to Kount to get a score, most orders get an immediate response such as Approve or Decline. In some cases additional time is needed to review the orders. In these cases a notification will be sent to Miva to update the Kount status in Miva using the ENS URL.

  • Clear Log Table: The Kount module has a database table which is used to track requests and responses sent to Kount. It is recommended that this table be cleaned up periodically to prevent it from growing too large.

Kount Status

Kount has four possible status values it returns for each order:

  • A = Approved

  • R = Review

  • E = Escalate

  • D = Declined

The Kount status is viewable in the Miva admin in three locations.

  • Order Batch List

  • Order Detail Screen

  • Export Orders

Order Batch List

There are two columns available to be added to the orders batch list:

  • Kount Transaction

  • Kount Status


Order Detail Screen

Notice the link for Kount also has Status = A embedded in the name so you can view the status code at a glance without having to open the pop-up window.


Export Orders

On the Export Orders to Flat File page (Data Management > Export Orders to Flat File) you can choose to include the Kount Transaction ID and Kount Status.


Admin (Manual) and Subscription Orders

Both orders placed via the Miva admin such as a phone order and orders created by the Miva subscripton system are not sent to Kount and no Kount status exists.

Order Workflows

Miva Order Workflows allow you to automatically add or remove orders for specific queues in Miva based on the results of the Kount status. The response data Kount sends Miva for each order is available to use in an order workflow. The correct syntax would look like the following:

  • order:CustomField_Values:kount:kount_status

  • order:CustomField_Values:kount:kount_tran



Both Kount Status and Kount Transaction ID are available via the Miva JSON API. To access them, you must pass the following in your OrderList_Load_Query API call for the on-demand columns.


Example API request

                "Store_Code": "test",
                "Function": "OrderList_Load_Query",
                "Count": 0,
                "Offset": 0,
                "Filter": [
                                "name": "ondemandcolumns",
                                "value": [

NOTE: You can also get the Kount data in your response if you are requesting all custom field data.


Example API response

NOTE: The following response is a snippet of a larger response returned from OrderList_Load_Query.

 "CustomField_Values": {
          "kount": {
            "kount_status": "A",
            "kount_tran": "123XXXXXXXXXXX"


The module automatically logs requests and responses from Kount into a table s0x_kount_log. This data can be used to help troubleshoot problems. It can only be viewed directly in the database.

Was this article helpful?
0 out of 0 found this helpful