Create a purchase order
Parameter | Mandatory | Description | Examples | More Info |
---|---|---|---|---|
API | Yes | The API area | purchases.json | |
General | Yes | Parameters described in overview | See overview | Structure of an API call |
Action | Yes | The action to perform | action=create | |
Input | Yes | JSON string | See below |
JSON Input | Mandatory | Description | Examples |
---|---|---|---|
poJobandPhase | Yes | Phase number | "poJobandPhase":"1/00000516.003" |
poSupplytype | Yes | Supply type | "poSupplytype":"1/ENG" |
poSupplierCode | Yes | Supplier code | "poSupplierCode":"1/AAMATT2" |
poDescription | Yes | Description | "poDescription":"Description" |
poOrderText | No | PO text tab description | "poOrderText":"Order text" |
poEstCost | No | Estimated cost | ""poEstCost": 25 |
poEstMarkUp | No | Estimated Markup% | "poEstMarkUp":100 |
poEstRecChgOut | No | Estimated charge | "poEstRecChgOut":50 |
poCurrencyCode | No | Currency code | "poCurrencyCode":"1\EUR" |
poCurrencyRate | No | Currency - rate | "poCurrencyRate":1.15 |
poCurrencyEstCost | No | Currency - estimated cost | "poCurrencyEstCost":50 |
poCurrencyEstCharge | No | Currency - estimated charge | "poCurrencyEstCharge":50 |
The currency estimated cost is related to the currency code passed. However, the estimated currency charge out relates to the currency of the job.
Example request:
http://<SERVER>/jsonapi/purchases.json?user=user&password=user&version=3.9&action=create&input={
"data": [
{
"poCurrencyEstCost": 25,
"poCurrencyEstCharge": 50,
"poJobandPhase": "1/00001076.002",
"poSupplytype": "1/ENG",
"poSupplierCode": "1/AAMATT2",
"poDescription": "Mypurchaseorder",
"poCurrencyCode": "1/EUR"
}
]
}
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"poCurrencyCode": "1/EUR",
"poCurrencyRate": 1.21,
"poCost": 0,
"poCurrencyCost": 0,
"poMarkup": 142.01,
"poCharge": 0,
"poCurrencyCharge": 0,
"poInvest": false,
"poInvestment": 0,
"poInvestmentMarkup": 0,
"poEstCost": 20.66,
"poCurrencyEstCost": 25,
"poEstMarkUp": 142.01,
"poEstRecChgOut": 50,
"poCurrencyEstCharge": 50,
"poOriginalCost": 0,
"poCurrencyOrigCost": 0,
"poInternal": 10008335,
"poUuid": "D6198877AB807C468CD3E80A9D81C19B",
"poTimeStampModified": 1522759412,
"poRecordVersionNumber": 2,
"poPONumber": "{EST}",
"poDateOrdered": "0000-00-00",
"poEstimatedDate": "2018-04-03",
"poSupplierCode": "1/AAMATT2",
"poSupplierContactInternalRef": 0,
"poSupplytype": "1/ENG",
"poInvoiceMemo": "",
"poDescription": "My purchase order ",
"poTheirRef": "",
"poOrderedByUserId": 3,
"poOrderText": "",
"poPicked": false,
"poPickedForQuote": false,
"poOption": ""
}
]
}