• Resolved rsabr

    (@rsabr)


    Hello,

    I am trying to use API to create a product with success but the problem I am having is that the API will generate the id of the product automatically and I need to assign the id value on my own so I tried adding the id parameter to the json and it throws an error that the product already exists which is not the case.
    I have used a plugin before that allows me to import products from a CSV and in that process I am able to assign the product ID to be used.

    Can you please provide some advice on how to create product through API but choose the ID to assign to the product?

    I have also tried to create the product and to later change product with the new id but that does not work either.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Product IDs are auto generated.

    This is what a SKU is for. Include your ID in the SKU field.

    Then, either keep a mapping of SKU –> Product ID on your end, or have someone extend the API for you to allow you update records via SKU rather than product ID.

    Hope this helps.

    Thread Starter rsabr

    (@rsabr)

    Hi,
    Thanks for you response but the application I am trying to integrate this to is old and this will not be possible for some very specific reasons. I was hoping this would be possible to do in WC API since that plug-in I mentioned does it in some way.

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create Product API call issue’ is closed to new replies.