Update a purchase record
Purchase update
Note:
The API supports the passing of all the variations of the cost, markup & chargeout fields. However, we would suggest you only attempt to update one of these fields at at time.
Parameter | Description | Example | More info |
---|---|---|---|
API | The API area | purchases.json | |
Action | The action to perform | action=update | |
Parameters described in overview | user=user&\password=user | ||
input | PO Internal (mandatory), then name/value pairs | "data": [<see example>] | |
Response | Returned data | See below |
Example requests:
http: //<SERVER>/jsonapi/purchases.json?company=1&user=user&password=user&version=3.3&action=update&input={
"data": [
{
"poInternal": "10008229",
"poEstCost": 33
}
]
}
http: //<SERVER>/jsonapi/purchases.json?company=1&user=user&password=user&version=3.3&action=update&input={
"data": [
{
"poInternal": "10008375",
"poCurrencyEstCharge": "2"
}
]
}
http://<SERVER>/jsonapi/purchases.json?company=1&user=user&password=user&version=3.3&action=update&input={
"data": [
{
"poInternal": "10008375",
"poCurrencyCost": "1.14"
}
]
}
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"poCurrencyCode": "",
"poCurrencyRate": 1,
"poCost": 150,
"poCurrencyCost": 0,
"poMarkup": 30,
"poChargeout": 195,
"poCurrencyCharge": 195,
"poInvest": false,
"poInvestment": 0,
"poInvestmentMarkup": 0,
"poEstCost": 33,
"poCurrencyEstCost": 33,
"poEstMarkUp": 30,
"poEstRecChgOut": 42.9,
"poCurrencyEstCharge": 42.9,
"poOriginalCost": 0,
"poCurrencyOrigCost": 0,
"poInternal": 10008180,
"poUuid": "EC2BCC0570400345AC130E1140DFB69E",
"poTimeStampModified": 1521020315,
"poRecordVersionNumber": 17,
"poPONumber": "012082"
}
]
}
Note:
To discover which fields are editable make a call to the "Purchase details" endpoint and specify '&style=modelstructure' see Meta-data
example of fields that can be updated using this endpoint:
In order to see all the possible fields see the return values in Purchase details
Note: this is subject to the business rules set up on the system.
poCurrencyCode
poCurrencyRate
poCost
poCurrencyCost
poMarkup
poCharge
poCurrencyCharge
poInvest
poInvestment
poInvestmentMarkup
poEstCost
poCurrencyEstCharge
poEstMarkUp
poEstRecChgOut
poOriginalCost
poCurrencyOrigCost