Files
medusa-store/docs/content/references/js-client/classes/LineItemsResource.md
Shahed Nasser 02d5c1da88 docs: update Typedoc and regenerate references (#1994)
* generated new services reference

* changed from automatic push to automated pull request

* updated typedoc, regenerated JS Client reference

* regenerated the reference after updating typedoc

* added action for js client
2022-08-04 17:29:52 +03:00

82 lines
2.5 KiB
Markdown

# Class: LineItemsResource
## Hierarchy
- `default`
**`LineItemsResource`**
## Methods
### create
**create**(`cart_id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
Creates a line-item for a cart
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cart_id` | `string` | id of cart |
| `payload` | [`StorePostCartsCartLineItemsReq`](internal-34.StorePostCartsCartLineItemsReq.md) | details needed to create a line-item |
| `customHeaders` | `Record`<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
#### Defined in
[medusa-js/src/resources/line-items.ts:17](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/line-items.ts#L17)
___
### delete
**delete**(`cart_id`, `line_id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
Remove a line-item from a cart
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cart_id` | `string` | id of cart |
| `line_id` | `string` | id of item to remove |
| `customHeaders` | `Record`<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
#### Defined in
[medusa-js/src/resources/line-items.ts:50](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/line-items.ts#L50)
___
### update
**update**(`cart_id`, `line_id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
Updates a line-item.
Only quantity updates are allowed
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cart_id` | `string` | id of cart |
| `line_id` | `string` | id of item to update |
| `payload` | [`StorePostCartsCartLineItemsItemReq`](internal-34.StorePostCartsCartLineItemsItemReq.md) | details needed to update a line-item |
| `customHeaders` | `Record`<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreCartsRes`](../modules/internal-30.md#storecartsres)\>
#### Defined in
[medusa-js/src/resources/line-items.ts:34](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/line-items.ts#L34)