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

can not get message from Notifications-API for SQS-Queue #1020

Closed applewindy closed 3 years ago

applewindy commented 3 years ago

Hello,

it would be helpful if the guide has a section included which permissions are need to set for the sqs-queue. I have an active Subscription for Any Offer Changed but no messages are coming in. It would also be good when there is function to send a testmessage like it was in the old MWS-API.

I also opened a case for this question 2179383133.

best regards

ghost commented 3 years ago

Sorry, not able to help you, but can I please ask you, if you had any problems with "createSubscription" to make the active subscription ?

I always get access denied and I have tried everything. I would love to know if you just followed the documentation, or you had to do some extra steps, like permissions, etc.

applewindy commented 3 years ago

@goodiebag45 I just followed the document , didn't do any extra step. I made the subscription but can not get any notification .

teddy-codes commented 3 years ago

From experience with the MWS api, you have to allow the Amazon account id access to send to your sqs queue. Otherwise, it will attempt to send and fail (which makes sense). I believe that the id is the same across the two APIs.

Hope this helps!

applewindy commented 3 years ago

@teddy-codes Thank you for the reply. I have set the access policy as below following the document. { "Version": "2008-10-17", "Id": "__default_policy_ID", "Statement": [ { "Sid": "__owner_statement", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::{id}:root" }, "Action": "SQS:*", "Resource": "arn:aws:sqs:us-west-2:{id}:queue1" }, { "Sid": "Stmt1612707416559", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::437568002678:root" }, "Action": "sqs:*", "Resource": "arn:aws:sqs:us-west-2:{id}:queue1" } ] } Do you mean I need do some other work?

cgaugel commented 3 years ago

I have the same Problem for eu-west-1. I created the SQS-Queue with the following JSON:

{ "Version": "2012-10-17", "Id": "Policy1613634129321", "Statement": [ { "Sid": "Stmt1613634128043", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::437568002678:root" }, "Action": [ "sqs:GetQueueAttributes", "sqs:SendMessage" ], "Resource": "arn:aws:sqs:eu-west-1:***MY-ID***:***MY-SQS-NAME***" } ] }

I called the createDestination Endpoint https://sellingpartnerapi-eu.amazon.com/notifications/v1/destinations with the ARN: arn:aws:sqs:eu-west-1:MY-ID:MY-SQS-NAME Than I received an destinationId. After that, I called the createSubscription Endpoint: https://sellingpartnerapi-eu.amazon.com/notifications/v1/subscriptions/ANY_OFFER_CHANGED with payloadVersion = 1.0, the destinationId I received from the createDestination call and the sellers Access-Token. I received an subscriptionId, but no messages comes into my SQS-Queue.

I already opened a case (6795898612) but did not get any answer yet.

Did I do anything wrong?

Thank you.

applewindy commented 3 years ago

@cgaugel I get No response and No reply until now.

parvathm commented 3 years ago

Hi @cgaugel,and @appleWindy

Sorry for the delay. We will work on your cases and provide an update soon.

Thanks, Parvathm Selling Partner API Developer Support.

vdanyliv commented 3 years ago

Hi @parvathm is there any updates regarding this issue?

teddy-codes commented 3 years ago

That is just absolutely annoying. How can you develop apps when Amazon's support is so bad.

You can't.. I have been having problems for over a little while now.

applewindy commented 3 years ago

Please let me know, if there are any update.

cgaugel commented 3 years ago

@parvathm so just tell me, is it a problem from my side or yours? Otherwise is spent hours to read more documentations and change my code.

You answered on my ticket, that you are working on it. Please give me an update!

parvathm commented 3 years ago

Hi @cgaugel,

We identified an issue on our end for ANY_OFFER_CHANGED notifications and our engineers are actively working to fix it. I will update this thread once the issue is fixed.

Thanks, Parvathm Selling Partner Developer support.

cgaugel commented 3 years ago

@parvathm The issue is still not fixed. How long do we have to wait?

applewindy commented 3 years ago

No answer.

fernlop commented 3 years ago

Also created a subscription for REPORT_PROCESSING_FINISHED and no notifications arrived yet. SQS Policy:

{
  "Version": "2012-10-17",
  "Id": "Policy1614026734364",
  "Statement": [
    {
      "Sid": "Stmt1614026416730",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::437568002678:root"
      },
      "Action": [
        "sqs:GetQueueAttributes",
        "sqs:SendMessage"
      ],
      "Resource": "arn:aws:sqs:eu-west-1:MYID:MYSQS"
    }
  ]
}

Subscription should be good also:

[
  {
    subscriptionId: 'fe62f422-ca10-415e-accf-0bc7a5ddXXX',
    destinationId: '0e2ffbd0-5d9d-4d02-a858-d99080c85XXX',
    payloadVersion: '1.0',
    notificationType: 'REPORT_PROCESSING_FINISHED'
  }
]

I just noticed in the monitoring tab of the SQS Query there are 15 empty receives every minute since connecting established.

What is also strange is that i can't delete destinations. It always returns:

{"code":"NotFound","
message":"The requested resource doesn't exist.",
"details":"Unable to find destination 0e2ffbd0-5d9d-4d02-a858-d99080c85XXX for application amzn1.sellerapps.app.61ace7ba-60f5-4a70-9796-8563346XXXX"}]
cgaugel commented 3 years ago

What is also strange is that i can't delete destinations. It always returns:

{"code":"NotFound","
message":"The requested resource doesn't exist.",
"details":"Unable to find destination 0e2ffbd0-5d9d-4d02-a858-d99080c85XXX for application amzn1.sellerapps.app.61ace7ba-60f5-4a70-9796-8563346XXXX"}]

