Skip to main content

Class: LineItemsResource

Hierarchy

  • default

    LineItemsResource

Methods

create

create(cart_id, payload, customHeaders?): ResponsePromise<StoreCartsRes>

Creates a line-item for a cart

Parameters

NameTypeDescription
cart_idstringid of cart
payloadStorePostCartsCartLineItemsReqdetails needed to create a line-item
customHeadersRecord<string, any>

Returns

ResponsePromise<StoreCartsRes>

Defined in

medusa-js/src/resources/line-items.ts:17


delete

delete(cart_id, line_id, customHeaders?): ResponsePromise<StoreCartsRes>

Remove a line-item from a cart

Parameters

NameTypeDescription
cart_idstringid of cart
line_idstringid of item to remove
customHeadersRecord<string, any>

Returns

ResponsePromise<StoreCartsRes>

Defined in

medusa-js/src/resources/line-items.ts:50


update

update(cart_id, line_id, payload, customHeaders?): ResponsePromise<StoreCartsRes>

Updates a line-item. Only quantity updates are allowed

Parameters

NameTypeDescription
cart_idstringid of cart
line_idstringid of item to update
payloadStorePostCartsCartLineItemsItemReqdetails needed to update a line-item
customHeadersRecord<string, any>

Returns

ResponsePromise<StoreCartsRes>

Defined in

medusa-js/src/resources/line-items.ts:34