Skip to content

Mart ​

Mounted under /v1. Money in requests is { amountMinor: number, currency }; in responses { amountMinor: string, currency }. Lists are cursor pages (?cursor=&limit=, meta.nextCursor, meta.hasMore).

Products (public browse; guests allowed) ​

MethodPathAuthBody / queryResponseErrors
GET/mart/productsoptionaltype?, sellerProfileId?, pagepage of ProductSummary (lowest price per currency)PAGINATION_CURSOR_INVALID
GET/mart/products/:idoptional—ProductView (tiers with terms and prices, previews with URLs, file list without links). Off-sale products only for their sellerMART_PRODUCT_NOT_FOUND

Selling (product wizard) ​

The product is its own draft. Step done-state is derived from data; currentStep resumes where the seller left off.

MethodPathAuthBodyResponseErrors
POST/mart/productsuser{ sellerProfileId, type, title }201 { product, wizard }PROFILE_NOT_FOUND
GET/me/mart/productsuserprofileId, pagepage of ProductSummary (all statuses)PROFILE_NOT_FOUND
GET/mart/products/:id/wizardseller—{ product, wizard }MART_PRODUCT_NOT_FOUND
PUT/mart/products/:id/wizard/:stepsellerstep body, below{ product, wizard }WIZARD_STEP_UNKNOWN, WIZARD_STEP_NOT_ANSWERABLE, MART_FILE_NOT_FOUND, MART_LICENCE_SOLD_OUT, MART_LICENCE_TIER_NOT_FOUND, PAYMENT_RECIPIENTS_INVALID, VALIDATION_FAILED
POST/mart/products/:id/publishseller—{ product, wizard }MART_PRODUCT_INCOMPLETE, MART_PRODUCT_INVALID_TRANSITION
POST/mart/products/:id/delistseller—sameMART_PRODUCT_INVALID_TRANSITION
POST/mart/products/:id/archiveseller—sameMART_PRODUCT_INVALID_TRANSITION

Types: song, release, beat, instrumental, stem_pack, sample_pack, loop_pack, preset, artwork, lyric_sheet, sheet_music, dj_set, other.

StepApplies toBody
detailsall{ title, subtitle?, description?, coverAssetId?, genreCode?, bpm?, musicalKey?, durationMs?, isExplicit?, languageCode?, tags?[] }
sourcesong, release{ recordingId } or { releaseId } (must belong to the seller profile)
filesall but song, release{ files: [{ mediaAssetId, role, fileName }] } (replaces; IDs kept for re-sent assets)
previewsall (optional){ previews: [{ mediaAssetId, kind: audio|video|image }] }
licencesall{ tiers: [{ tier: personal|lease|premium|exclusive, name?, maxStreams, distributionCopies, commercialUse, broadcastRights, broadcastStations, musicVideoRights, musicVideos, performanceRights, paidPerformances, derivativeWorks, creditRequired, creditText, termMonths, territory, fileIds[] }] } — tiers left out are retired
pricingall{ prices: [{ tier, price: { amountMinor, currency } }] }
splitsall (optional){ splits: [{ profileId, shareBps, role }] }, sum 10000. None means 100% to the seller

Buying ​

MethodPathAuthBody / queryResponseErrors
POST/mart/ordersuser, Idempotency-Key required{ productId, tier, currency, method: wallet|card|bank_transfer }201 { order, payment: { id, status, checkoutUrl } }. Card/transfer: open checkoutUrl. Wallet: usually succeeded at onceIDEMPOTENCY_KEY_REQUIRED, MART_PRODUCT_NOT_FOUND, MART_OWN_PRODUCT, MART_LICENCE_TIER_NOT_FOUND, MART_LICENCE_SOLD_OUT, MART_ALREADY_OWNED, MART_PRICE_NOT_AVAILABLE, WALLET_INSUFFICIENT_FUNDS, PAYMENT_*
GET/me/mart/ordersuserpagepage of OrderView (with licence document)—
GET/me/mart/orders/:iduser—OrderViewMART_ORDER_NOT_FOUND
GET/me/mart/salesprofile ownerprofileId, pagepage of { orderId, productId, productTitle, tierCode, status, amount, shareBps, paidAt }PROFILE_NOT_FOUND

An exclusive tier is held for the order while it's being paid for; on payment it's sold once, the other tiers are retired and the product is delisted. Refunds and chargebacks revoke library items and offline licences; a refunded exclusive returns to the seller unsold.

Library and downloads ​

