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
596 stars 730 forks source link

Merchant Fulfillment - getEligibileShipmentServices - Invalid Input #996

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am using the POST /mfn/v0/eligibleShippingServices endpoint but if I include the ShipmentRequestDetails > MustArriveByDate or ShipmentRequestDetails > ShipDate, I get the error Invalid Input back.

I am formatting the date as yyyy-MM-ddTHH:mm:ssZ which to my understanding is correct for the ISO 8601 datetime format. Can anyone advise if they have had this problem and if so, how they resolved it?

johnkw commented 3 years ago

Sounds like a duplicate of bug amzn/selling-partner-api-models#372

ghost commented 3 years ago

This is a different problem it bug amzn/selling-partner-api-models#372 because we are already sending the content-type as application/json not application/x-amz-json-1.0

Below is my POST request that I am sending to Amazon with sensitive data removed. As you can see the Content-Type is application/json

POST https://sellingpartnerapi-eu.amazon.com/mfn/v0/eligibleShippingServices HTTP/1.1 x-amz-access-token: ** x-amz-security-token: ***** Authorization: AWS4-HMAC-SHA256 Credential=** Accept: application/json, text/json, text/x-json, text/javascript, application/xml, text/xml User-Agent: RestSharp/106.11.7.0 Content-Type: application/json Host: sellingpartnerapi-eu.amazon.com Content-Length: 1498 Accept-Encoding: gzip, deflate

{ "ShipmentRequestDetails": { "AmazonOrderId": "", "SellerOrderId": null, "ItemList": [ { "OrderItemId": "", "Quantity": 1, "ItemWeight": null, "ItemDescription": null, "TransparencyCodeList": null, "ItemLevelSellerInputsList": null } ], "ShipFromAddress": { "Name": "*", "AddressLine1": "***", "AddressLine2": null, "AddressLine3": null, "DistrictOrCounty": null, "Email": "", "City": "", "StateOrProvinceCode": "", "PostalCode": "", "CountryCode": "GB", "Phone": "***" }, "PackageDimensions": { "Length": 90, "Width": 30, "Height": 50, "Unit": "centimeters", "PredefinedPackageDimensions": null }, "Weight": { "Value": 10000, "Unit": "g" }, "MustArriveByDate": null, "ShipDate": "2021-01-29T00:00:00Z", "ShippingServiceOptions": { "DeliveryExperience": "DeliveryConfirmationWithSignature", "DeclaredValue": null, "CarrierWillPickUp": true, "CarrierWillPickUpOption": "CarrierWillPickUp", "LabelFormat": "ZPL203" }, "LabelCustomization": null }, "ShippingOfferingFilter": null }

ShivikaK commented 3 years ago

Hello @danielgradwell83

We can assist you further via a support case and help resolve this issue. Please open a support case so we can pursue the investigation. If you have already created case for this error, please share the case ID and I will follow up on the case.

Thanks, 
Shivika Khare
 Selling Partner API Developer Support

ghost commented 3 years ago

Hi Shivika,

My case ID is 6750241172

Thanks

Dan

ShivikaK commented 3 years ago

Hello @danielgradwell83

Your case has been received by Support and is being looked into. Please continue monitoring the case for follow-ups regarding the next steps.

Thanks, 
Shivika Khare
 Selling Partner API Developer Support

ghost commented 3 years ago

Amazon has closed my case without resolving this issue. Have a chat session with someone to be told I will need to raise a new case. So helpful as always.

johnkw commented 3 years ago

Generically speaking, Invalid Input is not a reasonable error message under any circumstance. The API needs to be fixed to always say something meaningful like Field XXX is missing or Field XXX must be of type YYY.

danpryoreuro commented 3 years ago

@ShivikaK I have a case open on this issue as well - 8008539261.

ghost commented 3 years ago

Generically speaking, Invalid Input is not a reasonable error message under any circumstance. The API needs to be fixed to always say something meaningful like Field XXX is missing or Field XXX must be of type YYY.

I completely agree, this new API from Amazon is extremely painful to develop again compared to many other APIs that I have used. Completely unhelpful error messages.

