Plentymarkets interface documentation

Accounting

Contracts

AccountingLocationRepositoryContract

The repository to get, create, update and delete accounting locations.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public get($id):Plenty\Modules\Accounting\Models\AccountingLocation
Return type: AccountingLocation

Get an accounting location. The ID of the location must be specified.

Parameters

Name

Type

Description

$id

int

public getAll():Plenty\Modules\Accounting\Models\AccountingLocation
Return type: AccountingLocation

List all accounting locations *

public listByPlentyId($plentyId):void

List accounting locations for a client. The plenty ID of the client must be specified.

Parameters

Name

Type

Description

$plentyId

int

public create($data):Plenty\Modules\Accounting\Models\AccountingLocation
Return type: AccountingLocation

Create an accounting location.

Parameters

Name

Type

Description

$data

array

public update($id, $data):Plenty\Modules\Accounting\Models\AccountingLocation
Return type: AccountingLocation

Update an accounting location. The ID of the location must be specified.

Parameters

Name

Type

Description

$id

int

$data

array

public delete($id):bool

Delete an accounting location. The ID of the location must be specified.

Parameters

Name

Type

Description

$id

int

public getSettings($id):Plenty\Modules\Accounting\Models\AccountingLocationSettings
Return type: AccountingLocationSettings

Get accounting location settings. The ID of the location must be specified.

Parameters

Name

Type

Description

$id

int

The accounting location Id

public updateSettings($id, $data):Plenty\Modules\Accounting\Models\AccountingLocationSettings
Return type: AccountingLocationSettings

Update accounting location settings. The ID of the location must be specified.

Parameters

Name

Type

Description

$id

int

The accounting location Id

$data

array

The request data

AccountingServiceContract

Provides methods to detect a location ID.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public detectLocationId($plentyId, $countryId = null):int

Get a location ID for a country of delivery. The plenty ID must be specified and the ID of the country of delivery can be specified. If the ID of a country is not specified, the ID of the standard location of the specified client will be returned.

Parameters

Name

Type

Description

$plentyId

int

The plenty ID of the client (store). The default client will be used if the plenty ID is not specified.

$countryId

int

The ID of the country of delivery. The standard location of the specified client will be returned, if no ID of a country of delivery is specified.

public detectLocationIdByClientId($clientId = null, $countryId = null):int

Get the location ID for a country of delivery. The ID of the client and the ID of the country of delivery can be specified. If neither the client ID nor the ID of a country are specified, the ID of the standard location of the default client will be returned.

Parameters

Name

Type

Description

$clientId

int

The ID of the client. The default client (ID 0) will be used if the ID of client is not specified.

$countryId

int

The ID of the country of delivery. The standard location of the specified client will be returned, if no ID of a country of delivery is specified.

public getAccountingLocations($plentyId, $countryId = null):array

List accounting locations. The plenty ID must be specified and the ID of a country of delivery can be specified. If the ID of the country is specified, only one accounting location will be returned. If the ID of the country is not specified, all accounting locations of the client will be returned.

Parameters

Name

Type

Description

$plentyId

int

The plenty ID of the client (store).

$countryId

int

The ID of the country of delivery.

public getAccountingLocationsByClient($clientId = null, $countryId = null):array

List accounting locations. The ID of the client and the ID of the country of delivery can be specified. If neither the client ID nor the ID of a country are specified, all accounting locations of the default client will be returned.

Parameters

Name

Type

Description

$clientId

int

The ID of the client. The default client (ID 0) will be used if the ID of client is not specified.

$countryId

int

The ID of the country of delivery.

DebtorAccountRepositoryContract

The DebtorAccountRepositoryContract is the interface for the DebtorAccountRepository. This interface allows you to either list debtor accounts by locationId or by locationId and mode. The mode describes the criteria that is used to assign pending amounts to debtor accounts.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public findByLocationId($locationId):Plenty\Modules\Accounting\Models\DebtorAccountConfiguration
Return type: DebtorAccountConfiguration

Get debtor account configuration of an accounting location. The ID of the accounting location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location.

public listByLocationIdAndMode($locationId, $mode):void

Lists debtor accounts by mode for an accounting location . The mode and the accounting location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location.

$mode

