{"openapi":"3.1.0","info":{"title":"SKUWEFT Supplier Preparation API","version":"1.0.0","description":"Headless supplier accounts, scoped API keys, free previews, $9 USD Stripe-hosted credit checkout and private draft Shopify CSV export. No SKUWEFT browser sign-in. Creating checkout does not charge a payment method. Only verified Stripe webhooks grant credits. Accounts and credentials are separate from passkey accounts and the listing-writing API."},"servers":[{"url":"https://skuweft.pages.dev"}],"security":[{"supplierKey":[]}],"externalDocs":{"url":"https://skuweft.pages.dev/supplier-api.md","description":"Complete setup, privacy and retry instructions"},"paths":{"/api/v1/supplier/plans":{"get":{"operationId":"supplierPlans","summary":"Read current price, limits and availability","security":[],"responses":{"200":{"description":"Public supplier offer and runtime readiness.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plans"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/accounts":{"post":{"operationId":"registerSupplierAccount","summary":"Create or recover an API account using a client-generated management key","description":"Generate lma_ plus 32 cryptographically random bytes encoded as 64 lowercase hex digits. Save the secret privately BEFORE calling. Send it in Authorization. The same key always returns the same account until rotated; no browser, email or free export credit. Do not invent an account ID. Terms acceptance is required. Registration is bounded to 5/minute and 50/day across the service.","security":[{"accountKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["terms_accepted"],"properties":{"terms_accepted":{"const":true}}}}}},"responses":{"200":{"description":"Account identity; management secret is never echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Registration"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/accounts/rotate":{"post":{"operationId":"rotateSupplierAccountKey","summary":"Rotate account management key and revoke all operational keys","description":"Authenticate with the current management key. Store the fresh management key before submitting. Existing credits stay on the account. After a lost response, try GET /keys with the new key to check whether rotation succeeded. This revokes every operational key.","security":[{"accountKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["new_account_key"],"properties":{"new_account_key":{"type":"string","pattern":"^lma_[a-f0-9]{64}$","writeOnly":true}}}}}},"responses":{"200":{"description":"Rotation confirmed.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["account_id","rotated","all_operational_keys_revoked"],"properties":{"account_id":{"type":"string"},"rotated":{"const":true},"all_operational_keys_revoked":{"const":true}}}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/keys":{"get":{"operationId":"listSupplierKeys","summary":"List operational key metadata, never secrets","security":[{"accountKey":[]}],"responses":{"200":{"description":"At most 100 keys, including expired/revoked keys.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/KeyMetadata"}}}}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSupplierKey","summary":"Register a scoped, expiring operational key","description":"Generate and save lms_ plus 32 cryptographically random bytes in lowercase hex. Replaying the same key/settings returns its existing ID and does not extend expiry. Changing settings, reusing an expired/revoked key, or reusing another account’s key fails. 10 active and 100 lifetime keys per account. Only hashes are stored.","security":[{"accountKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["api_key","scopes","export_limit","expires_in_days"],"properties":{"api_key":{"type":"string","pattern":"^lms_[a-f0-9]{64}$","writeOnly":true},"scopes":{"type":"array","uniqueItems":true,"minItems":1,"maxItems":4,"items":{"enum":["supplier:read","supplier:preview","supplier:export","supplier:checkout"]},"contains":{"const":"supplier:read"}},"export_limit":{"type":"integer","minimum":0,"maximum":1000,"description":"Lifetime maximum new file unlocks. Re-downloads are free; refunds do not reset allowance."},"expires_in_days":{"type":"integer","minimum":1,"maximum":90}}}}}},"responses":{"200":{"description":"Key metadata. The credential is never echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedKey"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/keys/{id}":{"delete":{"operationId":"revokeSupplierKey","summary":"Revoke an operational key owned by this account","security":[{"accountKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Revocation confirmed; already-started responses may finish.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["revoked"],"properties":{"revoked":{"const":true}}}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/account":{"get":{"operationId":"supplierAccount","summary":"Read balance, mode and this key’s export allowance","description":"Requires supplier:read. No trial or free export credit is created.","responses":{"200":{"description":"Current supplier credit balance and key limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/preview":{"post":{"operationId":"previewSupplierFile","summary":"Prepare a free preview without retaining source contents","description":"Requires supplier:preview and consent:true. Mapping indexes are zero-based; title and price required, grouping explicit. Up to 500 KiB decoded source, 1,000 data rows, 100 columns. 3,200,000 byte JSON request maximum. Save the returned fingerprint and review all errors/warnings. Returns first five rows, never full CSV.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewInput"}}}},"responses":{"200":{"description":"Preview, errors, warnings, omitted columns, ownership and fingerprint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/export":{"post":{"operationId":"exportSupplierFile","summary":"Unlock or re-download the exact reviewed Shopify CSV","description":"Requires supplier:export, consent:true, reviewed:true and the preview fingerprint. Resend the original source and mapping on every call. One unused paid credit unlocks one exact preparation atomically, subject to key allowance. Identical retry/re-download needs no further credit. Changed inputs need a fresh preview and another credit. Refunds revoke access; another unused credit can unlock it again subject to allowance. Output is new draft/unpublished products. Files are not stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportInput"}}}},"responses":{"200":{"description":"Prepared CSV, private and uncached. Save locally.","headers":{"X-Skuweft-Fingerprint":{"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/checkouts":{"post":{"operationId":"createSupplierCheckout","summary":"Request a $9 USD Stripe checkout for one supplier credit","description":"Requires supplier:checkout. Confirm payment authority. No card is charged by this call. URL binds the verified payment to this API account. Payment Links are reusable: complete only one intended purchase; poll status after ambiguous payment outcomes. Paid/reversed checkouts return no URL.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"One UUID per intended credit purchase. Reuse for retries; check fulfillment before paying again.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_amount_cents","currency","credits"],"properties":{"expected_amount_cents":{"type":"integer","const":900},"currency":{"const":"usd"},"credits":{"const":1}}}}}},"responses":{"200":{"description":"Checkout URL and verified fulfillment state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/supplier/checkouts/{id}":{"get":{"operationId":"supplierCheckoutStatus","summary":"Read fulfillment confirmed by Stripe webhooks","description":"Requires supplier:read; account and mode ownership enforced. Poll no faster than every five seconds. Redirects and receipts do not grant credits. Multiple paid sessions on a reused link are counted separately. Any partial/full refund or recorded reversal removes the associated credit.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current checkout and credit state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"400":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Wait this many seconds before retrying.","schema":{"type":"integer"}}}},"503":{"description":"Structured error; files and credentials are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"accountKey":{"type":"http","scheme":"bearer","bearerFormat":"lma_<64 lowercase hex>","description":"Client-generated secret for account creation, recovery, rotation and key administration only. Store separately from operational agents."},"supplierKey":{"type":"http","scheme":"bearer","bearerFormat":"lms_<64 lowercase hex>","description":"Scoped operational supplier key. Never send to Stripe, put in a URL or expose in client-side code. Legacy lm_ keys and browser cookies are not accepted."}},"schemas":{"Error":{"type":"object","additionalProperties":false,"required":["code","error"],"properties":{"code":{"type":"string"},"error":{"type":"string"}}},"Registration":{"type":"object","additionalProperties":false,"required":["account_id","created_at","message"],"properties":{"account_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"message":{"type":"string"}}},"Plans":{"type":"object","required":["amount_cents","currency","credits","preview_free","checkout_available","test_mode","limits"],"properties":{"amount_cents":{"const":900},"currency":{"const":"usd"},"credits":{"const":1},"preview_free":{"const":true},"checkout_available":{"type":"boolean"},"test_mode":{"type":"boolean"},"limits":{"type":"object","additionalProperties":false,"required":["bytes","rows","columns"],"properties":{"bytes":{"const":512000},"rows":{"const":1000},"columns":{"const":100}}},"authentication":{"type":"string"},"payment_flow":{"const":"stripe_hosted_checkout"},"documentation":{"type":"string"},"openapi":{"type":"string"}}},"CreatedKey":{"type":"object","additionalProperties":false,"required":["id","prefix","scopes","export_limit","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"enum":["supplier:read","supplier:preview","supplier:export","supplier:checkout"]}},"export_limit":{"type":"integer"},"expires_at":{"type":"string","format":"date-time"}}},"KeyMetadata":{"type":"object","additionalProperties":false,"required":["id","prefix","scopes","export_limit","created_at","expires_at","revoked_at","exports_used"],"properties":{"id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"enum":["supplier:read","supplier:preview","supplier:export","supplier:checkout"]}},"export_limit":{"type":"integer"},"created_at":{"type":"integer"},"expires_at":{"type":"integer"},"revoked_at":{"type":["integer","null"]},"exports_used":{"type":"integer"}}},"Account":{"type":"object","additionalProperties":false,"required":["account_id","credits","test_mode","checkout_available","amount_cents","currency","key"],"properties":{"account_id":{"type":"string"},"credits":{"type":"integer"},"test_mode":{"type":"boolean"},"checkout_available":{"type":"boolean"},"amount_cents":{"const":900},"currency":{"const":"usd"},"key":{"type":"object","additionalProperties":false,"required":["id","scopes","expires_at","export_limit","exports_used","exports_remaining"],"properties":{"id":{"type":"string"},"scopes":{"type":"array","items":{"enum":["supplier:read","supplier:preview","supplier:export","supplier:checkout"]}},"expires_at":{"type":"string","format":"date-time"},"export_limit":{"type":"integer"},"exports_used":{"type":"integer"},"exports_remaining":{"type":"integer"}}}}},"SupplierFile":{"type":"object","additionalProperties":false,"required":["text","delimiter","decimal","mapping"],"properties":{"text":{"type":"string","description":"UTF-8 source text, at most 512000 bytes. Never a URL or path; source is processed only in memory."},"delimiter":{"enum":[",","\t",";"]},"decimal":{"enum":["dot","comma"]},"mapping":{"type":"object","additionalProperties":false,"required":["title","price"],"properties":{"title":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"price":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"sku":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"description":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"vendor":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"type":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"tags":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"barcode":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"size":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"color":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"image":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."},"group":{"type":"integer","minimum":0,"maximum":99,"description":"Zero-based source column index; each source column maps once."}}}}},"PreviewInput":{"type":"object","additionalProperties":false,"required":["file","consent"],"properties":{"file":{"$ref":"#/components/schemas/SupplierFile"},"consent":{"const":true}}},"ExportInput":{"type":"object","additionalProperties":false,"required":["file","consent","reviewed","expected_fingerprint"],"properties":{"file":{"$ref":"#/components/schemas/SupplierFile"},"consent":{"const":true},"reviewed":{"const":true},"expected_fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"Issue":{"type":"object","additionalProperties":false,"required":["line","message"],"properties":{"line":{"type":"integer"},"message":{"type":"string"}}},"Preview":{"type":"object","additionalProperties":false,"required":["headers","preview","rows","products","errors","warnings","errorCount","warningCount","ignored","fingerprint","owned"],"properties":{"headers":{"type":"array","items":{"type":"string"}},"preview":{"type":"array","maxItems":5,"items":{"type":"array","items":{"type":"string"}}},"rows":{"type":"integer"},"products":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"errorCount":{"type":"integer"},"warningCount":{"type":"integer"},"ignored":{"type":"array","items":{"type":"string"}},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owned":{"type":"boolean"}}},"Checkout":{"type":"object","additionalProperties":false,"required":["id","status","checkout_url","payment_count","credits_granted","credits_available","amount_cents","currency","test_mode","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["awaiting_payment","paid","reversed","partially_reversed"]},"checkout_url":{"type":["string","null"]},"payment_count":{"type":"integer"},"credits_granted":{"type":"integer"},"credits_available":{"type":"integer"},"amount_cents":{"const":900},"currency":{"const":"usd"},"test_mode":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}}}}