updateListing on Etsy API

Hi, So i’m fairly new to calling APIs.

I’ve created a scenario where upon product update on Woocommerce it Gets Listing (from Etsy’s module), then as advised by Make’s tech support to Call Etsy Api using Make’s module, bc “The Update Listing API from Etsy does not provide an option to update price and quantity”.

Etsy’s Api has two versions for the API: V2 & V3.

I used this URL for V2, Method PUT:
/v2/listings/{{31.listing_id}}/inventory

this for the body:

{
  "products": [
    {
      "sku": "string",
      "property_values": [
        {
          "property_id": 1,
          "value_ids": [
            1
          ],
          "scale_id": 1,
          "property_name": "string",
          "values": [
            "string"
          ]
        }
      ],
      "offerings": [
        {
          "price": 0,
          "quantity": 0,
          "is_enabled": true
        }
      ]
    }
  ],
  "price_on_property": [
    0
  ],
  "quantity_on_property": [
    0
  ],
  "sku_on_property": [
    0
  ]
}

This is the error i get:

The operation failed with an error. [403]: oauth_problem=signature_invalid&debug_sbs=PUT&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2Flistings%2F1272651627%2Finventory&oauth_consumer_key%3Dupw7o2cd35p5y80imeth3891%26oauth_nonce%3Da9864c64a9b34037bb4001314992a3eb%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1658678979%26oauth_token%3Db3365901f859fa9ac4280b5a900832%26oauth_version%3D1.0%26price_on_property%3D0%26products%3DArray%26quantity_on_property%3D0%26sku_on_property%3D0

the code was copied from etsy doc.
https://developers.etsy.com/documentation/reference/#operation/updateListingInventory

Not sure which Version to use or body response…or hoenstly what to fill in the body.

this is the error i get for V3

URL: /v3/application/listings/{{40.listing_id}}/inventory

[401]: [object Object]

Any guidance will help tremendously. thanks.

Hi!
How do you authenticate for the Etsy API? Because at least the V2 error code indicates and authentification problem.

Have you looked up the error codes 401/403 in the Etsy API documentation?

Let’s figure this out! :slight_smile:
Best,
Richard

Thanks for the reply Richard.

I assumed by connecting my etsy shop with the Make module the authentication was already done. Is there another step that needs to be done?

Previously i used the V2 URL and had a different json body …it was just blank and I received this error

[400]: Expected param 'products'.

not sure if the above has anything to do with it…or it was just and error of having no BODY…and then when I filled out the body the next error appears, which is the authentication…

thank you.

Hi @Mike_Finocchiaro,

so you use the Module “Etsy - Make an API Call”, right? Usually you are right about authentication. But as both error codes tell you, that there is a problem, suggest looking into it again.

Do you know the Integromat developer tool for Google Chrome? This way you can see the API-Call you do and double check if something seems wrong.

Thanks @Richard_Johannes

I installed the extension.

{
    "_engineData": {
        "calledAt": "Not available"
    },
    "response": {
        "status": 400,
        "headers": {
            "connection": "close",
            "content-length": "26",
            "server": "Apache",
            "set-cookie": [
                "uaid=ot1NP5rly1aohQYrBRyqdH9Y1vtjZACCpLtnjsLoaqXSxMwUJSsls3wXn5zw4viIUnddE_ei0HyfoLKoyEgvkwjHfKVaBgA.; expires=Mon, 24-Jul-2023 22:50:45 GMT; Max-Age=31536000; path=/; domain=.etsy.com; secure; SameSite=None",
                "user_prefs=bwLtzeDHcsHIQjRFj1Sbe6loGIdjZACCpLtnjsLo6LzSnBwd8ohYBgA.; expires=Mon, 24-Jul-2023 22:50:45 GMT; Max-Age=31536000; path=/; domain=.etsy.com"
            ],
            "x-cloud-trace-context": "d09d425eef0d97e4cf69d80f3ad1db6e/6861469416025466570;o=0",
            "x-etsy-request-uuid": "Eux-TNPDW0Y8SYP6EPLsO1L01646",
            "x-ratelimit-limit": "10000",
            "x-ratelimit-remaining": "9916",
            "x-error-detail": "Expected param 'products'.",
            "cache-control": "private",
            "content-type": "text/plain;charset=UTF-8",
            "via": "1.1 google, 1.1 varnish",
            "accept-ranges": "bytes",
            "date": "Sun, 24 Jul 2022 22:50:45 GMT",
            "x-served-by": "cache-iad-kjyo7100144-IAD",
            "x-cache": "MISS",
            "x-cache-hits": "0",
            "x-timer": "S1658703045.319145,VS0,VE69"
        },
        "body": "Expected param 'products'.",
        "_engineData": {
            "calledAt": "Not available"
        }
    },
    "request": {
        "url": "https://openapi.etsy.com/v2/listings/1258346546/inventory",
        "qs": {},
        "headers": {
            "user-agent": "Make/production",
            "content-type": "application/json"
        },
        "method": "PUT",
        "body": "undefined"
    }
}