string

Specifies the mode of the debtor accounts. There are 4 different modes available. These modes are: <ul> <li>character</li> <li>country</li> <li>payment</li> <li>country_payment</li> </ul> The modes are described in detail in the DebtorAccountConfiguration model as well as DebtorAccount model.

public update($locationId, $data):Plenty\Modules\Accounting\Models\DebtorAccountConfiguration
Return type: DebtorAccountConfiguration

Updates the debtor account configuration of an accounting location. The ID of the accounting location has to be specified.

Parameters

Name

Type

Description

$locationId

int

$data

array

DetermineShopCountryContract

This interface provides methods to initialise the country of a location or the country of an order as well as methods to get the ID of a client, the plenty ID of a client, the country or the ID of country.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public initByClientId($clientId):void

Initialise the country of the standard location of a client. The ID of the client must be specified.

Parameters

Name

Type

Description

$clientId

int

The ID of the client [optional, default=0]

public initByPlentyId($plentyId):void

Initialise the country of the standard location of a client. The plenty ID of the client can be specified. If no plenty ID is specified, the standard client will be used.

Parameters

Name

Type

Description

$plentyId

int

The plenty ID of the client [optional]

public initByLocationId($locationId):void

Initialise the country of a location. The ID of the location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the location

public initByOrderId($orderId):void

Initialise the country for an order. The ID of the order must be specified.

Parameters

Name

Type

Description

$orderId

int

The ID of the order

public getCountryId():int

Get the ID of the country of the current standard location. One of the initialise methods must be called first. The client that was initialised with the initialise method is your current client.

public getClientId():int

Get the ID of the current client. One of the initialise methods must be called first. The client that was initialised with the initialise method is your current client.

public getPlentyId():int

Get the plenty ID of the current client. One of the initialise methods must be called first. The client that was initialised with the initialise method is your current client.

public getCountryIdByClientId($clientId):int

Get the ID of the country of a client's standard location. The ID of the client must be specified.

Parameters

Name

Type

Description

$clientId

int

The ID of the client. The ID of the default client will be used if no ID is specified [optional, default=0].

public getCountryIdByPlentyId($plentyId):int

Get the ID of the country of a client's standard location. The plenty ID of the client must be specified.

Parameters

Name

Type

Description

$plentyId

int

The plenty ID of a client

public getCountryIdByClientIdAndCountryId($clientId, $countryId):int

Get the country of a client's standard location. The ID of the client and the ID of the country must be specified.

Parameters

Name

Type

Description

$clientId

int

The ID of the client.

$countryId

int

The ID of the country.

public getCountryIdByLocationId($locationId):int

Get the country of a location. The ID of the location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the location.

PostingKeyRepositoryContract

The PostingKeyRepositoryContract is the interface for the PostingKeyRepository. This interface provides the functionality to find the posting keys for an accounting location.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public findByLocationId($locationId):Plenty\Modules\Accounting\Models\PostingKeyConfiguration
Return type: PostingKeyConfiguration

Get the posting key configuration of an accounting location. The ID of the accounting location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

public update($locationId, $data):Plenty\Modules\Accounting\Models\PostingKeyConfiguration
Return type: PostingKeyConfiguration

Updates a posting key configuration of an accounting location. The ID of the accounting location has to be specified.

Parameters

Name

Type

Description

$locationId

int

$data

array

RevenueAccountRepositoryContract

The RevenueAccountRepositoryContract is the interface for the RevenueAccountRepository. This interface allows you to either list revenue accounts by locationId, find by locationId and countryId or to least all for an accounting location.

Namespace

Plenty\Modules\Accounting\Contracts

Methods
public listRevenueAccounts($page = 1, $itemsPerPage = 50):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List revenue account configurations for all accounting locations. Each accounting location has one revenue account configuration.

Parameters

Name

Type

Description

$page

int

The page to get. The default page that will be returned is page 1.

$itemsPerPage

int

The number of revenue accounts to be displayed per page. The default number of revenue accounts is 50.

public findByLocationId($locationId):Plenty\Modules\Accounting\Models\RevenueAccountLocationConfiguration
Return type: RevenueAccountLocationConfiguration

Get the revenue account configuration of an accounting location. The ID of the accounting location must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

