Responses and errors: responsePack¶
Pohoda answers with an rsp:responsePack file carrying the same id as
the incoming dataPack.
<rsp:responsePack version="2.0" id="imp-1" state="ok"
ico="12345678" note="Invoice import"
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
<rsp:responsePackItem version="2.0" id="FA001" state="ok">
<inv:invoiceResponse version="2.0" state="ok">
<rdc:producedDetails>
<rdc:id>1234</rdc:id>
<rdc:number>
<typ:numberRequested>26FV0001</typ:numberRequested>
</rdc:number>
</rdc:producedDetails>
</inv:invoiceResponse>
</rsp:responsePackItem>
</rsp:responsePack>
responsePack attributes¶
version, id, state are required; state is ok or error
(typ:stavType2). Also note, programVersion, ico / key
(the company that processed the XML) and dateTimeStamp.
responsePackItem has its own state and contains exactly one agenda
response (inv:invoiceResponse, adb:addressbookResponse,
ord:orderResponse…). The supported responses are listed in
docs/ResponseTypes.md of PHP-Pohoda-Connector.
Document details (documentresponse.xsd)¶
rdc:importDetailsa list of
rdc:detailwith errors and warnings raised while loading the document (state,errno,note, possibly anXPathpointing to the offending element).rdc:producedDetailsinformation on the created / changed record:
id,number,code,actionType.rdc:printDetailsattachments produced by printing (
idReportand Base64data) – see Printing and attachments.
States¶
ok– record processed.warning– processed with a warning (appears inrdc:detail; clients such as PHP-Pohoda-Connector handle it).error– record not saved; the reason is inimportDetails.
Warning
responsePack/@state="ok" does not mean all items succeeded: an error in
one dataPackItem shows in its responsePackItem. Always check the
state of every item.
Pohoda echoes the request note back even in a successful response – this
is not an error.
Common causes of errors¶
icoindataPackdoes not match the accounting unit, orperioddiffers from the current period.Non-existent reference (
idsof a pre-accounting, currency, centre, store).Duplicate
idwith duplicate checking enabled.Wrong encoding, or XML not matching the XSD (validate before sending).
The user lacks permission for the agenda (mServer: the HTTP interface).