{"openapi":"3.1.0","info":{"title":"Postforge API","version":"1","description":"The open-source ecommerce email platform. Errors are RFC 9457 problem details; docs at https://postforge.dev/developers."},"servers":[{"url":"https://api.postforge.dev/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A workspace API key (pf_…), created under Developers → API keys."}},"schemas":{"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"twoFactor":{"$ref":"#/components/schemas/TwoFactor"}},"required":["id","name","email","twoFactor"]},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"}}},"required":["user","workspaces"]},"TwoFactor":{"type":"object","properties":{"app":{"type":["object","null"],"properties":{"since":{"type":["string","null"],"format":"date-time"}},"required":["since"]},"email":{"type":["object","null"],"properties":{"since":{"type":["string","null"],"format":"date-time"}},"required":["since"]},"trustedBrowsers":{"type":"integer"}},"required":["app","email","trustedBrowsers"]},"WorkspaceSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"storeCount":{"type":"integer"},"requireTwoFactor":{"type":"boolean"}},"required":["id","name","slug","role","storeCount","requireTwoFactor"]},"Problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"],"description":"RFC 9457 problem details"},"SessionSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"browser":{"type":["string","null"]},"os":{"type":["string","null"]},"ipAddress":{"type":["string","null"]},"signedInAt":{"type":"string","format":"date-time"},"lastActiveAt":{"type":"string","format":"date-time"},"current":{"type":"boolean"}},"required":["id","browser","os","ipAddress","signedInAt","lastActiveAt","current"]},"CreatedWorkspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]},"MemberSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"joinedAt":{"type":"string","format":"date-time"},"lastActiveAt":{"type":["string","null"],"format":"date-time"}},"required":["id","userId","name","email","role","joinedAt","lastActiveAt"]},"InvitationSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"invitedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"expired":{"type":"boolean"}},"required":["id","email","role","invitedBy","createdAt","expiresAt","expired"]},"InvitationPreview":{"type":"object","properties":{"workspace":{"type":"string"},"workspaceSlug":{"type":"string"},"invitedBy":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"status":{"type":"string","enum":["pending","accepted","rejected","canceled","expired"]}},"required":["workspace","workspaceSlug","invitedBy","email","role","status"]},"ApiKeySummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"scope":{"type":"string","enum":["read","propose","write"]},"prefix":{"type":"string"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"rotatedAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["active","revoked"]},"revokedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","scope","prefix","createdBy","createdAt","lastUsedAt","rotatedAt","status","revokedAt"]},"CreatedApiKey":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKeySummary"},"key":{"type":"string"}},"required":["apiKey","key"]},"WorkspaceLocale":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"},"label":{"type":"string"},"language":{"type":"string"},"region":{"type":["string","null"]},"origin":{"type":"string","enum":["store","manual"]},"isDefault":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","code","label","language","region","origin","isDefault","createdAt"]},"StoreSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["shopify","custom"]},"name":{"type":"string"},"externalId":{"type":"string"},"currency":{"type":"string"},"primaryLocale":{"type":"string"},"status":{"type":"string","enum":["active","disconnected"]},"connectionStatus":{"type":"string","enum":["connected","needs_reauth","disconnected"]},"importStatus":{"type":"string","enum":["none","queued","running","completed","failed"]},"permissions":{"type":"object","properties":{"coupons":{"type":"boolean"},"consent":{"type":"boolean"}},"required":["coupons","consent"]},"connectedAt":{"type":"string","format":"date-time"}},"required":["id","platform","name","externalId","currency","primaryLocale","status","connectionStatus","importStatus","permissions","connectedAt"]},"Store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["shopify","custom"]},"name":{"type":"string"},"externalId":{"type":"string"},"currency":{"type":"string"},"primaryLocale":{"type":"string"},"status":{"type":"string","enum":["active","disconnected"]},"connectionStatus":{"type":"string","enum":["connected","needs_reauth","disconnected"]},"importStatus":{"type":"string","enum":["none","queued","running","completed","failed"]},"permissions":{"type":"object","properties":{"coupons":{"type":"boolean"},"consent":{"type":"boolean"}},"required":["coupons","consent"]},"connectedAt":{"type":"string","format":"date-time"},"storefrontUrl":{"type":["string","null"],"format":"uri"},"contactEmail":{"type":["string","null"]},"localeCount":{"type":"integer"},"customerCount":{"type":"integer"},"orderCount":{"type":"integer"},"productCount":{"type":"integer"},"lastOrderAt":{"type":["string","null"],"format":"date-time"},"lastProductSyncAt":{"type":["string","null"],"format":"date-time"},"imports":{"type":"object","properties":{"customersOrders":{"$ref":"#/components/schemas/StoreImport"},"products":{"$ref":"#/components/schemas/StoreImport"}},"required":["customersOrders","products"]},"latestCustomer":{"type":["object","null"],"properties":{"profileId":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["profileId","name","createdAt"]},"adminUrl":{"type":"string","format":"uri"}},"required":["id","platform","name","externalId","currency","primaryLocale","status","connectionStatus","importStatus","permissions","connectedAt","storefrontUrl","contactEmail","localeCount","customerCount","orderCount","productCount","lastOrderAt","lastProductSyncAt","imports","latestCustomer","adminUrl"]},"StoreImport":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"scope":{"type":"string","enum":["customers_orders","products"]},"status":{"type":"string","enum":["queued","running","completed","failed"]},"stage":{"type":["string","null"],"enum":["customers","orders","products",null]},"requestedBy":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"]},"imported":{"type":"object","properties":{"customers":{"type":"integer"},"orders":{"type":"integer"},"products":{"type":"integer"}},"required":["customers","orders","products"]},"error":{"type":["string","null"],"enum":["store_unreachable","export_failed","timed_out","import_failed","store_disconnected",null]},"queuedAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","scope","status","stage","requestedBy","imported","error","queuedAt","startedAt","completedAt"]},"StoreLocale":{"type":"object","properties":{"locale":{"type":"string"},"label":{"type":"string"},"isPrimary":{"type":"boolean"},"country":{"type":"string"},"currency":{"type":"string"},"url":{"type":["string","null"],"format":"uri"}},"required":["locale","label","isPrimary","country","currency","url"]},"Connection":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string","enum":["shopify"]},"name":{"type":"string"},"identifier":{"type":"string"},"state":{"type":"string","enum":["connected","importing","pending","needs_attention","disconnected"]},"connectedAt":{"type":"string","format":"date-time"},"path":{"type":["string","null"]},"connectIntentId":{"type":["string","null"],"format":"uuid"}},"required":["key","type","name","identifier","state","connectedAt","path","connectIntentId"]},"ConnectLinkPreview":{"type":"object","properties":{"store":{"type":"object","properties":{"externalId":{"type":"string"},"name":{"type":"string"}},"required":["externalId","name"]},"platform":{"type":"string","enum":["shopify","custom"]}},"required":["store","platform"]},"ConnectLink":{"type":"object","properties":{"store":{"type":"object","properties":{"externalId":{"type":"string"},"name":{"type":"string"}},"required":["externalId","name"]},"myWorkspaces":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"}},"requestedWorkspaceIds":{"type":"array","items":{"type":"string","format":"uuid"}},"previousWorkspace":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"twoFactorWorkspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["store","myWorkspaces","requestedWorkspaceIds","previousWorkspace","twoFactorWorkspaces"]},"ConnectResult":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid"},"slug":{"type":"string"}},"required":["workspaceId","slug"]},"ConnectChoice":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["connect"]},"workspaceId":{"type":"string","format":"uuid"}},"required":["action","workspaceId"]},{"type":"object","properties":{"action":{"type":"string","enum":["connect_new"]},"workspaceName":{"type":"string","minLength":1,"maxLength":80}},"required":["action","workspaceName"]}]},"ProfileSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"locale":{"type":["string","null"]},"storeIds":{"type":"array","items":{"type":"string","format":"uuid"}},"isCustomer":{"type":"boolean"},"emailMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"smsMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["id","name","email","phone","locale","storeIds","isCustomer","emailMarketingConsent","smsMarketingConsent","firstSeenAt","lastSeenAt"]},"Profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"locale":{"type":["string","null"]},"storeIds":{"type":"array","items":{"type":"string","format":"uuid"}},"isCustomer":{"type":"boolean"},"emailMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"smsMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"localeSource":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["order","customer"]},"storeId":{"type":["string","null"],"format":"uuid"},"signal":{"type":"string","enum":["hard","soft"]},"at":{"type":"string","format":"date-time"}},"required":["source","storeId","signal","at"]},"stores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]}},"orders":{"type":"integer"},"spent":{"type":"array","items":{"$ref":"#/components/schemas/Money"}}},"required":["id","name","email","phone","locale","storeIds","isCustomer","emailMarketingConsent","smsMarketingConsent","firstSeenAt","lastSeenAt","firstName","lastName","localeSource","stores","orders","spent"]},"Money":{"type":"object","properties":{"amount":{"type":"integer","description":"Minor units, e.g. cents"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217"}},"required":["amount","currency"]},"ProfileEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"source":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"storeId":{"type":["string","null"],"format":"uuid"},"properties":{"type":"object","additionalProperties":{}}},"required":["id","name","source","occurredAt","storeId","properties"]},"ProfileIdentity":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["email","phone","platform_customer_id","shopify_client_id","anonymous_id"]},"value":{"type":"string"},"store":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["id","type","value","store","firstSeenAt","lastSeenAt"]},"ProfileMerge":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"mergedProfileId":{"type":"string","format":"uuid"},"mergedAt":{"type":"string","format":"date-time"},"cause":{"type":["object","null"],"properties":{"source":{"type":"string"},"reference":{"type":["string","null"]}},"required":["source","reference"]}},"required":["id","mergedProfileId","mergedAt","cause"]},"ProfileCustomer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]},"externalId":{"type":"string"},"adminUrl":{"type":"string","format":"uri"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"locale":{"type":["string","null"]},"emailMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"smsMarketingConsent":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"externalCreatedAt":{"type":"string","format":"date-time"},"externalUpdatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","store","externalId","adminUrl","firstName","lastName","email","phone","locale","emailMarketingConsent","smsMarketingConsent","externalCreatedAt","externalUpdatedAt","deletedAt"]},"ConsentChange":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["email","sms"]},"state":{"type":"string","enum":["subscribed","not_subscribed","unsubscribed","pending"]},"source":{"type":"string","enum":["shopify","unsubscribe_link","one_click","import","api","manual"]},"store":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"address":{"type":["string","null"]},"proof":{"$ref":"#/components/schemas/ConsentProof"},"by":{"type":["string","null"]},"occurredAt":{"type":"string","format":"date-time"},"recordedAt":{"type":"string","format":"date-time"},"writeBacks":{"type":"array","items":{"$ref":"#/components/schemas/ConsentWriteBack"}}},"required":["id","channel","state","source","store","address","proof","by","occurredAt","recordedAt","writeBacks"]},"ConsentProof":{"type":"object","properties":{"ip":{"type":["string","null"],"maxLength":64},"userAgent":{"type":["string","null"],"maxLength":1000},"userId":{"type":["string","null"]},"apiKeyId":{"type":["string","null"]},"reference":{"type":["string","null"],"maxLength":200}},"required":["ip","userAgent","userId","apiKeyId","reference"]},"ConsentWriteBack":{"type":"object","properties":{"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"status":{"type":"string","enum":["pending","written","skipped","failed"]},"skipReason":{"type":["string","null"],"enum":["already_current","permission_missing","store_disconnected","no_email","customer_deleted","superseded",null]},"error":{"type":["string","null"]},"doneAt":{"type":["string","null"],"format":"date-time"}},"required":["store","status","skipReason","error","doneAt"]},"OrderSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"number":{"type":"string"},"placedAt":{"type":"string","format":"date-time"},"financialStatus":{"type":"string","enum":["pending","authorized","partially_paid","paid","partially_refunded","refunded","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","restocked"]},"cancelled":{"type":"boolean"},"total":{"$ref":"#/components/schemas/Money"},"locale":{"type":["string","null"]}},"required":["id","storeId","number","placedAt","financialStatus","fulfillmentStatus","cancelled","total","locale"]},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"number":{"type":"string"},"placedAt":{"type":"string","format":"date-time"},"financialStatus":{"type":"string","enum":["pending","authorized","partially_paid","paid","partially_refunded","refunded","voided"]},"fulfillmentStatus":{"type":"string","enum":["unfulfilled","partially_fulfilled","fulfilled","restocked"]},"cancelled":{"type":"boolean"},"total":{"$ref":"#/components/schemas/Money"},"locale":{"type":["string","null"]},"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]},"adminUrl":{"type":"string","format":"uri"},"customerAdminUrl":{"type":["string","null"],"format":"uri"},"buyer":{"type":["object","null"],"properties":{"profileId":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["profileId","name","email"]},"subtotal":{"$ref":"#/components/schemas/Money"},"totalDiscounts":{"$ref":"#/components/schemas/Money"},"totalShipping":{"$ref":"#/components/schemas/Money"},"totalTax":{"$ref":"#/components/schemas/Money"},"totalRefunded":{"$ref":"#/components/schemas/Money"},"sourceName":{"type":["string","null"]},"isTest":{"type":"boolean"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"lineItems":{"type":"array","items":{"$ref":"#/components/schemas/OrderLineItem"}}},"required":["id","storeId","number","placedAt","financialStatus","fulfillmentStatus","cancelled","total","locale","store","adminUrl","customerAdminUrl","buyer","subtotal","totalDiscounts","totalShipping","totalTax","totalRefunded","sourceName","isTest","cancelledAt","lineItems"]},"OrderLineItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"variantTitle":{"type":["string","null"]},"sku":{"type":["string","null"]},"quantity":{"type":"integer"},"unitPrice":{"$ref":"#/components/schemas/Money"},"totalDiscount":{"$ref":"#/components/schemas/Money"},"isGiftCard":{"type":"boolean"}},"required":["id","title","variantTitle","sku","quantity","unitPrice","totalDiscount","isGiftCard"]},"ProductSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"locale":{"type":"string"},"title":{"type":["string","null"]},"missing":{"type":"array","items":{"type":"string","enum":["title","link","price","image"]}},"published":{"type":"boolean"},"handle":{"type":["string","null"]},"status":{"type":"string","enum":["active","unlisted","draft","archived","removed"]},"removedAt":{"type":["string","null"],"format":"date-time"},"vendor":{"type":["string","null"]},"productType":{"type":["string","null"]},"image":{"$ref":"#/components/schemas/ProductImage"},"price":{"type":["object","null"],"properties":{"min":{"$ref":"#/components/schemas/Money"},"max":{"$ref":"#/components/schemas/Money"}},"required":["min","max"]},"compareAtPrice":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"]}]},"variantCount":{"type":"integer"},"stock":{"type":"string","enum":["in_stock","out_of_stock","not_tracked"]},"inventory":{"type":["integer","null"]},"changedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","storeId","externalId","locale","title","missing","published","handle","status","removedAt","vendor","productType","image","price","compareAtPrice","variantCount","stock","inventory","changedAt"]},"ProductImage":{"type":["object","null"],"properties":{"url":{"type":"string","format":"uri"},"alt":{"type":["string","null"]}},"required":["url","alt"]},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"locale":{"type":"string"},"title":{"type":["string","null"]},"missing":{"type":"array","items":{"type":"string","enum":["title","link","price","image"]}},"published":{"type":"boolean"},"handle":{"type":["string","null"]},"status":{"type":"string","enum":["active","unlisted","draft","archived","removed"]},"removedAt":{"type":["string","null"],"format":"date-time"},"vendor":{"type":["string","null"]},"productType":{"type":["string","null"]},"image":{"$ref":"#/components/schemas/ProductImage"},"price":{"type":["object","null"],"properties":{"min":{"$ref":"#/components/schemas/Money"},"max":{"$ref":"#/components/schemas/Money"}},"required":["min","max"]},"compareAtPrice":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"]}]},"variantCount":{"type":"integer"},"stock":{"type":"string","enum":["in_stock","out_of_stock","not_tracked"]},"inventory":{"type":["integer","null"]},"changedAt":{"type":["string","null"],"format":"date-time"},"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]},"locales":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"link":{"type":["string","null"],"format":"uri"},"adminUrl":{"type":["string","null"],"format":"uri"},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","additionalProperties":{"type":"string"}},"publishedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"addedAt":{"type":"string","format":"date-time"},"syncedAt":{"type":"string","format":"date-time"}},"required":["id","storeId","externalId","locale","title","missing","published","handle","status","removedAt","vendor","productType","image","price","compareAtPrice","variantCount","stock","inventory","changedAt","store","locales","description","link","adminUrl","tags","customFields","publishedAt","createdAt","addedAt","syncedAt"]},"ProductVariant":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"locale":{"type":"string"},"title":{"type":"string"},"sku":{"type":["string","null"]},"barcode":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]}},"image":{"$ref":"#/components/schemas/ProductImage"},"price":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"]}]},"compareAtPrice":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"]}]},"stock":{"type":"string","enum":["in_stock","out_of_stock","not_tracked"]},"inventory":{"type":["integer","null"]},"continueSellingWhenOutOfStock":{"type":"boolean"},"availableForSale":{"type":"boolean"},"position":{"type":"integer"},"removedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","externalId","locale","title","sku","barcode","options","image","price","compareAtPrice","stock","inventory","continueSellingWhenOutOfStock","availableForSale","position","removedAt","createdAt","updatedAt"]},"ProductSources":{"type":"object","properties":{"locale":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductSourceRecord"}},"winners":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}},"variantWinners":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","format":"uuid"}}}},"required":["locale","items","winners","variantWinners"]},"ProductSourceRecord":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["store","feed"]},"source":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"variantId":{"type":["string","null"],"format":"uuid"},"locale":{"type":"string"},"externalId":{"type":["string","null"]},"fields":{"type":"object","additionalProperties":{}},"firstSeenAt":{"type":"string","format":"date-time"},"seenAt":{"type":"string","format":"date-time"},"removedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","kind","source","variantId","locale","externalId","fields","firstSeenAt","seenAt","removedAt"]},"ProductSales":{"type":"object","properties":{"orders":{"type":"integer"},"units":{"type":"integer"},"revenue":{"$ref":"#/components/schemas/Money"}},"required":["orders","units","revenue"]},"ProductPriority":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/PrioritySource"}},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string","format":"uuid"}}},"customFields":{"type":"array","items":{"type":"string"}},"openChange":{"$ref":"#/components/schemas/PriorityChange"},"lastChange":{"$ref":"#/components/schemas/PriorityChange"}},"required":["storeId","sources","fields","customFields","openChange","lastChange"]},"PrioritySource":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["store","feed"]},"sourceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"},"locales":{"type":"array","items":{"type":"string"}},"products":{"type":"integer"}},"required":["id","kind","sourceId","name","platform","locales","products"]},"PriorityChange":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"storeId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["previewing","ready","applying","applied","failed"]},"rules":{"$ref":"#/components/schemas/PriorityRules"},"stale":{"type":"boolean"},"counts":{"type":"object","properties":{"products":{"type":"integer"},"previewed":{"type":"integer"},"changed":{"type":"integer"},"applied":{"type":"integer"}},"required":["products","previewed","changed","applied"]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"readyAt":{"type":["string","null"],"format":"date-time"},"appliedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","storeId","status","rules","stale","counts","error","createdAt","readyAt","appliedAt","completedAt"]},"PriorityRules":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"description":"Product source ids, first wins"},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"description":"Field → product source ids in its own order"}},"required":["order","fields"]},"PriorityChangeProduct":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"externalId":{"type":"string"},"title":{"type":["string","null"]},"image":{"type":["object","null"],"properties":{"url":{"type":"string","format":"uri"},"alt":{"type":["string","null"]}},"required":["url","alt"]},"changes":{"type":"array","items":{"$ref":"#/components/schemas/PriorityFieldChange"}}},"required":["id","externalId","title","image","changes"]},"PriorityFieldChange":{"type":"object","properties":{"locale":{"type":["string","null"]},"variant":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"}},"required":["id","title"]},"field":{"type":"string","pattern":"^(product\\.(title|description|handle|link|image|vendor|productType|tags|status|published|publishedAt)|variant\\.(title|options|sku|barcode|image|price|compareAtPrice|inventoryQuantity|availableForSale)|custom\\..{1,200})$","description":"`product.<field>`, `variant.<field>` or `custom.<key>`","example":"product.title"},"from":{"$ref":"#/components/schemas/PriorityValue"},"to":{"$ref":"#/components/schemas/PriorityValue"}},"required":["locale","variant","field","from","to"]},"PriorityValue":{"type":"object","properties":{"sourceId":{"type":["string","null"],"format":"uuid"},"value":{}},"required":["sourceId"]},"Feed":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"]},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"locale":{"type":["string","null"]},"mode":{"type":"string","enum":["add_and_enrich","enrich_only"]},"mapping":{"$ref":"#/components/schemas/FeedMapping"},"rank":{"type":"integer"},"latestImport":{"$ref":"#/components/schemas/FeedImport"},"nextImportAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","store","name","url","locale","mode","mapping","rank","latestImport","nextImportAt","createdAt"]},"FeedMapping":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","enum":["id","item_group_id","title","description","link","image_link","additional_image_link","price","sale_price","availability","quantity","brand","product_type","gtin","mpn","sku","color","size","material","pattern","locale","ignore"]},{"type":"object","properties":{"custom":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"A custom field’s key, e.g. season","example":"season"}},"required":["custom"]}]},"description":"Column name → a field, `ignore`, or `{ \"custom\": \"<key>\" }`"},"FeedImport":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"feedId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"trigger":{"type":"string","enum":["created","schedule","manual"]},"format":{"type":["string","null"],"enum":["csv","tsv","xml","json",null]},"bytes":{"type":["integer","null"]},"counts":{"type":"object","properties":{"rows":{"type":"integer"},"imported":{"type":"integer"},"variantOnly":{"type":"integer"},"fromFirstRow":{"type":"integer"},"created":{"type":"integer"},"products":{"type":"integer"},"unmatched":{"type":"integer"},"skipped":{"type":"integer"},"removed":{"type":"integer"}},"required":["rows","imported","variantOnly","fromFirstRow","created","products","unmatched","skipped","removed"]},"error":{"type":["string","null"],"enum":["unreachable","http_error","unreadable","too_large","row_too_long","no_rows","import_failed",null]},"queuedAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","feedId","status","trigger","format","bytes","counts","error","queuedAt","startedAt","completedAt"]},"FeedPreview":{"type":"object","properties":{"format":{"type":"string","enum":["csv","tsv","xml","json"]},"columns":{"type":"array","items":{"$ref":"#/components/schemas/FeedColumn"}},"sampled":{"type":"integer"},"matches":{"type":"integer"}},"required":["format","columns","sampled","matches"]},"FeedColumn":{"type":"object","properties":{"name":{"type":"string"},"suggested":{"anyOf":[{"type":"string","enum":["id","item_group_id","title","description","link","image_link","additional_image_link","price","sale_price","availability","quantity","brand","product_type","gtin","mpn","sku","color","size","material","pattern","locale","ignore"]},{"type":"object","properties":{"custom":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"A custom field’s key, e.g. season","example":"season"}},"required":["custom"]}]},"samples":{"type":"array","items":{"type":"string"}}},"required":["name","suggested","samples"]},"FeedCheck":{"type":"object","properties":{"checked":{"type":"integer"},"importable":{"type":"integer"},"variantOnly":{"type":"integer"},"fromFirstRow":{"type":"integer"},"unmatched":{"type":"integer"},"skipped":{"type":"integer"},"skippedRows":{"type":"array","items":{"$ref":"#/components/schemas/FeedSkippedRow"}}},"required":["checked","importable","variantOnly","fromFirstRow","unmatched","skipped","skippedRows"]},"FeedSkippedRow":{"type":"object","properties":{"row":{"type":"integer"},"id":{"type":["string","null"]},"reason":{"type":"string"}},"required":["row","id","reason"]},"Coupon":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"store":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"},"currency":{"type":"string"}},"required":["id","name","platform","currency"]},"name":{"type":"string"},"source":{"type":"string","enum":["platform","import"]},"kind":{"type":"string","enum":["personal","bulk"]},"quantity":{"type":["integer","null"]},"prefix":{"type":["string","null"]},"valueType":{"type":["string","null"],"enum":["percentage","amount",null]},"value":{"type":["integer","null"]},"minimumSubtotal":{"allOf":[{"$ref":"#/components/schemas/Money"},{"type":["object","null"]}]},"validity":{"$ref":"#/components/schemas/CouponValidity"},"combinesWith":{"$ref":"#/components/schemas/CouponCombinations"},"reissue":{"type":"string","enum":["after_use_or_expiry","every_email"]},"status":{"type":"string","enum":["active","ended","archived"]},"externalId":{"type":["string","null"]},"adminUrl":{"type":["string","null"],"format":"uri"},"importSkipped":{"type":["integer","null"]},"codes":{"type":"object","properties":{"available":{"type":"integer"},"assigned":{"type":"integer"},"used":{"type":"integer"},"expired":{"type":"integer"},"pending":{"type":"integer"},"failed":{"type":"integer"}},"required":["available","assigned","used","expired","pending","failed"]},"createdAt":{"type":"string","format":"date-time"},"archivedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","store","name","source","kind","quantity","prefix","valueType","value","minimumSubtotal","validity","combinesWith","reissue","status","externalId","adminUrl","importSkipped","codes","createdAt","archivedAt"]},"CouponValidity":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["days"]},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["until"]},"endsAt":{"type":"string","format":"date-time"}},"required":["type","endsAt"]},{"type":"object","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"]}]},"CouponCombinations":{"type":["object","null"],"properties":{"orderDiscounts":{"type":"boolean"},"productDiscounts":{"type":"boolean"},"shippingDiscounts":{"type":"boolean"}},"required":["orderDiscounts","productDiscounts","shippingDiscounts"]},"CouponImportCheck":{"type":"object","properties":{"column":{"type":["string","null"]},"rows":{"type":"integer"},"valid":{"type":"integer"},"samples":{"type":"array","items":{"type":"string"}},"duplicates":{"type":"integer"},"existing":{"type":"integer"},"existingSamples":{"type":"array","items":{"type":"string"}},"invalid":{"type":"integer"},"problems":{"type":"array","items":{"$ref":"#/components/schemas/CouponImportProblem"}}},"required":["column","rows","valid","samples","duplicates","existing","existingSamples","invalid","problems"]},"CouponImportProblem":{"type":"object","properties":{"row":{"type":"integer"},"value":{"type":"string"},"reason":{"type":"string"}},"required":["row","value","reason"]},"CouponCode":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string"},"status":{"type":"string","enum":["pending","available","assigned","used","expired","failed"]},"profile":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"]},"order":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"}},"required":["id","number"]},"assignedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"usedAt":{"type":["string","null"],"format":"date-time"},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","code","status","profile","order","assignedAt","expiresAt","usedAt","error","createdAt"]},"SearchResults":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/SearchGroup"}}},"required":["groups"]},"SearchGroup":{"type":"object","properties":{"kind":{"type":"string","enum":["profile","order","product","coupon","feed","store"]},"total":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}},"required":["kind","total","items"]},"SearchResult":{"type":"object","properties":{"kind":{"type":"string","enum":["profile","order","product","coupon","feed","store"]},"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"detail":{"type":["string","null"]},"image":{"type":["object","null"],"properties":{"url":{"type":"string","format":"uri"},"alt":{"type":["string","null"]}},"required":["url","alt"]},"platform":{"type":["string","null"]}},"required":["kind","id","title","detail","image","platform"]},"ChangeProposalSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"definitionId":{"type":["string","null"],"format":"uuid"},"name":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["open","approved","rejected"]},"stale":{"type":"boolean"},"author":{"$ref":"#/components/schemas/DefinitionAuthor"},"createdAt":{"type":"string","format":"date-time"},"reviewedBy":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"]},"reviewedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","kind","definitionId","name","summary","status","stale","author","createdAt","reviewedBy","reviewedAt"]},"DefinitionAuthor":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":["string","null"],"format":"uuid"},"name":{"type":["string","null"]}},"required":["type","id","name"]},"ChangeProposal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"definitionId":{"type":["string","null"],"format":"uuid"},"name":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["open","approved","rejected"]},"stale":{"type":"boolean"},"author":{"$ref":"#/components/schemas/DefinitionAuthor"},"createdAt":{"type":"string","format":"date-time"},"reviewedBy":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"]},"reviewedAt":{"type":["string","null"],"format":"date-time"},"baseVersionId":{"type":["string","null"],"format":"uuid"},"schemaVersion":{"type":"integer"},"definition":{},"patch":{"type":"array","items":{"$ref":"#/components/schemas/JsonPatchOperation"}},"resultVersionId":{"type":["string","null"],"format":"uuid"},"reviewNote":{"type":["string","null"]}},"required":["id","kind","definitionId","name","summary","status","stale","author","createdAt","reviewedBy","reviewedAt","baseVersionId","schemaVersion","patch","resultVersionId","reviewNote"]},"JsonPatchOperation":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","replace"]},"path":{"type":"string"},"value":{}},"required":["op","path"]},"DefinitionSchemaInfo":{"type":"object","properties":{"kind":{"type":"string"},"resource":{"type":"string"},"label":{"type":"string"},"schemaVersion":{"type":"integer"}},"required":["kind","resource","label","schemaVersion"]},"JsonSchema":{"type":"object","additionalProperties":{}}},"parameters":{}},"paths":{"/me":{"get":{"operationId":"me.get","tags":["me"],"summary":"Get the signed-in user","description":"The user and the workspaces they can open.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/me/two-factor/trusted-browsers/forget":{"post":{"operationId":"me.forgetTrustedBrowsers","tags":["me"],"summary":"Forget trusted browsers","description":"Every browser asks for a two-factor code again at its next sign-in.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/me/two-factor/email/disable":{"post":{"operationId":"me.disableTwoFactorEmail","tags":["me"],"summary":"Turn off email codes","description":"Sign-ins then need the authenticator app or a backup code. Only while the app is on; otherwise turn two-factor off.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sessions":{"get":{"operationId":"sessions.list","tags":["sessions"],"summary":"List your sessions","description":"Where you’re signed in, most recently active first.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SessionSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sessions/{id}":{"delete":{"operationId":"sessions.delete","tags":["sessions"],"summary":"Sign out a session","description":"That browser or device is signed out at once.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/sessions/sign-out-others":{"post":{"operationId":"sessions.deleteOthers","tags":["sessions"],"summary":"Sign out everywhere else","description":"Every session except the one making this request is signed out at once.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/workspaces":{"post":{"operationId":"workspaces.create","tags":["workspaces"],"summary":"Create a workspace","description":"The caller becomes its owner; its address (slug) is derived from the name.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWorkspace"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/workspaces/{id}":{"patch":{"operationId":"workspaces.update","tags":["workspaces"],"summary":"Update a workspace","description":"Owner only: its name, and whether members need two-factor on to open it (the owner needs it on first). The address (slug) never changes, so shared links keep working.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"requireTwoFactor":{"type":"boolean"}}}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/workspaces/available-slug":{"get":{"operationId":"workspaces.availableSlug","tags":["workspaces"],"summary":"Preview a workspace address","description":"The slug a new workspace with this name would get.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"name","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/members":{"get":{"operationId":"members.list","tags":["members"],"summary":"List members","description":"People with access to the workspace.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: owner, admin, member"},"required":false,"description":"Comma-separated, any of: owner, admin, member","name":"role","in":"query"},{"schema":{"type":"string","enum":["name","-name","joinedAt","-joinedAt"],"default":"joinedAt","description":"One of name, joinedAt; prefix with - for descending"},"required":false,"description":"One of name, joinedAt; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MemberSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/members/{id}/transfer-ownership":{"post":{"operationId":"members.transferOwnership","tags":["members"],"summary":"Transfer ownership","description":"Makes this member the owner; the current owner becomes an admin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/members/{id}":{"patch":{"operationId":"members.updateRole","tags":["members"],"summary":"Change a member’s role","description":"Admin or member; the owner’s role changes only through a transfer.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]}},"required":["role"]}}}},"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"members.delete","tags":["members"],"summary":"Remove a member","description":"They lose access to the workspace. The owner can’t be removed.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/members/leave":{"post":{"operationId":"members.leave","tags":["members"],"summary":"Leave the workspace","description":"The caller stops being a member. The owner transfers ownership first.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations":{"get":{"operationId":"invitations.list","tags":["invitations"],"summary":"List invitations","description":"Open invitations to the workspace, including expired ones.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InvitationSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"invitations.create","tags":["invitations"],"summary":"Invite someone","description":"Emails a link to join the workspace; valid for 7 days. Each person sends at most 50 invitation emails a day (429 `invitation_send_limit`).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["admin","member"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSummary"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations/{id}/preview":{"get":{"operationId":"invitations.preview","tags":["invitations"],"summary":"Preview an invitation","description":"For the accept page, before signing in: the id in the emailed link is the capability.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreview"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations/{id}/resend":{"post":{"operationId":"invitations.resend","tags":["invitations"],"summary":"Resend an invitation","description":"Emails it again and makes it valid for another 7 days; not within an hour of the last send (429 `invitation_recently_sent`), and within the daily budget (429 `invitation_send_limit`).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations/{id}":{"delete":{"operationId":"invitations.delete","tags":["invitations"],"summary":"Cancel an invitation","description":"The link stops working.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations/{id}/accept":{"post":{"operationId":"invitations.accept","tags":["invitations"],"summary":"Accept an invitation","description":"For the invited person, signed in with the invited (verified) email address.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspaceSlug":{"type":"string"}},"required":["workspaceSlug"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invitations/{id}/decline":{"post":{"operationId":"invitations.decline","tags":["invitations"],"summary":"Decline an invitation","description":"For the invited person, signed in with the invited email address.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api-keys":{"get":{"operationId":"apiKeys.list","tags":["apiKeys"],"summary":"List API keys","description":"The workspace’s keys, active first, newest first; never the keys themselves.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeySummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"apiKeys.create","tags":["apiKeys"],"summary":"Create an API key","description":"Answers the key once; only its hash is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scope":{"type":"string","enum":["read","propose","write"]}},"required":["name","scope"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api-keys/{id}/rotate":{"post":{"operationId":"apiKeys.rotate","tags":["apiKeys"],"summary":"Rotate an API key","description":"Replaces the key with a new one, same name and scope; the old key stops working at once. Answers the new key once.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api-keys/{id}/revoke":{"post":{"operationId":"apiKeys.revoke","tags":["apiKeys"],"summary":"Revoke an API key","description":"The key stops working at once; it stays listed as revoked.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/locales":{"get":{"operationId":"locales.list","tags":["locales"],"summary":"List locales","description":"The default first, then by code.","security":[{"apiKey":["read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceLocale"}}},"required":["items"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"locales.create","tags":["locales"],"summary":"Add a locale","description":"The workspace’s first locale becomes its default. 409 `locale_exists` when it’s there already.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":35,"description":"Locale: a language and a country, e.g. nl-NL or en-US","example":"nl-NL"}},"required":["code"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceLocale"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/locales/{id}/default":{"post":{"operationId":"locales.setDefault","tags":["locales"],"summary":"Make a locale the default","description":"The workspace's main locale, used when no locale is given.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceLocale"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/locales/{id}":{"delete":{"operationId":"locales.delete","tags":["locales"],"summary":"Remove a locale","description":"Only locales people added, and never the default (422 `locale_default`); a store’s locales come back when it syncs (422 `locale_from_store`).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores":{"get":{"operationId":"stores.list","tags":["stores"],"summary":"List stores","description":"The workspace’s connected stores, by name.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StoreSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores/{id}":{"get":{"operationId":"stores.get","tags":["stores"],"summary":"Get a store","description":"The store with its import progress.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores/{id}/locales":{"get":{"operationId":"stores.listLocales","tags":["stores"],"summary":"List where a store sells","description":"The store’s locales (ARCHITECTURE.md §5.5): every country of its markets in each language its storefront offers there, the primary locale first, then by name. Search matches the code, language, country or currency.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StoreLocale"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores/{id}/disconnect":{"post":{"operationId":"stores.disconnect","tags":["stores"],"summary":"Disconnect a store","description":"Uninstalls Postforge from the store on its platform and stops syncing. The store and its history stay in the workspace, marked disconnected; it can be connected again.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores/{id}/imports":{"get":{"operationId":"storeImports.list","tags":["storeImports"],"summary":"List a store’s imports","description":"Newest first.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StoreImport"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"storeImports.create","tags":["storeImports"],"summary":"Import a store’s history again","description":"Reads every customer and order, or every product, from the store again; live sync continues meanwhile. Records already in Postforge are updated, never duplicated, and only by data at least as new. Imports run one at a time per store: this one may wait in the queue. 409 `import_active` when this kind is queued or running already.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["customers_orders","products"]}},"required":["scope"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreImport"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connect-intents":{"post":{"operationId":"connectIntents.create","tags":["connectIntents"],"summary":"Ask to connect a store","description":"Records that this workspace wants the store and answers the platform’s install page. The store’s staff confirm it in the platform before it joins (ARCHITECTURE.md D12).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["shopify","custom"]},"externalId":{"type":"string","minLength":1,"maxLength":255}},"required":["platform","externalId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"installUrl":{"type":"string","format":"uri"}},"required":["installUrl"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connect-intents/{id}":{"delete":{"operationId":"connectIntents.delete","tags":["connectIntents"],"summary":"Cancel a request to connect a store","description":"Withdraws the workspace’s request before the store’s staff confirm it: the store no longer shows it.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connections":{"get":{"operationId":"connections.list","tags":["connections"],"summary":"List connections","description":"Every store connected to the workspace, and those waiting for confirmation.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: shopify"},"required":false,"description":"Comma-separated, any of: shopify","name":"type","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: connected, importing, pending, needs_attention, disconnected"},"required":false,"description":"Comma-separated, any of: connected, importing, pending, needs_attention, disconnected","name":"state","in":"query"},{"schema":{"type":"string","enum":["name","-name","connectedAt","-connectedAt"],"default":"name","description":"One of name, connectedAt; prefix with - for descending"},"required":false,"description":"One of name, connectedAt; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connect-links/{token}/preview":{"get":{"operationId":"connectLinks.preview","tags":["connectLinks"],"summary":"Preview a connect link","description":"The store’s name and platform, before signing in.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLinkPreview"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connect-links/{token}":{"get":{"operationId":"connectLinks.get","tags":["connectLinks"],"summary":"Get a connect link","description":"The store and the workspaces the signed-in user can add it to.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLink"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/connect-links/{token}/complete":{"post":{"operationId":"connectLinks.complete","tags":["connectLinks"],"summary":"Complete a connect link","description":"Adds the store to one of the user’s workspaces, or to a new one they own.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-Za-z]{43}$"},"required":true,"name":"token","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectChoice"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResult"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles":{"get":{"operationId":"profiles.list","tags":["profiles"],"summary":"List profiles","description":"The workspace’s people, most recently seen first.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated ids"},"required":false,"description":"Comma-separated ids","name":"store","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only people who did (true) or didn’t (false) place an order"},"required":false,"description":"Only people who did (true) or didn’t (false) place an order","name":"customer","in":"query"},{"schema":{"type":"string","enum":["lastSeenAt","-lastSeenAt","firstSeenAt","-firstSeenAt"],"default":"-lastSeenAt","description":"One of lastSeenAt, firstSeenAt; prefix with - for descending"},"required":false,"description":"One of lastSeenAt, firstSeenAt; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProfileSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"all":{"type":"integer"}},"required":["items","total","page","pageSize","all"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}":{"get":{"operationId":"profiles.get","tags":["profiles"],"summary":"Get a profile","description":"A merged profile answers with the profile it joined; its id differs from the one asked for.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/events":{"get":{"operationId":"profiles.listEvents","tags":["profiles"],"summary":"List a profile’s events","description":"The timeline, newest first.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProfileEvent"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/identities":{"get":{"operationId":"profiles.listIdentities","tags":["profiles"],"summary":"List a profile’s identities","description":"Every identifier the person is known by.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: email, phone, platform_customer_id, shopify_client_id, anonymous_id"},"required":false,"description":"Comma-separated, any of: email, phone, platform_customer_id, shopify_client_id, anonymous_id","name":"type","in":"query"},{"schema":{"type":"string","enum":["lastSeenAt","-lastSeenAt","firstSeenAt","-firstSeenAt"],"default":"-lastSeenAt","description":"One of lastSeenAt, firstSeenAt; prefix with - for descending"},"required":false,"description":"One of lastSeenAt, firstSeenAt; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProfileIdentity"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"all":{"type":"integer"}},"required":["items","total","page","pageSize","all"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/merges":{"get":{"operationId":"profiles.listMerges","tags":["profiles"],"summary":"List the profiles merged into a profile","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProfileMerge"}}},"required":["items"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/customers":{"get":{"operationId":"profiles.listCustomers","tags":["profiles"],"summary":"List a profile’s customer records","description":"The person as each store knows them.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProfileCustomer"}}},"required":["items"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/consent":{"get":{"operationId":"consent.list","tags":["consent"],"summary":"List a profile’s consent changes","description":"Every change of the person’s marketing consent, newest first, with its source and proof. The latest change per channel is the person’s consent.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: email, sms"},"required":false,"description":"Comma-separated, any of: email, sms","name":"channel","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConsentChange"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/profiles/{id}/consent/email":{"put":{"operationId":"consent.setEmail","tags":["consent"],"summary":"Subscribe or unsubscribe a profile’s email","description":"Records the change (source `manual` in the dashboard, `api` with an API key) on the person’s email address and writes it back to every store that knows them. Answers the latest email change; when the person already has this state nothing new is recorded. 409 `no_email` when the profile has no email address. Pass `proof` when the person gave or withdrew consent themselves (e.g. on your own form).","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["subscribed","unsubscribed"]},"occurredAt":{"type":"string","format":"date-time","description":"When the person changed it; defaults to now. Not in the future."},"proof":{"type":"object","properties":{"ip":{"type":["string","null"],"maxLength":64},"userAgent":{"type":["string","null"],"maxLength":1000},"reference":{"type":["string","null"],"maxLength":200}}}},"required":["state"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentChange"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/orders":{"get":{"operationId":"orders.list","tags":["orders"],"summary":"List orders","description":"Orders of the workspace’s stores, newest first. A Shopify app session sees its own store only.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated ids"},"required":false,"description":"Comma-separated ids","name":"store","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: pending, authorized, partially_paid, paid, partially_refunded, refunded, voided"},"required":false,"description":"Comma-separated, any of: pending, authorized, partially_paid, paid, partially_refunded, refunded, voided","name":"payment","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: unfulfilled, partially_fulfilled, fulfilled, restocked"},"required":false,"description":"Comma-separated, any of: unfulfilled, partially_fulfilled, fulfilled, restocked","name":"fulfillment","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only orders of this profile"},"required":false,"description":"Only orders of this profile","name":"profile","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only orders that include this product"},"required":false,"description":"Only orders that include this product","name":"product","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Placed from (inclusive)"},"required":false,"description":"Placed from (inclusive)","name":"placedFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Placed until (exclusive)"},"required":false,"description":"Placed until (exclusive)","name":"placedTo","in":"query"},{"schema":{"type":"string","enum":["placedAt","-placedAt","total","-total"],"default":"-placedAt","description":"One of placedAt, total; prefix with - for descending"},"required":false,"description":"One of placedAt, total; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"all":{"type":"integer"}},"required":["items","total","page","pageSize","all"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/orders/{id}":{"get":{"operationId":"orders.get","tags":["orders"],"summary":"Get an order","description":"The order with its buyer, line items and totals.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products":{"get":{"operationId":"products.list","tags":["products"],"summary":"List products","description":"Products of the workspace’s stores, by title, in a locale. Search matches the title, vendor, handle or a variant’s SKU. Without a status filter, removed products are left out. A Shopify app session sees its own store only.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","maxLength":35,"description":"Content locale; the workspace default without one","example":"nl-NL"},"required":false,"description":"Content locale; the workspace default without one","name":"locale","in":"query"},{"schema":{"type":"string","description":"Comma-separated ids"},"required":false,"description":"Comma-separated ids","name":"store","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: active, unlisted, draft, archived, removed"},"required":false,"description":"Comma-separated, any of: active, unlisted, draft, archived, removed","name":"status","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: in_stock, out_of_stock, not_tracked"},"required":false,"description":"Comma-separated, any of: in_stock, out_of_stock, not_tracked","name":"stock","in":"query"},{"schema":{"type":"string","enum":["title","-title","price","-price","inventory","-inventory","changedAt","-changedAt"],"default":"title","description":"One of title, price, inventory, changedAt; prefix with - for descending"},"required":false,"description":"One of title, price, inventory, changedAt; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"all":{"type":"integer"}},"required":["items","total","page","pageSize","all"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}":{"get":{"operationId":"products.get","tags":["products"],"summary":"Get a product","description":"The product’s details in a locale; its variants, sources and sales have their own operations.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":35,"description":"Content locale; the workspace default without one","example":"nl-NL"},"required":false,"description":"Content locale; the workspace default without one","name":"locale","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}/variants":{"get":{"operationId":"products.listVariants","tags":["products"],"summary":"List a product’s variants","description":"In the store’s order. Search matches the variant’s title or SKU.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","maxLength":35,"description":"Content locale; the workspace default without one","example":"nl-NL"},"required":false,"description":"Content locale; the workspace default without one","name":"locale","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: in_stock, out_of_stock, not_tracked"},"required":false,"description":"Comma-separated, any of: in_stock, out_of_stock, not_tracked","name":"stock","in":"query"},{"schema":{"type":"string","enum":["position","-position","title","-title","price","-price","inventory","-inventory"],"default":"position","description":"One of position, title, price, inventory; prefix with - for descending"},"required":false,"description":"One of position, title, price, inventory; prefix with - for descending","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}/variants/{variantId}":{"get":{"operationId":"products.getVariant","tags":["products"],"summary":"Get a product variant","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"variantId","in":"path"},{"schema":{"type":"string","maxLength":35,"description":"Content locale; the workspace default without one","example":"nl-NL"},"required":false,"description":"Content locale; the workspace default without one","name":"locale","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariant"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}/sources":{"get":{"operationId":"products.listSources","tags":["products"],"summary":"List a product’s sources","description":"What each source sent about the product and its variants in a locale, including sources that no longer have it, and which record won each product field.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":35,"description":"Content locale; the workspace default without one","example":"nl-NL"},"required":false,"description":"Content locale; the workspace default without one","name":"locale","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSources"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}/sync":{"post":{"operationId":"products.sync","tags":["products"],"summary":"Sync a product now","description":"Gets the product and its variants from the store’s platform again (changes normally arrive within seconds). A product the platform no longer has comes back `removed` (never deleted). 409 `store_unreachable` when the store must be reconnected; 422 `no_store_source` for a product only feeds have.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/products/{id}/sales":{"get":{"operationId":"products.sales","tags":["products"],"summary":"Get a product’s sales","description":"Orders that include the product, units and revenue, placed in the period (all time without one).","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time","description":"From (inclusive)"},"required":false,"description":"From (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Until (exclusive)"},"required":false,"description":"Until (exclusive)","name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSales"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/stores/{id}/product-priority":{"get":{"operationId":"productPriority.get","tags":["productPriority"],"summary":"Get a store’s product priority","description":"The store’s product sources in order (first wins), the fields with an order of their own, the custom fields its sources send, and the change that’s open or was applied last.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPriority"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/product-priority-changes":{"get":{"operationId":"productPriorityChanges.list","tags":["productPriorityChanges"],"summary":"List a store’s priority changes","description":"Newest first: the change that’s open (being previewed, waiting for review or being applied) and the ones applied or failed before. Discarded and replaced changes are gone.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"store","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PriorityChange"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"productPriorityChanges.create","tags":["productPriorityChanges"],"summary":"Preview a priority change","description":"Starts working out what every product of the store would show with these rules; nothing changes until it’s applied. Replaces a change that’s still open. 422 `invalid_rules` when the order doesn’t name every source of the store exactly once; 409 `priority_applying` while a change is being applied.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"rules":{"$ref":"#/components/schemas/PriorityRules"}},"required":["storeId","rules"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriorityChange"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/product-priority-changes/{id}":{"get":{"operationId":"productPriorityChanges.get","tags":["productPriorityChanges"],"summary":"Get a priority change","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriorityChange"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"productPriorityChanges.discard","tags":["productPriorityChanges"],"summary":"Discard a priority change","description":"Drops a change that isn’t applied; the priority stays as it is.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/product-priority-changes/{id}/products":{"get":{"operationId":"productPriorityChanges.listProducts","tags":["productPriorityChanges"],"summary":"List a priority change’s products","description":"The store’s products by title, each with the fields it would show differently. Search matches the title, vendor, handle, a variant’s SKU or the product’s id in a source; `changed=true` lists only products that change.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","enum":["true"],"description":"`true`: only products that change"},"required":false,"description":"`true`: only products that change","name":"changed","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PriorityChangeProduct"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/product-priority-changes/{id}/apply":{"post":{"operationId":"productPriorityChanges.apply","tags":["productPriorityChanges"],"summary":"Apply a priority change","description":"Makes the change the store’s priority and merges every product again with it. 409 `priority_change_not_ready` before its preview is done; 409 `priority_change_stale` when the store’s sources changed since.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriorityChange"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds":{"get":{"operationId":"feeds.list","tags":["feeds"],"summary":"List feeds","description":"The workspace’s product feeds, by name. Search matches the name or URL.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated ids"},"required":false,"description":"Comma-separated ids","name":"store","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Feed"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"feeds.create","tags":["feeds"],"summary":"Add a feed","description":"Adds a feed as a product source of the store, after the store’s other sources, and imports it right away. 422 `feed_mapping_incomplete` when the mapping lacks what the settings need.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","maxLength":2000,"format":"uri","description":"Where the file is: a public http(s) URL","example":"https://acme.com/feed.xml"},"locale":{"type":["string","null"],"maxLength":35,"description":"Every row’s locale; null when a column is mapped to `locale`","example":"nl-NL"},"mode":{"type":"string","enum":["add_and_enrich","enrich_only"]},"mapping":{"$ref":"#/components/schemas/FeedMapping"},"storeId":{"type":"string","format":"uuid"}},"required":["name","url","locale","mode","mapping","storeId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds/{id}":{"get":{"operationId":"feeds.get","tags":["feeds"],"summary":"Get a feed","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"operationId":"feeds.update","tags":["feeds"],"summary":"Change a feed","description":"Changes apply from the next import. 422 `feed_mapping_incomplete` as for create.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","maxLength":2000,"format":"uri","description":"Where the file is: a public http(s) URL","example":"https://acme.com/feed.xml"},"locale":{"type":["string","null"],"maxLength":35,"description":"Every row’s locale; null when a column is mapped to `locale`","example":"nl-NL"},"mode":{"type":"string","enum":["add_and_enrich","enrich_only"]},"mapping":{"$ref":"#/components/schemas/FeedMapping"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"feeds.delete","tags":["feeds"],"summary":"Delete a feed","description":"Removes the feed as a source: its data leaves every product, which is merged again from its other sources. Products only the feed had stay, as removed.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"No content"},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds/preview":{"post":{"operationId":"feeds.preview","tags":["feeds"],"summary":"Preview a feed","description":"Reads the first rows of a feed without adding it: its format, its columns with what each likely is and sample values, and how many rows match a variant or product of the store by id. 422 `feed_unreadable` when the URL can’t be read as a feed.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"url":{"type":"string","maxLength":2000,"format":"uri","description":"Where the file is: a public http(s) URL","example":"https://acme.com/feed.xml"}},"required":["storeId","url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedPreview"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds/check":{"post":{"operationId":"feeds.check","tags":["feeds"],"summary":"Check a feed before adding it","description":"Reads the first rows of a feed with the settings it would get and says how many would import, match nothing (enrich only) or be skipped, with the first skipped rows and why. Adds nothing. 422 `feed_unreadable` as for preview.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","description":"Where the file is: a public http(s) URL","example":"https://acme.com/feed.xml"},"locale":{"type":["string","null"],"maxLength":35,"description":"Every row’s locale; null when a column is mapped to `locale`","example":"nl-NL"},"mode":{"type":"string","enum":["add_and_enrich","enrich_only"]},"mapping":{"$ref":"#/components/schemas/FeedMapping"},"storeId":{"type":"string","format":"uuid"}},"required":["url","locale","mode","mapping","storeId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedCheck"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds/{id}/imports":{"get":{"operationId":"feeds.listImports","tags":["feeds"],"summary":"List a feed’s imports","description":"Newest first.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedImport"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"feeds.createImport","tags":["feeds"],"summary":"Import a feed now","description":"Imports the feed again now. 409 `import_active` when an import of it is queued or running.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedImport"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/feeds/{id}/imports/{importId}/skipped-rows":{"get":{"operationId":"feeds.listSkippedRows","tags":["feeds"],"summary":"List the rows an import skipped","description":"In file order, with why each was skipped.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"importId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedSkippedRow"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons":{"get":{"operationId":"coupons.list","tags":["coupons"],"summary":"List coupons","description":"Newest first. Search matches the name or prefix.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated ids"},"required":false,"description":"Comma-separated ids","name":"store","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: active, ended, archived"},"required":false,"description":"Comma-separated, any of: active, ended, archived","name":"status","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"coupons.create","tags":["coupons"],"summary":"Create a coupon","description":"Creates the discount in the store’s platform and starts making codes: a personal coupon keeps some ready as emails go out; a bulk coupon makes `quantity` at once. 422 `invalid_quantity` when a bulk coupon has none (or a personal one has one). 409 `coupons_unsupported` for a store without a supported platform; 409 `store_permission_missing` when the store hasn’t allowed Postforge to manage discounts yet; 409 `store_unreachable` when it must be reconnected; 422 `coupon_refused` with the platform’s reason.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Welcome 10%"},"valueType":{"type":"string","enum":["percentage","amount"]},"value":{"type":"integer","minimum":1},"minimumSubtotal":{"type":["integer","null"],"minimum":1},"validity":{"$ref":"#/components/schemas/CouponValidity"},"combinesWith":{"$ref":"#/components/schemas/CouponCombinations"},"reissue":{"type":"string","enum":["after_use_or_expiry","every_email"]},"storeId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["personal","bulk"]},"quantity":{"type":["integer","null"],"minimum":1,"maximum":500000},"prefix":{"type":["string","null"],"pattern":"^[A-Z0-9][A-Z0-9-]{0,19}$"}},"required":["name","valueType","value","minimumSubtotal","validity","combinesWith","reissue","storeId","kind","quantity","prefix"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/{id}":{"get":{"operationId":"coupons.get","tags":["coupons"],"summary":"Get a coupon","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"operationId":"coupons.update","tags":["coupons"],"summary":"Update a coupon","description":"Changes what its codes give, in the platform too. An imported coupon changes its name, validity and reissue only (what its codes give is set where they came from). A new validity in days applies to codes handed out from now on; a new end date to every code. A bulk coupon’s quantity can grow (422 `invalid_quantity` when it shrinks). The store, kind and prefix stay.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Welcome 10%"},"valueType":{"type":"string","enum":["percentage","amount"]},"value":{"type":"integer","minimum":1},"minimumSubtotal":{"type":["integer","null"],"minimum":1},"validity":{"$ref":"#/components/schemas/CouponValidity"},"combinesWith":{"$ref":"#/components/schemas/CouponCombinations"},"reissue":{"type":"string","enum":["after_use_or_expiry","every_email"]},"quantity":{"type":["integer","null"],"minimum":1,"maximum":500000}},"required":["name","validity","reissue","quantity"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/import-check":{"post":{"operationId":"coupons.checkImport","tags":["coupons"],"summary":"Check a file of codes","description":"Reads a CSV of codes (a column named code, coupon or discount code, else the first column) and says how many would be imported, which the file has twice, which the store has already, and which rows can’t be a code and why. Imports nothing.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"csv":{"type":"string","maxLength":25000000}},"required":["storeId","csv"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponImportCheck"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/imports":{"post":{"operationId":"coupons.import","tags":["coupons"],"summary":"Import a coupon’s codes","description":"Creates a coupon from a CSV of codes made elsewhere: Postforge hands them out and sees them used in orders; the discount stays where the codes came from. Codes the store has already are left out. A code works until a date or as long as the coupon is active (422 `invalid_validity` for days). 422 `no_codes` when no row is a code.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"csv":{"type":"string","maxLength":25000000},"validity":{"$ref":"#/components/schemas/CouponValidity"},"reissue":{"type":"string","enum":["after_use_or_expiry","every_email"]}},"required":["storeId","name","csv","validity","reissue"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/{id}/archive":{"post":{"operationId":"coupons.archive","tags":["coupons"],"summary":"Archive a coupon","description":"Turns the discount off in the platform: no code of it works anymore and none is handed out. Its codes stay, as history.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/{id}/codes":{"get":{"operationId":"coupons.listCodes","tags":["coupons"],"summary":"List a coupon’s codes","description":"Newest first. Search matches the code or the email it was handed out to.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search"},"required":false,"description":"Search","name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: pending, available, assigned, used, expired, failed"},"required":false,"description":"Comma-separated, any of: pending, available, assigned, used, expired, failed","name":"status","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CouponCode"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/coupons/{id}/codes/assign":{"post":{"operationId":"coupons.assignCode","tags":["coupons"],"summary":"Hand out a code","description":"Hands a code to a profile (its email): the same code never goes to two people. With `after_use_or_expiry` a person whose code still works gets that code again. Its days start when it’s first handed out. 409 `coupon_archived` or `coupon_ended`; 409 `coupon_codes_unavailable` when none is ready yet (more are being made); 422 `profile_without_email`.","security":[{"apiKey":["write"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"profileId":{"type":"string","format":"uuid"}},"required":["profileId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponCode"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/search":{"get":{"operationId":"search","tags":["search"],"summary":"Search the workspace","description":"Profiles (name, email or phone), orders (number, or the buyer’s exact email), products (title, vendor, handle, SKU or id), coupons (name or prefix), feeds (name or URL) and stores (name or domain): the first few of each kind and how many match.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"What to look for"},"required":true,"description":"What to look for","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20,"default":5,"description":"Results per kind"},"required":false,"description":"Results per kind","name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/change-proposals":{"get":{"operationId":"changeProposals.list","tags":["changeProposals"],"summary":"List change proposals","description":"Newest first.","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Starts at 1"},"required":false,"description":"Starts at 1","name":"page","in":"query"},{"schema":{"type":"number","default":25,"description":"One of 10, 25, 50, 100"},"required":false,"description":"One of 10, 25, 50, 100","name":"pageSize","in":"query"},{"schema":{"type":"string","description":"Comma-separated, any of: open, approved, rejected"},"required":false,"description":"Comma-separated, any of: open, approved, rejected","name":"status","in":"query"},{"schema":{"type":"string","description":"A definition kind, e.g. template"},"required":false,"description":"A definition kind, e.g. template","name":"kind","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"definitionId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChangeProposalSummary"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"all":{"type":"integer"}},"required":["items","total","page","pageSize","all"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"changeProposals.create","tags":["changeProposals"],"summary":"Propose a change","description":"A new version of a definition (`definitionId` and the `baseVersionId` it builds on: the current draft) or a new definition (`name`). The document must fit the kind’s schema (`/v1/schemas/{kind}`) and pass the checks before publish.","security":[{"apiKey":["propose"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string"},"definitionId":{"type":"string","format":"uuid"},"baseVersionId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":200},"definition":{},"summary":{"type":"string","minLength":1,"maxLength":2000}},"required":["kind","summary"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeProposal"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/change-proposals/{id}":{"get":{"operationId":"changeProposals.get","tags":["changeProposals"],"summary":"Get a change proposal","description":"With the proposed document and its diff from the base version (JSON Patch).","security":[{"apiKey":["read"]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeProposal"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/change-proposals/{id}/approve":{"post":{"operationId":"changeProposals.approve","tags":["changeProposals"],"summary":"Approve a change proposal","description":"Saves the proposed version and publishes it; a new definition is created as a draft. A stale proposal (409 `proposal_stale`) must be proposed again on the current draft.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeProposal"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/change-proposals/{id}/reject":{"post":{"operationId":"changeProposals.reject","tags":["changeProposals"],"summary":"Reject a change proposal","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Run this write once: a retry with the same key gets the first answer (24 hours)."},"required":false,"description":"Run this write once: a retry with the same key gets the first answer (24 hours).","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":2000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeProposal"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/schemas":{"get":{"operationId":"schemas.list","tags":["schemas"],"summary":"List definition schemas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DefinitionSchemaInfo"}}},"required":["items"]}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/schemas/{kind}":{"get":{"operationId":"schemas.get","tags":["schemas"],"summary":"Get a definition schema","description":"The kind’s document as JSON Schema (draft 2020-12).","parameters":[{"schema":{"type":"string"},"required":true,"name":"kind","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonSchema"}}}},"default":{"description":"Problem details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"webhooks":{}}