public findByLocationIdAndCountryId($locationId, $countryId):Plenty\Modules\Accounting\Models\RevenueAccountCountryConfiguration
Return type: RevenueAccountCountryConfiguration

Get the revenue account configuration of a country. The country account configuration is associated with an accounting location. The ID of the accounting location that the country is associated with as well as the ID of the country must be specified.

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

$countryId

int

The ID of the country

public update($locationId, $data):Plenty\Modules\Accounting\Models\RevenueAccountLocationConfiguration
Return type: RevenueAccountLocationConfiguration

Updates the revenue account configuration of an accounting location. The ID of the accounting location has to be specified.

Parameters

Name

Type

Description

$locationId

int

$data

array

Exceptions

AccountingException

Class AccountingException

Namespace

Plenty\Modules\Accounting\Exceptions

Models

AccountingLocation

The accounting location model. An accounting location always has a country and belongs to a client. An accounting location contains the VAT configurations. The VAT model contains the VAT configuration.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

id

int

The ID of the accounting location

countryId

int

The ID of the country of the accounting location

name

string

The name of the accounting location

clientId

int

The ID of the client that the accounting location belongs to

plentyId

int

The plenty ID of the client that the accounting location belongs to

vats

array

A collection of VAT configurations that are related to the accounting location

country

Country

The country that the accounting location belongs to

client

Webstore

The client (store) this accounting location belongs to

Methods
public toArray()

Returns this model as an array.

AccountingLocationSettings

The accounting location settings model.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

locationId

int

The ID of the accounting location

isInvoiceEUNet

bool

Is the invoice net for EU?

isInvoiceExportNet

bool

Is the invoice net for export?

showShippingVat

bool

Show the vat for shipping costs on the invoice?

isSmallBusiness

bool

Is it a small business?

numberOfDecimalPlaces

int

The number of decimal places for prices

roundTotalsOnly

bool

Do only round totals?

isReverseCharge

bool

Is the reverse charge method activated?

Methods
public toArray()

Returns this model as an array.

DebtorAccount

The DebtorAccountValue Model which contains the actual configured debtor accounts by character, payment and country.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

accountId

int

The ID of the debtor account configuration that the debtor account belongs to

mode

string

The mode describes the criteria based on which pending amounts are assigned to a debtor account. The following modes are available: <ul> <li>character = The debtor accounts are selected based on the first character of customer information. The information and the order of the information that will be used are defined with the sequence. There are 3 different sequences available.</li> <li>payment = The debtor accounts are selected based on the payment method.</li> <li>country = The debtor accounts are selected based on the country of delivery.</li> <li>country_payment = The debtor accounts are selected based on two criteria. The first criteria is the country and if the country is same as the country of the accounting location then the payment method is used to select the deptor account.</li> </ul>

key

string

The key depends on the debtor account mode. <ul> <li>For the character mode the keys are letters. The letters indicate the first letter of the customer information that was used to assign the pending amounts.</li> <li>For the payment mode the key is the ID of payment method.</li> <li>For the country mode the key is the ID of the country.</li> <li>For the country_payment mode the key is either the ID of the country or the ID of payment method. If the country is the same as the country of the accounting location then the payment methods are used to select the deptor account.</li> </ul>

value

string

The actual debtor account.

account

DebtorAccountConfiguration

The debtor account configuration this account is associated with.

Methods
public toArray()

Returns this model as an array.

DebtorAccountConfiguration

The debtor account configuration model. The configuration is a set of debtor accounts. The actual number of debtor accounts within the configuration depends on the mode used to assign pending amounts to debtor accounts.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

id

int

The ID of the debtor account configuration

locationId

int

The ID of the accounting location that the debtor account is associated with.

mode

string

The mode describes the criteria based on which pending amounts are assigned to a debtor account. The following modes are available: <ul> <li>character = The debtor accounts are selected based on the first character of customer information. The information and the order of the information that will be used are defined with the sequence. There are 3 different sequences available.</li> <li>payment = The debtor accounts are selected based on the payment method.</li> <li>country = The debtor accounts are selected based on the country of delivery.</li> <li>country_payment = The debtor accounts are selected based on two criteria. The first criteria is the country and if the country is same as the country of the accounting location then the payment method is used to select the deptor account.</li> </ul>

