Bad Request Error in VendorOrders().submit_acknowledgement()
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Welcome. I’ll create a release the next couple of days.
It works. Thank you!!!