259bit / idoklad-api-php-client
PHP client for iDoklad API v3
Requires
- php: ^7.4|^8.0
- ext-json: *
- jms/serializer: ^1.9
- marc-mabe/php-enum: ^4.4
- symfony/http-client: ^5.1|^6.0
- symfony/http-foundation: ^5.1|^6.0
Requires (Dev)
- phpstan/phpstan: ^0.12.50
- symplify/easy-coding-standard: ^8.3
This package is auto-updated.
Last update: 2025-01-30 16:29:55 UTC
README
Fill in
Installation
Fill in
Usage
Fill in
Supported use cases
Contact
Create contact
Usage
<?php use DobryProgramator\iDoklad\Enum\Country; use DobryProgramator\iDoklad\iDokladApiClient; use DobryProgramator\iDoklad\UseCase\Contact\CreateContact\CreateContactRequest; $idokladClient = new iDokladApiClient('clientId', 'clientSecret'); $createContactRequest = new CreateContactRequest('Acme Corporation', Country::CZECHIA()); $createContactRequest->setFirstname('John'); $createContactRequest->setSurname('Doe'); // All fields according to the documentation are available $response = $idokladClient->sendRequest($createContactRequest);
Enums
Country 🔗
Corresponds to iDoklad documentation, enum name is NameEnglish
.
Currency 🔗
Corresponds to iDoklad documentation, enum name is Code
.
DocumentType
Corresponds to iDoklad documentation, enum name is DocumentType
.
EetResponsibility
Exported
IsSentToPurchaser
Corresponds to iDoklad documentation, enum name is IsSentToPurchaser
.
ItemType
Corresponds to iDoklad documentation, enum name is ItemType
.
Payment option
PaymentStatus
Corresponds to iDoklad documentation, enum name is PaymentStatus
.
PriceType
ReportLanguage
VatOnPayStatus
VatRateType
Throwed exceptions
4xx
DobryProgramator\iDoklad\Exception\ApiRateExceededException
You API rate limit was exceeded. See iDoklad pricing 🔗 for more information.
DobryProgramator\iDoklad\Exception\BadRequestException
Bad request. Most likely you passed in wrong data, please check the documentation for integrity constraints.
DobryProgramator\iDoklad\UseCase\Authentication\AuthenticationException
Unable to authenticate. Either authentication request is wrong (which is unlikely), or your credentials are wrong.
DobryProgramator\iDoklad\Exception\NoActiveSubscriptionException
You either do not have an active subscription, or it expired. See my subscriptions page 🔗 for more information.
DobryProgramator\iDoklad\Exception\UnauthorizedException
iDoklad says you are not authenticated. This is most likely a bug in this library. Please create an issue.
5xx
DobryProgramator\iDoklad\Exception\CouldNotProcessResponseException
Throwed when iDoklad's response could not be parsed (e.g. when API response changed without maintaining BC).
DobryProgramator\iDoklad\Exception\iDokladServerException
Throwed when iDoklad API returns 5xx
HTTP code.