Are you deleting in the right region with the correct sellercentral-endpoint URI?

fernlop commented 3 years ago

@cgaugel yes:

path: '/notifications/v1/destinations/c187b155-e2dd-4681-91f8-7161bd2XXXX',
  host: 'sellingpartnerapi-eu.amazon.com',
  headers: {
    'x-amz-access-token': 'Atc|MQEBICMsbZCLmls2wTaB-dy-vIUzgNGXo4Y0Kix104ogqLPqIJY5KwdBURObawy78pUgZ-mS-C1Vh3ro3EdznY4OS6wGdVnt_j9C-FxrRPUQvRgUtnylgqjJz7TfeFuXcm1sYMCI0M9Le-lSbmBofDBEcWqfePFZEBJXyjLd8qPlO7y76pOfG302D6iBc1suyIVe4ant927S8j1rP9I5b7JvEQfs6c0eF107Jq3lkzHWIs6wBKdN9zL_yMK79MFZqaOOmDfkpxgsv7CxIMJmw0vcsxbXKor2NsPY5h0o12wynI9lJs9zl3gdVCVVfrine2HzKzhCjacUXXXXXXXX',
    Host: 'sellingpartnerapi-eu.amazon.com',
    'X-Amz-Security-Token': 'FwoGZXIvYXdzEOb//////////wEaDNy00OoZ4E32SGB9qyK4AU3CGYZAS5XXXXkQVe/tcu6xcLgwQZYkiew/xHBFlexRs5Zfjbwi5gOG83qrdyQZ3xTOjhI6BHWMncE/ec20m+1EHU9fFZTc1BtNFn7TeqUujX3IPFXXXXSBp2Lu/QFm9VvV74IZmwjTf7KjdRbamNLgz3y6PMpE2wjPOy4l+s86xGChrO1YxyfquEuXXXXcs4PsLrxB5JosvKQyWULzNjwWwa59eLf0ubkVZmS/ONIBCaTJntwoqbTQgQYyLYUHPyan6g+cZZeWCKiop/eJ26wbBm/Gn7MF+n5aFlC8HB2KZkN2HFBXXXX',
    'X-Amz-Date': '20210222T205507Z',
    Authorization: 'AWS4-HMAC-SHA256 Credential=ASIAVHJA2HMHVCXXXX/20210222/eu-west-1/execute-api/aws4_request, SignedHeaders=host;x-amz-access-token;x-amz-date;x-amz-security-token, Signature=d6be269f41e824dc9dce77e342e9ae69ca37894380ead247663b402ef33XXXX'
  },
  body: ''