sequence

string

The sequence defines the order in which customer information will be used for the debtor account assignment if the character made has been chosen. The following sequences are available: <ul> <li>FNV = stands for the sequence: company, lastname, firstname</li> <li>NVF = stands for the sequence: lastname, firstname, company</li> <li>NFV = stands for the sequence: lastname, company, firstname</li> </ul>

standard

string

The standard debtor account that will be used if no matching debtor account can be found.

save

bool

Flag that indicates if the debtor account shall be saved within the contact data.

accounts

The actual debtor accounts

Methods
public toArray()

Returns this model as an array.

PostingKey

The Posting Key Model. A posting key is always associated with an accounting location and holds an posting key for each configured vat rate.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

id

int

The Id posting key in relation to the vatrate.

value

string

The actual posting key for the vat rate.

Methods
public toArray()

Returns this model as an array.

PostingKeyConfiguration

The posting key configuration model. A posting key configuration is a set of 4 posting keys. A posting key configuration is always associated with an accounting location and can have a posting key per VAT rate. A posting key defines how line items are booked to accounts.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

locationId

int

The ID of the accounting location that the configuration belongs to

postingKeys

The posting keys for this configuration

location

AccountingLocation

The name of the accounting location that the configuration belongs to

Methods
public toArray()

Returns this model as an array.

RevenueAccount

The revenue account model provides information on a single revenue account. The ID of an account matches the ID of a VAT rate.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

id

int

The ID of the account. The account IDs are always 0,1,2 or 3. This way the IDs indicate the VAT rate that the account is used for. The revenues that were made with items that have the VAT rate with the ID 0 are assigned to the account with the ID 0.

account

int

The actual account number that was entered in the entry field.

Methods
public toArray()

Returns this model as an array.

RevenueAccountCountryConfiguration

The revenue account country configuration model. The revenue account country configuration is a set of up to 4 revenue accounts for one country. Each country that you need to pay VAT in needs a configuration. The 4 revenue account included in the configuration are associated with VAT rates. The VAT rate that one revenue account is associated with can be identified by the ID of the VAT rate. The ID of the VAT rate is included in the account name. Furthermore, each revenue account country configuration is part of a revenue account location configuration. A revenue account country configuration is only available if a VAT configuration for the country exists.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

countryId

int

The ID of the country that the account configuration belongs to

revenueAccountLocationId

int

The ID configuration of the revenue account that these accounts are for.

revenueAccounts

A list of the actual revenue accounts. The accounts are associated with VAT rate. The association can be identified by

country

Country

The country these accounts are associated with.

locationConfiguration

RevenueAccountLocationConfiguration

The revenue account configuration these accounts are associated with

Methods
public toArray()

Returns this model as an array.

RevenueAccountLocationConfiguration

The revenue account location configuration model. A revenue account location configuration is the set of all revenue accounts that belong to one accounting location.

Namespace

Plenty\Modules\Accounting\Models

Properties
Name Type Description

id

int

The ID of the revenue account configuration

locationId

int

The ID of the accounting location that the configuration belongs to

accountEu

string

The account used for revenues that are exempt from VAT and that were sold within the European Union

accountExport

string

The account used for revenues that are exempt from VAT and that were sold to outside the European Union

revenueAccountCountryConfigurations

The set of revenue accounts of one country

Methods
public toArray()

Returns this model as an array.

Vat

Contracts

VatInitContract

This interface provides methods to initialise the detection of a VAT configuration and to actually detect VAT rates or VAT fields.

Namespace

Plenty\Modules\Accounting\Vat\Contracts

Methods
public init($billingCountryId, $taxIdNumber, $locationId, $shippingCountryId, $startedAt = null):void

Initialise the VAT system data

Parameters

Name

Type

Description

$billingCountryId

int

The ID of the country of the invoice address

$taxIdNumber

string

The tax identification number

$locationId

int

The ID of the location

$shippingCountryId

int

The ID of the country of the shipping address. [optional, default=0]

$startedAt

string

The date when the VAT configuration went into effect. If no date is set, the current date will be used.

public isInitialized():bool

Get whether the VAT system is already initialised or not

