Method

Contracts

PaymentMethodRepositoryContract

Repository Contract for PaymentMethod

Namespace

Plenty\Modules\Order\Payment\Method\Contracts

Methods

public getPaymentMethods(int $countryId, int $plentyId = null, string $lang = "de"):array
Parameters
int $countryId
int $plentyId
string $lang

Models

PaymentMethod

The payment method model

Namespace

Plenty\Modules\Order\Payment\Method\Models

Properties

Type Name Description
int id
string name
float minimumGross
int priority
bool active
int showBankDetails
int infoPageType
int infoPageExternalUrl
float feeDomesticFlatRateWebstore
float feeDomesticFlatRateInternal
float feeDomesticPercentageWebstore
float feeDomesticPercentageInternal
float feeForeignFlatRateWebstore
float feeForeignFlatRateInternal
float feeForeignPercentageWebstore
float feeForeignPercentageInternal
array informations
array webstores
array coutries
PaymentMethodInformation information

Methods

public toArray()

Returns this model as an array.

PaymentMethodInformation

The payment method information model

Namespace

Plenty\Modules\Order\Payment\Method\Models

Properties

Type Name Description
int id
string lang
string name
int infoPageType
int infoPageInternalContent
string infoPageExternalUrl
string logo
int showLogo

Methods

public toArray()

Returns this model as an array.

Pdf

Models

OrderPdfGeneration

OrderPdfGeneration Model

Namespace

Plenty\Modules\Order\Pdf\Models

Properties

Type Name Description
string language
string advice
array sums
string link
string image
int imageHeight
int imageWidth

Methods

public toArray()

Returns this model as an array.

Events

OrderPdfGenerationEvent

OrderPdfGenerationEvent

Namespace

Plenty\Modules\Order\Pdf\Events

Methods

public getOrder():Order

Get the

public getDocType():string

Get the

public addOrderPdfGeneration(OrderPdfGeneration
 $orderPdfGeneration):Events
Parameters
OrderPdfGeneration $orderPdfGeneration

Scheduler

Models

OrderScheduler

The legacy order model

Namespace

Plenty\Modules\Order\Scheduler\Models

Properties

Type Name Description
int id The order id.
int contactId The contact id.
int methodOfPayment
start
last
end
Address deliveryAddress
Address billingAddress
Collection addresses
Collection addressRelations

Methods

public toArray()

Returns this model as an array.

Information

Contracts

ShippingInformationRepositoryContract

The ShippingInformationRepositoryContract is the interface for the shipping information repository. This interface allows to get shipping information by order ID, create new shipping information or update shipping information.

Namespace

Plenty\Modules\Order\Shipping\Information\Contracts

Methods

public getShippingInformationByOrderId(int $orderId):ShippingInformation

Get Shipping Information by an order ID

Parameters
int $orderId The ID of the Order
public resetShippingInformation(int $orderId):void

Delete Shipping Information by an order ID

Parameters
int $orderId The ID of the Order
public saveShippingInformation(array $data):ShippingInformation

Create Shipping Information

Parameters
array $data The shipping information data as associative array.
public updateAdditionalData(array $data, int $orderId):ShippingInformation

Update Additional Data of Shipping Information by Order ID

Parameters
array $data The additional data as associative array.
int $orderId The ID of the order.
public updateShippingStatus(array $data, int $orderId):ShippingInformation

Update Shipping Status of Shipping Information by Order ID

Parameters
array $data The status data as associative array.
int $orderId The ID of the order.

Models

ShippingInformation

ShippingInformationModel

Namespace

Plenty\Modules\Order\Shipping\Information\Models

Properties

Type Name Description
int orderId The ID of the order
string shippingServiceProvider The name of the shipping service provider
string transactionId The ID of the transaction
string shippingStatus The shipping status. Possible values are 'open', 'prepared' and 'registered'.
float shippingCosts The shipping costs
string additionalData The additional data. Depending on the shipping service provider selected, this data may contain different information, e.g. shipping service, email address and order ID.
int registrationAt The date and time the shipment was registered
int shipmentAt The date the items will be shipped

Methods

public toArray()

Returns this model as an array.

ExportDocuments

Contracts

ExportDocumentsContract

The ExportDocumentsContract

Namespace

Plenty\Modules\Order\Shipping\ExportDocuments\Contracts

Methods

public listExportDocumentsByOrderId(int $orderId):ExportDocument

List export documents by order ID

Parameters
int $orderId

Models

ExportDocument

The Export Document model

Namespace

Plenty\Modules\Order\Shipping\ExportDocuments\Models

Properties

Type Name Description
int id
int orderId
int packageNumber
int base64Content

Methods

public toArray()

Returns this model as an array.

Shipping

Contracts

EUCountryCodesServiceContract

The EUCountryCodesServiceContract

Namespace

Plenty\Modules\Order\Shipping\Contracts

Methods

public isEUCountry(int $countryId):bool
Parameters
int $countryId
public hasCommunityTax(int $countryId):bool
Parameters
int $countryId
public getTaxTerritory(int $countryId):int
Parameters
int $countryId
public hasCommunityToll(int $countryId):bool
Parameters
int $countryId
public getTollTerritory(int $countryId):int
Parameters
int $countryId
public isExportDelivery(int $countryId, int $merchandCountryId = null):bool
Parameters
int $countryId
int $merchandCountryId

ParcelServicePresetRepositoryContract

The ParcelServicePresetRepositoryContract is the interface for the shipping profile repository. This interface allows to get a shipping profile by the ID or list all shipping profiles.

Namespace

Plenty\Modules\Order\Shipping\Contracts

Methods

public getPresetList(array $columns = [], string $with = null, string $parcelServiceName = null, array $filters = []):void

Lists shipping profiles.

Parameters
array $columns The columns (attributes) to retrieve
string $with The parameter contains the name of an relation
string $parcelServiceName Filter that restricts the search result to parcel service presets with a specified service name (e.g. 'DHL' for DHL)
array $filters Possible attributes are updatedAtBefore and updatedAtAfter (yyyy-mm-dd or yyyy-mm-dd hh:mm:ss)
public getPresetById(int $presetId, array $columns = []):ParcelServicePreset

Gets a shipping profile. The ID of the shipping profile must be specified.

Parameters
int $presetId The ID of the shipping profile
array $columns The columns (attributes) to retrieve
public getLastWeightedPresetCombinations(Basket
 $basket, int $contactClass, array $customParams = []):array

Calculate shipping costs and list last weighted preset combinations.

Parameters
Basket $basket
int $contactClass
array $customParams
public getPreviewList(string $language = null, bool $useBackendName = false):array

Get an array with all parcel service preset with the ID as key and the name as value.

