Create PO Header

in Development
I am receiving an error message using Python.
{"httpCode":"400","httpMessage":"Bad Request","message":"JSON Input was invalid. Error Message: Syntax error","errorClass":"Exception"}
import requests
url = "https://api.lightspeedapp.com/API/Account/122864/Order.json"
thisdict = {
"vendorID": 2,
"shopID": 1,
"shipCost": 7.50
}
headers = {"authorization": "Bearer "+c_access_token}
response = requests.request("POST", url, data=thisdict, headers=headers)
Any ideas?
Tags:
Answers
Hey @soft911,
It seems you want to structure the payload for a purchase order according to the docs:
First Create the Order: https://developers.lightspeedhq.com/retail/endpoints/Order/#post-create-an-order
Then add lines to the order specifying the orderID in the payload:
https://developers.lightspeedhq.com/retail/endpoints/OrderLine/#post-create-an-order-line
Hope this helps!
Adrian Samuel
Software Developer
Lightspeed HQ