public getVatField($vatRate, $restrictedToDigitalItems = false):int

Get the VAT field for a VAT rate

Parameters

Name

Type

Description

$vatRate

float

The VAT rate to be used to find the VAT field

$restrictedToDigitalItems

bool

Flag that indicates if the VAT is restricted to digital items or not. <br />True = the VAT is restricted to digital items <br />False = the VAT is used for all items

public getVatRate($vatField, $restrictedToDigitalItems = false):float

Get the VAT rate of a VAT field

Parameters

Name

Type

Description

$vatField

int

The VAT field (0-5).

$restrictedToDigitalItems

bool

Flag that indicates if the VAT is restricted to digital items or not. <br />True = the VAT is restricted to digital items <br />False = the VAT is used for all items

public getRevenueAccount($vatField, $restrictedToDigitalItems = false):string

Get the revenue account of a VAT field

Parameters

Name

Type

Description

$vatField

int

The VAT field (0-5).

$restrictedToDigitalItems

bool

Flag that indicates if the VAT is restricted to digital items or not. <br />True = the VAT is restricted to digital items <br />False = the VAT is used for all items

public getUsingVat($restrictedToDigitalItems = false):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get the VAT configuration to be used for VAT calculation

Parameters

Name

Type

Description

$restrictedToDigitalItems

bool

Flag that indicates if the VAT is restricted to digital items or not. <br />True = the VAT is restricted to digital items <br />False = the VAT is used for all items

public getUsingVatRates($restrictedToDigitalItems = false):array

Get the VAT rates to be used for VAT calculation

Parameters

Name

Type

Description

$restrictedToDigitalItems

bool

Flag that indicates if the VAT is restricted to digital items or not. <br />True = the VAT is restricted to digital items <br />False = the VAT is used for all items

public getStandardVatByLocationId($locationId, $startedAt = null):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get a standard VAT configuration of an accounting location

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

$startedAt

string

The date when the VAT configuration went into effect. The date is in W3C format.

public getTaxIdNumber():string

Get the tax ID number used for tax determination.

VatRepositoryContract

The VatRepositoryContract is the interface for the VAT functionality. This interface allows you to get the VAT configuration for an accounting location and a country of delivery.

Namespace

Plenty\Modules\Accounting\Vat\Contracts

Methods
public findById($id):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get a VAT configuration

Parameters

Name

Type

Description

$id

int

The ID of the VAT configuration

public getStandardVat($plentyId = null, $startedAt = null):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get the standard VAT configuration for a plenty ID

Parameters

Name

Type

Description

$plentyId

int

The ID of the client (store)

$startedAt

string

The date when the VAT configuration went into effect. The date is given in W3C format.

public getStandardVatByLocation($locationId, $startedAt = null):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get the standard VAT configuration for a location ID

Parameters

Name

Type

Description

$locationId

int

The ID of the location.

$startedAt

string

The date when the VAT configuration went into effect. The date is given in W3C format.

public getVat($locationId, $countryId, $startedAt = null):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Gets the VAT configuration

Parameters

Name

Type

Description

$locationId

int

The ID of the location.

$countryId

int

The ID of the country.

$startedAt

string

The date when the VAT configuration went into effect. The date is given in W3C format.

public findVat($page = 1, $itemsPerPage = \Plenty\Modules\Accounting\Vat\Models\Vat::ITEMS_PER_PAGE, $relations = [], $columns = []):array

List VAT configurations

Parameters

Name

Type

Description

$page

int

The page to be returned. If no page is specified, the first page will be returned.

$itemsPerPage

int

The number of items per page. If not given, the model’s default number will be used.

$relations

array

The relations to load with the VAT object. The relations available are "location" and "country".

$columns

array

The columns to load in the response

public findVatByLocationId($locationId, $relations = [], $columns = []):array

List VAT configurations for an accounting location

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

$relations

array

The relations to load with the VAT object. The relations available are "location" and "country".

$columns

array

The columns to load in the response

public findVatByLocationIdAndCountry($locationId, $countryId, $relations = [], $columns = []):array

List VAT configuration for a country of delivery

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

$countryId

int

The ID of the country of delivery

$relations

array

