Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug) Invalid input content type #1178

Closed
PixsaOJ opened this issue Apr 29, 2024 · 3 comments
Closed

(Bug) Invalid input content type #1178

PixsaOJ opened this issue Apr 29, 2024 · 3 comments

Comments

@PixsaOJ
Copy link

PixsaOJ commented Apr 29, 2024

I am trying to cancel fulfillment order using cancelFulfillmentOrder

I saw this issue on version 1.10.3 so I upgraded to 2.1.1 and upgraded Auth library as well.

For some reason I get this content type error. Is it possible that Amazon has new requirement for content type? Maybe charset=utf8 is not set. I don't recall having this issue before.

[
  {
    code: 'InvalidInput',
    message: 'Invalid Input',
    details: 'Content type must be set to application/json; charset=utf-8.'
  }
]

How I use it

await this.client.cancelFulfillmentOrder({
  sellerFulfillmentOrderId: id
})
.then((response) => {})
@tusbar
Copy link
Member

tusbar commented May 20, 2024

Hello @PixsaOJ,

It seems like an issue with the models over on https://github.com/amzn/selling-partner-api-models.

You could work around this issue by using the 2nd parameter.

const response = await this.client.cancelFulfillmentOrder({
  sellerFulfillmentOrderId: id
}, {
  headers: {
    'content-type': 'application/json'
  }
})

Let me know if it fixes the issue for you.

@PixsaOJ
Copy link
Author

PixsaOJ commented May 26, 2024

Hi, I believe i was passing null as id. The error was misleading, because it has nothing to do with content type.

@PixsaOJ PixsaOJ closed this as completed May 26, 2024
@PixsaOJ
Copy link
Author

PixsaOJ commented Jun 4, 2024

{
  headers: {
    'content-type': 'application/json'
  }
}

Was the solution for some reason. Why this can't just work without external parameter @tusbar ?

@PixsaOJ PixsaOJ reopened this Jun 4, 2024
@PixsaOJ PixsaOJ closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants