Skip to main content

Class: AdminCollectionsResource

Hierarchy

  • default

    AdminCollectionsResource

Methods

addProducts

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

Description

Updates products associated with a Product Collection

Parameters

NameTypeDescription
idstringthe id of the Collection
payloadAdminPostProductsToCollectionReqan object which contains an array of Product IDs to add to the Product Collection
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

Defined in

medusa-js/src/resources/admin/collections.ts:100


create

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

Description

Creates a collection.

Parameters

NameType
payloadAdminPostCollectionsReq
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

Created collection.

Defined in

medusa-js/src/resources/admin/collections.ts:22


delete

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

Description

deletes a collection

Parameters

NameTypeDescription
idstringid of collection to delete.
customHeadersRecord<string, any>

Returns

ResponsePromise<DeleteResponse>

Deleted response

Defined in

medusa-js/src/resources/admin/collections.ts:52


list

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

Description

Lists collections matching a query

Parameters

NameTypeDescription
query?AdminGetCollectionsParamsQuery for searching collections
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminCollectionsListRes>

a list of collections matching the query.

Defined in

medusa-js/src/resources/admin/collections.ts:80


removeProducts

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

Description

Removes products associated with a Product Collection

Parameters

NameTypeDescription
idstringthe id of the Collection
payloadAdminDeleteProductsFromCollectionReqan object which contains an array of Product IDs to add to the Product Collection
customHeadersRecord<string, any>

Returns

ResponsePromise<DeleteResponse>

Defined in

medusa-js/src/resources/admin/collections.ts:115


retrieve

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

Description

get a collection

Parameters

NameTypeDescription
idstringid of the collection to retrieve.
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the collection with the given id

Defined in

medusa-js/src/resources/admin/collections.ts:66


update

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

Description

Updates a collection

Parameters

NameTypeDescription
idstringid of the collection to update.
payloadAdminPostCollectionsCollectionRequpdate to apply to collection.
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminCollectionsRes>

the updated collection.

Defined in

medusa-js/src/resources/admin/collections.ts:37

Was this page helpful?