There is no option to provide the region, if you didn't mean the amazon endpoint url.

cgaugel commented 3 years ago

@fernlop ok that looks correct. I can delete my destinations and my subscriptions without any problems. Maye yor destination was created at sellingpartnerapi.amazon.com instead of sellingpartnerapi-eu.amazon.com?

fernlop commented 3 years ago

@cgaugel No in created it with the same url. What's also strange is that i can call getDestinations and receive all of them but can't call getDestination (by ID in the URI)

fernlop commented 3 years ago

Update: I just received notifications TODAY at 8:13.. The report was already finished at about 22:00 yesterday! Great notification system haha :D EDIT: Not the report I created through Selling partner API. This is a notification I received for an auto-generated report.

{
  Records: [
    {
      messageId: '269e93d6-4178-4b11-b6c3-75dd7de72e9f',
      receiptHandle: 'AQEBeh5/GrWy8kMhQw1Xie0N5cJF5lx5ZnUUlbHhdYa+nmnda81NB8ECxKb8danoh6v9jQFsDQcUrJfxGBUKPfUXyffaul+QFme9vTS9c+z37AA2C9gE2q8PM16OtRORI+EaGL6FUzisKKqupxXKjHpFlvTT7VlgVIv+A1UyD765tcfJ91VV+kVWxkRxFi7u8hw7g5dWkhx/Q2Ik+KrMUBtqz4I3wg+g3UypEGTL8VBHScc04LXnZSlNHxOhvpoq6q6lb23xl5Y7faY283NPeW/JKJ8vrlGO0EsoSxfpXN5a0lI63mTmtbQr9BRbp7Ikeo5K7F5Qr3NVbqSonbKgFAAaTnWB0V+aUy+OzKrokTVZx7SRgofCIf3SRZpz3XECchDfFeCQCDYE/xKUfXXXXX',
      body: '{\n' +
        '  "notificationVersion" : "2020-09-04",\n' +
        '  "notificationType" : "REPORT_PROCESSING_FINISHED",\n' +
        '  "payloadVersion" : "1.0",\n' +
        '  "eventTime" : "2021-02-23T07:13:08.574Z",\n' +
        '  "payload" : {\n' +
        '    "reportProcessingFinishedNotification" : {\n' +
        '      "sellerId" : "A2O9O7FND0XXXX",\n' +
        '      "reportId" : "50398018XXX",\n' +
        '      "reportType" : "GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2",\n' +
        '      "processingStatus" : "DONE",\n' +
        '      "reportDocumentId" : "amzn1.tortuga.3.804bf7e6-fd72-4917-8c33-005d30c8e444.T3VK9NJFXEXXX"\n' +
        '    }\n' +
        '  },\n' +
        '  "notificationMetadata" : {\n' +
        '    "applicationId" : "amzn1.sellerapps.app.61ace7ba-60f5-4a70-9796-85633XXXX",\n' +
        '    "subscriptionId" : "fe62f422-ca10-415e-accf-0bc7a5ddXXX",\n' +
        '    "publishTime" : "2021-02-23T07:13:09.098Z",\n' +
        '    "notificationId" : "5034b549-9fc2-44ef-b780-77e9f4f08XXX"\n' +
        '  }\n' +
        '}',
      attributes: [Object],
      messageAttributes: {},
      md5OfBody: 'df2ce2d2e781c08fe2ccbdda2f46XX',
      eventSource: 'aws:sqs',
      eventSourceARN: 'arn:aws:sqs:eu-west-1:359235468XXX:XXX',
      awsRegion: 'eu-west-1'
    }
  ]
}
cgaugel commented 3 years ago