rusanpas commented 3 years ago

Same error. Without dates is ok, but with ShipDate is invalid input.

johnkw commented 3 years ago

We haven't used that particular call, but whenever there's a date field we're just doing "%Y-%m-%d", ie, no time or timezone.

https://github.com/amzn/selling-partner-api-docs/blob/main/references/fulfillment-inbound-api/fulfillmentInboundV0.md#datestringtype etc should document what the expected format is. But you might give the above a try.

kamioftea commented 3 years ago

I'm also having this issue with ShipmentRequestDetails > ShipDate . The following formats have all failed:

Sending an otherwise identical request without the ShipDate returns a success response, so I can confirm this field is the issue.

The Documentation just specifies Type : string (date-time) which doesn't help.

https://github.com/amzn/selling-partner-api-models/blob/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json#L388 The swagger specification doesn't include the optional fields, and ShipDate is optional. All the responses use the 2021-04-20T19:15:40Z format, but I can't see a date string in any of the example requests to check if they should use a different format.

danpryoreuro commented 3 years ago

I don't really understand what is tripping support up so much with this issue. I have had my case open for two months and this is simple to reproduce.

parvathm commented 3 years ago

Hi @danpryoreuro,

Sorry for the delay in response. We have identified the issue with timestamp and we are working on a fix. I will update you once the issue is fixed.

Thanks, Parvathm, Selling Partner API Developer Support.

johnkw commented 3 years ago

See also bug amzn/selling-partner-api-models#372 which aims to broadly address "Invalid Input" either in documentation (explaining that it's horrible and will require Seller Support intervention), or fixed in the API itself because it is not a reasonable error message ever.

parvathm commented 3 years ago

Hi All,

We have deployed the fix to address the invalid input error caused due to timestamp present in the input. Can you please try the request now and let us know if that fixed your issue.

Thanks, Parvathm. Selling Partner API Developer Support.

danpryoreuro commented 3 years ago

Hi @parvathm - based on my testing the issue appears to be resolved. Thanks for following up.

kamioftea commented 3 years ago

Hi @parvathm,

This is still not working for me. A request (x-amzn-RequestId: f810c783-8e09-46da-a816-6ab12da9a7e6) sent with the ShipDate as 2021-05-05T19:37:53Z failed with this response:

{
  "errors": [
    {
      "code": "InvalidInput",
      "message": "Invalid Input",
      "details": ""
    }
  ]
}

Sending it again without the ShipDate as the only change was successful (x-amzn-RequestId: ac235e70-8c34-4ae7-bf6d-a080ac00bb70)

This is in the EU region if that matters? url: https://sellingpartnerapi-eu.amazon.com/mfn/v0/shipments.

Anonymised sample json that was rejected:

{
  "ShipmentRequestDetails": {
    "AmazonOrderId": "202-3898648-1234567",
    "ItemList": [
      {
        "OrderItemId": "66881091234567",
        "Quantity": 1
      }
    ],
    "ShipFromAddress": {
      "Name": "Name",
      "AddressLine1": "AddressLine1",
      "AddressLine2": "AddressLine2",
      "AddressLine3": "AddressLine3",
      "DistrictOrCounty": "DistrictOrCounty",
      "Email": "Email",
      "City": "City",
      "PostalCode": "PostalCode",
      "CountryCode": "CountryCode",
      "Phone": "Phone"
    },
    "PackageDimensions": {
      "Length": 16.6,
      "Width": 30.8,
      "Height": 21,
      "Unit": "centimeters"
    },
    "Weight": {
      "Value": 660,
      "Unit": "g"
    },
    "ShipDate": "2021-05-05T19:37:53Z",
    "ShippingServiceOptions": {
      "DeliveryExperience": "DeliveryConfirmationWithoutSignature",
      "DeclaredValue": {
        "CurrencyCode": "GBP",
        "Amount": 15.99
      },
      "CarrierWillPickUp": true
    },
    "LabelCustomization": []
  },
  "ShippingServiceId": "prime-premium-uk-mfn",
  "ShippingServiceOfferId": "LZ6I6rys8cvj5w..."
}
parvathm commented 3 years ago

