I've got this error while trying to create sale order through API.
Every thing is set up following the guide line, but still got error. Already try different content-type (application/json;odata.metadata=minimal;EEE754Compatible=true) but also not work.
{ "error": { "code": "BadRequest", "message": "Invalid Request Body CorrelationId: 9b68df58-b11a-4485-8069-84f8e2b06384." } }
{ "customerNumber": "1728", "orderDate": "2023-05-30", "postingDate": "2023-05-30", "billToCustomerNumber": "1728", "sellToAddressLine1": "BLK 704 ANG MO KIO AVENUE 8", "sellToAddressLine2": "#01-2559", "sellToCity": "", "sellToState": "", "sellToCountry": "", "sellToPostCode": "560704", "shipToAddressLine1": "BLK 704 ANG MO KIO AVENUE 8", "shipToAddressLine2": "#01-2559", "shipToCity": "", "shipToState": "", "shipToCountry": "", "shipToPostCode": "560704" }
Hope this helps
[View:https://youtu.be/TSQiE42tDwU:320:240]
Hi @Gian,
As API is automatically generated by web service in Business central, I don't see it should be the cause here. Anw, I tried to use company id it's still got same error
Hi Ramiz , I tried to send only customer number but the error is consistent. Do you have any suggestion where can I find information about proper names or fields inthe API page?
Hi Nam Ta
This is very common error when you are passing a value in JSON that doesn't exit on the API Pages or the name that you have put in JSON is wrong.
Please check all of the fields are available in the sales order API page and with same name. customerNumber, OrderDate etc.
You can also test it by passing only the customerNumber and see if it is inserting the record or not. If it gets inserted then your JSON has some field thats not available on the API page.
{ "customerNumber": "1728", "orderDate": "2023-05-30", "postingDate": "2023-05-30", "billToCustomerNumber": "1728", "sellToAddressLine1": "BLK 704 ANG MO KIO AVENUE 8", "sellToAddressLine2": "#01-2559", "sellToCity": "", "sellToState": "", "sellToCountry": "", "sellToPostCode": "560704", "shipToAddressLine1": "BLK 704 ANG MO KIO AVENUE 8", "shipToAddressLine2": "#01-2559", "shipToCity": "", "shipToState": "", "shipToCountry": "", "shipToPostCode": "560704" }
hello, try using the API instead of the Odata call.
Set your url like this:
in the company you must use the company id and not its name
Don't forget to help the community by Verifying the answer and Like it if your question has been answered. It will let others know that the topic has verified answer.
Thanks & Regards,
Gian
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156