Do i have to add query string? bc i didn’t add any.

Ah thank you.

This time it says

You should add a “products” query string to your request.

I am not sure if I found the V2 Documentation but yesterday I read that they require an API-Key. I can’t see an API Key in your request-headers, so you might add that too and I hope it works! ;D

Getting really close @Richard_Johannes

I was able to make a call and it did update listing with price and quantity…however the other values that i copied from etsy api reference page went along with so i had to replace those…but when i tried…i get an error about JSON data being invalid… i believe it’s the \ that’s being created within json…

{
    "_engineData": {
        "calledAt": "Not available"
    },
    "response": {
        "status": 400,
        "headers": {
            "connection": "close",
            "content-length": "47",
            "server": "Apache",
            "set-cookie": [
                "uaid=Wq8vM9QWQpvCTBgafhgAiQOwy7pjZACCpHuH5GF0tVJpYmaKkpVSiXN4oEtgaK6jhV9FVo6Jo2GgV5qxU6JfbqSBq1ItAwA.; expires=Tue, 25-Jul-2023 16:17:35 GMT; Max-Age=31536000; path=/; domain=.etsy.com; secure; SameSite=None",
                "user_prefs=jQR3QHwxQ7x3SIt0ZqjdrvW0021jZACCpHuH5GF0dF5pTo4OeUQsAwA.; expires=Tue, 25-Jul-2023 16:17:35 GMT; Max-Age=31536000; path=/; domain=.etsy.com"
            ],
            "x-cloud-trace-context": "091ed860534761f6ccb9af435514580c/13781947715482592619;o=0",
            "x-etsy-request-uuid": "EuN4RE-mrpO7s7E8UQQlt9HNgZ2a",
            "x-ratelimit-limit": "10000",
            "x-ratelimit-remaining": "9888",
            "x-error-detail": "Value for products was not a valid JSON string.",
            "cache-control": "private",
            "content-type": "text/plain;charset=UTF-8",
            "via": "1.1 google, 1.1 varnish",
            "accept-ranges": "bytes",
            "date": "Mon, 25 Jul 2022 16:17:35 GMT",
            "x-served-by": "cache-iad-kjyo7100112-IAD",
            "x-cache": "MISS",
            "x-cache-hits": "0",
            "x-timer": "S1658765855.010194,VS0,VE68"
        },
        "body": "Value for products was not a valid JSON string.",
        "_engineData": {
            "calledAt": "Not available"
        }
    },
    "request": {
        "url": "https://openapi.etsy.com/v2/listings/1274307181/inventory",
        "qs": {
            "products": "[{\"sku\": \"ABB_MarshallPic\",\"property_values\": [{\"property_id\": 1,\"value_ids\": [1],\"scale_id\":1,\"property_name\": \"Allman Brothers Band At Fillmore East Original Photograph by Jim Marshall\"]}],\"offerings\": [{\"price\": 4975,\"quantity\": 2,\"is_enabled\": true}]}],\"price_on_property\": [4975],\"quantity_on_property\": [2],\"sku_on_property\": [ABB_MarshallPic]"
        },
        "headers": {
            "user-agent": "Make/production",
            "content-type": "application/json"
        },
        "method": "PUT",
        "body": "undefined"
    }
}

not sure how to get rid of it…

Can you try to add “]}” in “products”

": [ABB_MarshallPic]" → ": [ABB_MarshallPic]"]}

@Richard_Johannes we got it!

so the cause were the line breaks \n and \ …

I tried replacing the text with Make’s text parser that didn’t and then i tried replace() function…that didn’t work either…so i just copied the json from the first successful call.

I really appreciate your help :clap::clap::clap::clap:!

2 Likes

Awesome! :tada:

It’s just really hard to help without actually doing it in the moment and doing some trial and error. I’m glad you made it! :fire:

2 Likes

Hi, Mike

I had the same error.

You should change “products” to ‘products’ and all other " you should change to ’
Also remove breaks /n from the JSON body

1 Like