Hi @kamioftea,

I am taking a look and will provide an update soon.

Thanks, Parvathm, Selling Partner API Developer Support

johnkw commented 3 years ago

What is the correct format (or formats) for dates? It's still missing from https://github.com/amzn/selling-partner-api-docs/blob/main/references/fulfillment-inbound-api/fulfillmentInboundV0.md#datestringtype

parvathm commented 3 years ago

Hi @kamioftea ,

This request id f810c783-8e09-46da-a816-6ab12da9a7e6 has createShipment call. The issue with createShipment is being tracked in this issue. We are actively working to resolve the issue with createShipment. I will update our findings soon in above issue link.

Appreciate your patience.

Thanks, Parvathm, Selling Partner Developer API Support.

parvathm commented 3 years ago

Hi,

The code changes to fix the issue with CreateShipment invalid input is deployed. Please try making the request now and let us know if you are still facing the same issue. Further updates on CreateShipment issue can be tracked here

Thanks, Parvathm Selling Partner API Developer Support.

franciscocha commented 2 years ago

I am unable to get a successful call when using the following payload.

{
    "ShipmentRequestDetails": {
        "AmazonOrderId": "xxx-xxxxxxx-xxxxxxx",
        "ItemList": [
            {
                "OrderItemId": "xxxxxxxxxxxxxx",
                "Quantity": 1
            }
        ],
        "PackageDimensions": {
            "Height": 6.0,
            "Length": 6.0,
            "Unit": "inches",
            "Width": 6.0
        },
        "ShipFromAddress": {
            "AddressLine1": "address 1",
            "City": "city",
            "CountryCode": "US",
            "Email": "email",
            "Name": "name",
            "Phone": "phone",
            "PostalCode": "postalcode",
            "StateOrRegion": "State",
            "DistrictOrCounty": null,
        },
        "ShippingServiceOptions": {
            "CarrierWillPickUp": false,
            "DeliveryExperience": "DeliveryConfirmationWithoutSignature",
            "LabelFormat": "PNG"
        },
        "Weight": {
            "Unit": "oz",
            "Value": 6.0
        }
    }
}

It keeps returning

{
    "errors": [
        {
            "code": "InvalidInput",
            "message": "Invalid Input",
            "details": ""
        }
    ]
}
defenderjim commented 2 years ago

@franciscocha, Did you get this working? I am using a similar payload and getting the same response.

danpryoreuro commented 2 years ago

@franciscocha StateOrRegion should be StateOrPostalCode, and DistrictOrCounty should be set to an empty string or eliminated. Also, when I was testing this to verify I found that I also needed to put trailing commas after the braces closing Weight and ShipmentRequestDetails.

defenderjim commented 2 years ago

@franciscocha I have made the changes you stated, and it is still not working and responds with no details for the "Invalid Input". Also, as per the docs, there is no field "StateOrRegion", nor "StateOrPostalCode".
There is "StateOrProvinceCode" and "PostalCode".

danpryoreuro commented 2 years ago

@defenderjim Are you referring to the changes I suggested? You'd have to post your request here for suggestions specific to that. It is extremely easy to get something wrong in these requests and end up with the invalid input error. If it will help anyone, here is a sample request I can confirm works. given a valid order ID, order item ID, and address:


  "ShipmentRequestDetails": {
    "AmazonOrderId": "XXX-XXXXXXX-XXXXXXX",
    "ItemList": [
      {
        "OrderItemId": "00000000000001",
        "Quantity": 1
      }
    ],
    "ShipFromAddress": {
      "Name": "NAME",
      "AddressLine1": "123 Main St",
      "Email": "test@netsuite.com",
      "City": "CITY",
      "StateOrProvinceCode": "ST",
      "PostalCode": "99999",
      "CountryCode": "US",
      "Phone": "9991231234"
    },
    "PackageDimensions": {
      "Length": 20,
      "Width": 10,
      "Height": 6.1,
      "Unit": "inches"
    },
    "Weight": {
      "Value": 6.5,
      "Unit": "oz"
    },
    "ShippingServiceOptions": {
      "DeliveryExperience": "DeliveryConfirmationWithoutSignature",
      "CarrierWillPickUp": false,
      "CarrierWillPickUpOption": "ShipperWillDropOff",
      "LabelFormat": "ZPL203"
    },
    "MustArriveByDate": "2022-02-01T00:00:00",
    "ShipDate": "2022-01-25T00:00:00"
  },
}
defenderjim commented 2 years ago