@fernlop how did you create your access key? could you show me your code? Maybe you selected the wrong region there..

But if you receive your notifications, you did everything right I guess. I am still waiting for my notifications..

fernlop commented 3 years ago

@cgaugel I think I got this all right, just using the eu-west-1 for everything. But i will check. Also, the notification i received today at 8:13 is NOT the report I requested. I think that just some auto generated report. I created reports with the type "GET_MERCHANT_LISTINGS_ALL_DATA". I still can't receive notifications for report I request through the Selling Partner API.

cgaugel commented 3 years ago

Ok so there is still a problem with the notifications :( I received an answer for my support ticket yesterday:

"Hi,

Our Engineers are working to fix the code. I will update you with an ETA soon.

Thank you for selling with Amazon.

Parvathi M. Amazon.co.uk Seller Support"

I wonder how long this will take again :D

cgaugel commented 3 years ago

@parvathm any news today? What is the ETA? You are providing a non working API and we have to pay for it?

applewindy commented 3 years ago

nothing.

cgaugel commented 3 years ago

Same here, thats just ridiculous.

cgaugel commented 3 years ago

Still nothing

cgaugel commented 3 years ago

Again nothing. Thank you @parvathm

parvathm commented 3 years ago

Hi @cgaugel,

We are working to address the issue of notifications not being delivered during the responsible engineering team's current sprint. This is due to the lack of marketplace ID parameter in subscriptions. Our backend team is working to make changes which enables notifications for all marketplaces. We appreciate your patience while they work to deliver a fix.

Thanks, Parvathm Selling Partner API Developer Support.

applewindy commented 3 years ago

@parvathm Could you please tell us the schedule for the fix. I want add that into our schedule.

cgaugel commented 3 years ago

Still no update.

applewindy commented 3 years ago

The same.

ghost commented 3 years ago

Hi @parvathm

I have 2 apps (draft state) created a few months back and I have ANY_OFFER_CHANGED notifications working for those and I can also delete subscription and create a new destination on another SQS queue with no problems and still receive notifications.

However, if I create a new app, create a destination and subscription, I get absolutely no notifications to the queue. It is the same IAM User and SQS queues used for the 2 apps that works, so permissions should be fine. I have also tried creating new IAM User and SQS Queue, but no matter what I try, I cannot get any notifications anymore.

I have tried everything and several combinations of user/queue for the last 3 weeks, but it's not working. Can you tell me if that is part of the problem you are trying to fix, because your description is a little difficult to understand.

parvathm commented 3 years ago

Hi @goodiebag45,

Can you please open a support case with these details, we will investigate and get back to you.

Thanks, Parvathm, Selling Partner API Developer Support.

cgaugel commented 3 years ago

What is the status today @parvathm with our notification problem??

jlevers commented 3 years ago

I'm getting an error when I try to call getSubscription, which seems possibly related to the error @fernlop was running into with getDestination.

I get [404] Subscription doesn't exist for notification type REPORT_PROCESSING_FINISHED when I call getSubscription with REPORT_PROCESSING_FINISHED, which should mean that I don't have any subscriptions to that notification.

But when I try to delete my existing destinations by iterating over the results of getDestinations and calling deleteDestination on each one, I get [403] Destination has subscriptions. By checking my SQS queue manually, I was able to find the ID of a subscription to the REPORT_PROCESSING_FINISHED notification and delete it via deleteSubscriptionById, at which point the deleteDestination calls worked.

cgaugel commented 3 years ago

I received an email from Amazon (03/13).

Subject:

Change to "AnyOfferChange" notification in Amazon Selling Partner API

Content:

Dear Selling Partner API user,

We are contacting you because you subscribed to the ANY_OFFER_CHANGED notification through Selling Partner API. Starting Monday 3/15, you will receive ANY_OFFER_CHANGED notifications via SP-API for all Marketplaces within a region, even if you selected specific MarketplaceId’s when you subscribed to the ANY_OFFER_CHANGED notification in MWS.

For example, if you created an SPDS subscription in the EU region, you will receive notifications for offer changes in all EU Marketplaces. This will happen even if you indicated a preference to only receive notifications from offers in Germany and Italy when you signed up for this notification in MWS.

Note: This change only impacts subscriptions made through SP-API. Existing MWS subscriptions will continue to only deliver notifications for selected Marketplaces,

If you have any questions or concerns about this change, please contact SP-API Developer Support –  North America, Europe, Japan – and mention “AOCN MarketplaceId change” in your message. 

Best regards,

Selling Partner API/MWS team

Today it is the 03/15. However it is still not working. I created a new SQS-Queue, gave all permissions. Created destination and subscription. But still no ANY_OFFER_CHANGED notifications are in my queue. I am pissed.

applewindy commented 3 years ago

@cgaugel The same to me. I got the mail too.

cgaugel commented 3 years ago

@appleWindy I just received Notifications:

image

Now I have notifications for marketplaces I don't need in my queue and I have to pay for that notifications -.-

iosdevel commented 3 years ago

It seems this issue that no messages come through to SQS still hasn't been resolved. I created a support request nearly a week ago and still no response.

jlevers commented 3 years ago

I just had to rewrite a significant portion of a client's application because SQS wasn't providing accurate report processing notifications. It would be extremely helpful to get this issue resolved.

parvathm commented 3 years ago

@jlevers,

Can you please open a support case with more details about report processing notifications issue and provide the case id here? We will investigate further and get back to you.

Thanks, Parvathm, Selling Partner API Developer Support.

parvathm commented 3 years ago

It seems this issue that no messages come through to SQS still hasn't been resolved. I created a support request nearly a week ago and still no response.

@iosdevel Can you please share the case id here?

iosdevel commented 3 years ago

It seems this issue that no messages come through to SQS still hasn't been resolved. I created a support request nearly a week ago and still no response.

@iosdevel Can you please share the case id here?

The case ID is 2193044913

applewindy commented 3 years ago

I can receive the notification now. So I will close the issue.

irshadali18 commented 2 years ago

I created reports with the type "_GET_FLAT_FILE_ORDERSDATA" for amazon india and region is us-east-2. I still can't receive notifications for report I requested through the Selling Partner API but i can receive notifications for amazon Europe. Please advise as soon as possible.

igoryan-k commented 2 years ago

Has this been resolved for everyone? I created a subscription for ANY_OFFER_CHANGED, but the messages are not flowing. How long it usually takes after creating the queue, destination and subscription for messages to appear?

igoryan-k commented 2 years ago

They're just started flowing. It took about an hour.

KernelRun commented 2 years ago

Has this been resolved for everyone? I created a subscription for ANY_OFFER_CHANGED, but the messages are not flowing. How long it usually takes after creating the queue, destination and subscription for messages to appear?

How did you do subscription for any_offer_changed? i am trying but always fails. Can you share your codes? And how is your configuration on aws? i have a user and has AmazonSQSFullAccess and its sqs permissions

"Id": "Policy1637232015714", "Statement": [ { "Sid": "Stmt1637232008228", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::437568002678:root" }, "Action": [ "sqs:GetQueueAttributes", "sqs:SendMessage" ], "Resource": "arn:aws:sqs:us-east-1:138***:sqsname" } ] }

AND ALSO HAVE

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "execute-api:Invoke", "Resource": "arn:aws:execute-api:::*" } ] }

still not working for me. Please inform me about how it works.

Thank you.

eternalparquet commented 2 years ago

I am getting this error after I 've succesfully created a destination id and I am trying to subscribe: {'code': 'InvalidInput', 'message': 'Request has missing or invalid parameters and cannot be parsed.', 'details': 'No destination with id DESTINATIONTID for applicationId APPID'}