dobryprogramator/idoklad-api-php-client

PHP client for iDoklad API v3

v1.0.0 2022-07-29 15:06 UTC

README

Fill in

Installation

Fill in

Usage

Fill in

Supported use cases

Contact

Create contact

iDoklad documentation 🔗

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.