Plentymarkets interface documentation

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 = []):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".

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 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.

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

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)

Methods
public toArray()

Returns this model as an array.