← Back to EcomCentral
MIVA MERCHANT JSON API

Miva Merchant Setup Guide

Connect your Miva Merchant store to EcomCentral using HMAC-SHA256 signed API requests for secure authentication.

About Miva Merchant

Miva Merchant is a mature US-based e-commerce platform widely used by enterprise retailers. Founded in 1997, it powers thousands of mid-to-large online stores in North America and is known for its deep customization capabilities and robust built-in functionality. Miva exposes all store data through a proprietary JSON API that uses HMAC-SHA256 request signing for authentication, ensuring every call is cryptographically verified.

ℹ️ EcomCentral connects to Miva via its JSON API at your store's json.mvc endpoint (e.g. https://store.com/mm5/json.mvc). API access must be enabled in Admin and an API token must be created before connecting.

Prerequisites

Enabling the JSON API

  1. Log in to your Miva Merchant administration panel
  2. Navigate to Settings → API (or Domain → API in some versions)
  3. Ensure the JSON API is enabled — toggle it on if it is off
  4. Note the full API endpoint URL, which is typically https://your-store.com/mm5/json.mvc. The mm5 path segment may vary per installation.
  5. Navigate to User Management → API Tokens (or Users → API Tokens)
  6. Click Create New Token, give it a name, and save
  7. If HMAC request signing is enabled, copy the Signing Key exactly as shown — it is base64-encoded
⚠️ The signing key shown in Miva Admin is base64-encoded. Copy it exactly as displayed — do not decode it before pasting into EcomCentral. EcomCentral decodes it internally before computing the HMAC.

Connection Credentials

  1. Go to Settings → Store Information and note your Store Code (a short identifier like PS or MYSTORE)
  2. Go to User Management → API Tokens and create or copy your Access Token
  3. If HMAC signing is configured, copy the Signing Key (base64 string) from the token detail page
  4. Note the full JSON API URL — typically https://your-store.com/mm5/json.mvc
  5. In EcomCentral, add a new Miva Merchant connection and fill in all fields
  6. Click ⚡ Test to verify the connection

Credentials Reference

KeyRequiredDescriptionExample
base_url Required Full JSON API URL including the json.mvc path https://store.com/mm5/json.mvc
store_code Required Store Code from Settings → Store Information MYSTORE
access_token Required API access token from User Management → API Tokens ••••••••••••••••
signing_key Optional HMAC-SHA256 signing key (base64-encoded, copied exactly from Miva Admin). Leave blank to use unsigned MIVA <token> authentication. YWJjZGVmZ2g=
✅ Alternative key names accepted: baseUrl or url for the API URL; storeCode or store for the store code; accessToken or token for the access token; signingKey or hmac_key for the signing key.
ℹ️ Unsigned mode: If signing_key is left blank, EcomCentral uses MIVA <token> authentication (no HMAC). This works when the API token is configured without a signing key in Miva Admin.

API Functions Used

All requests are POST to the json.mvc endpoint with a JSON body containing Store_Code, Miva_Request_Timestamp, Function, and function-specific parameters.

OperationMiva FunctionKey Parameters
Test connectionOrderList_Load_QueryCount=1, Offset=0
List ordersOrderList_Load_QueryCount, Offset, Sort=-orderdate
Order detailOrder_LoadOrder_ID
List productsProductList_Load_QueryCount, Offset
Product detailProduct_Load_CodeProduct_Code (the SKU)
Create shipmentOrderItemList_CreateShipmentOrder_ID, Line_IDs
Add trackingOrderShipmentList_UpdateShipment_Updates[].{shpmnt_id, tracknum, tracktype, mark_shipped}
Update stockInventoryProductSettings_UpdateProduct_SKU, CurrentStock
ℹ️ List responses return { success:1, data:{ total_count:N, start_offset:N, data:[...] } }. Single-item responses return { success:1, data:{ data:{...} } }. Application-level errors return { success:0, error_code:"...", error_message:"..." }.

Order Status Codes

Miva uses numeric status codes for orders. EcomCentral maps these to labels and displays them with colour-coded badges.

CodeLabelBadge colour
0 Pending Blue
100 Processing Blue
200 Shipped Green
201 Partially Shipped Amber
300 Cancelled Red
400 Backordered Amber
500 RMA Issued Amber
600 Returned Red

Supported Features

FeatureSupportedNotes
View orders (paginated)Order ID, date (unix timestamp), status, total
View order detailBilling & shipping addresses, email, phone, line items, total, existing shipments/tracking
Add tracking numberTwo-step: OrderItemList_CreateShipment creates the shipment, then OrderShipmentList_Update attaches tracking and marks it shipped
View products (paginated)SKU, name, price, inventory quantity
View product detailFull product via Product_Load_Code — description (HTML stripped), weight, inventory managed flag
Update stock quantityInventoryProductSettings_Update with absolute CurrentStock value, by SKU
Test connectionOrderList_Load_Query with Count=1 — success confirms host, credentials, and store code are valid

Troubleshooting

HMAC signature error / "Authorization header invalid"

The signing key must be copied exactly as displayed in Miva Admin — it is already base64-encoded. Do not decode it, trim it, or add extra characters. EcomCentral decodes it internally before computing the HMAC. If you copied it correctly and still get errors, try regenerating the token.

Wrong Store_Code

The store code is case-sensitive. Verify it under Settings → Store Information in Miva Admin. A wrong store code typically returns success:0 with an error about an invalid store.

403 Forbidden

The API token may not have permission to call a specific function. In Miva Admin, check the token's permission groups or allowed functions and ensure the operations you need (OrderList_Load_Query, ProductList_Load_Query, etc.) are permitted.

"success":0 errors from the API

Miva returns HTTP 200 with { "success": 0, "error_code": "...", "error_message": "..." } for application-level failures. Common causes: invalid function name, missing required parameter, or an order/product that does not exist. The error message returned by Miva will be shown in EcomCentral's error banner.

SSL / certificate errors

EcomCentral requires a valid SSL certificate on the store. Self-signed certificates are rejected. Use a certificate from a trusted CA (e.g. Let's Encrypt) or contact your hosting provider.

🔧 Quick sanity check — try calling the API directly with curl:
curl -X POST https://your-store.com/mm5/json.mvc \ -H "Content-Type: application/json" \ -H "X-Miva-API-Authorization: MIVA your-token-here" \ -d '{"Store_Code":"YOURCODE","Miva_Request_Timestamp":1,"Function":"OrderList_Load_Query","Count":1}' A { "success": 1, ... } response confirms the endpoint and token are correct.