Get an accounting document
const url = 'https://api.sancho-wms.pl/v1/accountingDocuments.get';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"integrationId":1,"id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sancho-wms.pl/v1/accountingDocuments.get \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "integrationId": 1, "id": 1 }'Returns one accounting document as the ERP holds it now, with its lines and each line’s tax category, its JPK_V7 marking (taxReporting, and otherJpkCodes for the codes that block has no place for), its proposed journal entry (proposedJournalEntry), the journal entry that books it (journalEntry, with that entry’s own status), and the cash-flow items that pay it (a document carried over from the ERP’s trade module, such as an invoice or a receipt, lists that trade document’s cash-flow items). Send modifiedAt back as the update’s expectedModifiedAt.
Authorizations
Abschnitt betitelt „Authorizations“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Responses
Abschnitt betitelt „Responses“Successful response
object
object
object
object
object
object
object
object
object
object
Example
{ "kind": "purchase", "documentType": "invoice", "origin": "invoice", "status": "draft", "eInvoice": { "system": "ksef" }, "journalEntry": { "status": "draft" }, "taxReporting": { "country": "PL", "ksefMarker": "OFF", "gtu": [ "GTU_01" ], "procedures": [ "WSTO_EE" ], "documentMarker": "FP" }, "integrationType": "comarch-optima", "transactionKind": "domestic", "lines": [ { "taxRate": { "category": "standardRated" }, "deductible": "full", "lineKind": "goods", "rateStatus": "exempt" } ], "cashFlowItems": [ { "direction": "incoming", "settlementStatus": "notApplicable" } ]}Bad request
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "BAD_REQUEST", "message": "Bad request", "issues": []}Unauthorized
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNAUTHORIZED", "message": "Unauthorized", "issues": []}Payment required
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "PAYMENT_REQUIRED", "message": "Payment required", "issues": []}Forbidden
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "FORBIDDEN", "message": "Forbidden", "issues": []}Not found
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "NOT_FOUND", "message": "Not found", "issues": []}Unprocessable content
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNPROCESSABLE_CONTENT", "message": "Unprocessable content", "issues": []}Too many requests
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "TOO_MANY_REQUESTS", "message": "Too many requests", "issues": []}Internal server error
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "INTERNAL_SERVER_ERROR", "message": "Internal server error", "issues": []}Service unavailable
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "SERVICE_UNAVAILABLE", "message": "Service unavailable", "issues": []}