Files
medusa-store/www/apps/docs/content/references/js-client/classes/AdminCollectionsResource.md
github-actions[bot] daea35fe73 chore(docs): Generated JS Client Reference (#5334)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-10-10 17:47:07 +00:00

6.5 KiB

displayed_sidebar
displayed_sidebar
jsClientSidebar

Class: AdminCollectionsResource

Hierarchy

  • default

    AdminCollectionsResource

Methods

addProducts

addProducts(id, payload, customHeaders?): ResponsePromise<AdminCollectionsRes>

Parameters

Name Type Description
id string the id of the Collection
payload AdminPostProductsToCollectionReq an object which contains an array of Product IDs to add to the Product Collection
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

Description

Updates products associated with a Product Collection

Defined in

packages/medusa-js/src/resources/admin/collections.ts:101


create

create(payload, customHeaders?): ResponsePromise<AdminCollectionsRes>

Parameters

Name Type
payload AdminPostCollectionsReq
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

Created collection.

Description

Creates a collection.

Defined in

packages/medusa-js/src/resources/admin/collections.ts:23


delete

delete(id, customHeaders?): ResponsePromise<DeleteResponse>

Parameters

Name Type Description
id string id of collection to delete.
customHeaders Record<string, any>

Returns

ResponsePromise<DeleteResponse>

Deleted response

Description

deletes a collection

Defined in

packages/medusa-js/src/resources/admin/collections.ts:53


list

list(query?, customHeaders?): ResponsePromise<AdminCollectionsListRes>

Parameters

Name Type Description
query? AdminGetCollectionsParams Query for searching collections
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsListRes>

a list of collections matching the query.

Description

Lists collections matching a query

Defined in

packages/medusa-js/src/resources/admin/collections.ts:81


removeProducts

removeProducts(id, payload, customHeaders?): ResponsePromise<AdminDeleteProductsFromCollectionRes>

Parameters

Name Type Description
id string the id of the Collection
payload AdminDeleteProductsFromCollectionReq an object which contains an array of Product IDs to add to the Product Collection
customHeaders Record<string, any>

Returns

ResponsePromise<AdminDeleteProductsFromCollectionRes>

Description

Removes products associated with a Product Collection

Defined in

packages/medusa-js/src/resources/admin/collections.ts:116


retrieve

retrieve(id, customHeaders?): ResponsePromise<AdminCollectionsRes>

Parameters

Name Type Description
id string id of the collection to retrieve.
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the collection with the given id

Description

get a collection

Defined in

packages/medusa-js/src/resources/admin/collections.ts:67


update

update(id, payload, customHeaders?): ResponsePromise<AdminCollectionsRes>

Parameters

Name Type Description
id string id of the collection to update.
payload AdminPostCollectionsCollectionReq update to apply to collection.
customHeaders Record<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the updated collection.

Description

Updates a collection

Defined in

packages/medusa-js/src/resources/admin/collections.ts:38