amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
585 stars 730 forks source link

[BUG] [SP-API] [Issue] Shipping API Get Rates #2496

Closed defenderjim closed 1 year ago

defenderjim commented 1 year ago

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

SP-API Name and Version or Report/Feed Type

GetRates() v2 https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference#getrates

I POST to /shipping/v2/shipments/rates

I am getting the error Invalid input : The currency unit passed into the request is invalid

I am passing: insuredValue = new Currency { unit = "USD", value = 154 }

Expected Behavior

Should get successful response of GetRatesResponse

Should accept ISO 4217 as per the docs, which is what I am using.

Current Behavior

Invalid input : The currency unit passed into the request is invalid

This is the error, happens every time.

Context/Screenshots

Your Environment

Here is the full json body:


{
    "shipTo": {
        "stateOrRegion": "IL",
        "name": "Test Bob",
        "addressLine1": "100 Main St.",
        "city": "Chicago",
        "countryCode": "US",
        "postalCode": "60185"
    },
    "shipFrom": {
        "stateOrRegion": "MD",
        "email": "bob@xx.com",
        "phoneNumber": "301xxxxxx2",
        "name": "Test Frank",
        "addressLine1": "1100 Main St.",
        "city": "Rockville",
        "countryCode": "US",
        "postalCode": "20850"
    },
    "shipDate": "2023-01-28T12:00:00Z",
    "packages": [{
            "dimensions": {
                "length": 48.0,
                "width": 40.0,
                "height": 22.0,
                "unit": "INCH"
            },
            "weight": {
                "value": 4.0,
                "unit": "POUND"
            },
            "insuredValue": {
                "value": 30.0,
                "unit": "USD"
            },
            "isHazmat": false,
            "packageClientReferenceId": "asdf",
            "items": [{
                    "itemIdentifier": "xxxxxxxxxxxxxx",
                    "quantity": 7,
                    "weight": {
                        "value": 0.09,
                        "unit": "POUND"
                    },
                    "isHazmat": false
                }
            ]
        }
    ],
    "channelDetails": {
        "channelType": "AMAZON",
        "amazonOrderDetails": {
            "orderId": "113-xxxxxx-xxxxxx"
        }
    }
}
defenderjim commented 1 year ago

Error message is misleading. If I add the following to the item detail, then it works. itemValue = new Currency { unit = "USD", value = 30

github-actions[bot] commented 1 year ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

github-actions[bot] commented 1 year ago

closed for inactivity

Ziyun-KyLin commented 1 year ago

I also encountered this problem

tavatir commented 3 months ago

This bus still exists.