{"openapi":"3.1.0","info":{"title":"Subreddit Marketing API","version":"1.0.0","summary":"Quote and order native Reddit posts.","description":"Order Reddit posts without filling in a form. 1) GET /api/quote for a price. 2) POST /api/orders with the brief: you get a paymentUrl and an orderToken. 3) A person pays at paymentUrl (this API never takes card details). 4) Follow the order with GET /api/orders/{id}. The order exists once the payment provider confirms the payment. Prices: https://subredditmarketing.co/pricing.md. Terms: https://subredditmarketing.co/terms.","contact":{"email":"hello@subredditmarketing.co","url":"https://subredditmarketing.co/contact"}},"servers":[{"url":"https://subredditmarketing.co"}],"paths":{"/api/quote":{"get":{"operationId":"getQuote","summary":"Price an order","description":"Public and cached. The same price calculation checkout uses. Above the maximum, returns ok: false with code talk_to_us.","parameters":[{"name":"posts","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["visibility","citations"],"default":"visibility"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","enum":["USD","INR"],"default":"USD"}}],"responses":{"200":{"description":"A quote (or talk_to_us above the maximum).","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["ok","quote"],"properties":{"ok":{"const":true},"quote":{"$ref":"#/components/schemas/Quote"},"display":{"type":"object","additionalProperties":{"type":["string","null"]}},"links":{"type":"object","additionalProperties":{"type":["string","null"]}}}},{"type":"object","required":["ok","code"],"properties":{"ok":{"const":false},"code":{"const":"talk_to_us"},"message":{"type":"string"}}}]}}}},"400":{"description":"Bad parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/orders":{"post":{"operationId":"createOrder","summary":"Create a payable order from a brief","description":"Validates the brief with the same rules as the order form, prices the order on the server (discount or referral codes included) and returns a payment link. Rate-limited per IP. Never send card details.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"Order created and waiting for payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderResponse"}}}},"400":{"description":"Invalid body. error.fields maps each field path to what's wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The payment provider didn't answer. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Payments aren't configured in this environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/orders/{id}":{"get":{"operationId":"getOrder","summary":"Order status, post links and views","description":"Needs the orderToken from createOrder, as a Bearer token (or ?token=). A wrong or missing token returns 404.","security":[{"orderToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"token","in":"query","required":false,"description":"Alternative to the Authorization header.","schema":{"type":"string"}}],"responses":{"200":{"description":"The order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatus"}}}},"404":{"description":"No order with that id and token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"orderToken":{"type":"http","scheme":"bearer","description":"The orderToken returned once by createOrder."}},"schemas":{"CreateOrderRequest":{"type":"object","properties":{"posts":{"type":"integer","minimum":1,"maximum":100,"description":"Number of posts, 1 to 100. Above that, talk to us."},"mode":{"type":"string","enum":["visibility","citations"],"description":"visibility: Reach, engagement and the front page of the subreddit. citations: Threads that Google ranks and LLMs quote: searchable titles, comparisons and \"best X for Y\" formats. Views are lower on purpose."},"industry":{"type":"string","enum":["dev-tools","gtm-tools","b2b-saas-ai","consumer-ai-apps","consumer-saas-ai","consumer-apps","fintech","healthtech","d2c","edtech","personal-branding","other"],"description":"Optional industry slug."},"currency":{"default":"USD","description":"USD is paid by card through Stripe; INR through Razorpay (UPI, cards, netbanking).","type":"string","enum":["USD","INR"]},"brief":{"$ref":"#/components/schemas/Brief"},"invoice":{"description":"Optional. Printed on the invoice.","type":"object","properties":{"companyName":{"anyOf":[{"type":"string","maxLength":200},{"type":"string","const":""}]},"taxId":{"anyOf":[{"type":"string","maxLength":40},{"type":"string","const":""}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"string","const":""}]},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"string","const":""}]}}},"discountCode":{"description":"A discount code or a referral code (REF-XXXXXXXX). The server checks it and works out the final amount.","type":"string","maxLength":40},"termsAccepted":{"type":"boolean","const":true,"description":"The buyer has agreed to /terms, /refund-policy and /acceptable-use."}},"required":["posts","mode","brief","termsAccepted"],"additionalProperties":false},"Brief":{"type":"object","properties":{"email":{"type":"string","title":"Work email","description":"For receipts and your dashboard login.","format":"email"},"companyName":{"type":"string","minLength":1,"maxLength":200,"title":"Company or person name","description":"Who we're posting about."},"websiteUrl":{"type":"string","minLength":1,"title":"Website or product URL","description":"We read it before drafting anything. https:// is added if missing."},"oneLiner":{"type":"string","minLength":1,"maxLength":140,"title":"One-line description","description":"How a Redditor would describe it to a friend. 140 characters max. Example: A Postgres GUI that writes the SQL for you","examples":["A Postgres GUI that writes the SQL for you"]},"problem":{"type":"string","minLength":1,"maxLength":3000,"title":"The problem you solve","description":"The pain the posts will be built around. Example: Finance teams spend three days every month matching card receipts by hand.","examples":["Finance teams spend three days every month matching card receipts by hand."]},"solution":{"type":"string","minLength":1,"maxLength":3000,"title":"How you solve it","description":"What's different about your approach. Example: We read receipts from email and Slack and match them to card lines automatically.","examples":["We read receipts from email and Slack and match them to card lines automatically."]},"narrative":{"type":"string","minLength":1,"maxLength":3000,"title":"What you want people to say about you","description":"The story we're building across posts. Example: The tool small finance teams switch to after outgrowing spreadsheets.","examples":["The tool small finance teams switch to after outgrowing spreadsheets."]},"competitors":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"url":{"anyOf":[{"type":"string","minLength":1},{"type":"string","const":""}]}},"required":["name"]},"title":"Competitors or close alternatives","description":"Up to 5. Used for comparison posts and AI-citation queries."},"icp":{"type":"string","minLength":1,"maxLength":3000,"title":"Target audience","description":"Who buys, their role and company size. This decides which subreddits we use. Example: Finance managers at 20 to 200 person startups in the US and UK.","examples":["Finance managers at 20 to 200 person startups in the US and UK."]},"subreddits":{"maxItems":20,"type":"array","items":{"type":"string"},"title":"Subreddits you already know matter","description":"Ideas we'll check against our own list. Press Enter after each."},"avoid":{"anyOf":[{"type":"string","maxLength":3000},{"type":"string","const":""}],"title":"Topics, claims or words to avoid","description":"Legal or brand limits. Example: Don't mention our pricing or the word 'cheap'.","examples":["Don't mention our pricing or the word 'cheap'."]},"redditPresence":{"anyOf":[{"type":"string","maxLength":3000},{"type":"string","const":""}],"title":"Existing Reddit presence","description":"Brand account, past threads, any bans."},"proof":{"anyOf":[{"type":"string","maxLength":3000},{"type":"string","const":""}],"title":"Proof we can mention","description":"Numbers, screenshots or reviews we can use in posts. Example: 4.8 stars from 120 reviews on G2; used by 300 finance teams.","examples":["4.8 stars from 120 reviews on G2; used by 300 finance teams."]},"proofFiles":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","exclusiveMinimum":0,"maximum":10485760},"type":{"type":"string","maxLength":100}},"required":["key","name","size","type"]},"title":"Proof files","description":"Screenshots or PDFs, up to 5 files, 10 MB each."},"categoryConfirmed":{"type":"boolean","const":true,"title":"Category confirmation","description":"Must be true: confirms the brand isn't in an excluded category (see /acceptable-use)."}},"required":["email","companyName","websiteUrl","oneLiner","problem","solution","narrative","competitors","icp","categoryConfirmed"]},"Quote":{"type":"object","description":"getQuote(): the same calculation checkout uses. Whole currency units unless the name ends in Minor.","required":["posts","mode","currency","pricePerPost","total","totalMinor","viewFloor"],"properties":{"posts":{"type":"integer"},"mode":{"type":"string","enum":["visibility","citations"]},"currency":{"type":"string","enum":["USD","INR"]},"pricePerPost":{"type":"number"},"total":{"type":"number"},"totalMinor":{"type":"integer","description":"Cents or paise."},"tier":{"type":"object","properties":{"minPosts":{"type":"integer"},"maxPosts":{"type":"integer"}}},"nextBreak":{"type":["object","null"],"properties":{"atPosts":{"type":"integer"},"addPosts":{"type":"integer"},"pricePerPost":{"type":"number"}}},"viewFloor":{"type":"integer","description":"Minimum total views, counted 48 hours after each post goes live."},"typicalViews":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}}},"viewsCountedAfterHours":{"type":"integer"},"firstPostWithinHours":{"type":"integer"},"notDeliveredAfterDays":{"type":"integer"},"showTalkToUs":{"type":"boolean"}}},"AmountDue":{"type":"object","description":"What the buyer pays: list price minus discount minus referral credit, worked out on the server. Minor units (cents or paise).","required":["currency","subtotalMinor","discountMinor","creditMinor","totalMinor"],"properties":{"currency":{"type":"string","enum":["USD","INR"]},"subtotalMinor":{"type":"integer"},"discountMinor":{"type":"integer"},"creditMinor":{"type":"integer"},"totalMinor":{"type":"integer"},"discountCode":{"type":["string","null"]},"display":{"type":"object","properties":{"subtotal":{"type":"string"},"discount":{"type":["string","null"]},"credit":{"type":["string","null"]},"total":{"type":"string"}}}}},"CreateOrderResponse":{"type":"object","required":["ok","id","orderToken","status","paymentUrl","statusUrl","quote","amountDue"],"properties":{"ok":{"const":true},"id":{"type":"string","format":"uuid","description":"The order reference. Use it with GET /api/orders/{id}."},"orderNumber":{"type":["string","null"],"description":"Set once the payment is confirmed (e.g. SM-1042)."},"status":{"const":"awaiting_payment"},"orderToken":{"type":"string","description":"Secret. Shown only once; needed for GET /api/orders/{id}."},"paymentUrl":{"type":"string","format":"uri","description":"Send this to the person paying. USD: a Stripe Checkout page. INR: our pay page (Razorpay)."},"paymentProvider":{"type":"string","enum":["stripe","razorpay"]},"payPageUrl":{"type":"string","format":"uri","description":"Our own pay page for this order. Works in either currency for 30 days."},"statusUrl":{"type":"string","format":"uri"},"quote":{"$ref":"#/components/schemas/Quote"},"amountDue":{"$ref":"#/components/schemas/AmountDue"},"next":{"type":"array","items":{"type":"string"}}}},"OrderStatus":{"type":"object","required":["ok","id","status","paid","postsOrdered","postsDelivered","posts"],"properties":{"ok":{"const":true},"id":{"type":"string","format":"uuid"},"orderNumber":{"type":["string","null"]},"status":{"type":"string","enum":["awaiting_payment","expired","paid","briefing","in_progress","delivered","refunded"]},"statusText":{"type":"string"},"paid":{"type":"boolean"},"mode":{"type":["string","null"],"enum":["visibility","citations",null]},"industry":{"type":["string","null"]},"currency":{"type":["string","null"],"enum":["USD","INR",null]},"amount":{"type":["object","null"],"properties":{"listMinor":{"type":"integer"},"discountMinor":{"type":"integer"},"creditMinor":{"type":"integer"},"totalMinor":{"type":"integer"},"display":{"type":"object","properties":{"total":{"type":["string","null"]}}}}},"postsOrdered":{"type":["integer","null"]},"postsDelivered":{"type":"integer","description":"Posts live now."},"postsRemoved":{"type":"integer","description":"Removed by moderators (replaced free within the removal allowance)."},"postsScheduled":{"type":"integer"},"viewFloor":{"type":["integer","null"]},"views48hTotal":{"type":"integer"},"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"subreddit":{"type":"string"},"title":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri","description":"Null until the post is live."},"status":{"type":"string","enum":["scheduled","live","removed","replaced"]},"postedAt":{"type":["string","null"],"format":"date-time"},"views48h":{"type":["integer","null"]},"replacesPostId":{"type":["string","null"],"format":"uuid"}}}},"createdAt":{"type":"string","format":"date-time"},"paidAt":{"type":["string","null"],"format":"date-time"},"deliveredAt":{"type":["string","null"],"format":"date-time"},"dashboardUrl":{"type":["string","null"],"format":"uri"}}},"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["invalid_request","discount_expired","card_details_not_accepted","not_found","rate_limited"]},"message":{"type":"string"},"fields":{"type":"object","description":"Field path (e.g. brief.email) -> what's wrong with it.","additionalProperties":{"type":"string"}}}}}}}}}