CoolCMS API

VatIdCheckTrait

Admin bridge to the VAT id verification, four-layer shape like the Front {@see \App\Core\Traits\Front\Models\Managers\VatIdCheckTrait}; asks `api/system/vat-id-check/*`.

Admin is a privileged role, so the Api applies no online limit. RBAC: admin needs :Api:System:VatIdCheck:verify and :Api:System:VatIdCheck:saveManual.

Table of Contents

Methods

findVatIdCheckHistory()  : array<string, mixed>
Evidence history of a VAT id, or of the registration number of a non-EU business (address country outside the EU, "document the company"). Read only, no online call.
saveVatIdManual()  : Result
Manual verification with a mandatory note (evidence). `$countryCode` + `$vatNumber` = the pair resolved by {@see verifyVatId()} (prefix wins over the address country).
verifyVatId()  : array<string, mixed>
`forceOnline` true = "verify online" (always an online call); false = the stored evidence only (badge, no online call).

Methods

findVatIdCheckHistory()

Evidence history of a VAT id, or of the registration number of a non-EU business (address country outside the EU, "document the company"). Read only, no online call.

public findVatIdCheckHistory(string $number, string|null $countryCode) : array<string, mixed>
Parameters
$number : string
$countryCode : string|null
Return values
array<string, mixed> —

countryCode, vatNumber, nonEuBusiness, businessDocumented, checks (newest first); empty on a bridge failure

saveVatIdManual()

Manual verification with a mandatory note (evidence). `$countryCode` + `$vatNumber` = the pair resolved by {@see verifyVatId()} (prefix wins over the address country).

public saveVatIdManual(string $countryCode, string $vatNumber, bool $valid, string $note) : Result
Parameters
$countryCode : string
$vatNumber : string
$valid : bool
$note : string
Return values
Result

verifyVatId()

`forceOnline` true = "verify online" (always an online call); false = the stored evidence only (badge, no online call).

public verifyVatId(string $vatId[, bool $forceOnline = false ][, string|null $countryCode = null ][, bool $automatic = false ]) : array<string, mixed>

automatic true = check after a save: online only for a VAT id of another EU state than the seller's (VatIdAutoCheckManager), answer carries automaticOnline.

Parameters
$vatId : string
$forceOnline : bool = false
$countryCode : string|null = null
$automatic : bool = false
Return values
array<string, mixed> —

verification (countryCode, vatNumber, verified, valid, source, checkedAt, flags, name, …), empty on a bridge failure

On this page

Search results