@plentymarkets/shop-api / returnGetters
Variable: returnGetters ​
constreturnGetters:object
Defined in: getters/returnGetters.ts:232
Type Declaration ​
getDate ​
getDate: (
returnItem) =>string
Returns the creation date of a return item as a localised date-time string.
Parameters ​
returnItem ​
The return order object.
Returns ​
string
The formatted date-time string, or an empty string if the date is not available.
getDefaultReturnReasonId ​
getDefaultReturnReasonId: (
data) =>number|null
Returns the ID of the default return reason from a returns response.
Parameters ​
data ​
The order returns response object.
Returns ​
number | null
The default return reason ID, or null if not set.
getFormattedPrice ​
getFormattedPrice: (
price) =>string
Returns the price as a formatted string.
Parameters ​
price ​
number
The numeric price value.
Returns ​
string
The price as a string, or "0" if falsy.
getId ​
getId: (
returnItem) =>string
Returns the unique ID of a return item as a string.
Parameters ​
returnItem ​
The return order object.
Returns ​
string
The order ID string, or an empty string if not set.
getItemName ​
getItemName: (
item) =>string
Returns the display name of a return order item.
Parameters ​
item ​
The order item.
Returns ​
string
The order item name string, or an empty string if not set.
getItemPrice ​
getItemPrice: (
item) =>number
Returns the gross unit price of a return order item.
Parameters ​
item ​
The order item.
Returns ​
number
The original gross price, or 0 if not set.
getItemQty ​
getItemQty: (
item) =>number
Returns the quantity of a return order item.
Parameters ​
item ​
The order item.
Returns ​
number
The item quantity, or 0 if not set.
getItems ​
getItems: (
returnItem) =>OrderItem[]
Returns all order items belonging to a return.
Parameters ​
returnItem ​
The return order object.
Returns ​
An array of OrderItem objects, or an empty array if none exist.
getItemSku ​
getItemSku: (
item) =>string
Parameters ​
item ​
The order item (currently unused).
Returns ​
string
An empty string.
Deprecated ​
Not yet implemented — always returns an empty string.
getItemVariationId ​
getItemVariationId: (
item) =>number
Returns the variation ID of a return order item.
Parameters ​
item ​
The order item.
Returns ​
number
The item variation ID, or 0 if not set.
getOrderItemLink ​
getOrderItemLink: (
order,productId) =>string
Returns the URL path to the product page for a return order item.
Parameters ​
order ​
The return order object containing variation data.
productId ​
number
The numeric ID of the product.
Returns ​
string
The product URL path string.
getOrderItemReturnReason ​
getOrderItemReturnReason: (
returnItem) =>OrderReturnReason|null
Returns the return reason associated with a return order item.
Parameters ​
returnItem ​
The order item.
Returns ​
OrderReturnReason | null
The OrderReturnReason object, or null if not set.
getOrderItemReturnReasonId ​
getOrderItemReturnReasonId: (
returnItem) =>number
Returns the numeric ID of the return reason for a return order item.
Parameters ​
returnItem ​
The order item.
Returns ​
number
The return reason ID, or 0 if not set.
getOrderItemReturnReasonName ​
getOrderItemReturnReasonName: (
returnItem) =>string
Returns the name of the return reason for a return order item.
Parameters ​
returnItem ​
The order item.
Returns ​
string
The return reason name string, or an empty string if not set.
getOrders ​
getOrders: (
returns) =>Order[]
Returns all return orders from a returns response.
Parameters ​
returns ​
The returns response object.
Returns ​
Order[]
An array of Order objects, or an empty array if none exist.
getOrdersTotal ​
getOrdersTotal: (
returns) =>number
Returns the total count of returns from a returns response.
Parameters ​
returns ​
The paginated orders response object.
Returns ​
number
The total number of returns, or 0 if not set.
getPagination ​
getPagination: (
returns) =>AgnosticPagination
Returns the pagination data for a returns response.
Parameters ​
returns ​
The paginated orders response object.
Returns ​
AgnosticPagination
An AgnosticPagination object with current page, total pages, total items, items per page, and page options.
getPrice ​
getPrice: (
returnItem) =>number
Returns the gross total price of a return item.
Parameters ​
returnItem ​
The return order object.
Returns ​
number
The gross total as a number, or 0 if not set.
getReturnReasonId ​
getReturnReasonId: (
reason) =>number
Returns the numeric ID of a return reason.
Parameters ​
reason ​
The return reason object.
Returns ​
number
The reason ID.
getReturnReasonName ​
getReturnReasonName: (
reason) =>string
Returns the name of a return reason.
Parameters ​
reason ​
The return reason object.
Returns ​
string
The reason name string.
getReturnReasons ​
getReturnReasons: (
data) =>OrderReturnReason[]
Returns the list of available return reasons from a returns response.
Parameters ​
data ​
The order returns response object.
Returns ​
An array of OrderReturnReason objects.
getStatus ​
getStatus: (
returnItem) =>string
Returns the status name of a return item.
Parameters ​
returnItem ​
The return order object.
Returns ​
string
The status name string, or an empty string if not set.