Parameters
string $language The names will be returned in this language.
bool $useBackendName Use the backend name instead of the external name?
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(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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

DefaultShipping

The Default Shipping model

Namespace

Plenty\Modules\Order\Shipping\Models

Properties

Type Name Description
int id
float referrerId
int shippingDestinationId
int position
int paymentMethod1
int paymentMethod2
int paymentMethod3

Methods

public toArray()

Returns this model as an array.

Events

AfterShippingCostCalculated

An event class fired after the shipping calculation is done. Listeners can add fees to the shipping costs.

  • The shipping provider type name is mandatory, orderId is optional.

Namespace

Plenty\Modules\Order\Shipping\Events

Methods

public getShippingServiceProvider():int

Get the

public __construct(string $shippingServiceProvider, int $orderId, int $shippingProfileId):void

AfterShippingCostCalculated constructor.

Parameters
string $shippingServiceProvider
int $orderId
int $shippingProfileId
public getOrderId():int

Get the

public getAdditonalFee():float

Get the

public addAdditionalFee(float $additonalFee):AfterShippingCostCalculated

Set the

Parameters
float $additonalFee
public getShippingProfileId():int
public setShippingProfileId(int $shippingProfileId):void
Parameters
int $shippingProfileId

ServiceProvider

Contracts

ShippingServiceProviderRepositoryContract

The ShippingServiceProviderRepositoryContract is the interface for the shipping service provider repository. This interface allows to list shipping service providers.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Contracts

Methods

public all(array $columns = [], int $page = 1, int $itemsPerPage = 50, array $filters = [], array $with = []):void

Lists shipping service providers.

Parameters
array $columns The columns to retrieve
int $page
int $itemsPerPage The number of items to list per page
array $filters
array $with
public find(int $shippingServiceProviderId):ShippingServiceProvider

Gets a shipping service provider. The ID of the shipping service provider must be specified.

Parameters
int $shippingServiceProviderId The ID of the shipping service provider
public findByName(string $shippingServiceProviderName):ShippingServiceProvider

Gets a shipping service provider. The name of the shipping service provider must be specified.

Parameters
string $shippingServiceProviderName The name of the shipping service provider
public saveShippingServiceProvider(string $pluginName, string $shippingServiceProviderName):ShippingServiceProvider

Creates a shipping service provider or updates it if already existing

Parameters
string $pluginName The plugin name the plugin is registered with
string $shippingServiceProviderName The name of the shipping service provider
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.

ShippingServiceProviderPluginRepositoryContract

The ShippingServiceProviderPluginRepositoryContract is the interface for the shipping service provider plugin repository. This interface allows to list shipping service provider plugins.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Contracts

Methods

public plugins():void
public filteredPluginList(string $filter):void
Parameters
string $filter

Models

ShippingServiceProvider

The service provider model

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Models

Properties

Type Name Description
int id The ID of the shipping service provider
string name The name of the shipping service provider
int pluginId The optional ID of the plugin when the shipping service provider is registered as a plugin
createdAt The time the shipping service provider was created
updatedAt The time the shipping service provider was updated

Methods

public toArray()

Returns this model as an array.

RegisterShipmentResponse

RegisterShipmentResponse model.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Models

Methods

public addSuccessfullyRegisteredShipment(SuccessfullyRegisteredShipment
 $successfullyRegisteredShipment):void
Parameters
SuccessfullyRegisteredShipment $successfullyRegisteredShipment
public addFailedRegisterShipment(FailedRegisterShipment
 $failedRegisterShipment):void
Parameters
FailedRegisterShipment $failedRegisterShipment
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

FailedRegisterShipment

FailedRegisterShipment model.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Models

Methods

public addErrorMessage(string $errorMessage):void
Parameters
string $errorMessage
public addException(Exception
 $exception):void
Parameters
Exception $exception
public setOrderId(int $orderId):void
Parameters
int $orderId
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

SuccessfullyRegisteredShipment

SuccessfullyRegisteredShipment model.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Models

Methods

public setOrderId(int $orderId):void
Parameters
int $orderId
public setHasNewPackageNumber(bool $hasNewPackageNumber):void
Parameters
bool $hasNewPackageNumber
public addMessage(string $message):void
Parameters
string $message
public addPackage(OrderShippingPackage
 $package):void
Parameters
OrderShippingPackage $package
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

Services

ShippingServiceProviderService

The ShippingServiceProviderService class offers the possibility to register a shipping provider class and method that can be called by plentymarkets shipping controllers.

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Services

Methods

public registerShippingProvider(string $shippingServiceProviderCode, $shippingServiceProviderNames, $shippingServiceProviderClasses):bool
Parameters
string $shippingServiceProviderCode
$shippingServiceProviderNames
$shippingServiceProviderClasses
public hasShippingServiceProviderMethod(string $shippingServiceProviderCode, string $methodName):bool
Parameters
string $shippingServiceProviderCode
string $methodName

Services

Entries

ShippingServiceProviderEntry

The shipping provider entry contains all information needed to use module shipping in plentymarkets shipping .

Namespace

Plenty\Modules\Order\Shipping\ServiceProvider\Services\Entries

Methods

public getShippingServiceProviderClasses():array

Get the

public getShippingServiceProviderNames():void

Get the

public setShippingServiceProviderNames(array $shippingServiceProviderNames):ShippingServiceProviderEntry

Set the

Parameters
array $shippingServiceProviderNames
public getShippingServiceProviderCode():string

Get the

public setShippingServiceProviderCode(string $shippingServiceProviderCode):ShippingServiceProviderEntry

Set the

Parameters
string $shippingServiceProviderCode
public getShippingServiceProviderClass(string $methodName):string
Parameters
string $methodName
public methodExists(string $methodName):bool
Parameters
string $methodName

ReturnsServiceProviderEntry

The returns provider entry contains all information needed to use module returns in plentymarkets returns .

Namespace

Plenty\Modules\Order\Shipping\Returns\Services\Entries

Methods

public getReturnsServiceProviderLabel():string

Get the

public setReturnsServiceProviderLabel(string $returnsServiceProviderLabel):ReturnsServiceProviderEntry

Set the

Parameters
string $returnsServiceProviderLabel
public getReturnsServiceProviderCode():string

Get the

public setReturnsServiceProviderCode(string $returnsServiceProviderCode):ReturnsServiceProviderEntry

Set the

Parameters
string $returnsServiceProviderCode
public getReturnsServiceProviderClass(string $methodName):string
Parameters
string $methodName
public methodExists(string $methodName):bool
Parameters
string $methodName
public getProviderId():int

Get the

ParcelService

Models

ParcelServiceName

The Parcel Service Name Model

Namespace

Plenty\Modules\Order\Shipping\ParcelService\Models

Properties

Type Name Description
int parcelServiceId
string name
string lang

Methods

public toArray()

Returns this model as an array.

ParcelServicePreset

The Parcel Service Preset Model

Namespace

Plenty\Modules\Order\Shipping\ParcelService\Models

Properties

Type Name Description
int id The ID of the shipping profile (autoincrement value)
int parcelServiceId The ID of the shipping service provider
string backendName The back end name of the shipping profile
int flag The icon of the shipping profile
int priority The priority of the shipping profile
int category The category of the shipping profile
int useArticlePorto Flag that indicates if the extra shipping charge saved in the item data record is used
int isInsured Flag that indicates if the shipping profile is insured
int isExpress Flag that indicates if the shipping profile is used for express delivery
int isPostident Flag that indicates if the shipping profile includes an authority verification
int isDefaultEnabled Flag that indicates if the shipping profile is automatically assigned to new items
float islandFee The extra charge for islands saved in the shipping profile
int isCod Flag that indicates Cash on Delivery
array supportedMultishop The clients (stores) that are activated for the shipping profile
array supportedReferrer The order referrers that are activated for the shipping profile
array subreferrerSupport This field is currently without any function.
array excludedPaymentMethods The blocked payment methods that are not offered for the shipping profile
array excludedCustomerGroups The blocked customer groups for the shipping profile. Blocked customer groups cannot select the shipping profile during checkout.
string shippingGroup The group of the shipping profile
string dispatchIdentifier This field is currently without any function.
int auctionType The eBay listing type for the shipping profile
array supportedLoyaltyPrograms The loyalty programs that are supported by the shipping profile
string updatedAt The date the shipping profile was last updated
array parcelServicePresetNames
array parcelServiceNames
int showDataPrivacyAgreementHint
string transmitPrivacyRule
string alternativeEmail
string alternativePhone
int isParcelBox Indicates whether the e.g. paketshop is supported
int isPostOffice Indicates whether the e.g. postfiliale is supported
ParcelService parcelService The parcel service.

Methods

public toArray()

Returns this model as an array.

ParcelServiceConstraint

The Parcel Service Constraint Model

Namespace

Plenty\Modules\Order\Shipping\ParcelService\Models

Properties

Type Name Description
int parcelServiceRegionId
int constraintType
int subConstraintType
int constraintLimit
int cost
int startValue

Methods

public toArray()

Returns this model as an array.

ParcelService

The Parcel Service Model

Namespace

Plenty\Modules\Order\Shipping\ParcelService\Models

Properties

Type Name Description
int id
string backendName
string trackingUrl
int shippingServiceProviderId
string shippingServiceProviderAddress
ShippingServiceProvider shippingServiceProvider
parcelServiceNames

Methods

public toArray()

Returns this model as an array.

ParcelServicePresetName

The Parcel Service Preset Name Model

Namespace

Plenty\Modules\Order\Shipping\ParcelService\Models

Properties

Type Name Description
int presetId
string name
string lang

Methods

public toArray()

Returns this model as an array.

ParcelServiceRegion

Contracts

ParcelServiceRegionRepositoryContract

Get parcel service region

Namespace

Plenty\Modules\Order\Shipping\ParcelServiceRegion\Contracts

Methods

public getParcelServiceRegion(int $parcelServiceRegionId, array $columns = []):ParcelServiceRegion

Get a parcel service region

Parameters
int $parcelServiceRegionId The ID of the parcel service region.
array $columns
public listParcelServiceRegions(int $parcelServicePresetId, array $columns = []):array

Lists parcel service regions by parcel service preset id.

Parameters
int $parcelServicePresetId The ID of the parcel service preset.
array $columns

Models

ParcelServiceRegion

The parcel service region model.

Namespace

Plenty\Modules\Order\Shipping\ParcelServiceRegion\Models

Properties

Type Name Description
int id The ID of the parcel service region
int shippingRegionId The ID of the shipping region
int parcelServicePresetId The ID of the parcel service preset
string shippingRegionName The name of the shipping region
int serviceType Type of the parcel service

Methods

public toArray()

Returns this model as an array.

ParcelServiceRegionName

The parcel service region name model.

Namespace

Plenty\Modules\Order\Shipping\ParcelServiceRegion\Models

Properties

Type Name Description
int id The ID of the parcel service region name
int name The name of the shipping region

Methods

public toArray()

Returns this model as an array.

Returns

Contracts

ReturnsServiceProviderRepositoryContract

The ReturnsServiceProviderRepositoryContract is the interface for the returns service provider repository. This interface allows to list returns service providers.

Namespace

Plenty\Modules\Order\Shipping\Returns\Contracts

Methods

public getReturnsServiceProviderList(array $columns = [], int $page = 1, int $itemsPerPage = 50, array $filters = [], array $with = []):PaginatedResult
Parameters
array $columns
int $page
int $itemsPerPage
array $filters
array $with
public findById(int $returnsServiceProviderId):ReturnsServiceProvider
Parameters
int $returnsServiceProviderId
public findByName(string $returnsServiceProviderName):array
Parameters
string $returnsServiceProviderName
public saveReturnsServiceProvider(string $pluginName):ReturnsServiceProvider
Parameters
string $pluginName
public getReturnsServiceProvider(int $orderId):ReturnsServiceProvider
Parameters
int $orderId
public pluginList():void

ReturnsRepositoryContract

The ReturnsRepositoryContract is the interface for the order returns repository. This interface allows to register, assign to order and list order returns.

Namespace

Plenty\Modules\Order\Shipping\Returns\Contracts

Methods

public registerReturns(string $pluginName, array $orderIds):RegisterReturnsResult
Parameters
string $pluginName
array $orderIds
public getReturnsLabelById(int $labelId, array $with):PaginatedResult
Parameters
int $labelId
array $with
public assignLabel2Return(int $orderId, int $returnsId):OrderReturns
Parameters
int $orderId
int $returnsId
public getOrderReturns(int $orderId, array $with = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult
Parameters
int $orderId
array $with
int $page
int $itemsPerPage

Models

SuccessfullyRegisteredOrderReturns

The model for SuccessfullyRegisteredOrderReturns

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Methods

public setOrderId(int $orderId):void
Parameters
int $orderId
public setFileName(string $fileName):void
Parameters
string $fileName
public setExternalNumber(string $externalNumber):void
Parameters
string $externalNumber
public setExternalData(array $externalData):void
Parameters
array $externalData
public setAvailableUntil(string $availiableUntil):void
Parameters
string $availiableUntil
public setLabelBase64(string $labelBase64):void
Parameters
string $labelBase64
public setReturnsOrderId(int $returnsOrderId):void
Parameters
int $returnsOrderId
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

FailedRegisterOrderReturns

The FailedRegisterOrderReturns model.

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Methods

public addErrorMessage(string $errorMessage):void
Parameters
string $errorMessage
public setOrderId(int $orderId):void
Parameters
int $orderId
public addException(Exception
 $exception):void
Parameters
Exception $exception
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

OrderReturns

The model for OrderReturns

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Properties

Type Name Description
int id
int orderId
int returnsOrderId
int providerId
Carbon createdAt
string fileName
string externalNumber
string externalData
Carbon availableUntil

Methods

public toArray()

Returns this model as an array.

RegisterReturnsResult

The model for RegisterReturnsResult

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Properties

Type Name Description
array orderReturnsList
array failedRegisterOrderReturnsList

Methods

public toArray()

Returns this model as an array.

ReturnsServiceProvider

ReturnsServiceProvider

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Properties

Type Name Description
int id The ID of the returns service provider
string name The name of the returns service provider
int pluginId The optional ID of the plugin when the returns service provider is registered as a plugin
createdAt The time the returns service provider was created
updatedAt The time the returns service provider was updated

Methods

public toArray()

Returns this model as an array.

RegisterOrderReturnsResponse

The RegisterOrderReturnsResponse model.

Namespace

Plenty\Modules\Order\Shipping\Returns\Models

Methods

public addSuccessfullyRegisteredReturns(SuccessfullyRegisteredOrderReturns
 $successfullyRegisteredReturn):void
Parameters
SuccessfullyRegisteredOrderReturns $successfullyRegisteredReturn
public addFailedRegisterOrderReturns(FailedRegisterOrderReturns
 $failedRegisterOrderReturn):void
Parameters
FailedRegisterOrderReturns $failedRegisterOrderReturn
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

Services

RegisterReturnsService

The RegisterReturnsService class offers the possibility to register returns, get returns label and persist returns label.

Namespace

Plenty\Modules\Order\Shipping\Returns\Services

Methods

public registerReturns(string $pluginName, array $orderIds):RegisterReturnsResult
Parameters
string $pluginName
array $orderIds
public persistLabel(string $labelBase64, OrderReturns
 $returns):Document
Parameters
string $labelBase64
OrderReturns $returns
public getLabel(OrderReturns
 $orderReturns):string
Parameters
OrderReturns $orderReturns

ReturnsServiceProviderService

The ReturnsServiceProviderService class offers the possibility to register a returns service provider class and method that can be called by plentymarkets returns controllers.

Namespace

Plenty\Modules\Order\Shipping\Returns\Services

Methods

public registerReturnsProvider(string $returnsServiceProviderCode, string $returnsServiceProviderLabel, string $returnsServiceProviderClass):bool

Register returns service provider

Parameters
string $returnsServiceProviderCode
string $returnsServiceProviderLabel
string $returnsServiceProviderClass
public getReturnsServiceProviderEntryById(int $providerId):ReturnsServiceProviderEntry

Get returns service provider by id

Parameters
int $providerId
public hasReturnsServiceProviderMethod(string $returnsServiceProviderCode, string $methodName):bool

Returns boolean whether the returns service provider has or has not the given method

Parameters
string $returnsServiceProviderCode
string $methodName

Countries

Contracts

CountryRepositoryContract

Repository for Country

Namespace

Plenty\Modules\Order\Shipping\Countries\Contracts

Methods

public findIsoCode(int $countryId, string $isoCodeType):string
Parameters
int $countryId
string $isoCodeType
public getCountryById(int $countryId):Country
Parameters
int $countryId
public getCountriesList(int $active, array $with):Collection
Parameters
int $active
array $with
public getActiveCountriesList():Collection
public getActiveCountryNameMap(string $language):array
Parameters
string $language
public getCountryByIso(string $isoCode, string $isoType):void
Parameters
string $isoCode
string $isoType ('isoCode2', 'isoCode3')
public getCountryStateByIso(int $countryId, string $isoCode):CountryState
Parameters
int $countryId
string $isoCode

Models

Country

The country model

Namespace

Plenty\Modules\Order\Shipping\Countries\Models

Properties

Type Name Description
int id The country id.
string name The system country name.
int shippingDestinationId The shipping destination (region) id.
int active The active flag (1: active, 2: backend active, 3: supplier active
int storehouseId The id of the main warehouse in this country.
string isoCode2 The ISO 3166 ALPHA-2 code of the country.
string isoCode3 The ISO 3166 ALPHA-3 code of the country.
string lang The main language spoken in the country.
bool isCountryStateMandatory Flag that states if a country state is mandatory for the country.
array states An array with country states.
array names An array with country names in different languages.

Methods

public toArray()

Returns this model as an array.

CountryState

country state

Namespace

Plenty\Modules\Order\Shipping\Countries\Models

Properties

Type Name Description
int id
int countryId
string isoCode
string name
string isoCode3166

Methods

public toArray()

Returns this model as an array.

CountryName

country name

Namespace

Plenty\Modules\Order\Shipping\Countries\Models

Properties

Type Name Description
int id
string language
string name

Methods

public toArray()

Returns this model as an array.

Package

Contracts

OrderShippingPackageItemsRepositoryContract

Create and get items in packages from order

Namespace

Plenty\Modules\Order\Shipping\Package\Contracts

Methods

public getItemsForPackage(int $packageId):OrderShippingPackageItems

Get items for a package

Parameters
int $packageId The ID of the package
public getItemsFromPackagesForOrder(int $orderId):OrderShippingPackageItems

Get items for an order

Parameters
int $orderId The ID of the order
public createItemsForPackageOrder(array $data, int $packageId):array

Create items for a package

Parameters
array $data Array with data including item id, variation id and the quantity of the item in package
int $packageId The ID of the package. This ID is optional. If the ID is not provided, it must be present in the $data array
public updateItemsFromPackage(int $packageId, int $itemId, int $variationId, array $data):int

Update items in a package

Parameters
int $packageId The ID of the package
int $itemId The ID of the item
int $variationId The ID of the variation
array $data Array with data including item id, variation id and the quantity of the item in package
public deleteItemsFromPackage(int $packageId, int $itemId, int $variationId):DeleteResponse

Delete a variation of an item from package in order

Parameters
int $packageId The ID of the package
int $itemId The ID of the item
int $variationId The ID of the variation

OrderShippingPackageRepositoryContract

Create, get, update and delete order shipping packages.

Namespace

Plenty\Modules\Order\Shipping\Package\Contracts

Methods

public getOrderShippingPackage(int $orderShippingPackageId, array $columns = []):OrderShippingPackage

Get an order shipping package

Parameters
int $orderShippingPackageId The ID of the order shipping package
array $columns The properties to be loaded
public listOrderShippingPackages(int $orderId, array $columns = [], array $with = []):array

List order shipping packages

Parameters
int $orderId The ID of the order
array $columns The properties to be loaded
array $with (optional) Possible value is 'labelBase64' to get the label with the response
public createOrderShippingPackage(int $orderId, array $data):OrderShippingPackage

Create an order shipping package

Parameters
int $orderId The ID of the order
array $data The request data
public updateOrderShippingPackage(int $orderShippingPackageId, array $data):OrderShippingPackage

Update an order shipping package

Parameters
int $orderShippingPackageId The ID of the order shipping package
array $data The request data
public deleteOrderShippingPackage(int $orderShippingPackageId):void

Delete an order shipping package

Parameters
int $orderShippingPackageId The ID of the order shipping package

Models

OrderShippingPackageItems

The relation between package, item and variation model

Namespace

Plenty\Modules\Order\Shipping\Package\Models

Properties

Type Name Description
int packageId The ID of the package (id column from plenty_package_type2order)
int itemId The ID of the item (plenty_item_variation_base_item_id column from plenty_item_variation_base)
int variationId The ID of the variation (plenty_item_variation_base_id column from plenty_item_variation_base)
float itemQuantity The quantity of the item in the package

Methods

public toArray()

Returns this model as an array.

OrderShippingPackage

The order shipping package model

Namespace

Plenty\Modules\Order\Shipping\Package\Models

Properties

Type Name Description
int id The ID of the order shipping package
int orderId The ID of the order
int packageId The ID of the package
int weight The weight of the package in grams
string packageNumber The package number
string labelPath The path to the label
string labelBase64 The base64 encoded label
string exportLabelBase64 The base64 encoded export label
int packageType The type of the package. The following types are valid:
  • 0: unpacked
  • 1: Bale
  • 2: Dispenser
  • 3: Coil
  • 4: Roll pallet
  • 5: Colli
  • 6: Container
  • 7: Bucket
  • 8: Cask
  • 9: Bottles
  • 10: European flat pallet
  • 11: Structural frame
  • 12: Gas cylinder
  • 13: Pallet cage
  • 14: Hobbock
  • 15: Half pallet
  • 16: Pallet of food items
  • 17: Wooden coaster
  • 18: IBC container
  • 19: Pitcher
  • 20: Wicker bottle
  • 21: Case
  • 22: Canister
  • 23: Customer pallet
  • 24: Cardboard box
  • 25: Composite packaging
  • 26: Package
  • 27: Ring
  • 28: Role
  • 29: Sack
  • 30: units
  • 31: Tank
  • 32: Drum
  • 34: Crate
  • 35: Quarter pallet
  • 36: Other pallets
  • 37: Bin
  • 38: One-way pallet
  • 39: Foil bag
float volume The volume of the package
Order order The order the package belongs to

Methods

public toArray()

Returns this model as an array.

PackageType

Contracts

ShippingPackageTypeRepositoryContract

The ShippingPackageTypeRepositoryContract is the interface for the shipping package type repository. This interface allows to list all shipping package types or to get a shipping package type by the ID.

Namespace

Plenty\Modules\Order\Shipping\PackageType\Contracts

Methods

public findShippingPackageTypeById(int $shippingPackageTypeId):ShippingPackageType

Gets a shipping package type. The ID of the shipping package type must be specified.

Parameters
int $shippingPackageTypeId The ID of the shipping package type
public listShippingPackageTypes():array

Lists shipping packages types.

Models

ShippingPackageType

The shipping package type model.

Namespace

Plenty\Modules\Order\Shipping\PackageType\Models

Properties

Type Name Description
int id The ID of the shipping package type
string name The name of the shipping package type
int width The width of the shipping package type
int height The height of the shipping package type
int length The length of the shipping package type
string unit The unit of the shipping package type dimension
int maxWeight The maximum weight of the shipping package type
int maxVolume The maximum volume of the shipping package type
int volumeType The volume type of the shipping package type

Methods

public toArray()

Returns this model as an array.

Order

Models

CouponCodeOrder

The CouponCodeOrder model.

Namespace

Plenty\Modules\Order\Coupon\Code\Order\Models

Properties

Type Name Description
int corderItemId The ID of the order item that the coupon was redeemed for
int campaignId The ID of the campaign that the coupon belongs to
string code The coupon code
string type The display type of the redeemed coupon The following display types are available:
  • disposable
  • fixed_vat
  • fixed
  • percental
  • undefined
float amount The redeemed amount of the coupon
string vatRate The redeemed vat rate of the coupon

Methods

public toArray()

Returns this model as an array.

GiftCardCode

Model that holds gift card codes.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Code\Order\Models

Properties

Type Name Description
int id The ID of the gift card code
int orderItemId The order item ID
int campaignId The campaign ID
string code The coupon code
string sender The name of the sender
string receiver The name of the receiver
string message The message

Methods

public toArray()

Returns this model as an array.

PriceCalculationResultItem

price calculation result item

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
float total
float totalNet
float totalGross
float totalVat
int highestVatId
array netAmountsMap
array vatAmountsMap

Methods

public toArray()

Returns this model as an array.

OrderReference

The order reference model. Each OrderReference has an origin order (the most top order) and a referenced order (currently only 'parent').

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The id of the order reference entry.
int orderId The order id.
int originOrderId The id of the origin order.
int referenceOrderId The id of the referenced order.
string referenceType The reference type (currently only "parent") of the referenced order.
Order order
Order originOrder The origin order of the order.
Order referenceOrder The referenced order of the order.

Methods

public toArray()

Returns this model as an array.

OrderAmountVat

The order amount vat model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the VAT information of an order amount
int orderAmountId The ID of the order amount that the VAT information belong to
int countryVatId The ID of the VAT configuration
int vatField The ID of the VAT rate's field [0,1,2,3].
float vatRate The actual VAT rate that was used, e.g. 19%.
float value The VAT amount of money given in the same currency as the order amount.
float netTotal The net amount for the current vat rate.
float grossTotal The gross amount for the current vat rate.
createdAt The date that the VAT was created.
updatedAt The date that the VAT was updated last.
OrderAmount orderAmount The OrderAmount model that the OrderAmountVat belongs to.

Methods

public toArray()

Returns this model as an array.

Order

The order model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order
int typeId The ID of the order type It is possible to define individual order types. However, the following types are available by default:
  • Sales order = 1
  • Delivery = 2
  • Returns = 3
  • Credit note = 4
  • Warranty = 5
  • Repair = 6
  • Offer = 7
  • Advance order = 8
  • Multi-order = 9
  • Multi credit note = 10
  • Multi delivery = 11
  • Reorder = 12
  • Partial delivery = 13
  • Subscription = 14
  • Redistribution = 15
int methodOfPaymentId The ID of the order's payment method (read only)
int shippingProfileId The ID of the order's shipping profile (read only)
string paymentStatus The payment status of the order (read only)
float statusId The ID of the order status
string statusName The name for the status ID (read only)
int ownerId The user ID of the order's owner
createdAt The date that the order was created
updatedAt The date that the order was updated last
int plentyId The plenty ID of the client that the order belongs to
int locationId The ID of the location that the order belongs to
string lockStatus The lock status of the order. The following statuses are available:
  • unlocked
  • permanentlyLocked
  • reversibleLocked
Address billingAddress The invoice address of the order
Address deliveryAddress The delivery address of the order
User owner The owner of the order
addresses The address objects that are associated with the order.
addressRelations The address relations for this order.
orderItems The order items that are associated with the order.
properties The order properties that are associated with the order.
relations The order relation reference instances that are associated with the order.
amounts The order amounts that are associated with the order.
comments The order comments.
AccountingLocation location The accounting location of the order.
payments The payments that are associated with the order.
orderReferences The order references.
reverseOrderReferences The sub order references showing on the current order .
originOrderReferences The references of other orders, e.g. returns or credit notes, associated with the order.
documents The documents that are associated with the order.
dates The dates of the order. Can contain many different dates with their types like:
  • Delete date = 1
  • Entry date = 2
  • Payment date = 3
  • Delivery date = 4
Order originOrder The origin order of this order. If this order is the origin, this attribute is null. (deprecated)
Order parentOrder The parent order of this order. If this order has no parent, this attribute is null. (deprecated)
originOrders The origin orders of this order.
parentOrders The parent orders of this order.
childOrders All orders referencing the current order as parent.
OrderAmount systemAmount The order amount in the system currency.
OrderAmount amount The order amount in foreign currency if exists. Otherwise the amount in system currency.

Methods

public toArray()

Returns this model as an array.

OrderItemOrderProperty

This model contains the order properties that are assigned to order items.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int propertyId The ID of the order property
string value The value for the order property
string fileUrl The URL of the order property
string name The name of the order property

Methods

public toArray()

Returns this model as an array.

OrderAmount

The order amount model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order amount.
int orderId The ID of the order that the amount belongs to.
bool isSystemCurrency Flag that states if the current currency is the same as system currency or not.
bool isNet Flag that states if the invoice is net or not. If the invoice is not net, it is gross.
string currency The currency of the amounts.
float exchangeRate The exchange rate for converting the current currency into the system currency.
float netTotal The total net amount of the order.
float grossTotal The total gross amount of the order.
float vatTotal The total vat amount of the order.
float invoiceTotal The total invoice amount.
float paidAmount The order amount that is already paid.
float prepaidAmount This is deprecated and will be removed in the next version. Please use $giftCardAmount instead.
float giftCardAmount The amount that comes from gift cards that were redeemed when placing the order The gift cards amount does not reduce the invoice total, but reduces the amount that still needs to be paid. The amount that still needs to paid is not an own parameter because the amount can be calculated by subtracting the gift cards amount from the invoice total.
float shippingCostsGross The gross shipping costs.
float shippingCostsNet The net shipping costs.
createdAt The date that the amount was created.
updatedAt The date that the amount was updated last.
Order order The order that this amount belongs to.
vats The vat amounts

Methods

public toArray()

Returns this model as an array.

OrderItem

The order item model. Items, shipping costs, coupons, surcharges etc. are all displayed as order items.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order item
int orderId The ID of the order that the order item belongs to
int typeId The ID of the order item type
  • VARIATION = 1
  • ITEM_BUNDLE = 2
  • BUNDLE_COMPONENT = 3
  • PROMOTIONAL_COUPON = 4
  • GIFT_CARD = 5
  • SHIPPING_COSTS = 6
  • PAYMENT_SURCHARGE = 7
  • GIFT_WRAP = 8
  • UNASSIGEND_VARIATION = 9
  • DEPOSIT = 10
  • ORDER = 11
float referrerId The ID of order item referrer
int itemVariationId The ID of the item variation
float quantity The quantity.
string orderItemName The name of the order item
string attributeValues The attribute value names
int shippingProfileId The ID of the order item's shipping profile
int countryVatId The ID of the country vat
int vatField The vat id (0-3).
float vatRate The vat amount, e.g. 19.0 for 19% VAT.
int position The order items position in the order.
int warehouseId The ID of the warehouse.
createdAt The date at which the order item was created.
updatedAt The date that the order item was last updated.
OrderItemAmount systemAmount The order item's amount in the system currency.
OrderItemAmount amount The order item's amount in the order currency. If the order currency is the same as the system currency this amount is the same.
Order order The order that the property belongs to.
OrderItemType type The order item type
Vat countryVat The country vat instance.
Variation variation The item variation in the position.
amounts The order item amounts that belong to the order item.
properties The order item properties that belong to the order item.
orderProperties The order item order properties that belong to the order item.
orderDates The dates of the associated order.
dates The dates of the order item. Can contain many different dates with their types. The following types are currently available:
  • Deleted on = 1
  • Created on = 2
  • Paid date = 3
  • Last update = 4
  • Completed on = 5
  • Return date = 6
  • Payment due date = 7
  • Estimated shipping date = 8
  • Start date = 9
  • End date = 10
  • Possible delivery date = 11
  • Market transfer date = 12
references The order item references.
giftCardCodes The gift card codes that belong to the order item.
array transactions The transactions that belong to the order item
array serialNumbers The serial numbers that belong to the order item
array variationBarcodes The barcodes that belong to the variation of the order item

Methods

public toArray()

Returns this model as an array.

OrderItemAmount

The order item amount model. Order item amount refers to amounts of money.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order item amount.
int orderItemId The ID of the order item that the amount belongs to.
bool isSystemCurrency Flag that indicates if the current currency is the same as the system currency or not.
string currency The currency of the amounts.
float exchangeRate The exchange rate for converting the current currency into the system currency.
float purchasePrice The purchase price of the variation.
float priceOriginalGross The original gross price without any surcharges or discounts.
float priceOriginalNet The original net price without any surcharges or discounts.
float priceGross The total gross price including surcharges and discounts [READONLY].
float priceNet The total net price including surcharges and discounts [READONLY].
float surcharge The surcharge as gross amount.
float discount The discount can be a percentage or a fixed value.
bool isPercentage Flag that indicates if a discount is given as a percentage or as a fixed value.
createdAt The date that the amount was created.
updatedAt The date that the amount was last updated.
OrderItem orderItem The order item that the amount belongs to.

Methods

public toArray()

Returns this model as an array.

OrderItemType

The order item type model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order item type. The following types are currently available:
  • VARIATION = 1
  • ITEM_BUNDLE = 2
  • BUNDLE_COMPONENT = 3
  • PROMOTIONAL_COUPON = 4
  • GIFT_CARD = 5
  • SHIPPING_COSTS = 6
  • PAYMENT_SURCHARGE = 7
  • GIFT_WRAP = 8
  • UNASSIGEND_VARIATION = 9
  • DEPOSIT = 10
  • ORDER = 11
bool isErasable Flag that indicates if this type can be deleted or not
int position The position for sorting
names The names of the order item types

Methods

public toArray()

Returns this model as an array.

OrderItemTypeName

The order item type name model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the type name
int typeId The related type id.
string name The type name.
string lang The ISO 639-1 language code for the name, e.g. "en" for English
OrderItemType type The order item type instance.

Methods

public toArray()

Returns this model as an array.

OrderTypeName

The order type name model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the type name
int typeId The ID of the type
string name The type name.
string lang The ISO 639-1 language code for the name, e.g. "en" for English
OrderType type The order type instance.

Methods

public toArray()

Returns this model as an array.

OrderType

The order type model.

Namespace

Plenty\Modules\Order\Models

Properties

Type Name Description
int id The ID of the order type
bool isErasable Flag that states if this type can be deleted or not.
int position The position for sorting
names The names of the order item types.

Methods

public toArray()

Returns this model as an array.

Contracts

OrderAmountRepositoryContract

This interface allows you to get and list order amounts and their vats.

Namespace

Plenty\Modules\Order\Contracts

Methods

public getByOrderId(int $orderId, string $currency = null):OrderAmount

Get an order amount for an order in a currency. The ID of the order must be specified. The currency is optional. If no currency is specified, the order amount entry will be returned in the default system currency.

Parameters
int $orderId The ID of the order
string $currency The currency of the order amount
public getById(int $id):OrderAmount

Get an order amount. The ID of the order amount must be specified.

Parameters
int $id The ID of the order amount
public listByOrderId(int $orderId):array

List all order amounts of an order. The ID of the order must be specified.

Parameters
int $orderId The ID of the order

OrderRepositoryContract

The OrderRepositoryContract is the interface for the order repository. This interface allows you to find, create and update orders. There are many different order types and the data returned depends on the order type.

Namespace

Plenty\Modules\Order\Contracts

Methods

public findOrderById(int $orderId, array $with = []):Order

Get an order

Parameters
int $orderId The ID of the order
array $with The relations to load in the order instance, one of "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments".
public findOrderByExternalOrderId(string $externalOrderId, array $with = []):Order

Get an order by external order ID

Parameters
string $externalOrderId
array $with
public createOrder(array $data, string $coupon = null):Order

Create an order

Parameters
array $data The order data. The properties that are required to create an order can be found in the order model.
string $coupon A coupon code or a list of coupon codes to be redeemed in the order.
public updateOrder(array $data, int $orderId):Order

Update an order

Parameters
array $data The order data. The properties that are required to update an order can be found in the order model.
int $orderId The ID of the order
public deleteOrder(int $orderId):bool

Delete an order

Parameters
int $orderId The ID of the order
public undeleteOrder(int $orderId, float $status):Order

Restore an order

Parameters
int $orderId The ID of the order
float $status The status of the order
public isDeleted(int $orderId):bool

Checks whether an order has been deleted or not.

Parameters
int $orderId The ID of the order
public findSchedulerById(int $schedulerId):OrderScheduler

Get a scheduler order

Parameters
int $schedulerId The ID of the scheduler order
public allOrdersByContact(int $contactId, int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List orders of a contact

Parameters
int $contactId The ID of the contact
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of orders to be displayed per page. The default number of orders per page is 50.
array $with The relations to load in the Order instance. Valid are "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments".
public allOrdersBySupplier(int $contactId, int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List orders that include one or more variations from a supplier

Parameters
int $contactId The ID of the contact (supplier id)
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of orders to be displayed per page. The default number of orders per page is 50.
array $with The relations to load in the Order instance. Valid are "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments".
public allOrdersByContactSender(int $contactId, int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List orders sent by a contact

Parameters
int $contactId The ID of the contact
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of orders to be displayed per page. The default number of orders per page is 50.
array $with The relations to load in the Order instance. Valid are "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments".
public getLatestOrderByContactId(int $contactId, array $with = []):Order

Get latest order of a contact

Parameters
int $contactId The ID of the contact
array $with The relations to load in the Order instance. The relations available are: "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments". If you want to load relations, you need to include at least one, but you can also include several or all.
public searchOrders(int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List orders

Parameters
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of orders to be displayed per page. The default number of orders per page is 50.
array $with The relations to load in the Order instance. Valid are "addresses", "events", "dates", "relation", "reference", "location", "payments", "documents" and "comments".
public getPackageNumbers(int $orderId):array

List package numbers of an order

Parameters
int $orderId The ID of the order
public cancelOrder(int $orderId, array $data):void

Cancel an order

Parameters
int $orderId The ID of the order
array $data The request data
public findOrderByAccessKey(int $orderId, string $accessKey):Order

Find the order for the given order ID and access key.

Parameters
int $orderId The ID of the order to be checked.
string $accessKey The access key, that belongs to the order.
public generateAccessKey(int $orderId):string

Generate an access key for the given order ID.

Parameters
int $orderId
public completeOrder(int $orderId, array $data = []):Order

Complete an incomplete order.

Parameters
int $orderId The ID of the order
array $data Additional data. Currently only the statusId can be specified.
public createMultiOrderByContact(int $contactId):Order

Creates a multi order for a specific contact

Parameters
int $contactId
public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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.

OrderItemRepositoryContract

The OrderItemRepositoryContract is the interface for the order item repository. This interface allows you to find, create and update order items. An order item can be e.g. items, surcharges and coupons. Each order item is given a unique id, which links it to a specific order.

Namespace

Plenty\Modules\Order\Contracts

Methods

public getOrderItem(int $orderItemId):OrderItem

Get an order item

Parameters
int $orderItemId The ID of the order item
public deleteOrderItem(int $orderId, int $orderItemId):bool

Delete an order item

Parameters
int $orderId The ID of the order that the item belongs to.
int $orderItemId The ID of the order item to be deleted.

Events

OrderPartlyPaid

An Event class fired after a payment is assigned and if the order is only partly paid.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

SubscriptionChildOrderCreated

An event class fired after a new order for a subscription is created. The order type is not relevant.

  • At the same time also type depended events will be fired, like ReturnsCreated or CreditNoteCreated.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderOverpaid

An event class will be fired after a payment is assigned and if the order is overpaid.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderCreated

An event class fired after a new order is created. The order type is not relevant.

  • At the same time also type depended events will be fired, like ReturnsCreated or CreditNoteCreated.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderPaidEvent

A base Event class for all order paid events.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderFullyPaid

An Event class fired after a payment assignment when the order is fully paid.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderPaymentAssigned

An Event class fired after a payment was assigned to an order.

  • After this event one of the following events will be fired, depending the payment status of the order:
  • OrderPrepaid, OrderPartlyPaid, OrderFullyPaid, OrderOverpaid.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order, Payment
 $payment):void

OrderPaymentAssigned constructor.

Parameters
Order $order
Payment $payment
public getPayment():Payment

Get the payment.

public getOrder():Order

Get the order instance.

OrderPrepaid

An Event class fired after a payment is assigned and if the order is paid in advance.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

OrderEvent

A base event class for all order events. Each order event expects an order instance.

Namespace

Plenty\Modules\Order\Events

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

Services

OrderCreatedTypeService

This class is used as an event listener as well as a service for registering events. The class allows to register event classes to extend the OrderCreated event for custom order types.

Namespace

Plenty\Modules\Order\Services

Methods

public handle(OrderCreated
 $created):void

Reacts upon the OrderCreated event

Parameters
OrderCreated $created The event instance.
public static addEventForType(int $typeId, string $className):void

Create event class for a custom order type

Parameters
int $typeId The ID of the custom order type.
string $className The name of the event class.
public static removeEventForType(int $typeId, string $className):void

Delete event class from a custom order type

Parameters
int $typeId The ID of the custom order type.
string $className The name of the event class.

Contact

Contracts

CouponCodeContactRepositoryContract

This is the contract for the coupon codes by contacts repository. It allows you to list coupon codes redeemed by a contact as well as to create, update and delete redeemed coupon codes.

Namespace

Plenty\Modules\Order\Coupon\Code\Contact\Contracts

Methods

public create(array $data):CouponCodeContact

Create redeemed coupons for a contact.

Parameters
array $data The redeemed coupon data. The properties that are required to create an entry can be found in the CouponCodeContact model.
public update(int $contactId, int $campaignId, string $coupon, array $data):CouponCodeContact

Update a redeemed coupon of a contact.

Parameters
int $contactId The ID of the contact that redeemed the coupon code
int $campaignId The ID of the coupon campaign
string $coupon The coupon code
array $data The redeemed coupon data. The properties that are required to update an entry can be found in the CouponCodeContact model
public find(int $contactId, int $campaignId, string $coupon):CouponCodeContact

Get a redeemed coupon for a contact

Parameters
int $contactId The ID of the contact which redeemed the coupon code
int $campaignId The ID of the coupon campaign
string $coupon The coupon code
public findByContact(int $contactId, int $page = 1, int $itemsPerPage = 50):PaginatedResult

List redeemed coupons for a contact

Parameters
int $contactId The contact ID as filter for redeemed coupons.
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of coupons to be displayed per page. The default number of coupons per page is 50.
public findByCampaign(int $campaignId, int $page = 1, int $itemsPerPage = 50):PaginatedResult

List redeemed coupons of a campaign.

Parameters
int $campaignId The campaign ID as filter for redeemed coupons.
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of coupons to be displayed per page. The default number of coupons per page is 50.
public findByCoupon(string $coupon, int $page = 1, int $itemsPerPage = 50):PaginatedResult

List redeemed coupons of a coupon code

Parameters
string $coupon The coupon code
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of coupons to be displayed per page. The default number of coupons per page is 50.

Models

CouponCodeContact

The CouponCodeContact model.

Namespace

Plenty\Modules\Order\Coupon\Code\Contact\Models

Properties

Type Name Description
string code The coupon code
int contactId The ID of the contact that redeemed the coupon
float openAmount The coupon amount that can still be redeemed
int redeemCount How many times a coupon code has already been redeemed
updatedAt The date that the coupon code was updated last.
int campaignId The ID of the campaign that the coupon belongs to
int externalTransactionId The ID that is assigned to a coupon by the external coupon service provider, when the coupon is redeemed.

Methods

public toArray()

Returns this model as an array.

Code

Contracts

CouponCodeRepositoryContract

The CouponCodeRepositoryContract is the interface for the coupon code repository. This interface allows you to redeem coupons.

Namespace

Plenty\Modules\Order\Coupon\Code\Contracts

Methods

public redeem(int $orderId, string $coupon):bool

Redeem coupon codes

Parameters
int $orderId The ID of the order
string $coupon The coupon code to be redeemed

CouponCampaignCodeRepositoryContract

This interface allows you to get and create coupon codes.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Code\Contracts

Methods

public getByCode(string $code, array $with = []):CouponCampaignCode

Gets a coupon code. The code string must be specified.

Parameters
string $code
array $with
public deleteCode(string $code, bool $withoutUsed = false):bool

Delete a coupon code.

Parameters
string $code
bool $withoutUsed
public create(array $data):CouponCampaignCode

Creates a coupon code. The ID of the campaign must be specified. A code can optionally be specified. A random code will be generated if the code is not specified. A coupon value can also be optionally specified. The value of the campaign will be used if no individual value is specified.

Parameters
array $data
public setDisabledByCode(string $code, int $disabled):int

Disable or enable coupon

Parameters
string $code
int $disabled

Models

CouponCampaignCode

The CouponCampaignCode model contains information about coupon codes. Each code belongs to one campaign only.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Code\Models

Properties

Type Name Description
string code The coupon code
int campaignId The ID of the campaign that the code belongs to
int disable Flag that indicates if a code is active or deactivated.
  • True = the code is deactivated
  • False = the code is active
int consumed Flag that indicates if a code was redeemed or not.
  • True = the code was redeemed
  • False = the code is not redeemed
int usedCount How many times a code has been redeemed
float usedAmount The amount that is already redeemed. The total amount that can be redeemed is defined in the campaign as coupon value, because the value applies to all codes of a campaign.
Carbon generatedAt The date and time that the code was generated
Carbon lastUsedAt The date and time that the code was redeemed last. This date will be set if the coupon amount has not been fully used.
Carbon consumedAt The date and time that the coupon amount of this code was fully consumed
Carbon expiresAt The date and time that the code will expire or has expired
float value The value of the coupon if it differs from the campaign value. The value is null if the campaign value is used.
CouponCampaign campaign The coupon campaign and all information about the campaign that this code belongs to

Methods

public toArray()

Returns this model as an array.

Validation

Contracts

CouponCodeValidatorContract

CouponCodeValidatorContract is the interface for the coupon code validation repository. This interface provides the functionality to validate coupon data.

Namespace

Plenty\Modules\Order\Coupon\Code\Validation\Contracts

Methods

public validate(CouponCodeValidation
 $validationData):CouponCodeValidation

Validate a coupon code

Parameters
CouponCodeValidation $validationData The data to validate a coupon

Models

CouponCodeValidation

The CouponCodeValidation data model contains all data necessary for validating a coupon.

Namespace

Plenty\Modules\Order\Coupon\Code\Validation\Models

Properties

Type Name Description
int campaignId The ID of the campaign
string validationType The type of the campaign. Currently the only type available is plentymarkets.
items The list of items or variations to be validated
int contactId The ID of the contact that wants to redeem the coupon
string couponCode The coupon code
string currency The currency of the purchase
float referrer The order referrer
float salesDiscount The total discount from a coupon applied to an order. The discount is given as gross amount.
float salesDiscountNet The net discount from a coupon applied to an order. The net discount is the total discount minus the vat amount.
float itemDiscount The discount amount applied to items.
float itemDiscountNet The net discount applied to items.
float shippingDiscount The discount applied to shipping costs.
float shippingDiscountNet The net discount applied to shipping costs.
array usedVatFields The vat fields used for the validation
float restCouponAmount The remaining coupon amount
array checkedItems The list of variations that passed the validation
array validateParams Validation parameters
string couponCampaignType The campaign type

Methods

public toArray()

Returns this model as an array.

CouponCodeValidationItem

The CouponCodeValidationItem model contains all item data needed for validating whether the coupon can be redeemed for these items or not.

Namespace

Plenty\Modules\Order\Coupon\Code\Validation\Models

Properties

Type Name Description
float amount The price of a variation multiplied by the quantity
int noCoupon Flag that indicates whether a variation can be bought with a coupon, can exclusively be bought with a coupon or can not be bought with a coupon.
int quantity The quantity of the variation
float singlePrice The price of a single variation
int itemId The ID of the item
int vatField The field of the VAT rate

Methods

public toArray()

Returns this model as an array.

Campaign

Contracts

CouponCampaignRepositoryContract

This is the contract for the coupon campaign repository. It allows you to get coupon campaigns.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Contracts

Methods

public findById($id):CouponCampaign

Get a coupon campaign

Parameters
$id The ID of the coupon campaign
public findByEmailPlaceholder(string $placeholder):CouponCampaign

Get the CouponCampaign model from the database by emailPlaceholder.

Parameters
string $placeholder The email placeholder to search the database by
public findByCouponCode(string $couponCode):CouponCampaign

Get the coupon campaign of a coupon code

Parameters
string $couponCode The coupon code to search the database by
public getCouponDisplayType(CouponCodeValidation
 $couponCodeValidation):string

Get the display type of a coupon

Parameters
CouponCodeValidation $couponCodeValidation
public create(array $data):CouponCampaign

Create a coupon campaign

Parameters
array $data
public modifyCampaignUsage(int $couponCampaignId, string $operator, string $field):void

Modifies the two counter 'used' and 'unused'

Parameters
int $couponCampaignId ID of the Coupon Campaign
string $operator How should the usage been modified ( '+' or '-' )
string $field Usage type to modify ( 'used' or 'unused' )
public delete(int $couponCampaignId):bool

Delete a coupon campaign

Parameters
int $couponCampaignId The ID of the coupon campaign

Models

CouponCampaign

The CouponCampaign model contains all information of a campaign.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Models

Properties

Type Name Description
int id The ID of a coupon campaign
string externalId DEPRECATED! The external ID of a coupon campaign
string name The name of the coupon campaign
int variable The variable to display coupon codes in emails. There are only 10 variables available. A variable may only be used for one campaign. The variable names follow this pattern: CouponCode + Number e.g. CouponCode1.
bool isPermittedForExternalReferrers Flag that indicates whether or not coupons can be redeemed if a customer enters the online store from an external referrer.
  • TRUE = The coupon can be redeemed if the customer enters the online store from an external referrer

  • FALSE = The coupon can not be redeemed
bool includeShipping The discount also applies to shipping costs. The property will be only be set if the discount type fixed is set.
int unusedCodesCount The number of codes that have been redeemed
int usedCodesCount The number of codes that have not been redeemed
string endsAt The date that the campaign ends
string startsAt The date that the campaign starts
float minOrderValue The minimum order value that needs to be reached for the coupon to be redeemed. If the value is not reached the coupon will not be redeemed.
int codeDurationWeeks The number of weeks that codes of this campaign can be redeemed after they have been generated.
string codeAssignment The code assignment is only relevant for vouchers. Codes can either be generated every time a voucher is bought or a code from a previously created list of codes can be used. The two options available are generate and use_existing.
  • generate = a new code is generated on demand
  • use_existing = the code already exists and is taken from a previously entered list of codes
string codeLength There are 3 different length available. The code can be 6, 16, 24 or 32 characters long.
string usage The usage defines what the coupon codes from this campaign can be used for. There are three options available:
  • single_and_subscription = The codes can be used for single orders and subscription orders
  • single_order = The codes can be used for single orders only
  • subscription = The codes can be used for subscriptions only
string concept The campaign concept defines how many codes belong to a campaign. The concept interacts with the redeem type that is explained next. There are two concept options available:
  • single_code = The campaign has only one code
  • multi_code = The campaign has several codes
string redeemType The redeem type defines how many times a code of a campaign can be redeemed. There are 4 redeem types available:
  • multi_redeem_per_user = Each customer is allowed to redeem the same code several times
  • single_redeem_per_user = Each customer can only redeem the same code once
  • redeem_until_value_reached = A code can be entered several times by the same customer or by different customers, but only until the coupon value is depleted
  • unique_redeem = The code can be redeemed once. If several customers get the same code, only the first customer to enter the code can use it.
The redeem type interacts with the concept. Pay attention to the combination these two options form.
string discountType There are 4 discount types available:
  • fixed = The coupon value is a fixed amount of money. This discount type is the only one that makes sense for coupons that are sold in the online store. The actual amount of money needs to be set with the value property.
  • percent = The discount is given as percentage and the actual value depends on the purchase. The actual number of percent need to be set with the value property.
  • item = The discount applies to entire items. A typical example would be - Buy 1 get 1 free - or in other words - Get 2 for the price of 1. The number of items the customer gets and the number of items the customer has to pay for need to be set with itemDiscountToPay and itemDiscountToBuy.
  • shipping = The shipping does not cost anything. The cost will be set to zero no matter what the actual shipping costs are.
int itemDiscountToPay The number of items that the customer has to pay for. This number needs to be compared to the number of items the customer receives, itemDiscountToBuy
int itemDiscountToBuy The number of items that the customer receives, but he or she only has to pay for the number of items set with itemDiscountToPay.
string campaignType The two campaign types available are coupon or voucher.
string couponType The coupon type is only for campaigns that have the campaign type coupon. The two coupon types available are promotion and sales.
string description The description of the campaign
float value The actual discount value of a coupon. The value needs to be set for the two discount types fixed and percent.
Collection codes The codes and information about the codes that belong to this CouponCampaign
Collection references These references are available
  • category =
  • item =
  • webstore =
  • customer_group =
  • customer_type =

Methods

public toArray()

Returns this model as an array.

Reference

Contracts

CouponCampaignReferenceRepositoryContract

This is the contract for the coupon campaign reference repository. It allows you to get and create coupon campaigns references.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Reference\Contracts

Methods

public findByCouponCampaignId(int $couponCampaignId):Collection

Get a coupon campaign

Parameters
int $couponCampaignId The ID of the coupon campaign
public create(array $data):Collection

Create a Coupon Campaign reference

Parameters
array $data

Models

CouponCampaignReference

The CouponCampaignReference model contains all information of a campaign reference.

Namespace

Plenty\Modules\Order\Coupon\Campaign\Reference\Models

Properties

Type Name Description
int campaignId The ID of a coupon campaign
string referenceType The reference type defines the type of the reference. There are five reference types available:
  • category =
  • item =
  • webstore =
  • customer_group =
  • customer_type =
int value The name of the coupon campaign

Methods

public toArray()

Returns this model as an array.

SerialNumber

Contracts

OrderSerialNumberRepositoryContract

List serial numbers for orders

Namespace

Plenty\Modules\Order\SerialNumber\Contracts

Methods

public listSerialNumbersByOrder(int $orderId):void

List serial numbers of an order

Parameters
int $orderId The ID of the order
public listSerialNumbersByOrderItem(int $orderItemId):void

List serial numbers if an order item

Parameters
int $orderItemId The ID of the order item

Models

OrderSerialNumber

The order serial number model

Namespace

Plenty\Modules\Order\SerialNumber\Models

Properties

Type Name Description
int serialNumberId The ID of the serial number
int orderId The ID of the order
int orderItemId The ID of the order item
string serialNumber The serial number

Methods

public toArray()

Returns this model as an array.

Idea

Models

Export

The export model for IDEA exports.

Namespace

Plenty\Modules\Order\Export\Pos\Idea\Models

Properties

Type Name Description
int id The id of the export entry.
string token The token generated for the export entry.
float progress The progress of the export process.
string currentModule The currently exporting module of the export process.
string state The current state of the export process.
string filename The filename of the export content.
Carbon createdAt Specifies the creation date of the export entry.
Carbon updatedAt Specifies the last update date of the export entry.
Collection modules The modules to be used by the export process.
Collection options The options for the export process. Currently only "year" is supported as option key.

Methods

public toArray()

Returns this model as an array.

Currency

Contracts

CurrencyRepositoryContract

Provides methods for currency data.

Namespace

Plenty\Modules\Order\Currency\Contracts

Methods

public getCurrency(string $currencyIso, array $columns = [], array $with = []):Currency

Get a currency

Parameters
string $currencyIso The currency ISO 4217 code, e.g. "EUR".
array $columns The attributes to be loaded in the currency instance.
array $with The relations to be loaded in the currency instance. Valid relations are "names" or "countries").
public getCurrencyList(array $columns = [], array $with = []):void

Get all currencies supported in the system.

Parameters
array $columns The attributes to be loaded in the currency instances.
array $with The relations to be loaded in the currency instance. Valid relations are "names" or "countries".
public getCurrencyCountries(string $currencyIso, array $columns = []):void

List countries for a currency

Parameters
string $currencyIso The currency ISO 4217 code, e.g. "EUR".
array $columns The attributes to be loaded in the country instances.
public getCountryCurrency(int $countryId, array $columns = [], array $with = []):Currency

Get a currency for a country

Parameters
int $countryId The country id.
array $columns The attributes to be loaded in the currency instance.
array $with The relations to be loaded in the currency instance ("names" or "countries").

CurrencyConversionSettingsRepositoryContract

Provides methods for currency conversion data.

Namespace

Plenty\Modules\Order\Currency\Contracts

Methods

public getCurrencyConversionList():array

Gets the currency conversion setting.

Models

CurrencyName

The currency name model.

Namespace

Plenty\Modules\Order\Currency\Models

Properties

Type Name Description
int id The ID of the currency name
string currency The currency
string lang The language of the currency name
string name The name in the language
Currency currencyInstance The currency instance.

Methods

public toArray()

Returns this model as an array.

Currency

The currency model. The model includes information like the ISO 4217 code and the related currency symbols as well as the countries that a currency is used in.

Namespace

Plenty\Modules\Order\Currency\Models

Properties

Type Name Description
string currency The ISO 4217 code and id of the currency.
string htmlCode The html code (entity) for the currency.
string unicodeSign The unicode symbol for the currency. If no unicode symbol exists, the html code will be used.
bool isActive Flag that indicates if the currency is active in the system or not. Currencies are activated per sales price.
bool isErasable Flag that indicates if this currency can be deleted or not.
  • False = Currency cannot be deleted
  • True = Currency can be deleted
countries A list of countries that use the currency.
names A list of names in different languages for the currency.

Methods

public toArray()

Returns this model as an array.

CurrencyCountryRelation

The CurrencyCountryRelation model indicates which currency is related to which country.

Namespace

Plenty\Modules\Order\Currency\Models

Properties

Type Name Description
int id The ID of the relation
string currency The currency
int countryId The ID of the country
Country country The related country information
Currency currencyInstance The related currency information

Methods

public toArray()

Returns this model as an array.

Referrer

Contracts

OrderReferrerRepositoryContract

Provides methods for processing order referrers. An order referrer indicates where a purchase was made originally.

Namespace

Plenty\Modules\Order\Referrer\Contracts

Methods

public getList(array $columns = []):void

List order referrers

Parameters
array $columns The columns (attributes) to load in the instances.
public create(array $data, float $parentReferrerId = null):OrderReferrer

Create an order referrer

Parameters
array $data The order referrer data. The properties that are required to create an order referrer can be found in the order referrer model.
float $parentReferrerId If a parent referrer ID is specified, the new referrer will be created as a sub referrer to this one and will be assigned a sub referrer ID. Sub referrer IDs are build of an integer part and a fractional part. The integer part is the parent ID followed by a 2 character long fractional part. This way the relation between a sub referrer and the parent referrer can be seen easily.
public update(array $data, float $referrerId):OrderReferrer

Update an order referrer

Parameters
array $data The order referrer data. The properties that are required to update an order referrer can be found in the order referrer model.
float $referrerId The ID of the order referrer
public getReferrerById(float $referrerId, array $columns = []):OrderReferrer

Get an order referrer

Parameters
float $referrerId The ID of the order referrer
array $columns The columns (attributes) to load in the instances.
public delete(float $referrerId):bool

Delete an order referrer.

Parameters
float $referrerId The ID of the order referrer
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.

Models

OrderReferrer

The order referrer model. An order referrer shows where a purchase was originally made.

Namespace

Plenty\Modules\Order\Referrer\Models

Properties

Type Name Description
float id The ID of the order referrer
bool isEditable Flag that indicates if this referrer can be updated as well as deleted or not
  • True = the referrer can be edited and deleted
  • False = the referrer can neither be edited nor deleted
string backendName The backend name of the referrer
string name The public name of the referrer as it is displayed e.g. on documents
int orderOwnerId The user ID of whoever owns new orders from this referrer
bool isFilterable Flag that indicates if this referrer can be used as a filter or not
  • True = Can be used as a filter
  • False = Cannot be used as a filter
string origin The origin of this referrer

Methods

public toArray()

Returns this model as an array.

Transaction

Contracts

OrderItemTransactionRepositoryContract

List and create order item transactions.

Namespace

Plenty\Modules\Order\Transaction\Contracts

Methods

public list(int $orderItemId, array $columns = [], array $with = []):Collection

List transactions

Parameters
int $orderItemId
array $columns
array $with
public create(array $data):OrderItemTransaction

Create a transaction

Parameters
array $data

Models

OrderItemTransaction

The order item transaction model.

Namespace

Plenty\Modules\Order\Transaction\Models

Properties

Type Name Description
int id The ID of the transaction
int orderItemId The ID of the order item
float quantity The quantity
int userId The ID of the user
string identification External identification. Can be an arbitrary string
string status The status. Possible values are 'in' and 'out'
int receiptId The receipt ID
int warehouseLocationId The ID of the warehouse location
int batchBestBeforeDateId The ID of the batch or best before date
createdAt The date the transaction was created
updatedAt The date the transaction was last updated
OrderItem orderItem The order item the transaction belongs to

Methods

public toArray()

Returns this model as an array.

RelationReference

Contracts

OrderRelationReferenceRepositoryContract

Get, create, update and delete order relation references.

Namespace

Plenty\Modules\Order\RelationReference\Contracts

Methods

public find(int $id):OrderRelationReference

Get a relation reference by ID

Parameters
int $id The ID of the relation reference
public findByComposite(int $orderId, string $referenceType, string $relation):OrderRelationReference

Get a relation reference by composite key

Parameters
int $orderId The ID of the order
string $referenceType The reference type. Valid types are:
  • contact
  • warehouse
  • account
string $relation The relation. Valid relations are:
  • sender
  • receiver
public findByOrderId(int $orderId):void

List relation references by order ID

Parameters
int $orderId The ID of the order
public findByAnyValues(array $values, int $page = 1, int $itemsPerPage = 50):PaginatedResult

List relation references by any values

Parameters
array $values The array with the given filter values. E.g. ['referenceType' => 'contact']. Valid filters are:
  • id
  • orderId
  • referenceType
  • referenceId
  • relation
int $page The page to get
int $itemsPerPage The items per page
public create(array $data):OrderRelationReference

Create a relation reference

Parameters
array $data The request data
public update(int $id, array $data):OrderRelationReference

Update a relation reference by ID

Parameters
int $id The ID of the relation reference
array $data The request data
public updateByComposite(int $orderId, string $referenceType, string $relation, array $data):OrderRelationReference

Update a relation reference by composite key

Parameters
int $orderId The ID of the order
string $referenceType The reference type. Valid types are:
  • contact
  • warehouse
  • account
string $relation The relation. Valid relations are:
  • sender
  • receiver
array $data The request data
public delete(int $id):bool

Delete a relation reference by ID

Parameters
int $id The ID of the relation reference
public deleteByComposite(int $orderId, string $referenceType, string $relation):bool

Delete a relation reference by composite key

Parameters
int $orderId The ID of the order
string $referenceType The reference type. Valid types are:
  • contact
  • warehouse
  • account
string $relation The relation. Valid relations are:
  • sender
  • receiver

Models

OrderRelationReference

The order relation reference model specifies how references and orders are related to one another.

Namespace

Plenty\Modules\Order\RelationReference\Models

Properties

Type Name Description
int id The relation reference id.
int orderId The order id.
string referenceType The reference type. The reference types available are the following:
  • contact
  • account
  • warehouse
int referenceId The reference id.
string relation The relation between a reference and an order. The relation types available are the following:
  • sender
  • receiver
Order order The order that the reference belongs to.
Contact contactReceiver The Contact referenced with relation "receiver".
Contact contactSender The Contact referenced with relation "sender".
Account accountReceiver The Account referenced with relation "receiver".
Account accountSender The Account referenced with relation "sender".

Methods

public toArray()

Returns this model as an array.

Property

Contracts

OrderItemPropertyRepositoryContract

The OrderItemPropertyRepositoryContract contains the functionality to find, create, update and delete OrderItemProperty instances.

Namespace

Plenty\Modules\Order\Property\Contracts

Methods

public find(int $id):OrderItemProperty

Find an order item property by its ID.

Parameters
int $id The ID of the order item property.
public create(array $data = []):OrderItemProperty

Create an order item property

Parameters
array $data The order item property data. The properties that are required to create an order item can be found in the OrderItemProperty model.
public update(array $data, int $id):OrderItemProperty

Update an order item property

Parameters
array $data The order item property data. The properties that are required to create an order item can be found in the OrderItemProperty model.
int $id The ID of the order item property
public save(array $data = []):OrderItemProperty

Create or update an order item property

Parameters
array $data The order item property data. The properties that are required to create an order can be found in the OrderItemProperty model.
public delete(int $id):bool

Delete an order item property

Parameters
int $id The ID of the order item property
public findByOrderItemIdAndTypeId(int $orderItemId, int $typeId):OrderItemProperty

Get an order item property by an order item ID and an order property type ID.

Parameters
int $orderItemId The ID of the order item
int $typeId The ID of the property type
public createByOrderItemIdAndTypeId(array $data, int $orderItemId, int $typeId):OrderItemProperty

Create an order item property by an order item ID and an order property type ID.

Parameters
array $data The order item property data. The properties that are required to create an order can be found in the OrderItemProperty model.
int $orderItemId The ID of the order item
int $typeId The ID of the property type
public updateByOrderItemIdAndTypeId(array $data, int $orderItemId, int $typeId):OrderItemProperty

Update an order item property by an order item ID and an order property type ID.

Parameters
array $data The order item property data. The properties that are required to create an order can be found in the OrderItemProperty model.
int $orderItemId The ID of the order item
int $typeId The ID of the property type
public deleteByOrderItemIdAndTypeId(int $orderItemId, int $typeId):bool

Delete an order item property by an order item ID and an order property type ID.

Parameters
int $orderItemId The ID of the order item
int $typeId The ID of the property type
public findByOrderItemId(int $orderItemId):void

List order item properties of an order item.

Parameters
int $orderItemId The ID of the order

OrderPropertyRepositoryContract

The OrderPropertyRepositoryContract contains the functionality to get, list, create, update and delete OrderPropertyTypes and OrderProperties as well as OrderProperties. Order properties contain information that are additional to an order. Each property has a type and each type can have several names, but only one name per language. An order can only have one property of each property type.

Namespace

Plenty\Modules\Order\Property\Contracts

Methods

public create(array $data = []):OrderProperty

Create an order property

Parameters
array $data The order property data. The properties that are required to create an order can be found in the OrderProperty model.
public update(array $data, int $orderPropertyId = null):OrderProperty

Update an order property

Parameters
array $data The order property data. The properties that are required to create an order can be found in the OrderProperty model.
int $orderPropertyId The ID of the order property.
public delete($data = []):bool

Deletes an order property. The ID of the order property must be specified.

Parameters
$data Either the ID of the property or an array holding the composite key composed of the order ID and the type ID.
public findByOrderId(int $orderId, int $typeId = null):void

List order properties of an order

Parameters
int $orderId The ID of the order.
int $typeId The ID of the type.
public getType(int $typeId, array $languages = []):OrderPropertyType

Get a property type

Parameters
int $typeId The ID of the property type
array $languages The languages to load
public getTypes(array $languages = []):void

List order property types

Parameters
array $languages The languages to load
public createType(array $data = []):OrderPropertyType

Create an order property type

Parameters
array $data The order property type data. The properties that are required to create a type can be found in the OrderPropertyType model.
public updateType(array $data, int $id):OrderPropertyType

Update an order property type

Parameters
array $data The order property type data.
int $id The ID of the order property type.
public deleteType(int $id):bool

Delete an order property type

Parameters
int $id The ID of the order property type

Models

OrderPropertyTypeName

The order property type name model. Each order property type can have one name per language.

Namespace

Plenty\Modules\Order\Property\Models

Properties

Type Name Description
int id The ID of type name
int typeId The ID of the property type
string name The name of property type
string lang The language of the type name
OrderPropertyType type The property type instance.

Methods

public toArray()

Returns this model as an array.

OrderPropertyType

The OrderPropertyType model. Each order property must have a property type. An order can have one property of each property type. The default property types provided by plentymarkets are listed here.

Namespace

Plenty\Modules\Order\Property\Models

Properties

Type Name Description
int id The ID of the property type
bool isErasable Flag that states if this type can be deleted or not.
int position The position for sorting
string cast The data type of the values of this property type. Valid types are:
  • string
  • int
  • numeric
  • bool
  • enum(val1,val2,val3,...)
array names The names of the order property types.

Methods

public toArray()

Returns this model as an array.

OrderItemProperty

The order item property model.

Namespace

Plenty\Modules\Order\Property\Models

Properties

Type Name Description
int id The ID of the order item property.
int orderItemId The ID of the order item that the property belongs to.
int typeId The ID of the property type.
  • WAREHOUSE = 1
  • SHIPPING_PROFILE = 2
  • PAYMENT_METHOD = 3
  • WEIGHT = 11
  • WIDTH = 12
  • LENGTH = 13
  • HEIGHT = 14
  • EXTERNAL_TOKEN_ID = 16
  • EXTERNAL_ITEM_ID = 17
  • COUPON_CODE = 18
  • COUPON_TYPE = 19
  • ORIGINAL_WAREHOUSE = 20
  • ORIGINAL_QUANTITY = 21
  • CATEGORY_ID = 22
  • MARKET_FEE = 23
  • STOCK_REVERSING = 24
  • DISPUTE_STATUS = 25
  • NO_CHANGE_BY_CONTACT = 26
  • SIZE = 29
  • LOCATION_RESERVED = 30
  • EXTERNAL_SHIPMENT_ITEM_ID = 31
  • PARTIAL_SHIPPING_COSTS = 32
  • MAIN_DOCUMENT_NUMBER = 33
  • SALES_TAX_ID_NUMBER = 34
  • RETURNS_REASON = 35
  • RETURNS_ITEM_STATUS = 36
  • FULFILLMENT_CENTER_ID = 37
  • FULFILLMENT_CENTER_COUNTRY_ISO = 38
  • REORDER_ITEM_ID = 39
  • LISTING_TYPE = 40
  • SOLD_COUPON_CODE = 46
  • ORDER_ITEM_STATE = 48
string value The value of the property. The value depends on type.
createdAt The date that the property was created.
updatedAt The date that the property was last updated.
OrderItem orderItem The order item that the property belongs to.
OrderPropertyType type The type of the property.

Methods

public toArray()

Returns this model as an array.

OrderProperty

The order properties model. Each order property has a type.

Namespace

Plenty\Modules\Order\Property\Models

Properties

Type Name Description
int id The ID of the order property
int orderId The ID of the order that the property belongs to
int typeId The ID of the property type. The following types are available:
  • WAREHOUSE = 1
  • SHIPPING_PROFILE = 2
  • PAYMENT_METHOD = 3
  • PAYMENT_STATUS = 4
  • EXTERNAL_SHIPPING_PROFILE = 5
  • DOCUMENT_LANGUAGE = 6
  • EXTERNAL_ORDER_ID = 7
  • CUSTOMER_SIGN = 8
  • DUNNING_LEVEL = 9
  • SELLER_ACCOUNT = 10
  • WEIGHT = 11
  • WIDTH = 12
  • LENGTH = 13
  • HEIGHT = 14
  • FLAG = 15
  • EXTERNAL_TOKEN_ID = 16
  • EXTERNAL_ITEM_ID = 17
  • COUPON_CODE = 18
  • COUPON_TYPE = 19
  • SALES_TAX_ID_NUMBER = 34
  • MAIN_DOCUMENT_NUMBER = 33
  • PAYMENT_TRANSACTION_ID = 45
  • EXTERNAL_TAX_SERVICE = 47
string value The value of the property. The value depends on the type.
createdAt The date that the property was created.
updatedAt The date that the property was updated last.
Order order The order that the property belongs to.

Methods

public toArray()

Returns this model as an array.

Date

Contracts

OrderDateRepositoryContract

The OrderDateRepositoryContract contains the functionality to find available OrderDateTypes with their names in a specific language. Furthermore it is possible to create new OrderDateTypes, to update or delete existing date types and to create date type names for a language.

Namespace

Plenty\Modules\Order\Date\Contracts

Methods

public findNamesByTypeId(int $typeId):void

List names of a date type

Parameters
int $typeId The ID of the date type
public findNameByTypeIdAndLang(int $typeId, string $lang):OrderDateTypeName

Get a name of a date type

Parameters
int $typeId The ID of the date type
string $lang The language ISO 639-1 code, e.g. "en" for English
public findTypes(array $languages = []):void

List date types

Parameters
array $languages The languages to load
public findTypeById(int $typeId):OrderDateType

Get a date type

Parameters
int $typeId The ID of the date type
public create(array $data = []):OrderDate

Create an order date

Parameters
array $data The order date data. The properties that are required to create an order can be found in the OrderDate model.
public update(array $data, int $orderDateId):OrderDate

Update a date

Parameters
array $data The order date data. The properties that are required to create an order can be found in the OrderDate model.
int $orderDateId The ID of the order date
public save(array $data = []):OrderDate

Create or update an order date

Parameters
array $data The order date data. The properties that are required to create an order can be found in the OrderDate model.
public delete(int $orderDateId):bool

Delete a date

Parameters
int $orderDateId The ID of the order date
public deleteByOrderIdAndType(int $orderId, int $typeId):void

Delete an order date from an order by the type of the order date

Parameters
int $orderId The ID of the order
int $typeId The ID of the date type.
public findByOrderIdAndTypeId(int $orderId, int $typeId):OrderDate

Get an order date from an order by the type of the order date

Parameters
int $orderId The ID of the order
int $typeId The ID of the date type
public findByOrderId(int $orderId):void

List order dates of an order

Parameters
int $orderId The ID of the order

OrderItemDateRepositoryContract

The OrderItemDateRepositoryContract contains the functionality to get, create, update and delete OrderItemDate instances.

Namespace

Plenty\Modules\Order\Date\Contracts

Methods

public find(int $id):OrderItemDate

Get an order item date

Parameters
int $id The ID of the order item date.
public create(array $data = []):OrderItemDate

Create an order item date

Parameters
array $data The order item date data. The properties that are required to create an order item can be found in the OrderItemDate model.
public update(array $data, int $id):OrderItemDate

Update an order date

Parameters
array $data The order item date data. The properties that are required to create an order item can be found in the OrderItemDate model.
int $id The ID of the order item date
public save(array $data = []):OrderItemDate

Create or update an order item date

Parameters
array $data The order item date data. The properties that are required to create or update an order can be found in the OrderItemDate model.
public delete(int $id):bool

Delete a date

Parameters
int $id The ID of the order item date
public findByOrderItemIdAndTypeId(int $orderItemId, int $typeId):OrderItemDate

Get an order item date by an order item and an order date type.

Parameters
int $orderItemId The ID of the order item
int $typeId The ID of the date type
public createByOrderItemIdAndTypeId(array $data, int $orderItemId, int $typeId):OrderItemDate

Create an order item date by an order item and an order date type.

Parameters
array $data The order item date data. The properties that are required to create an order can be found in the OrderItemDate model.
int $orderItemId The ID of the order item
int $typeId The ID of the date type
public updateByOrderItemIdAndTypeId(array $data, int $orderItemId, int $typeId):OrderItemDate

Update an order item date by an order item and an order date type.

Parameters
array $data The order item date data. The properties that are required to update an order can be found in the OrderItemDate model.
int $orderItemId The ID of the order item
int $typeId The ID of the date type
public deleteByOrderItemIdAndTypeId(int $orderItemId, int $typeId):bool

Delete an order item date by an order item and an order date type.

Parameters
int $orderItemId The ID of the order item
int $typeId The ID of the date type
public findByOrderItemId(int $orderItemId):void

List order item dates of an order item.

Parameters
int $orderItemId The ID of the order

Models

OrderDateType

The OrderDateType model.

Namespace

Plenty\Modules\Order\Date\Models

Properties

Type Name Description
int id The ID of the order date type. The following date types are available:
  • Deleted on = 1
  • Created on = 2
  • Paid date = 3
  • Last update = 4
  • Completed on = 5
  • Return date = 6
  • Payment due date = 7
  • Estimated shipping date = 8
  • Start date = 9
  • End date = 10
  • Possible delivery date = 11
  • Market transfer date = 12
  • Subscription cancelled on = 13
  • Subscription last run = 14
  • Subscription next run = 15
bool isErasable Flag that indicates if this type can be deleted or not.
int position The position for sorting
names The names for this OrderDateType
orderDates The actual dates that belong to the order date type

Methods

public toArray()

Returns this model as an array.

OrderDate

The OrderDate model.

Namespace

Plenty\Modules\Order\Date\Models

Properties

Type Name Description
int id The ID of the order date
int orderId The ID of the order that the date belongs to
int typeId The ID of the date type. The following types are available:
  • Deleted on = 1
  • Created on = 2
  • Paid date = 3
  • Last update = 4
  • Completed date = 5
  • Return date = 6
  • Payment due date = 7
  • Estimated shipping date = 8
  • Start date = 9
  • End date = 10
  • Estimated delivery date = 11
  • Market transfer date = 12
  • Subscription cancelled on = 13
  • Subscription last run = 14
  • Subscription next run = 15
Carbon date The date plus hours, minutes and seconds. The date format must comply with the W3C standard.
createdAt The date when the date was created
updatedAt The date when the date was last updated
OrderDateType type The type of date

Methods

public toArray()

Returns this model as an array.

OrderItemDate

The OrderItemDate model.

Namespace

Plenty\Modules\Order\Date\Models

Properties

Type Name Description
int id The ID of the order date
int orderItemId The ID of the order item that the date belongs to
int typeId The ID of the date type. The following types are available:
  • Start date = 9
  • End date = 10
  • Estimated delivery date = 11
Carbon date The date plus hours, minutes and seconds. The date format must comply with the W3C standard.
createdAt The date when the date was created
updatedAt The date when the date was last updated
OrderDateType type The type of the date. The following date types are available:
  • Deleted on = 1
  • Created on = 2
  • Paid date = 3
  • Last update = 4
  • Completed on = 5
  • Return date = 6
  • Payment due date = 7
  • Estimated shipping date = 8
  • Start date = 9
  • End date = 10
  • Possible delivery date = 11
  • Market transfer date = 12

Methods

public toArray()

Returns this model as an array.

OrderDateTypeName

The OrderDateTypeName model. Order date types can have several names. One name per language. Each name has a unique ID.

Namespace

Plenty\Modules\Order\Date\Models

Properties

Type Name Description
int id The ID of the order date type name
int typeId The ID of the date type that this name belongs to. The following date types are available:
  • Deleted on = 1
  • Created on = 2
  • Paid date = 3
  • Last update = 4
  • Completed on = 5
  • Return date = 6
  • Payment due date = 7
  • Estimated shipping date = 8
  • Start date = 9
  • End date = 10
  • Possible delivery date = 11
  • Market transfer date = 12
string lang The ISO 639-1 language code for the name, e.g. "en" for English
string name The name of the order date type
OrderDateType type The date type that this name belongs to

Methods

public toArray()

Returns this model as an array.

ContactWish

Contracts

ContactWishRepositoryContract

This interface allows you to get and create contact wishes.

Namespace

Plenty\Modules\Order\ContactWish\Contracts

Methods

public getContactWish(int $orderId):ContactWish

Get the contact wish

Parameters
int $orderId The ID of the order
public createContactWish(int $orderId, string $text):ContactWish

Create a contact wish

Parameters
int $orderId The ID of the order
string $text The text for the contact wish

Models

ContactWish

The contact wish model.

Namespace

Plenty\Modules\Order\ContactWish\Models

Properties

Type Name Description
string text The text of the contact wish

Methods

public toArray()

Returns this model as an array.

Models

Legacy

Order

The legacy order model

Namespace

Plenty\Modules\Order\Models\Legacy

Properties

Type Name Description
int id The Id of an order
string orderType The type of an order type
int contactId The ID of the contact
float referrerId The referrer
float status The status
int userId The owner of an order
string entryDate The date that the order was entered
int webstoreId The ID of the webstore
int warehouseId The ID of the warehouse
string sellerAccount The seller account
Address deliveryAddress
Address billingAddress
Collection addresses
Collection addressRelations

Methods

public toArray()

Returns this model as an array.

Status

Contracts

OrderStatusRepositoryContract

The OrderStatusRepositoryContract is the interface for the order status repository. This interface allows you to get a single order status or to list order statuses as well as to create, update or delete.

Namespace

Plenty\Modules\Order\Status\Contracts

Methods

public get(float $statusId):OrderStatus

Get an order status.

Parameters
float $statusId The number of the order status.
public search(int $page = 1, int $itemsPerPage = 50):PaginatedResult

Search order status.

Parameters
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of order statuses to be displayed per page. The default number per page is 50.
public all():Collection

List order statuses.

public create(array $data):OrderStatus

Create an order status.

Parameters
array $data The order status data to be created.
public update(float $statusId, array $data):OrderStatus

Update an order status.

Parameters
float $statusId The number of the order status to be updated.
array $data The order status data, which is updated.
public delete(float $statusId):void

Delete an order status.

Parameters
float $statusId The number of the order status, to be deleted.
public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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

OrderStatus

The order status model

Namespace

Plenty\Modules\Order\Status\Models

Properties

Type Name Description
float statusId The ID of the status.
bool isErasable Flag that indicates whether the status is erasable or not.
createdAt The date, when the status was created.
updatedAt The date, when the status was updated.
bool isFrontendVisible
string color
Collection names The names of the order status.

Methods

public toArray()

Returns this model as an array.

Subscription

Contracts

SubscriptionOrderRepositoryContract

The SubscriptionOrderRepositoryContract allows you to find subscriptions, that due either today or on any given date, so that corresponding orders are created for them.

Namespace

Plenty\Modules\Order\Subscription\Contracts

Methods

public runToday():bool

Finds all subscriptions that are due today and creates corresponding orders for them.

public runAnyDate(string $date):bool

Finds all subscriptions that are due on the given date and creates corresponding orders for them.

Parameters
string $date The date that the subscriptions are due on. Given in the following format: Y-m-d

Search

Contracts

OrderElasticSearchScrollRepositoryContract

...

Namespace

Plenty\Modules\Order\Search\Contracts

Methods

public hasNext():bool
public setNumberOfDocumentsPerShard(int $size):void
Parameters
int $size
public setIndex(IndexInterface
 $index):ElasticSearchSearchRepositoryContract
Parameters
IndexInterface $index
public addSearch($search):ElasticSearchSearchRepositoryContract
Parameters
$search
public execute():array

Address

Contracts

OrderAddressRepositoryContract

The OrderAddressRepositoryContract is the interface for the order address repository. This interface allows you to get, create, update and delete addresses of an order.

Namespace

Plenty\Modules\Order\Address\Contracts

Methods

public findAddressByType(int $orderId, int $typeId):Address

Get an address of an order

Parameters
int $orderId The ID of the order
int $typeId The ID of the address type
public findSchedulerAddressByType(int $schedulerId, int $typeId):Address

Get an address of a scheduler order

Parameters
int $schedulerId The ID of the scheduler
int $typeId The ID of the address type
public createOrderAddress(array $data, int $orderId, int $typeId = \Plenty\Modules\Account\Address\Models\AddressRelationType::BILLING_ADDRESS):Address

Create an address for an order

Parameters
array $data The address data
int $orderId The ID of the order
int $typeId [optional] The ID of the address type. The default ID is 1 for billing address. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public updateOrderAddress(array $data, int $addressId, int $orderId, int $typeId):Address

Update an address of an order

Parameters
array $data The address data
int $addressId The ID of address
int $orderId The ID of the order
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public getAddress(int $addressId, array $with = []):Address

Get an address

Parameters
int $addressId The ID of the address
array $with The relations to load in the address instance. The relations available are "options", "contacts", "orders", "country".
public findAddresses(int $orderId):Collection

List addresses of an an order

Parameters
int $orderId The ID of the order
public getAddressOfOrder(int $addressId, int $orderId, int $typeId):Address

Get an address of an order

Parameters
int $addressId The ID of the address
int $orderId The ID of the order
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public getAddressOfScheduler(int $addressId, int $schedulerId, int $typeId):Address

Get an address of a scheduler

Parameters
int $addressId The ID of the address
int $schedulerId The ID of the scheduler
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public addOrderAddress(int $addressId, int $orderId, int $typeId):void

Create an address relation from an order to an address

Parameters
int $addressId The ID of the address
int $orderId The ID of the order
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public addSchedulerAddress(int $addressId, int $schedulerId, int $typeId):void

Create an address relation from a scheduler to an address

Parameters
int $addressId The ID of the address
int $schedulerId The ID of the scheduler
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
public deleteOrderAddress(int $addressId, int $orderId, int $typeId):bool

Delete an address relation from an order

Parameters
int $addressId The ID of the address
int $orderId The ID of the order
int $typeId The ID of the address type. The types available are:
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7

StatusHistory

Contracts

StatusHistoryRepositoryContract

This interface allows you to get the status history of an order and to list the status histories of all orders.

Namespace

Plenty\Modules\Order\StatusHistory\Contracts

Methods

public getStatusHistoryByOrderId(int $orderId, array $columns = []):Collection

Get the status history of an order

Parameters
int $orderId The ID of the order
array $columns The columns to get
public getStatusHistory(array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

List status histories

Parameters
array $columns The columns to get
int $page The page to get
int $itemsPerPage The number of entries from status histories listed per page
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(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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

StatusHistoryEntry

The status history entry model

Namespace

Plenty\Modules\Order\StatusHistory\Models

Properties

Type Name Description
int id The ID of the status history entry
int orderId The ID of the order
float statusId The ID of the status
createdAt The date when the entry was created
int userId The ID of the user
string procedureText The information text of the procedure that created the entry

Methods

public toArray()

Returns this model as an array.

Documents

Contracts

DocumentAccountingSummaryRepositoryContract

Get document accounting summaries.

Namespace

Plenty\Modules\Order\Documents\Contracts

Methods

public list(int $page = 1, int $itemsPerPage = 10):PaginatedResult

Lists document accounting summaries. A document accounting summary is saved along with each reversal document (for invoice and credit note). It contains accounting information about the order for this point in time. The summary is saved because an order can be updated after a reversal_document is generated. The information about the order before the update is needed for accounting.

Parameters
int $page The page to get. The default page that will be returned is page 1.
int $itemsPerPage The number of summaries to be displayed per page. The default number of orders per page is 10.
public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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.

OrderDocumentStorageContract

Provides methods to store, get and delete order document files. The files are stored on an AWS S3 storage by default. The implementation for this contract can be replaced by your own implementation.

Namespace

Plenty\Modules\Order\Documents\Contracts

Methods

public fileExists(string $path):bool

Check if the file path exists on the storage.

Parameters
string $path The file path
public put(string $path, string $file):void

Store a file on the storage.

Parameters
string $path The file path
string $file The file to store. Can be either a file path on the file system or an object.
public get(string $path):StorageObject

Get a file from the storage

Parameters
string $path The file path
public delete(string $path):bool

Delete a file from the storage.

Parameters
string $path The file path

Events

Created

CreditNoteCreated

An event class fired after a new credit note is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

WarrantyCreated

An event class fired after a new warranty is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

ReturnCreated

An event class fired after a new returns is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

MultiCreditNoteCreated

An event class fired after a new multi credit note is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

SalesOrderCreated

An event class fired after a new sales order is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

DeliveryOrderCreated

An event class fired after a new delivery order is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

RepairCreated

An event class fired after a new repair is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

MultiOrderCreated

An event class fired after a new multi order is created.

Namespace

Plenty\Modules\Order\Events\Created

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

Canceled

BeforeOrderCanceled

An event class fired before an order will be canceled.

Namespace

Plenty\Modules\Order\Events\Canceled

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

AfterOrderCanceled

An event class fired after an order is canceled.

Namespace

Plenty\Modules\Order\Events\Canceled

Methods

public __construct(Order
 $order):void

OrderEvent constructor.

Parameters
Order $order
public getOrder():Order

Get the order instance.

Changed

OrderStatusChanged

An event class fired after the status of an order has changed.

Namespace

Plenty\Modules\Order\Events\Changed

Methods

public __construct(Order
 $order, float $oldStatus):void

OrderStatusChanged constructor.

Parameters
Order $order
float $oldStatus
public getOldStatus():float

Get the old order status.

public getOrder():Order

Get the order instance.