• Resolved artemis21

    (@artemis21)


    Hi,
    I’m trying to send a single product but in postman I get this error “product_invalid_catalog_visibility”. If I try using the batch method it works.

    this is the JSON:

    {"id":0,"name":"FLUYD SHORTY LADY 2.0MM","slug":null,"permalink":null,"date_created":"0001-01-01T00:00:00","date_created_gmt":"0001-01-01T00:00:00","date_modified":"0001-01-01T00:00:00","date_modified_gmt":"0001-01-01T00:00:00","type":"variable","status":null,"featured":false,"catalog_visibility":null,"description":null,"short_description":null,"sku":"000031","price":null,"regular_price":"","sale_price":null,"date_on_sale_from":null,"date_on_sale_from_gmt":null,"date_on_sale_to":null,"date_on_sale_to_gmt":null,"on_sale":false,"purchasable":false,"total_sales":0,"virtual":false,"downloadable":false,"downloads":null,"download_limit":0,"download_expiry":0,"external_url":null,"button_text":null,"tax_status":null,"tax_class":null,"manage_stock":true,"stock_quantity":0,"backorders":null,"backorders_allowed":false,"backordered":false,"low_stock_amount":null,"sold_individually":false,"weight":null,"dimensions":null,"shipping_required":false,"shipping_taxable":false,"shipping_class":null,"shipping_class_id":0,"reviews_allowed":false,"average_rating":null,"rating_count":0,"upsell_ids":null,"cross_sell_ids":null,"parent_id":0,"purchase_note":null,"categories":null,"tags":null,"images":null,"attributes":[{"id":5,"name":"size","position":0,"visible":true,"variation":true,"options":["L","M","S","XL","XS"]}],"default_attributes":null,"variations":null,"grouped_products":null,"menu_order":0,"price_html":null,"related_ids":null,"meta_data":null,"stock_status":null,"has_options":false,"brands":null,"ean":null,"_links":null,"error":null}

    Error:

    View post on imgur.com

Viewing 7 replies - 1 through 7 (of 7 total)
  • con

    (@conschneider)

    Engineer

    Hi there,

    Could post your entire request here including body and headers and request type. We can try and mimic your steps then to check what is going on.

    Kind regards,

    Thread Starter artemis21

    (@artemis21)

    Request: https://ecommerce.giessedati.it/wp-json/wc/v3/products?

    Method: POST

    Body: {"id":0,"name":"FLUYD SHORTY LADY 2.0MM","slug":null,"permalink":null,"date_created":"0001-01-01T00:00:00","date_created_gmt":"0001-01-01T00:00:00","date_modified":"0001-01-01T00:00:00","date_modified_gmt":"0001-01-01T00:00:00","type":"variable","status":null,"featured":false,"catalog_visibility":null,"description":null,"short_description":null,"sku":"000031","price":null,"regular_price":"","sale_price":null,"date_on_sale_from":null,"date_on_sale_from_gmt":null,"date_on_sale_to":null,"date_on_sale_to_gmt":null,"on_sale":false,"purchasable":false,"total_sales":0,"virtual":false,"downloadable":false,"downloads":null,"download_limit":0,"download_expiry":0,"external_url":null,"button_text":null,"tax_status":null,"tax_class":null,"manage_stock":true,"stock_quantity":0,"backorders":null,"backorders_allowed":false,"backordered":false,"low_stock_amount":null,"sold_individually":false,"weight":null,"dimensions":null,"shipping_required":false,"shipping_taxable":false,"shipping_class":null,"shipping_class_id":0,"reviews_allowed":false,"average_rating":null,"rating_count":0,"upsell_ids":null,"cross_sell_ids":null,"parent_id":0,"purchase_note":null,"categories":null,"tags":null,"images":null,"attributes":[{"id":5,"name":"size","position":0,"visible":true,"variation":true,"options":["L","M","S","XL","XS"]}],"default_attributes":null,"variations":null,"grouped_products":null,"menu_order":0,"price_html":null,"related_ids":null,"meta_data":null,"stock_status":null,"has_options":false,"brands":null,"ean":null,"_links":null,"error":null}

    Header: no value

    con

    (@conschneider)

    Engineer

    Howdy @artemis21,

    Header: no value

    Without an authorisation header your request will fail. You must use authorisation.
    Do you know how to make an authorised request to the REST API?

    Kind regards,

    Thread Starter artemis21

    (@artemis21)

    Hello,
    I have created an user for the API and I’m doing through authorization with its credentials using querystring (I use C#). How do I set the header for the authorization?

    Thank you

    • This reply was modified 3 years, 11 months ago by artemis21.
    • This reply was modified 3 years, 11 months ago by artemis21.
    Mirko P.

    (@rainfallnixfig)

    Hi @artemis21,

    There is an authentication section in the REST API documentation which may come in handy for your authorization issues:

    https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication

    Let us know if you have any other questions after checking out that.

    Thread Starter artemis21

    (@artemis21)

    Hi,
    thank you but it’s not an authentication problem, I already follow the API documentation.
    The batch product creation works as expected, it is the single product creation that returns the error.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    The authentication section that I shared above includes information on authorization headers which seems to be the problem here as they show no value.

    You said that you’re using Query String to authenticate but you may need to enable the behavior by passing queryStringAuth: true.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error: product_invalid_catalog_visibility’ is closed to new replies.