open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[BUG]: CreateShopShippingProfile's defaults do not work (should default to "everywhere")

Open DemiImp opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

As per the spec, I have not set either destination_country_iso or destination_region as neither are required. I am receiving the error:

You must provide either a destination_country_iso code or a destination_region

The documentation states that:

  • destination_country_iso's default is null
  • destination_region's default is "none"

The documentation states that if destination_country_iso is set to null, then the API will use destination_region. If destination_region is "none", it will first check if destination_country_iso is not null. If destination_country_iso is null, it will default to "everywhere".

I shouldn't be getting any errors as destination_region should default to "everywhere" given my current request.

Steps to reproduce

  1. Try to create a new shipping profile with only the required fields filled out. (ex: title=temp&origin_country_iso=US&primary_cost=10&secondary_cost=10&min_processing_time=5&max_processing_time=7)
  2. Get error.

Expected behavior

destination_region should default to "everywhere" and it should successfully create the shipping profile.

Additional context

No response

DemiImp avatar Feb 11 '22 01:02 DemiImp

See this thread: #348 . We are still working on updating the documentation. Basically though you do have to provide one or the other.

etsyachristensen avatar Feb 11 '22 18:02 etsyachristensen

@etsyachristensen - Ah, ok. It looks like that didn't pop up in my search because the issue was closed.

Maybe you should make changes to the API docs where things have a "Required*" where the details of when the field is required is in the description of the field?

DemiImp avatar Feb 11 '22 19:02 DemiImp