Plentymarkets interface documentation

Variables

Contracts

DocumentBuilderVariablesContainerContract

A container service for DocumentBuilder variables and variable groups registration

Namespace

Plenty\Modules\Document\Builder\Variables\Contracts

Methods
public registerVariableGroup($group):void

Register a variable group.

Parameters

Name

Type

Description

$group

VariableGroup

public registerVariable($variable):void
Parameters

Name

Type

Description

$variable

Variable

Enums

VariablesObjectTypeEnum

An enum type with all objects available for variables.

Namespace

Plenty\Modules\Document\Builder\Variables\Enums

Methods
public toArray()

Returns this model as an array.

Events

DocumentBuilderVariablesRegistering

An event class, which will be triggered, when the DocumentBuilder variables are registered.

Namespace

Plenty\Modules\Document\Builder\Variables\Events

Methods
public toArray()

Returns this model as an array.

Models

DynamicVariable

The base class for dynamically detected variables.

Namespace

Plenty\Modules\Document\Builder\Variables\Models

Methods
public toArray()

Returns this model as an array.

DynamicVariableGroup

A variable group that can be used to register dynamically determined variables.

Namespace

Plenty\Modules\Document\Builder\Variables\Models

Methods
public toArray()

Returns this model as an array.

Variable

The base class for DocumentBuilder variables.

Namespace

Plenty\Modules\Document\Builder\Variables\Models

Methods
public toArray()

Returns this model as an array.

VariableGroup

The base class for DocumentBuilder variable groups.

Namespace

Plenty\Modules\Document\Builder\Variables\Models

Methods
public toArray()

Returns this model as an array.

AddressGroup

AddressBaseVariable

The base class for all address variables

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Variables\AddressGroup

Methods
public toArray()

Returns this model as an array.

ExternalCustomerIDVariable

The external customer ID address option variable (only for invoice and delivery address)

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Variables\AddressGroup

Methods
public toArray()

Returns this model as an array.

Services

VariablesResolutionService

The service for variables resolution

Namespace

Plenty\Modules\Document\Builder\Variables\Services

Methods
public setLanguage($language):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set the language to be used by the variables resolution.

Parameters

Name

Type

Description

$language

string

public setOrder($order):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set the order into the variables context

Parameters

Name

Type

Description

$order

Order

public setDocument($document):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set the document into the variables context

Parameters

Name

Type

Description

$document

Document

public setMetaData($metaData):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set the meta data of the template into the variables context

Parameters

Name

Type

Description

$metaData

array

public setContact($contact):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set the contact into the variables context

Parameters

Name

Type

Description

$contact

Contact

public setObject($typeEnum, $object):Plenty\Modules\Document\Builder\Variables\Services\VariablesResolutionService
Return type: VariablesResolutionService

Set an object into the variables context.

Parameters

Name

Type

Description

$typeEnum

string

A VariablesObjectTypeEnum constant

$object

Models

Context

ObjectEntry

This class represents an object entry with the object type and the object itself.

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Context

Properties
Name Type Description

objectType

string

A VariablesObjectTypeEnum constant

object

Methods
public toArray()

Returns this model as an array.

PluginContext

Informations about plugin entries for the plugin variables (old logic).

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Context

Methods
public toArray()

Returns this model as an array.

VariablesContext

This class is a container for all available object entries

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Context

Methods
public toArray()

Returns this model as an array.

VariablesResolution

This class can be used by variables to get the needed objects and to push resolved variable content.

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Context

Methods
public toArray()

Returns this model as an array.

Groups

AddressGroup

The order address variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

AddressTypeBaseGroup

The order address type variable group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

BankDataGroup

The BankData variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

CompanyGroup

The Company variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

ContactBankDataGroup

The ContactBankData variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

ContactGroup

The contact variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

DocumentGroup

The Document variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

HeaderFooterGroup

The HeaderFooter variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderForeignAmountGroup

The OrderForeignAmount variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderGroup

The Order variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderItemForeignAmountGroup

The OrderItemForeignAmount variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderItemGroup

The OrderItem variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderItemPropertyGroup

The OrderItemProperty variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderItemSystemAmountGroup

The OrderItemSystemAmount variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderPropertyGroup

The OrderPropety variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

OrderSystemAmountGroup

The OrderSystemAmount variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

PaymentGroup

The Order Payment variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

PluginGroup

The Plugin variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

ShipmentGroup

The Shipment variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

VariationGroup

The order item Variation variables group

Namespace

Plenty\Modules\Document\Builder\Variables\Models\Groups

Methods
public toArray()

Returns this model as an array.

Document

Contracts

DocumentRepositoryContract

Download and list order documents as well as download, list, upload and delete category documents.

Namespace

Plenty\Modules\Document\Contracts

Methods
public getDocumentPath($id):void

Get the path to a document

Parameters

Name

Type

Description

$id

int

The ID of the document

