Party class represents either the seller or buyer in a FacturaE invoice. It supports both legal entities (companies) and natural persons.
Static Constructors
company()
Create a legal entity (company) party.Tax identification number (NIF/CIF)
Company legal name
Returns a new Party instance representing a company
person()
Create a natural person party.Tax identification number (NIF/DNI)
Person’s first name
Person’s first surname
Person’s second surname (optional)
Returns a new Party instance representing a person
Fluent Setters
address()
Set the party’s address.Street address
Postal code
Town/city name
Province name
ISO 3166-1 alpha-3 country code
Returns self for method chaining
tradeName()
Set the trade name (nombre comercial).Trade name
Returns self for method chaining
email()
Set the email address.Email address
Returns self for method chaining
phone()
Set the phone number.Phone number
Returns self for method chaining
fax()
Set the fax number.Fax number
Returns self for method chaining
website()
Set the website URL.Website URL
Returns self for method chaining
contactPeople()
Set the contact person name.Contact person name
Returns self for method chaining
cnoCnae()
Set the CNO or CNAE code (economic activity classification).CNO/CNAE code
Returns self for method chaining
ineTownCode()
Set the INE town code.INE town code
Returns self for method chaining
merchantRegister()
Set the merchant register data (Registro Mercantil).Book (Tomo)
Register name
Sheet (Hoja)
Folio
Section (Sección)
Volume (Libro)
Returns self for method chaining
centre()
Add an administrative centre.Role code (e.g., ‘01’ for fiscal, ‘02’ for receiver, ‘03’ for payer)
Centre code
Centre name
Returns self for method chaining
Getters
isLegalEntity()
Returns true if the party is a company, false if it’s a person
taxNumber()
Returns the tax identification number
name()
Returns the name (company name or person’s first name)
firstSurname()
Returns the first surname (only for persons)
lastSurname()
Returns the second surname (only for persons)
getTradeName()
Returns the trade name
getAddress()
Returns the Address entity
getEmail()
Returns the email address
getPhone()
Returns the phone number
getFax()
Returns the fax number
getWebsite()
Returns the website URL
getContactPeople()
Returns the contact person name
getCnoCnae()
Returns the CNO/CNAE code
getIneTownCode()
Returns the INE town code
getBook()
Returns the merchant register book
getMerchantRegister()
Returns the merchant register name
getSheet()
Returns the merchant register sheet
getFolio()
Returns the merchant register folio
getSection()
Returns the merchant register section
getVolume()
Returns the merchant register volume
getCentres()
Returns array of centres:
array<int, array{role: string, code: string, name: ?string}>