Skip to main content

Warehousing Module

The warehousing module manages inventory, stock levels, warehousing providers, and tokenized product handling.

Configuration Options​

The warehousing module has no configuration options.

Module API​

Access via modules.warehousing in the Unchained API context.

Provider Queries​

MethodArgumentsDescription
findProvider{ warehousingProviderId }Get a specific provider
findProvidersquery?, options?List warehousing providers
allProviders—Get all active providers (cached)
countquery?Count providers
providerExists{ warehousingProviderId }Check if provider exists

Provider Mutations​

MethodArgumentsDescription
createdocCreate a warehousing provider
updatewarehousingProviderId, docUpdate provider
deleteproviderIdDelete provider

Token Operations​

For tokenized products (NFTs, digital assets):

MethodArgumentsDescription
findToken{ tokenId }, options?Get a specific token
findTokensselector, options?List tokens
tokensCountselector?Count tokens
findTokensForUser{ userId } | { walletAddresses }, options?Get user's tokens
createTokenstokensBatch create tokens
updateTokenOwnership{ tokenId, userId } | { tokenId, walletAddress }Transfer token ownership
invalidateTokentokenIdRevoke a token
buildAccessKeyFromTokentokenGenerate an access key for a token

Usage​

// Create a warehousing provider
await modules.warehousing.create({
adapterKey: 'shop.unchained.warehousing.store',
type: 'PHYSICAL',
configuration: [],
});

// Find tokens for a user
const tokens = await modules.warehousing.findTokensForUser({
userId: 'user-123',
});

// Transfer token ownership
await modules.warehousing.updateTokenOwnership({
tokenId: 'token-id',
userId: 'new-owner-id',
});

Events​

EventPayloadDescription
WAREHOUSING_PROVIDER_CREATE{ warehousingProvider }Emitted when a warehousing provider is created
WAREHOUSING_PROVIDER_UPDATE{ warehousingProvider }Emitted when a warehousing provider is updated
WAREHOUSING_PROVIDER_REMOVE{ warehousingProvider }Emitted when a warehousing provider is removed