File

projects/congarevenuecloud/ecommerce/src/lib/modules/order/services/order-line-item.service.ts

Description

The order line item object represents an order line item in Conga. Only order line item for given order will be returned by this service.

Extends

AObjectService

Index

Properties
Methods

Methods

Public getOrderLineItemsForOrder
getOrderLineItemsForOrder(orderId: string, days?: number, limit: number, pageNumber: number, orderBy: string, orderDirection: "ASC" | "DESC")

Method returns a list of order line items for an order.

Example:

Example :
import { OrderLineItemService, OrderLineItem } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
orderLineItemList: Array<OrderLineItem>;
orderLineItemList$: Observable<Array<OrderLineItem>>;

constructor(private orderLineItemService: OrderLineItemService){}

ngOnInit(){
this.orderLineItemService.getOrderLineItemsForOrder(orderId: string).subscribe(o => this.orderLineItemList = o);
// or
this.orderLineItemList$ = this.orderLineItemService.getOrderLineItemsForOrder(orderId: string);
}
}
Parameters :
Name Type Optional Default value Description
orderId string No

the order id to fetch the order line items results.

days number Yes

the number of days into the past with which to retrieve orders. If left empty, will retrieve all orders.

limit number No 10

the total number of records to return.

pageNumber number No 0

the offset of the records to return (i.e. records 10-20, the offset will be 10)

orderBy string No 'CreatedDate'

the field by which to order the records. Defaulted to order creation date.

orderDirection "ASC" | "DESC" No 'DESC'

the direction in which to sort the records. Defaulted to 'Desc'.

Returns : Observable<Array<OrderLineItem>>

an observable array of order line items.

Public getOrderLineItemsWithAttributes
getOrderLineItemsWithAttributes(orderId: string, filters: Array<FieldFilter>, relatedRecords: string, limit: number, pageNumber: number, orderBy: string, orderDirection: "Asc" | "Desc")

Method returns a list of order line items with attributes for an order.

Example:

Example :
import { OrderLineItemService, OrderLineItem } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
orderLineItemList: Array<OrderLineItem>;
orderLineItemList$: Observable<Array<OrderLineItem>>;

constructor(private orderLineItemService: OrderLineItemService){}

ngOnInit(){
this.orderLineItemService.getOrderLineItemsWithAttributes(orderId: string).subscribe(o => this.orderLineItemList = o);
// or
this.orderLineItemList$ = this.orderLineItemService.getOrderLineItemsWithAttributes(orderId: string);
}
}
Parameters :
Name Type Optional Default value Description
orderId string No

the order id to fetch the order line items results.

filters Array<FieldFilter> No null
relatedRecords string No ''
limit number No 50

the total number of records to return.

pageNumber number No 1

the offset of the records to return (i.e. records 10-20, the offset will be 10)

orderBy string No 'Name'

the field by which to order the records. Defaulted to line items Name.

orderDirection "Asc" | "Desc" No 'Desc'

the direction in which to sort the records. Defaulted to 'Desc'.

Returns : Observable<Array<OrderLineItem>>

an observable array of order line items.

Properties

type
Default value : OrderLineItem

results matching ""

    No results matching ""