Raise Exception in VendorInvoices().submit_invoices() when trying to submit a new invoice
See original GitHub issueDescribe the bug When trying to submit a new invoice to VendorInvoices().submit_invoices() for Retail Partners, I get an exception that json content is invalid. It seems that the key from kwargs is added to the beginning of JSON object, which it is not supposed to.
Error Message
raise exception(error, headers=res.headers)
sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': 'Invoices', 'details': ''}, {'code': 'InvalidInput', 'message': "Invalid content was found starting with element 'body'. One of '{invoices}' is expected.", 'details': ''}]
To Reproduce
Here is the code used to call Amazon Vendor SP-API:
with open("invoice.json", ) as file:
obj = json.load(file)
res = VendorInvoices(account="VC").submit_invoices(body=obj)
This is the invoice object that was created according to Amazon Vendor SP-API guidelines:
{
"invoices": [
{
"billToParty": {
"address": {
"addressLine1": "440 Terry Ave N",
"city": "Seattle",
"countryCode": "US",
"name": "Amazon.com",
"stateOrRegion": "WA"
},
"partyId": "AKC1"
},
"date": "xxxxxxxx",
"id": "xxxxxxxx",
"invoiceTotal": {
"amount": xxxxxxx,
"currencyCode": "USD"
},
"invoiceType": "Invoice",
"items": [
{
"amazonProductIdentifier": "xxxxxxx",
"invoicedQuantity": {
"amount": 10.0,
"unitOfMeasure": "Eaches"
},
"itemSequenceNumber": "9",
"netCost": {
"amount": "xxxxx",
"currencyCode": "USD"
},
"purchaseOrderNumber": "xxxxxxx",
"vendorProductIdentifier": "xxxxxxxx"
}
],
"paymentTerms": {
"discountDueDays": xx,
"discountPercent": "xx",
"netDueDays": xx,
"type": "Basic"
},
"remitToParty": {
"address": {
"addressLine1": "xxxxxxxx",
"city": "xxxxxx",
"countryCode": "US",
"name": "xxxxxx",
"postalOrZipCode": "xxxxxx",
"stateOrRegion": "WA"
},
"partyId": "OR4YV"
},
"shipFromParty": {
"address": {
"addressLine1": "xxxxx",
"city": "xxxxxx",
"countryCode": "US",
"name": "xxxxx",
"postalOrZipCode": "xxxxxx",
"stateOrRegion": "WA"
},
"partyId": "OR4YV"
},
"shipToParty": {
"address": {
"addressLine1": "440 Terry Ave N",
"city": "Seattle",
"countryCode": "US",
"name": "Amazon.com",
"stateOrRegion": "WA"
},
"partyId": "AKC1"
}
}
]
}
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:5 (3 by maintainers)
Top Results From Across the Web
11 Common Invoice Processing Problems and How to Fix ...
Many PA teams struggle with these eleven common issues with processing invoices. Learn what they are and what to do to put your...
Read more >The Top 7 Challenges Organizations Face When ...
“Transmission error or failure”. #5. The time and effort to create and submit invoices is sometimes prohibitive. When supplier organizations ...
Read more >Vendor invoices overview - Finance | Dynamics 365
In this article. Vendor invoices; Understanding invoice line quantities; Adding a line that wasn't on the purchase order; Submitting a vendor ...
Read more >Error: You can try again, or come back later and try connecting ...
My customer is unable to pay an invoice. Keeps seeing this error: "Error: You can try again, or come back later and try...
Read more >What is Invoice Processing? Definition, Steps, Flowchart & ...
Invoice processing is an accounts payable function with a series of steps for managing vendor or supplier invoices from receipt to payment.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks again!!
Fixed here
#174412d73058b1b15cf02866207e5c6dd7019da3