public findById($id, $columns = [], $with = []):Plenty\Modules\Document\Models\Document
Return type: Document

Get a document

Parameters

Name

Type

Description

$id

int

The ID of the document

$columns

array

The columns to be loaded

$with

array

The relations to be loaded. Possible value is "references".

public find($page = 1, $itemsPerPage = 50, $columns = [], $with = [], $sortBy = "id", $sortOrder = "desc"):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List documents

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 orders to be displayed per page. The default number of orders per page is 50.

$columns

array

The columns to be loaded

$with

array

The relations to be loaded. Possible value is "references".

$sortBy

string

This field is used for sorting. Default is 'id'. Possible values are 'id', 'type', 'number', 'createdAt', 'displayDate', 'updatedAt'

$sortOrder

string

The order to sort by. Possible values are 'asc' and 'desc'.

public uploadOrderDocuments($orderId, $type, $data):array

Upload order documents

Parameters

Name

Type

Description

$orderId

int

The ID of the order

$type

string

The document type. Supported types are 'invoiceExternal', 'deliveryNote', 'poDeliveryNote', 'orderConfirmation', 'offer', 'dunningLetter', 'returnNote', 'successConfirmation', 'correction', 'creditNoteExternal', 'reorder', 'uploaded'.

$data

array

The request data

public deleteOrderDocument($orderId, $documentId):bool

Delete order document

Parameters

Name

Type

Description

$orderId

int

The ID of the order

$documentId

int

The ID of the document

public archiveOrderDocument($orderId, $documentId):void

Archive order document

Parameters

Name

Type

Description

$orderId

int

The ID of the order

$documentId

int

The ID of the document

public uploadCategoryDocuments($categoryId, $data):array

Upload category documents

Parameters

Name

Type

Description

$categoryId

int

The ID of the category

$data

array

The request data

public deleteCategoryDocument($categoryId, $documentId):bool

Delete a category document.

Parameters

Name

Type

Description

$categoryId

int

The ID of the category

$documentId

int

The ID of the document

public uploadOrderShippingPackageDocuments($packageId, $type, $document):array

Uploads documents

Parameters

Name

Type

Description

$packageId

int

$type

string

$document

string

base64 encoded document

public findOrderShippingPackageDocuments($packageId, $type):array

Find documents

Parameters

Name

Type

Description

$packageId

int

$type

string

public findCurrentOrderDocument($orderId, $type, $includePending = false):Plenty\Modules\Document\Models\Document
Return type: Document

Finds the current order document

Parameters

Name

Type

Description

$orderId

int

$type

string

$includePending

bool

public findRecentOrderDocument($orderId, $type, $includePending = false):Plenty\Modules\Document\Models\Document
Return type: Document

Finds order document.

Parameters

Name

Type

Description

$orderId

int

$type

string

$includePending

bool

public deleteOrderShippingPackageDocuments($packageId):bool

Delets a document.

Parameters

Name

Type

Description

$packageId

int

public getDocumentStorageObject($key):void

Gets a document storage object.

Parameters

Name

Type

Description

$key

public uploadOrderReturnsDocuments($returnsId, $document):Plenty\Modules\Document\Models\Document
Return type: Document

Uploads a specific document.

Parameters

Name

Type

Description

$returnsId

int

$document

string

public getOrderReturnsDocumentById($returnsId, $withLabel = false):Plenty\Modules\Document\Models\Document
Return type: Document

Finds a document.

Parameters

Name

Type

Description

$returnsId

int

$withLabel

bool

public generateOrderDocument($orderId, $type, $data):bool

Generate order document

Parameters

Name

Type

Description

$orderId

int

The ID of the order

$type

string

The document type

$data

array

The request data

public documentWithoutReversalDocumentExists($orderId, $documentTypes):bool

Check if there is a document without a reversed counter part

Parameters

Name

Type

Description

$orderId

int

The ID of the order

$documentTypes

array

The document types

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.

Enums

DocumentGroupTypeEnum

A list of document type groups

Namespace

Plenty\Modules\Document\Enums

Methods
public toArray()

Returns this model as an array.

DocumentTypeEnum

A list of document types

Namespace

Plenty\Modules\Document\Enums

Methods
public toArray()

Returns this model as an array.

Models

Document

The document model contains information about actual documents.

Namespace

Plenty\Modules\Document\Models

Properties
Name Type Description

id

int

The ID of the document

type

string

The type of the document. The following types are available: <ul> <li>admin</li> <li>blog</li> <li>category</li> <li>correction_document</li> <li>credit_note</li> <li>credit_note_external</li> <li>customer</li> <li>delivery_note</li> <li>dunning_letter</li> <li>ebics_hash</li> <li>facet</li> <li>invoice</li> <li>invoice_external</li> <li>pos_invoice</li> <li>pos_invoice_cancellation</li> <li>item</li> <li>multi_credit_note</li> <li>multi_invoice</li> <li>offer</li> <li>order_confirmation</li> <li>pickup_delivery</li> <li>receipt</li> <li>refund_reversal</li> <li>reorder</li> <li>repair_bill</li> <li>return_note</li> <li>reversal_document</li> <li>settlement_report</li> <li>success_confirmation</li> <li>ticket</li> <li>webshop</li> <li>webshop_customer</li> <li>z_report</li> <li>shipping_label</li> <li>shipping_export_label</li> <li>returns_label</li> <li>reversal_dunning_letter</l> </ul>

