Aladin SALEH Posted May 3, 2021 Share Posted May 3, 2021 I'm trying to learn the sage api I've tried to make a POST request for create a purchase invoice so I did as the documentation but i get this error message. "$message": "purchase_invoice[invoice_lines] is invalid" and I don't know why. Can someone help me ? Link to comment Share on other sites More sharing options...
Administrators Ben Smith Posted May 7, 2021 Administrators Share Posted May 7, 2021 Hi Aladin, This is most likely because you are passing the attributes and values as query params. You need to ensure you build a JSON body as per our API reference, passing the values accordingly, along with a header of Accept: application/json: Purchase Transactions | Sage Developer { "purchase_invoice": { "contact_id": "string", "date": "2019-08-24", "due_date": "2019-08-24", "reference": "string", "total_quantity": 0, "net_amount": 0, "tax_amount": 0, "total_amount": 0, "invoice_lines": [ ... ], "tax_analysis": [] } } Once you've had a look at the guide I've linked above it should make sense. Let me know if you still have any issues. Ben 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now