Error Creating Purchase Order Receipt via API

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
HNCDev
Posts: 7
Joined: Thu Dec 10, 2020 11:32 pm

Error Creating Purchase Order Receipt via API

Post by HNCDev » Fri Sep 17, 2021 3:47 am

Hi,

I am trying to work out how to create purchase order receipts via the API. I have tried to follow the API documentation and no matter what I try I get the same error (below). The error doesn't really provide any information as to what the problem is so I'm a bit stuck.

Status 422 - Unprocessable Entity

Reponse:

Code: Select all

"errors": [
{
"path": null,
"message": "No data to be inserted for vendor receipt.",
"value": null
}
]

Request:
POST {{SimPRO_BaseURL}}/api/v1.0/companies/{{CompanyID}}/vendorOrders/{{vendorOrderID}}/receipts/

Code: Select all

{
"VendorInvoiceNo": "PO134345",
"PackingSlipNo": "PS2154",
"Notes": "This one was created via the API",
"ExchangeRate": 1,
"DateIssued": "2021-09-17",
"Category": 0,
"TaxAdjustment": 0,
"FreightTaxCode": 1,
"Freight": {
"ExTax": 0
},
"Total": {
"ExTax": 591
},
"ItemsReceived": true
}
Muqeet
Posts: 772
Joined: Mon Dec 03, 2018 3:24 am

Re: Error Creating Purchase Order Receipt via API

Post by Muqeet » Fri Sep 17, 2021 4:13 am

This usually happens when the request data is not correctl, json format could be wrong or may be you would need to pass the Content-Type: application/json in request headers.
Muqeet
API Developer | simPRO Software Group
HNCDev
Posts: 7
Joined: Thu Dec 10, 2020 11:32 pm

Re: Error Creating Purchase Order Receipt via API

Post by HNCDev » Fri Sep 17, 2021 5:52 am

Thanks adding the request header Content-Type: application/json did the trick.
Post Reply