number

int

The document number

numberWithPrefix

string

The document number with prefix

path

string

The path to the document

userId

int

The ID of the user

source

string

The source where the document was generated. Possible sources are 'klarna', 'soap', 'admin', 'hitmeister', 'paypal' and 'rest'.

displayDate

string

The date displayed on the document

status

string

The generation status of the document ("pending", "faulty" or "done"

content

string

The base64 encoded content of the document.

createdAt

The time the document was created

updatedAt

The time the document was last updated

references

Collection

Collection of document references. The references available are: <ul> <li>contacts</li> <li>orders</li> <li>webstores = refers to clients</li> <li>categories</li> </ul>

comment

DocumentComment

The manual comment

cancelledBy

Document

The reference document that cancelled the current document, if any

cancels

Document

The reference document that is cancelled by the current document, if any

contacts

Collection

Collection of contacts that are associated with the document

orders

Collection

Collection of orders that are associated with the document

webstores

Collection

Collection of webstores that are associated with the document

categories

Collection

Collection of categories that are associated with the document

tags

Methods
public toArray()

Returns this model as an array.

DocumentComment

The manual comment model for the document model .

Namespace

Plenty\Modules\Document\Models

Properties
Name Type Description

documentId

int

The id of the document.

type

string

The type of the text (comment).

value

string

The text value

document

Document

The related document.

Methods
public toArray()

Returns this model as an array.

DocumentReference

The document reference model. A document reference allows you to assign a document to other models.

Namespace

Plenty\Modules\Document\Models

Properties
Name Type Description

documentId

int

The ID of the document

type

string

The reference type. The following reference types are available: <ul> <li>blog</li> <li>cash_register</li> <li>category</li> <li>customer</li> <li>facet</li> <li>facet_value</li> <li>item</li> <li>multishop</li> <li>order</li> <li>reorder</li> <li>ticket</li> <li>warehouse</li> <li>order_shipping_package</li> </ul>

value

string

The reference value (e.g. the ID of another model)

document

Document

The document this reference belongs to

Methods
public toArray()

Returns this model as an array.

Generation

Contracts

DocumentBuilderGenerationRestrictionContainerContract

A container service for DocumentBuilder document generation restrictions registration

Namespace

Plenty\Modules\Document\Generation\Contracts

Methods
public registerGenerationRestriction($restriction, $descriptions):void

Register a document generation restriction.

Parameters

Name

Type

Description

$restriction

The Closure should have the signature <pre>function(Order $order, string $documentType): bool</pre>

$descriptions

The messages in case of restriction. At least the keys 'de' and 'en' are required.

public checkGenerationRestrictions($order, $documentType):void

Check for restrictions of the generation of the given document type for the given order.

Parameters

Name

Type

Description

$order

Order

The order for which the document is to be generated

$documentType

string

The document type of the document to be generated

TemplateSetting

Models

DocumentTemplateOutputSetting

The DocumentBuilder template output setting model

Namespace

Plenty\Modules\Document\TemplateSetting\Models

Properties
Name Type Description

id

int

templateId

int

pageWidth

float

pageHeight

float

marginTop

float

marginBottom

float

marginLeft

float

marginRight

float

header

string

footer

string

createdAt

updatedAt

fontFamily

string

fontSize

int

amountFormat

string

currencyFormat

string

dateFormat

string

pdfBackground

outputType

string

xmlFormat

string

repeatPdfBackground

string

unitFormat

string

documentTemplateSetting

DocumentTemplateSetting

Methods
public toArray()

Returns this model as an array.

DocumentTemplateReference

The DocumentBuilder template reference model

Namespace

Plenty\Modules\Document\TemplateSetting\Models

Properties
Name Type Description

templateId

int

type

int

referenceTemplateId

int

documentTemplateSetting

DocumentTemplateSetting

referenceDocumentTemplateSetting

DocumentTemplateSetting

Methods
public toArray()

Returns this model as an array.

DocumentTemplateSetting

The DocumentBuilder template setting model

Namespace

Plenty\Modules\Document\TemplateSetting\Models

Properties
Name Type Description

id

int

defaultTemplate

bool

referenceId

string

active

bool

documentType

string

templateName

string

metaData

array

fileName

string

stateChangeDate

Carbon

createdAt

updatedAt

tags

outputSetting

DocumentTemplateOutputSetting

references

headerReference

DocumentTemplateReference

footerReference

DocumentTemplateReference

referencedBy

headerReferencedBy

footerReferencedBy

typeSettings

Methods
public toArray()

Returns this model as an array.