Announcement

Collapse
No announcement yet.

New Products Created via API Return 404 Until Manually Updated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New Products Created via API Return 404 Until Manually Updated

    I'm encountering a strange issue when creating new products through the Miva API. Here's my process:
    1. Create the product: I use the API to create the initial product with "active" set to false.
    2. Populate product data: I update all the necessary product information (name, description, price, images, etc.) via the API.
    3. Activate the product: I set the product's "active" status to true using the API.

    However, immediately after this, the product returns a 404 error when I try to access it on the storefront.

    Troubleshooting steps I've tried:
    • Flushing the Miva cache: I've manually flushed the cache within the Miva admin, but this doesn't resolve the issue.
    • Manually updating the product: If I go into the Miva admin and simply click the "Update" button on the product page, it magically starts working.


    It seems like something isn't being triggered properly when the product is activated via the API.

    My question:

    Is there a way to "force update" a product via the API or some other method to avoid this manual step? I'm managing a large number of products, and manually updating each one in the admin isn't feasible.

    Any help or insights would be greatly appreciated!



    Miva Merchant 10.11.01
    api-sdk-php 2.6.0

    #2
    TipPro The product returning a 404 is probably because the creation of an inactive product does not trigger the URI creation for the product. When you create an inactive product in Miva (API or admin) the software does not generate a URI by default. There are a couple options:

    Option1:
    Use the Multiple Iteration Request, https://docs.miva.com/developer/deve...ration-request, with the product_insert function and set product_active to true then in the second iteration set the same product_active to false.

    Option 2:
    After creating the inactive product use the ProductURI_Insert function to insert a URI for the product. This way when you activate the product it will already have the URI available.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment

    Working...
    X