The relations to load with the VAT object. The relations available are "location" and "country".

$columns

array

The columns to load in the response.

public findVatByLocationIdAndDate($locationId, $date, $relations = [], $columns = []):array

List VAT configuration for a date

Parameters

Name

Type

Description

$locationId

int

The ID of the accounting location

$date

string

The started at date

$relations

array

The relations to load with the VAT object. The relations available are "location" and "country".

$columns

array

The columns to load in the response.

public getVatById($id):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get a VAT configuration by id

Parameters

Name

Type

Description

$id

int

public createVat($data):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Create a VAT configuration

Parameters

Name

Type

Description

$data

array

public updateVat($id, $data):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Update a VAT configuration

Parameters

Name

Type

Description

$id

int

$data

array

public deleteVat($id):void

Delete a VAT configuration

Parameters

Name

Type

Description

$id

int

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

VatServiceContract

Provides methods for a quick search of VAT fields, VAT rates and VAT names of a specific VAT configuration.

Namespace

Plenty\Modules\Accounting\Vat\Contracts

Methods
public getVatField($vat, $vatRate):int

Get the VAT field for a VAT rate.

Parameters

Name

Type

Description

$vat

Vat

The VAT configuration of a country

$vatRate

float

The VAT rate

public getVatRate($vat, $vatField):float

Get the VAT rate for a VAT field.

Parameters

Name

Type

Description

$vat

Vat

The VAT configuration of a country

$vatField

int

The VAT field

public getVatName($vat, $vatField):string

Get the name of a VAT field.

Parameters

Name

Type

Description

$vat

Vat

The VAT configuration of a country

$vatField

int

The VAT field

public getRevenueAccount($vat, $vatField):string

Get the revenue account for the given vat field.

Parameters

Name

Type

Description

$vat

Vat

The country VAT instance.

$vatField

int

The vat field.

Exceptions

VatException

Class VatException

Namespace

Plenty\Modules\Accounting\Vat\Exceptions

Models

Vat

The VAT model contains the complete VAT configuration in plentymarkets. The VAT configuration is based on 4 VAT rates. A VAT configuration always belongs to an accounting location. The accounting location is in a specified country and is assigned to a client. One accounting location can have several VAT configurations, but only one is active at a time. Which one is active depends on the startedAt date. This also means that only one VAT number is active per accounting location.

Namespace

Plenty\Modules\Accounting\Vat\Models

Properties
Name Type Description

id

int

The ID of the VAT configuration. A VAT configuration includes 4 VAT rates

countryId

int

The ID of the country that the VAT configuration belongs to

taxIdNumber

string

The tax id number of VAT configuration.

startedAt

The date when the VAT configuration went into effect

invalidFrom

The date when the VAT configuration should not be used any more

locationId

int

The ID of the location

marginScheme

string

Specifies the tax rate that is used, when the margin scheme is applied. Available values: 'none', 'vat1', 'vat2', 'vat3', 'vat4'.

isRestrictedToDigitalItems

bool

Flag that indicates if the VAT configuration is used only applied to digital goods or not. True= The VAT set is only applied to digital goods. False = The VAT set is applied to all types of goods.

isStandard

bool

Flag that indicates if the VAT configuration is the standard VAT configuration for the location

createdAt

The date at which the VAT configuration was created.

updatedAt

The date that the VAT configuration was last updated.

isActive

bool

Is this the active VAT configuration for this location and country? (read-only)

location

AccountingLocation

The accounting location that the VAT configuration belongs to. Each accounting location is assigned to a country and only one accounting location is allowed per country.

country

Country

The country that the VAT configuration belongs to

vatRates

array

The VAT rates of a VAT configuration

Methods
public toArray()

Returns this model as an array.

VatRate

The VAT rate model is always associated with a VAT configuration and contains the ID, name and percentage of a VAT rate. Each VAT configuration can have 4 rates.

Namespace

Plenty\Modules\Accounting\Vat\Models

Properties
Name Type Description

id

int

The ID of the VAT rate

vatRate

float

The percentage of the VAT rate, e.g. 19.00 for 19 %

name

string

The name of a VAT rate

revenueAccount

string

The revenue account for the VAT rate

Methods
public toArray()

Returns this model as an array.