• Hi,

    How can I add gtin with woocommerce rest api?

    I have tried with meta data but no luck.

    “meta_data”:[{“value”:”xxxxxxxxx”,”key”:”_wpm_gtin_code”}]

    What is the field name which one I need to add to my json payload?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Emanuela Castorina

    (@kreamweb)

    Hello,
    I made a test and it is working.
    See this screenshot:
    https://pasteboard.co/J5uIzvz.png

    {
      "name": "Premium Quality Prodotto",
      "type": "simple",
      "regular_price": "21.99",
      "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
      "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
      "categories": [
        {
          "id": 9
        },
        {
          "id": 14
        }
      ],
      "images": [
        {
          "src": "https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
        },
        {
          "src": "https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
        }
      ],
      "meta_data": [
        {
          "key": "_wpm_gtin_code",
          "value":"123798123987132"
        }
      ]
    }

    Hi Emanuela @kreamweb,

    Good job building this plugin!
    I have the same issue as @cipi79, I added:

    meta_data: [ 
      {
        key  : '_wpm_gtin_code',
        value: '111'
      }
    ]

    to my javascript object that I send to WooCommerce REST API.

    The product in WooCommerce ends up without EAN/GTIN value. The field in “Inventory” is empty, also the front-end shows: EAN: N/A

    Thoughts ?

    Thank you!
    Marius

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Addin gtin with woocommerce rest api’ is closed to new replies.