Appearance
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)
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /mart/products | optional | type?, sellerProfileId?, page | page of ProductSummary (lowest price per currency) | PAGINATION_CURSOR_INVALID |
| GET | /mart/products/:id | optional | — | ProductView (tiers with terms and prices, previews with URLs, file list without links). Off-sale products only for their seller | MART_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.
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| POST | /mart/products | user | { sellerProfileId, type, title } | 201 { product, wizard } | PROFILE_NOT_FOUND |
| GET | /me/mart/products | user | profileId, page | page of ProductSummary (all statuses) | PROFILE_NOT_FOUND |
| GET | /mart/products/:id/wizard | seller | — | { product, wizard } | MART_PRODUCT_NOT_FOUND |
| PUT | /mart/products/:id/wizard/:step | seller | step 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/publish | seller | — | { product, wizard } | MART_PRODUCT_INCOMPLETE, MART_PRODUCT_INVALID_TRANSITION |
| POST | /mart/products/:id/delist | seller | — | same | MART_PRODUCT_INVALID_TRANSITION |
| POST | /mart/products/:id/archive | seller | — | same | MART_PRODUCT_INVALID_TRANSITION |
Types: song, release, beat, instrumental, stem_pack, sample_pack, loop_pack, preset, artwork, lyric_sheet, sheet_music, dj_set, other.
| Step | Applies to | Body |
|---|---|---|
details | all | { title, subtitle?, description?, coverAssetId?, genreCode?, bpm?, musicalKey?, durationMs?, isExplicit?, languageCode?, tags?[] } |
source | song, release | { recordingId } or { releaseId } (must belong to the seller profile) |
files | all but song, release | { files: [{ mediaAssetId, role, fileName }] } (replaces; IDs kept for re-sent assets) |
previews | all (optional) | { previews: [{ mediaAssetId, kind: audio|video|image }] } |
licences | all | { 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 |
pricing | all | { prices: [{ tier, price: { amountMinor, currency } }] } |
splits | all (optional) | { splits: [{ profileId, shareBps, role }] }, sum 10000. None means 100% to the seller |
Buying
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| POST | /mart/orders | user, 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 once | IDEMPOTENCY_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/orders | user | page | page of OrderView (with licence document) | — |
| GET | /me/mart/orders/:id | user | — | OrderView | MART_ORDER_NOT_FOUND |
| GET | /me/mart/sales | profile owner | profileId, page | page 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
| Method | Path | Auth | Body | Response | Errors |
|---|---|---|---|---|---|
| GET | /me/mart/library | user | page | page of { id, productId, tierId, orderId, recordingId, grantedAt, product } | — |
| GET | /me/mart/library/:id | user | — | item + tierCode, tierName, licenceDocument, downloadableFiles[], offlineFiles[] | MART_NOT_ENTITLED |
| POST | /me/mart/library/:id/downloads | user, 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.
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| POST | /me/mart/device-keys | user | { 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 licences | DEVICE_NOT_FOUND, MART_DEVICE_KEY_INVALID |
| GET | /me/mart/device-keys | user | — | active keys | — |
| DELETE | /me/mart/device-keys/:id | user | — | { status: "ok" }; revokes its licences | MART_DEVICE_KEY_NOT_FOUND |
| POST | /me/mart/library/:id/offline-licences | user | { deviceKeyId, fileId? } (fileId for non-catalogue products) | 201 licence with key { algorithm, ephemeralPublicKey, salt, iv, tag, wrappedKey, binding } and packageUrl | MART_NOT_ENTITLED, MART_DEVICE_KEY_NOT_FOUND, MART_DEVICE_LIMIT_REACHED, MART_FILE_NOT_FOUND |
| POST | /me/mart/offline-licences/:id/check-in | user | — | renewed licence, freshly wrapped | MART_OFFLINE_LICENCE_NOT_FOUND, MART_OFFLINE_LICENCE_REVOKED, MART_DEVICE_KEY_NOT_FOUND |
| GET | /me/mart/offline-licences | user | deviceKeyId, page | page of licences without key material (revoked ones included, so the app deletes them) | — |
Events
| Type | Payload |
|---|---|
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 fromGET /store-price-tiers?kind=martfixes 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|androidaddsinAppPrices: [{ price, storePriceTierId, storeProductId }]to each licence tier, with the store product the app should buy.- Purchases with
apple_iaporgoogle_playneed the chosen currency's price to have a store tier (STORE_PRICE_TIER_REQUIRED); the app then confirms withPOST /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_ENTITLEDotherwise), on at mostmart.offlineMaxDevicesdevices (MART_DEVICE_LIMIT_REACHED). It uses the same device keys (/me/mart/device-keys) and key wrapping as purchases; the binding'slibraryItemIdis the recording ID.POST /me/offline/licences/:id/check-inrenews and re-wraps; it revokes everything once the plan no longer allows downloads (MART_OFFLINE_LICENCE_REVOKED).GET /me/offline/licences?deviceKeyIdlists 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 andivHex. GET /mart/products?releaseId=or?recordingId=finds the product selling a catalogue item.