Skip to main content

Resources (Assets & Services)

The resources model represents customer-owned assets (tangible equipment) and service subscriptions. Assets can have warranty tracking and compatible services; Services have contracts with payment periods. This module supports after-sales scenarios like equipment management and subscription renewal.

Plugin Required

The Resources module requires the medusa-plugin-assets-services plugin when using the Medusa.js integration.

Resource Service​

The ResourceService provides methods to interact with assets and services.

getServiceList​

Retrieves a paginated list of service subscriptions for the authenticated customer.

getServiceList(
query: GetServiceListQuery,
authorization: string
): Observable<Services>

Query Parameters​

ParameterTypeDescription
statusContractStatusFilter by contract status
typeProductTypeFilter by product type
categorystringFilter by category
billingAccountIdstringFilter by billing account
dateFromstringFilter by start date
dateTostringFilter by end date
offsetnumberNumber of items to skip
limitnumberMaximum number of items to return
sortstringSorting criteria
localestringLocale for localized content

getService​

Retrieves a specific service by ID.

getService(
params: GetServiceParams,
authorization?: string
): Observable<Service>

getAssetList​

Retrieves a paginated list of assets (customer equipment) for the authenticated customer.

getAssetList(
query: GetAssetListQuery,
authorization: string
): Observable<Assets>

Query Parameters​

ParameterTypeDescription
statusstringFilter by asset status
typeProductTypeFilter by product type
billingAccountIdstringFilter by billing account
dateFromstringFilter by date
dateTostringFilter by date
offsetnumberNumber of items to skip
limitnumberMaximum number of items to return
sortstringSorting criteria
localestringLocale for localized content

getAsset​

Retrieves a specific asset by ID.

getAsset(
params: GetAssetParams,
authorization?: string
): Observable<Asset>

getCompatibleServiceList​

Retrieves services that can be purchased for a specific asset (upsell/cross-sell).

getCompatibleServiceList(params: GetAssetParams): Observable<Products.Model.Products>

getFeaturedServiceList​

Retrieves featured or promoted services.

getFeaturedServiceList(): Observable<Products.Model.Products>

purchaseOrActivateResource / purchaseOrActivateService​

Initiates purchase or activation of a resource or service. Not fully implemented in all integrations.

purchaseOrActivateResource(params: GetResourceParams, authorization?: string): Observable<void>
purchaseOrActivateService(params: GetServiceParams, authorization?: string): Observable<void>

Data Model Structure​

  • Resource — Base for Asset and Service; links to Product and BillingAccount
  • Asset — Customer-owned equipment (serial no, warranty, compatible services)
  • Service — Subscription with Contract (start/end date, payment period)

Types​

Resource​

Base type for assets and services.

FieldTypeDescription
idstringUnique identifier
productProductAssociated product
billingAccountIdstringBilling account ID

Asset​

Customer-owned tangible equipment. Extends Resource.

FieldTypeDescription
manufacturerstringManufacturer (optional)
modelstringModel name
serialNostringSerial number
descriptionstringDescription
statusAssetStatusAsset status (optional)
addressAddressInstallation/location (optional)
endOfWarrantystringWarranty end date (optional)
compatibleServicesProductsServices that can be purchased (optional)

Service​

Service subscription. Extends Resource.

FieldTypeDescription
contractContractContract details
assetsAsset[]Linked assets (optional)

Contract​

FieldTypeDescription
idstringUnique identifier
typestringContract type (optional)
statusContractStatusContract status
startDatestringStart date
endDatestringEnd date
paymentPeriodPaymentPeriodBilling frequency (optional)
pricePriceContract price

AssetStatus​

ValueDescription
ACTIVEActive asset
INACTIVEInactive
RETIREDRetired

ContractStatus​

ValueDescription
ACTIVEActive contract
EXPIREDExpired
INACTIVEInactive

PaymentPeriod​

ValueDescription
ONE_TIMEOne-time
MONTHLYMonthly
YEARLYYearly
WEEKLYWeekly

Services / Assets​

Paginated lists.

type Services = Pagination.Paginated<Service>;
type Assets = Pagination.Paginated<Asset>;