Thanks for your json. I made changes based on your payload.

It is extremely easy to get something wrong in these requests Isn't that the truth! It's been that way with every single endpoint, and this one is the worst for them all. I was getting "Invalid Input", made a change, got a constraint error, fixed that, back to invalid input.

I tried changing StateOrRegion to StateOrProvinceCode, no difference.


{
    "ShipmentRequestDetails": {
        "AmazonOrderId": "114-xxxxxxx-xxxxxxx",
        "ItemList": [{
                "OrderItemId": "xxxx",
                "Quantity": 1
            }
        ],
        "ShipFromAddress": {
            "StateOrPostalCode": "ME",
            "AddressLine1": "10 Main St.",
            "PostalCode": "20940",
            "City": "Rockville",
            "CountryCode": "US",
            "Name": "xxxxxx",
            "Email": "support@xxxxxxx.com"
        },
        "PackageDimensions": {
            "Length": 8.0,
            "Width": 8.0,
            "Height": 8.0,
            "Unit": "inches"
        },
        "Weight": {
            "Unit": "oz",
            "Value": 12.0
        },
        "MustArriveByDate": "2022-01-23T00:00:00",
        "ShipDate": "2022-01-18T00:00:00",
        "ShippingServiceOptions": {
            "DeliveryExperience": "DeliveryConfirmationWithoutSignature",
            "CarrierWillPickUp": true,
            "LabelFormat": "ZPL203"
        }
    },
}
franciscocha commented 2 years ago

@danpryoreuro Thank you so much that was the issue.

franciscocha commented 2 years ago

@defenderjim Your new json payload has StateOrPostalCode instead of StateOrProvinceCode

danpryoreuro commented 2 years ago

@defenderjim @franciscocha Sorry for the confusion above - I meant to type StateOrProvinceCode rather than StateOrPostalCode.

defenderjim commented 2 years ago

Ok, I see in the docs it is supposed to be StateOrProvinceCode . Good catch. Missed that on the conversion over from MWS. Still not working.

franciscocha commented 2 years ago

@defenderjim You have an extra , at the end of your json file. Also phone is a required field. Here is your json payload with the fixes that I tested.

    "ShipmentRequestDetails": {
        "AmazonOrderId": "114-xxxxxxx-xxxxxxx",
        "ItemList": [
            {
                "OrderItemId": "xxxx",
                "Quantity": 1
            }
        ],
        "MustArriveByDate": "2022-01-23T00:00:00",
        "PackageDimensions": {
            "Height": 8.0,
            "Length": 8.0,
            "Unit": "inches",
            "Width": 8.0
        },
        "ShipDate": "2022-01-18T00:00:00",
        "ShipFromAddress": {
            "AddressLine1": "10 Main St.",
            "City": "Rockville",
            "CountryCode": "US",
            "Email": "support@xxxxxxx.com",
            "Name": "xxxxxx",
            "PostalCode": "20940",
            "StateOrProvinceCode": "ME",
            "Phone": "xxxxxxxxxx"
        },
        "ShippingServiceOptions": {
            "CarrierWillPickUp": true,
            "DeliveryExperience": "DeliveryConfirmationWithoutSignature",
            "LabelFormat": "ZPL203"
        },
        "Weight": {
            "Unit": "oz",
            "Value": 12.0
        }
    }
}
defenderjim commented 2 years ago

I thought the extra comma was wrong too, but someone, see above, said they had to include that to get it working, so who am I to argue?

Ok, added the phone, got rid of the comma, and .... Working!

Thank you for your help!

franciscocha commented 2 years ago

@defenderjim No worries I would have done the same thing

AlexioDanje commented 2 years ago

