{"openapi":"3.1.0","info":{"title":"First 100 Transactions API","version":"1.0.0","summary":"Get your first 100 real business transactions.","description":"Launch a digital business with 100 completed paid transactions coordinated through participating Factory businesses acting as buyers/resellers. One campaign = exactly 100 transactions. Digital deliverables only (no physical goods). No reviews, ratings or reputation effects are created or promised. Money is decimal strings in USDC (6 decimals)."},"servers":[{"url":"https://first100transactions.online"}],"externalDocs":{"url":"https://first100transactions.online/docs","description":"Human-readable documentation"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Customer API key (f100_…) from POST /api/v1/accounts. Shown once."},"session":{"type":"apiKey","in":"cookie","name":"f100_session","description":"Browser session (same-origin only)."},"admin":{"type":"http","scheme":"bearer","description":"Owner/admin token."},"x402":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"x402 v2 exact payment (USDC on Base). Request without it to receive the 402 challenge (PAYMENT-REQUIRED header)."},"buyerSignature":{"type":"apiKey","in":"header","name":"F100-Signature","description":"t=<unix>,v1=hex(HMAC-SHA256(per-buyer secret, `${t}.${body}`)) plus F100-Buyer-Id."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}}}}},"Money":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"CampaignInput":{"type":"object","additionalProperties":false,"required":["business_name","business_url","product_url","description","purchase_instructions","delivery_format","seller_pricing","minimum_purchase_amount","target_spend","duration","seller_payment_method","contact_email"],"properties":{"business_name":{"type":"string","maxLength":200},"business_url":{"type":"string","format":"uri","description":"Public HTTPS URL"},"product_url":{"type":"string","format":"uri","description":"Product/service URL or API endpoint (public HTTPS)"},"description":{"type":"string","maxLength":4000,"description":"What is being purchased"},"purchase_instructions":{"oneOf":[{"type":"string"},{"type":"object"}],"description":"How a buyer makes a purchase"},"delivery_format":{"type":"string","description":"Delivery/result format"},"price_information":{"type":"string"},"seller_pricing":{"oneOf":[{"type":"object","required":["mode","price"],"properties":{"mode":{"const":"fixed"},"price":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]}}},{"type":"object","required":["mode"],"properties":{"mode":{"const":"range"},"min":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"max":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"increment":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]}}},{"type":"object","required":["mode","prices"],"properties":{"mode":{"const":"options"},"prices":{"type":"array","items":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"maxItems":20}}}],"description":"Purchasable prices. Amounts are heterogeneous but always valid for the seller and sum exactly to target_spend."},"minimum_purchase_amount":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"target_spend":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"],"description":"Total the buyer network should spend with your business"},"duration":{"oneOf":[{"type":"string","enum":["1m","1h","24h","3d","7d","10d"]},{"type":"integer","description":"seconds"}]},"distribution":{"type":"string","enum":["even","increase","decrease","custom"],"default":"even"},"interval":{"type":"string","enum":["minute","hour","day"],"description":"Required for custom"},"counts":{"type":"array","items":{"type":"integer","minimum":0},"description":"custom: per-interval counts totalling 100"},"spacing":{"type":"string","enum":["even","variable"],"default":"even"},"seller_payment_method":{"type":"string","enum":["x402_usdc_base","stripe_checkout","card","api_key_prepaid","invoice","other"]},"contact_email":{"type":"string","format":"email"},"api_documentation_url":{"type":"string","format":"uri"},"test_instructions":{"type":"string"},"additional_requirements":{"type":"string"},"auto_start":{"type":"boolean","default":false},"seed":{"type":"string","pattern":"^[0-9a-f]{32}$","description":"From /campaigns/preview: reproduces exactly the previewed schedule and amounts"}}},"Preview":{"type":"object","properties":{"transactions":{"const":100},"seed":{"type":"string"},"pricing":{"$ref":"#/components/schemas/Quote"},"schedule":{"type":"object","properties":{"duration_seconds":{"type":"integer"},"distribution":{"type":"string"},"interval":{"type":"string"},"spacing":{"type":"string"},"intervals":{"type":"array","items":{"$ref":"#/components/schemas/Interval"}}}},"purchase_amounts":{"type":"object"},"target_spend_note":{"type":"string"}}},"Quote":{"type":"object","properties":{"pricing_version":{"type":"integer"},"currency":{"const":"USDC"},"campaign_price":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"target_spend":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"network_allocation":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"expected_reseller_margin":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"platform_gross_margin":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"minimum_price_applied":{"type":"boolean"}}},"Interval":{"type":"object","properties":{"index":{"type":"integer"},"start_offset_seconds":{"type":"integer"},"end_offset_seconds":{"type":"integer"},"count":{"type":"integer"}}},"Campaign":{"type":"object","required":["id","status","progress","money"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["DRAFT","AWAITING_PAYMENT","FUNDED","SCHEDULED","RUNNING","PAUSED","COMPLETED","PARTIALLY_COMPLETED","FAILED","CANCELLED","REFUND_REVIEW"]},"sandbox":{"type":"boolean"},"progress":{"type":"object","properties":{"completed":{"type":"integer"},"total":{"const":100},"label":{"type":"string","examples":["37 / 100"]},"failed":{"type":"integer"},"by_status":{"type":"object"}}},"money":{"type":"object","properties":{"currency":{"const":"USDC"},"campaign_price":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"target_spend":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"actual_spend":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"remaining":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"network_allocation":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"refund_due":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"refunded":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]}}},"schedule":{"type":"object"},"started_at":{"type":["string","null"],"format":"date-time"},"expected_completion_at":{"type":["string","null"],"format":"date-time"},"next_actions":{"type":"array","items":{"type":"string"}}}},"Transaction":{"type":"object","properties":{"number":{"type":"string","examples":["001"]},"status":{"type":"string","enum":["CREATED","SCHEDULED","DISPATCHED","ACCEPTED","PURCHASING","PURCHASED","RESULT_RECEIVED","RESULT_STORED","RESELLER_COMPLETED","VERIFIED","FAILED","RETRY_PENDING","CANCELLED"]},"scheduled_at":{"type":["string","null"]},"planned_amount":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"actual_amount":{"type":["string","null"]},"attempts":{"type":"integer"},"completed_at":{"type":["string","null"]},"failure_code":{"type":["string","null"]}}},"Result":{"type":"object","properties":{"asset_id":{"type":"string"},"transaction":{"type":"string"},"status":{"type":"string"},"amount_paid":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"content_sha256":{"type":["string","null"]},"size_bytes":{"type":["integer","null"]},"mime_type":{"type":["string","null"]},"storage":{"type":"string","enum":["inline","blob","reference"]},"evaluation":{"type":"object","description":"Objective checks only (no subjective/AI quality score)"},"content_url":{"type":["string","null"]}}},"ProcurementJob":{"type":"object","description":"f100-procurement/1 job sent by the orchestrator to a participating Factory buyer: POST {buyer_endpoint}/jobs","required":["protocol","job_id","campaign_id","seller","product","allocated_budget","maximum_purchase_amount","expected_reseller_margin","purchase_instructions","delivery_requirements","deadline","callback_url","idempotency_key"],"properties":{"protocol":{"const":"f100-procurement/1"},"job_id":{"type":"string"},"campaign_id":{"type":"string"},"transaction_id":{"type":"string"},"attempt":{"type":"integer"},"sandbox":{"type":"boolean"},"seller":{"type":"object"},"product":{"type":"object"},"allocated_budget":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"maximum_purchase_amount":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"planned_purchase_amount":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"expected_reseller_margin":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"currency":{"const":"USDC"},"purchase_instructions":{},"delivery_requirements":{"type":"object"},"deadline":{"type":"string","format":"date-time"},"callback_url":{"type":"string","format":"uri"},"idempotency_key":{"type":"string"}}},"ProcurementCallback":{"type":"object","required":["protocol","event_id","job_id","status"],"properties":{"protocol":{"const":"f100-procurement/1"},"event_id":{"type":"string","description":"Unique per callback; duplicates are acknowledged and ignored"},"job_id":{"type":"string"},"status":{"type":"string","enum":["accepted","purchasing","purchased","completed","failed","rejected"]},"payment_made":{"type":"boolean","description":"Required for failed/rejected. false = safe to reassign; true = final"},"failure_code":{"type":"string"},"purchase_amount":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"reseller_margin":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"network_fee":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,6})?$","examples":["10.00"]},"seller_transaction_id":{"type":"string"},"result":{"type":"object","properties":{"content_base64":{"type":"string","description":"≤ 256 KB"},"location":{"type":"string","format":"uri","description":"Public HTTPS (≤ 10 MB)"},"content_type":{"type":"string"},"file_name":{"type":"string"},"size_bytes":{"type":"integer"},"sha256":{"type":"string"}}},"receipt":{"type":"object"},"seller_response":{"type":"object"},"timestamps":{"type":"object"}}},"WebhookEvent":{"type":"object","description":"POSTed to your endpoint with F100-Signature: t=<unix>,v1=hex(HMAC-SHA256(secret, `${t}.${body}`)), F100-Event, F100-Delivery.","properties":{"id":{"type":"string","description":"Stable event id (dedupe on it)"},"type":{"type":"string","enum":["campaign.created","campaign.funded","campaign.started","campaign.paused","campaign.resumed","campaign.progress","campaign.completed","campaign.partial","campaign.failed","campaign.cancelled","transaction.completed","transaction.failed"]},"created_at":{"type":"string"},"data":{"type":"object"}}}}},"paths":{"/api/v1/pricing":{"get":{"operationId":"getPricing","summary":"Current pricing configuration and formula","responses":{"200":{"description":"Pricing","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/accounts":{"post":{"operationId":"createAccount","summary":"Create an account; returns an API key once","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"session":{"type":"boolean","description":"Browser: also set the session cookie"}}}}}},"responses":{"201":{"description":"Account and API key","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"api_key":{"type":"string"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sessions":{"post":{"operationId":"signIn","summary":"Browser sign-in with an API key (sets an HttpOnly cookie)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["api_key"],"properties":{"api_key":{"type":"string"}}}}}},"responses":{"200":{"description":"Signed in","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"signOut","summary":"Sign out","responses":{"200":{"description":"Signed out","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/campaigns/preview":{"post":{"operationId":"previewCampaign","summary":"Stateless schedule + price preview (no account, nothing stored)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInput"}}}},"responses":{"200":{"description":"Preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"400":{"description":"Invalid input (precise reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns":{"post":{"operationId":"createCampaign","summary":"Create a campaign (DRAFT) with exactly 100 transactions","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"Optional; retries return the same campaign"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInput"}}}},"responses":{"201":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listCampaigns","summary":"Your campaigns","security":[{"apiKey":[]},{"session":[]}],"responses":{"200":{"description":"Campaigns","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}":{"get":{"operationId":"getCampaign","summary":"Campaign status, progress and money","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/confirm":{"post":{"operationId":"confirmCampaign","summary":"Confirm the previewed schedule (DRAFT → AWAITING_PAYMENT)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/fund":{"post":{"operationId":"fundCampaign","summary":"Pay the campaign price with x402 (USDC on Base)","description":"Without PAYMENT-SIGNATURE: 402 with the x402 challenge. With it: verified and settled through the Coinbase CDP facilitator; the campaign becomes FUNDED. The same authorization is never charged twice.","security":[{"apiKey":[],"x402":[]},{"session":[],"x402":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Funded campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required / rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Wrong state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Payments not configured or settlement unknown","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/checkout":{"post":{"operationId":"cardCheckout","summary":"Optional card checkout (Stripe) when enabled","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Checkout URL","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Card rail not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/start":{"post":{"operationId":"startCampaign","summary":"Start a FUNDED campaign (schedules all transactions)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Wrong state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/pause":{"post":{"operationId":"pauseCampaign","summary":"Pause (in-flight purchases finish; nothing new is dispatched)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/resume":{"post":{"operationId":"resumeCampaign","summary":"Resume; remaining slots shift by the pause length (recorded)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/cancel":{"post":{"operationId":"cancelCampaign","summary":"Cancel; funded campaigns go to REFUND_REVIEW (pro-rata unspent refund)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/transactions":{"get":{"operationId":"listTransactions","summary":"All 100 transactions","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Transactions","content":{"application/json":{"schema":{"type":"object","properties":{"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/results":{"get":{"operationId":"listResults","summary":"Receipts and results metadata (Digital Warehouse)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Result"}}}}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/campaigns/{id}/results/{asset}/content":{"get":{"operationId":"getResultContent","summary":"Download a stored deliverable","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^camp_[A-Za-z0-9_-]{16}$"}},{"name":"asset","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Bytes (application/octet-stream)"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks":{"post":{"operationId":"addWebhook","summary":"Register a signed webhook endpoint (secret shown once)","security":[{"apiKey":[]},{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["campaign.created","campaign.funded","campaign.started","campaign.paused","campaign.resumed","campaign.progress","campaign.completed","campaign.partial","campaign.failed","campaign.cancelled","transaction.completed","transaction.failed"]}}}}}}},"responses":{"201":{"description":"Endpoint + secret","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listWebhooks","summary":"Endpoints and delivery history","security":[{"apiKey":[]},{"session":[]}],"responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","summary":"Delete an endpoint","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/deliveries/{id}/replay":{"post":{"operationId":"replayWebhook","summary":"Manually replay a delivery (re-enables a disabled endpoint)","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Replayed","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for other customers’ campaigns)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/callbacks":{"post":{"operationId":"buyerCallback","summary":"Factory buyer callback (f100-procurement/1)","description":"Signed with the buyer’s own scoped secret. See docs/PROCUREMENT_PROTOCOL.md.","security":[{"buyerSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcurementCallback"}}}},"responses":{"200":{"description":"Applied or duplicate","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Bad signature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Job closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid callback / result required / budget exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/campaigns":{"get":{"operationId":"adminCampaigns","summary":"Owner: campaigns","security":[{"admin":[]}],"responses":{"200":{"description":"Campaigns","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/buyers":{"get":{"operationId":"adminBuyers","summary":"Owner: buyer registry","security":[{"admin":[]}],"responses":{"200":{"description":"Buyers","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"operationId":"registerBuyer","summary":"Owner: register a buyer (scoped secret shown once)","security":[{"admin":[]}],"responses":{"201":{"description":"Buyer + secret","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/pricing":{"get":{"operationId":"adminPricing","summary":"Owner: pricing","security":[{"admin":[]}],"responses":{"200":{"description":"Pricing","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"operationId":"setPricing","summary":"Owner: change multiplier, minimum price, reseller margin, duration limits (no redeploy)","security":[{"admin":[]}],"responses":{"200":{"description":"New pricing version","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/ledger":{"get":{"operationId":"adminLedger","summary":"Owner: append-only ledger and balances","security":[{"admin":[]}],"responses":{"200":{"description":"Ledger","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/health":{"get":{"operationId":"health","summary":"Configuration readiness (never touches the database)","responses":{"200":{"description":"Ready","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"x-procurement-protocol":{"name":"f100-procurement/1","buyer_endpoints":{"dispatch":"POST {endpoint}/jobs (body: ProcurementJob)","cancel":"POST {endpoint}/jobs/{job_id}/cancel → {\"status\":\"cancelled\"|\"not_found\"} or 409 when already purchasing"},"job_response":{"accepted":{"accepted":true,"job_id":"…","status":"accepted"},"rejected":{"accepted":false,"reason":"…"}}}}