MethodPathAuthBodyResponseErrors
GET/me/mart/libraryuserpagepage of { id, productId, tierId, orderId, recordingId, grantedAt, product }—
GET/me/mart/library/:iduser—item + tierCode, tierName, licenceDocument, downloadableFiles[], offlineFiles[]MART_NOT_ENTITLED
POST/me/mart/library/:id/downloadsuser, 60/hour{ fileId }201 { url, expiresAt, fingerprint } (Cache-Control: no-store; URL lives MART_DOWNLOAD_URL_TTL_SECONDS)MART_NOT_ENTITLED (also for audio/video, which play offline only), MART_FILE_NOT_FOUND, RATE_LIMITED

Every download gets its own watermark fingerprint, recorded before the URL is issued.

Offline licences ​

The app keeps an X25519 key pair in its keystore and registers the public key. A licence wraps the track's content key to that key: ephemeral X25519 → HKDF-SHA256 (salt, info = binding) → AES-256-GCM (AAD = binding). The binding is plemuz-offline-v1|userId|deviceId|libraryItemId|licenceId|mediaAssetId|contentKeyId|expiresAt. Check in within MART_OFFLINE_CHECKIN_DAYS (30); at most MART_OFFLINE_MAX_DEVICES (3) devices per purchase.

MethodPathAuthBody / queryResponseErrors
POST/me/mart/device-keysuser{ deviceId, publicKey } (raw 32 bytes or SPKI, base64/base64url)201 { id, deviceId, algorithm, fingerprint, createdAt }. A new key for a device revokes the old one and its licencesDEVICE_NOT_FOUND, MART_DEVICE_KEY_INVALID
GET/me/mart/device-keysuser—active keys—
DELETE/me/mart/device-keys/:iduser—{ status: "ok" }; revokes its licencesMART_DEVICE_KEY_NOT_FOUND
POST/me/mart/library/:id/offline-licencesuser{ deviceKeyId, fileId? } (fileId for non-catalogue products)201 licence with key { algorithm, ephemeralPublicKey, salt, iv, tag, wrappedKey, binding } and packageUrlMART_NOT_ENTITLED, MART_DEVICE_KEY_NOT_FOUND, MART_DEVICE_LIMIT_REACHED, MART_FILE_NOT_FOUND
POST/me/mart/offline-licences/:id/check-inuser—renewed licence, freshly wrappedMART_OFFLINE_LICENCE_NOT_FOUND, MART_OFFLINE_LICENCE_REVOKED, MART_DEVICE_KEY_NOT_FOUND
GET/me/mart/offline-licencesuserdeviceKeyId, pagepage of licences without key material (revoked ones included, so the app deletes them)—

Events ​

TypePayload
mart.product.published{ productId, sellerProfileId, type }
mart.product.delisted{ productId, sellerProfileId, reason: seller|exclusive_sold|archived }
mart.order.paid{ orderId, buyerUserId, productId, tierId, sellerProfileId, paymentId, amount }
mart.order.refunded{ orderId, buyerUserId, productId, paymentId }

Notifications: mart.purchase to the buyer (email mart.purchase_receipt), mart.sale to owners of every recipient profile (email mart.sale).

In-app pricing ​

  • The pricing step takes { prices: [{ tier, price?, storePriceTierId? }] }. A store price point from GET /store-price-tiers?kind=mart fixes the amount and makes that price sellable in-app. A free amount (no store tier) sells on web, wallet and card only.
  • GET /mart/products/:id?platform=ios|android adds inAppPrices: [{ price, storePriceTierId, storeProductId }] to each licence tier, with the store product the app should buy.
  • Purchases with apple_iap or google_play need the chosen currency's price to have a store tier (STORE_PRICE_TIER_REQUIRED); the app then confirms with POST /payments/:id/store-purchase.
  • Refunds notify the buyer (mart.order_refunded).

Subscriber downloads and package facts ​

  • POST /me/offline/licences { contentType: "recording", contentId, deviceKeyId } issues a licence for a subscriber whose plan allows downloads (PLAYBACK_NOT_ENTITLED otherwise), on at most mart.offlineMaxDevices devices (MART_DEVICE_LIMIT_REACHED). It uses the same device keys (/me/mart/device-keys) and key wrapping as purchases; the binding's libraryItemId is the recording ID.
  • POST /me/offline/licences/:id/check-in renews and re-wraps; it revokes everything once the plan no longer allows downloads (MART_OFFLINE_LICENCE_REVOKED). GET /me/offline/licences?deviceKeyId lists them.
  • Every issued or checked-in licence carries package { url, algorithm: "aes-128-cbc", ivHex, container, byteSize, checksumSha256 }: decrypt the package with the unwrapped content key and ivHex.
  • GET /mart/products?releaseId= or ?recordingId= finds the product selling a catalogue item.

Plemuz API v2