Can someone help me with my request class ShipmentRequestDetails { amazonOrderId: 026-9350696-test sellerOrderId: null itemList: class ItemList { [class Item { orderItemId: 676469534test quantity: 1 itemWeight: null itemDescription: null transparencyCodeList: null itemLevelSellerInputsList: null }] } shipFromAddress: class Address { name: ,,,,,,,,,,,, addressLine1: ................ addressLine2: Milton Park addressLine3: null districtOrCounty: null email: ollie@;;;;;;.com city: Abingdon stateOrProvinceCode: null postalCode: ;;;;;;;; countryCode: GB phone: 01235 ...... } packageDimensions: class PackageDimensions { length: 220.0000000 width: 258.0000000 height: 113.0000000 unit: inches predefinedPackageDimensions: null } weight: class Weight { value: 3000.0000 unit: oz } mustArriveByDate: null shipDate: null shippingServiceOptions: class ShippingServiceOptions { deliveryExperience: DeliveryConfirmationWithSignature declaredValue: null carrierWillPickUp: true carrierWillPickUpOption: null labelFormat: null } labelCustomization: null } Response { "errors": [ { "code": "InvalidInput", "message": "Invalid Input", "details": "" } ] }

defenderjim commented 2 years ago

As I remember, the endpoints don't like null values passed in, so don't serialize those. Which endpoint are you using? Remove that email and address in your payload, don't disclose confidential info on any forum, including this one.

AlexioDanje commented 2 years ago

Ok thanks

I'm calling Https://sellingpartnerapi-eu.amazon.co/mfn/v0/eligibleShippingServices

On Tue, 22 Feb 2022, 16:22 Jim, @.***> wrote:

As I remember, the endpoints don't like null values passed in, so don't serialize those. Which endpoint are you using?

— Reply to this email directly, view it on GitHub https://github.com/amzn/selling-partner-api-models/issues/996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOX7OUDMIF6CDOPVCZ3I5DU4OL3ZANCNFSM4WXF4IYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

defenderjim commented 2 years ago

This is a working payload.


{
    "ShipmentRequestDetails": {
        "AmazonOrderId": "xxx-5xxxx53-5xxxxx5",
        "ItemList": [{
                "OrderItemId": "xxxxxxxxxxx454",
                "Quantity": 1
            }
        ],
        "ShipFromAddress": {
            "StateOrProvinceCode": "MI",
            "AddressLine1": "xx xxxxxxll Ave",
            "Phone": "xxxxxxx234",
            "PostalCode": "48123",
            "City": "Detroit",
            "CountryCode": "US",
            "Name": "John Doe",
            "Email": "jdxxxxxxllkj@xxxxx.com"
        },
        "PackageDimensions": {
            "Length": 10,
            "Width": 10,
            "Height": 10,
            "Unit": "inches"
        },
        "Weight": {
            "Unit": "oz",
            "Value": 10.0
        },
        "MustArriveByDate": "2022-03-04T09:45:00Z",
        "ShipDate": "2022-02-22T09:45:00Z",
        "ShippingServiceOptions": {
            "DeliveryExperience": "NoTracking",
            "CarrierWillPickUp": false,
            "CarrierWillPickUpOption": "ShipperWillDropOff",
            "LabelFormat": "PNG"
        }
    }
}
AlexioDanje commented 2 years ago

For my case, a call to the sandbox is successful but calling the actual API that's were I'm getting Invalid input error

On Tue, 22 Feb 2022, 16:59 Jim, @.***> wrote:

This is a working payload.

