Skip to content

Get a company's accounting mode

POST
/accounting.profile
curl --request POST \
--url https://api.sancho-wms.pl/v1/accounting.profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "integrationId": 1 }'

Returns how the company behind integrationId keeps its books (bookkeeping: doubleEntry, or kpir or ryczalt for a company without double-entry books), the ISO 4217 currency it keeps them in (baseCurrency) and the ISO 3166 country whose tax law they follow (country). Reading the chart of accounts and the ledger settlement items needs only bookkeeping doubleEntry (422 notDoubleEntry otherwise), and a company without double-entry books lists no fiscal years and no journals. Opening ledger accounts, writing an accounting document with a proposedJournalEntry and accountingDocuments.post also need the ERP’s general-ledger module on the integration’s login, which ledgerLicensed reports (422 ledgerNotLicensed without it). Accounting documents without a proposed journal entry and cash work under every mode. bookkeeping is null when the company never chose one.

Media typeapplication/json
object
integrationId
required
number

Example generated

{
"integrationId": 1
}

Successful response

Media typeapplication/json
AccountingProfile
object
bookkeeping
required
Any of:
string
Allowed values: ryczalt kpir doubleEntry
baseCurrency
required
string
/^[A-Z]{3}$/
country
required
string
/^[A-Z]{2}$/
ledgerLicensed
required
boolean

Example

{
"bookkeeping": "ryczalt"
}

Bad request

Media typeapplication/json
error.BAD_REQUEST

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Bad request",
"issues": []
}

Unauthorized

Media typeapplication/json
error.UNAUTHORIZED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}

Payment required

Media typeapplication/json
error.PAYMENT_REQUIRED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"issues": []
}

Forbidden

Media typeapplication/json
error.FORBIDDEN

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Forbidden",
"issues": []
}

Not found

Media typeapplication/json
error.NOT_FOUND

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}

Unprocessable content

Media typeapplication/json
error.UNPROCESSABLE_CONTENT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNPROCESSABLE_CONTENT",
"message": "Unprocessable content",
"issues": []
}

Too many requests

Media typeapplication/json
error.TOO_MANY_REQUESTS

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests",
"issues": []
}

Internal server error

Media typeapplication/json
error.INTERNAL_SERVER_ERROR

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}

Service unavailable

Media typeapplication/json
error.SERVICE_UNAVAILABLE

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable",
"issues": []
}