Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs


This request asks the store for one product. It confirms that your endpoint, token and permissions work before you write any signing code.

You need a token with ProductList_Load_Query assigned and the signature requirement turned off. See Create an API token. If you’d rather not use the command line, set up Postman instead.

Send the request#

Replace the endpoint, YOUR_API_TOKEN and YOUR_STORE_CODE, then run:

curl -X POST "https://www.example.com/mm5/json.mvc" \
  -H "Content-Type: application/json" \
  -H "X-Miva-API-Authorization: MIVA YOUR_API_TOKEN" \
  -d '{
    "Store_Code": "YOUR_STORE_CODE",
    "Function": "ProductList_Load_Query",
    "Count": 1,
    "Offset": 0
  }'

Every request has the same parts:

Part Value
Method POST. Other methods are rejected.
Content-Type header application/json
X-Miva-API-Authorization header MIVA followed by a space and your access token. Signed requests use a different format; see the next page.
Store_Code The store the function runs against
Function The function to run
Everything else The function’s own parameters. Count and Offset page through results.

If your token requires a timestamp, add "Miva_Request_Timestamp" with the current Unix time, for example "Miva_Request_Timestamp": 1735689600. The request then has 30 seconds to arrive.

Read the response#

A successful call returns success and the function’s data:

{
    "success": 1,
    "data": {
        "total_count": 152,
        "start_offset": 0,
        "data": [
            {
                "id": 1,
                "code": "test",
                "sku": "",
                "name": "Test Product",
                "price": 10.0,
                "formatted_price": "$10.00",
                "active": true
            }
        ]
    }
}

total_count is how many products match, and data holds the ones returned. The real response has more fields per product; ProductList_Load_Query lists them all.

A failed call returns success set to 0 with an error code and message:

{
    "success": 0,
    "error_code": "access_denied",
    "error_message": "Function not assigned to token"
}

That one means the token doesn’t have ProductList_Load_Query. Troubleshooting lists every authentication error and its cause.

Note

If you get no response at all, check the header name. Miva doesn’t answer requests that are missing X-Miva-API-Authorization or that spell it differently.

Next step#

Unsigned requests are fine for a test. For a real integration, sign every request: Make a signed request with HMAC.

Looking for the order integration material that used to be on this page? It’s now the Order integration guide.