{ "ShipmentRequestDetails": { "AmazonOrderId": "xxx-5xxxx53-5xxxxx5", "ItemList": [{ "OrderItemId": "xxxxxxxxxxx454", "Quantity": 1 } ], "ShipFromAddress": { "StateOrProvinceCode": "MI", "AddressLine1": "xx xxxxxxll Ave", "Phone": "xxxxxxx234", "PostalCode": "48123", "City": "Detroit", "CountryCode": "US", "Name": "John Doe", "Email": @.***" }, "PackageDimensions": { "Length": 10, "Width": 10, "Height": 10, "Unit": "inches" }, "Weight": { "Unit": "oz", "Value": 10.0 }, "MustArriveByDate": "2022-03-04T09:45:00Z", "ShipDate": "2022-02-22T09:45:00Z", "ShippingServiceOptions": { "DeliveryExperience": "NoTracking", "CarrierWillPickUp": false, "CarrierWillPickUpOption": "ShipperWillDropOff", "LabelFormat": "PNG" } } }

— Reply to this email directly, view it on GitHub https://github.com/amzn/selling-partner-api-models/issues/996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOX7OSJKFN46MZQMHMYKHDU4OQEFANCNFSM4WXF4IYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

defenderjim commented 2 years ago

Been there. From experience, just keep trying different values. You have to use a valid order id. Make sure you are using the order item ids from that order. Don't change your weight values as you know, from the sandbox testing, those values are correct.

AlexioDanje commented 2 years ago

Ok, thanks. Will keep trying. I'm actually using a real order

On Tue, 22 Feb 2022, 17:12 Jim, @.***> wrote:

Been there. From experience, just keep trying different values. You have to use a valid order id. Make sure you are using the order item ids from that order. Don't change your weight values as you know, from the sandbox testing, those values are correct.

— Reply to this email directly, view it on GitHub https://github.com/amzn/selling-partner-api-models/issues/996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOX7OWMYJ4VN3ZU4ZCEYETU4ORVZANCNFSM4WXF4IYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

defenderjim commented 2 years ago

I'm actually using a real order Well, yes, you have to. Just make sure you have the AmazonOrderId and OrderItemId set correctly. Don't send nulls in your payload, it won't work if you do. That's where your problem lies.

coder771 commented 2 years ago

For my case, a call to the sandbox is successful but calling the actual API that's were I'm getting Invalid input error On Tue, 22 Feb 2022, 16:59 Jim, @.> wrote: This is a working payload. { "ShipmentRequestDetails": { "AmazonOrderId": "xxx-5xxxx53-5xxxxx5", "ItemList": [{ "OrderItemId": "xxxxxxxxxxx454", "Quantity": 1 } ], "ShipFromAddress": { "StateOrProvinceCode": "MI", "AddressLine1": "xx xxxxxxll Ave", "Phone": "xxxxxxx234", "PostalCode": "48123", "City": "Detroit", "CountryCode": "US", "Name": "John Doe", "Email": @." }, "PackageDimensions": { "Length": 10, "Width": 10, "Height": 10, "Unit": "inches" }, "Weight": { "Unit": "oz", "Value": 10.0 }, "MustArriveByDate": "2022-03-04T09:45:00Z", "ShipDate": "2022-02-22T09:45:00Z", "ShippingServiceOptions": { "DeliveryExperience": "NoTracking", "CarrierWillPickUp": false, "CarrierWillPickUpOption": "ShipperWillDropOff", "LabelFormat": "PNG" } } } — Reply to this email directly, view it on GitHub <#352 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOX7OSJKFN46MZQMHMYKHDU4OQEFANCNFSM4WXF4IYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.***>

can you please send me your sandbox request body, I'm getting below error on calling sandbox

{ "errors": [ { "message": "Invalid request body: [instance type (string) does not match any allowed primitive type (allowed: [\"object\"])]", "code": "InvalidInput" } ] }

defenderjim commented 2 years ago

My sandbox request body would be the same as above, except with the appropriate sandbox parameters. The page can be hard to find here it is. https://github.com/amzn/selling-partner-api-models/blob/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json Give me a few to run the test to gen the json.

coder771 commented 2 years ago

My sandbox request body would be the same as above, except with the appropriate sandbox parameters. The page can be hard to find here it is. https://github.com/amzn/selling-partner-api-models/blob/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json Give me a few to run the test to gen the json.

I'm following that page and below is my request body from it, but still gettting the error

{ "ShipmentRequestDetails": { "AmazonOrderId": "903-5563053-5647845", "ItemList": [ { "OrderItemId": "52986411826454", "Quantity": 1 } ], "ShipFromAddress": { "Name": "John Doe", "AddressLine1": "300 Turnbull Ave", "Email": "jdoeasdfllkj@yahoo.com", "City": "Detroit", "StateOrProvinceCode": "MI", "PostalCode": "48123", "CountryCode": "US", "Phone": "7132341234" }, "PackageDimensions": { "Length": 10, "Width": 10, "Height": 10, "Unit": "inches" }, "Weight": { "Value": 10, "Unit": "oz" }, "ShippingServiceOptions": { "DeliveryExperience": "NoTracking", "CarrierWillPickUp": false, "CarrierWillPickUpOption": "ShipperWillDropOff" } } }

defenderjim commented 2 years ago

In the future, please use the chevrons "<>" icon to format your code. It just makes it a lot more readable. Your code is missing a few lines, "LabelFormat": "PNG", MustArriveByDate, & ShipDate.

Here is my body that I just tried and works, which is almost identical.

{
    "ShipmentRequestDetails": {
        "AmazonOrderId": "903-5563053-5647845",
        "ItemList": [{
                "OrderItemId": "52986411826454",
                "Quantity": 1
            }
        ],
        "ShipFromAddress": {
            "StateOrProvinceCode": "MI",
            "AddressLine1": "300 Turnbull Ave",
            "Phone": "7132341234",
            "PostalCode": "48123",
            "City": "Detroit",
            "CountryCode": "US",
            "Name": "John Doe",
            "Email": "jdoeasdfllkj@yahoo.com"
        },
        "PackageDimensions": {
            "Length": 10,
            "Width": 10,
            "Height": 10,
            "Unit": "inches"
        },
        "Weight": {
            "Unit": "oz",
            "Value": 10
        },
        "MustArriveByDate": "2022-03-04T13:25:23Z",
        "ShipDate": "2022-02-22T13:25:23Z",
        "ShippingServiceOptions": {
            "DeliveryExperience": "NoTracking",
            "CarrierWillPickUp": false,
            "CarrierWillPickUpOption": "ShipperWillDropOff",
            "LabelFormat": "PNG"
        }
    }
}
coder771 commented 2 years ago

In the future, please use the chevrons "<>" icon to format your code. It just makes it a lot more readable. Your code is missing a few lines, "LabelFormat": "PNG", MustArriveByDate, & ShipDate.

Here is my body that I just tried and works, which is almost identical.

{
  "ShipmentRequestDetails": {
      "AmazonOrderId": "903-5563053-5647845",
      "ItemList": [{
              "OrderItemId": "52986411826454",
              "Quantity": 1
          }
      ],
      "ShipFromAddress": {
          "StateOrProvinceCode": "MI",
          "AddressLine1": "300 Turnbull Ave",
          "Phone": "7132341234",
          "PostalCode": "48123",
          "City": "Detroit",
          "CountryCode": "US",
          "Name": "John Doe",
          "Email": "jdoeasdfllkj@yahoo.com"
      },
      "PackageDimensions": {
          "Length": 10,
          "Width": 10,
          "Height": 10,
          "Unit": "inches"
      },
      "Weight": {
          "Unit": "oz",
          "Value": 10
      },
      "MustArriveByDate": "2022-03-04T13:25:23Z",
      "ShipDate": "2022-02-22T13:25:23Z",
      "ShippingServiceOptions": {
          "DeliveryExperience": "NoTracking",
          "CarrierWillPickUp": false,
          "CarrierWillPickUpOption": "ShipperWillDropOff",
          "LabelFormat": "PNG"
      }
  }
}

Thanks for getting back. But those lines dont exist in sandbox request, should we not have the same request parameters as in sandbox for it?

franciscocha commented 2 years ago

@coder771 what lines are you referring to?

coder771 commented 2 years ago

"LabelFormat": "PNG"

"LabelFormat": "PNG", "MustArriveByDate": "2022-03-04T13:25:23Z", "ShipDate": "2022-02-22T13:25:23Z", are not in the sandbox request. I'm referring to request object that is on line 63 in this document https://github.com/amzn/selling-partner-api-models/blob/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json