Creating a document
Document types
The document creation endpoint is generic for all transaction types, with all the setup being inferred from the DocTypeId
field.
Basic example
POST /api/purchaseInvoice
{
"DocTypeId": "PIN",
"ContactAccountId": "API1",
"Details": [
{
"ProductId": "WIDGETG",
"Quantity": 5,
"CurrencyUnitPrice": 4.99
}
]
}
Notes:
The above example create a PIN
document type which in our example maps to a Purchase Invoice (the exact type varies based on your environment configuration)
The API is flexible in terms of required fields that must be specified, and where they are not provided the data is calculated or inferred from the environment setup.
See the field reference for a description of how unspecified fields are computed.
Complete example
{
"LegalEntityId": "LE1",
"DocTypeId": "APPO",
"ContactAccountId": "SUP100",
"TaxAuthorityId": "IE",
"ResponsibleResourceId": "CM",
"DocDate": "2020-06-20",
"DueDate": "2020-07-19",
"TaxDate": "2020-07-19",
"Description": "Widgets",
"Currency": "EUR",
"CurrencyRate": 1.234567,
"TheirDocNo": "PIN-1999992",
"TheirRef": "W9128283",
"Post": {
"CostCentre": "A",
"Department": "B"
},
"Ext": {
"Custom1": "foo-bar"
},
"TextHeader": "Combines orders X and Y",
"TextFooter": "Free delivery on this order",
"Details": [
{
"ProductId": "WIDGETG",
"ProductSkuId": "W001",
"AccountId": "2020",
"Description": "Widgets",
"TaxBandId": "S",
"TaxCodeId": "SPG_OEC",
"Quantity": 10,
"IsNetEntry": false,
"CurrencyUnitPrice": 19.99,
"ProjectId": "PD",
"Post": {
"CostCentre": "A",
"Department": "B"
}
},
{
"AccountId": "30340",
"Description": "Management fees",
"CurrencyUnitPrice": 4.99,
"Post": {
"CostCentre": "X"
},
"TextPre": "Other fees: ",
"TextPost": "* Note the fee will increase from 1st of Jan."
}
]
}
Note the codes might vary in your environment so be sure to consult the available reference catalogs in Iplicit or via the catalogs endpoints