Documentation Index
Fetch the complete documentation index at: https://mintlify.com/josemmo/Verifactu-PHP/llms.txt
Use this file to discover all available pages before exploring further.
AeatClient (josemmo\Verifactu\Services\AeatClient) is the primary entry point for communicating with the AEAT VERI*FACTU web service endpoint. It builds the SOAP envelope, attaches your mTLS certificate, and dispatches registration and cancellation records asynchronously using Guzzle’s promise-based HTTP client.
Constructor
The SIF (Sistema Informático de Facturación) metadata embedded in every record. See ComputerSystem.
The fiscal entity that issues the invoices (obligado a expedir la factura). See FiscalIdentifier.
An optional pre-configured Guzzle client. When
null, a new Client instance is created automatically. Supply your own to inject middleware, custom timeouts, or proxy settings.Configuration methods
All configuration methods returnstatic (the same AeatClient instance) so calls can be chained fluently.
setCertificate()
Filesystem path to an encrypted PEM certificate or a PKCS#12 (PFX) bundle.
Password for the certificate. Pass
null when the certificate has no password.setRepresentative()
Representative details, or
null to clear a previously set representative.This feature requires the represented fiscal entity to have completed the GENERALLEY58 form at AEAT before submissions are accepted.
setProduction()
Pass
true (default) to target the live production endpoint. Pass false to target the pre-production (testing) endpoint.| Value | Regular endpoint | Entity-seal endpoint |
|---|---|---|
true | https://www1.agenciatributaria.gob.es | https://www10.agenciatributaria.gob.es |
false | https://prewww1.aeat.es | https://prewww10.aeat.es |
setEntitySeal()
Pass
true when authenticating with an entity-seal certificate (sello de entidad). This switches the base URL to the www10 / prewww10 endpoints. Pass false (default) for regular personal/company certificates.setVoluntaryRemissionEndDate()
The end date of the voluntary remission period. The time component is ignored. Pass
null to clear a previously set value.Set to
true if the voluntary remission was at any point affected by a technical incident.setRequirementReference()
The AEAT requirement reference number, or
null to clear.Set to
true to signal that no further records will be submitted for this requirement.Sending records
send()
$records into a SOAP envelope and dispatches the request asynchronously.
The billing records to submit. May contain a mix of
RegistrationRecord and CancellationRecord instances. AEAT imposes a hard limit of 1,000 records per call.GuzzleHttp\Promise\PromiseInterface<AeatResponse>
Call ->wait() on the returned promise to block until the response arrives. The resolved value is an AeatResponse object with the following properties:
| Property | Type | Description |
|---|---|---|
csv | string|null | AEAT-assigned CSV identifier for the batch (only set when not rejected) |
submittedAt | DateTimeImmutable|null | Timestamp assigned by AEAT to the submission |
waitSeconds | int | Minimum seconds to wait before the next submission |
status | ResponseStatus | Overall batch status |
items | ResponseItem[] | Per-record status details |
Constants
| Constant | Value | Description |
|---|---|---|
AeatClient::NS_SOAPENV | http://schemas.xmlsoap.org/soap/envelope/ | SOAP envelope XML namespace |
AeatClient::NS_AEAT | https://www2.agenciatributaria.gob.es/…/SuministroLR.xsd | AEAT client XML namespace |