question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad Request Error in VendorOrders().submit_acknowledgement()

See original GitHub issue

Describe the bug When I call submit_acknowledgement, I get an error message saying that invalid content was found in the body of request. Even though I do not add marketplaceIds, it seems like self._request() adds it to the body before sending a request to API.

Error Message

sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': "Invalid content was found starting with element 'marketplaceIds'. One of '{acknowledgements}' is expected.", 'details': ''}, {'code': 'InvalidInput', 'message': 'MarketplaceIds', 'details': ''}]

To Reproduce

Here is the code used to call Amazon Vendor SP-API:

with open("ack_body.json", ) as file:
      obj = json.load(file)
 
res = VendorOrders(account="VC").submit_acknowledgement(body=obj)

This is the acknowledgement object that was created according to Amazon Vendor SP-API guidelines:


{
    "acknowledgements": [
        {
            "purchaseOrderNumber": "6GYSI89S",
            "sellingParty": {
                "partyId": "XXXXX",
                "address": {
                    "name": " D XXXXXXXXX",
                    "addressLine1": "1481 XXXXXXXXXX",
                    "addressLine2": "",
                    "addressLine3": "",
                    "city": "Seattle",
                    "county": "",
                    "district": "",
                    "stateOrRegion": "WA",
                    "postalCode": "99999",
                    "countryCode": "US",
                    "phone": ""
                },
                "taxInfo": {
                    "taxRegistrationType": "",
                    "taxRegistrationNumber": ""
                }
            },
            "acknowledgementDate": "2021-11-03T18:00:00-07:00",
            "items": [
                {
                    "itemSequenceNumber": "1",
                    "amazonProductIdentifier": "B0XXXXXXXX",
                    "vendorProductIdentifier": "",
                    "orderedQuantity": {
                        "amount": 48,
                        "unitOfMeasure": "Eaches",
                        "unitSize": 1
                    },
                    "netCost": {
                        "currencyCode": "USD",
                        "amount": "9.69"
                    },
                    "listPrice": {
                        "currencyCode": "",
                        "amount": ""
                    },
                    "discountMultiplier": "",
                    "itemAcknowledgements": [
                        {
                            "acknowledgementCode": "Rejected",
                            "acknowledgedQuantity": {
                                "amount": 0,
                                "unitOfMeasure": "Eaches",
                                "unitSize": "1"
                            },
                            "scheduledShipDate": "",
                            "scheduledDeliveryDate": "",
                            "rejectionReason": "TemporarilyUnavailable"
                        }
                    ]
                }
            ]
        }
    ]
}

Expected behavior

I expect this API call to return an ApiResponse with res.payload that includes transactionId. I can then use transactionId to check the request status later.

Desktop:

  • OS: Mac
  • IDE: VS Code

Additional context

Any help to get this resolved is appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
saleweavercommented, Nov 3, 2021

Welcome. I’ll create a release the next couple of days.

1reaction
ej-cdxcommented, Nov 3, 2021

Can you please try with the last commit I’ve just pushed, should work then

It works. Thank you!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >
Bad Request from Shipping API · Issue #34 - GitHub
I was leary to add the declaration there as some functions in the api spec seem to have it excluded (e.g. Refund order)....
Read more >
Error Codes (v1.0) - Business Central - Microsoft Learn
Exception Type Error Message Error Code ODataNotFoundException Bad Request ‑ Error in query syntax BadRequest_Not... ODataNotFoundException '|' or ',' expected at position 3 in (GUID)...
Read more >
Invoice error messages
Error No. Error Message Meaning and suggested resolution 35 INVOICE_UPDATE The invoice status has been successfully u... 36 INVOICE_UPDATE_WITH_PAYMENT The invoice status has been successfully...
Read more >
Warnings and Errors in the VSP Interface - Eyefinity
VSP Errors — You must fix all VSP errors before you can submit a VSP claim for billing. ... If lenses are not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found