Good Docs Save Time
Bad docs generate questions. Great docs prevent them.
Start With Why
# Payment Processing
## Why this exists
We built this to handle Stripe webhooks reliably,
with automatic retry and idempotency.
## When to use it
- Processing subscription events
- Handling one-time payments
- Refund automation
Show Working Examples
## Quick Start
npm install @company/payments
const payments = require('@company/payments')
// Process a payment
const result = await payments.charge({
amount: 1999,
currency: 'usd',
customerId: 'cus_123'
})
console.log(result.id) // 'ch_abc123'
Structure Consistently
docs/
├── getting-started.md # First thing to read
├── installation.md # Setup steps
├── configuration.md # Options and settings
├── api/ # Reference docs
│ ├── payments.md
│ └── webhooks.md
├── guides/ # How-to articles
│ ├── subscriptions.md
│ └── refunds.md
└── troubleshooting.md # Common issues
Keep It Updated
Outdated docs are worse than no docs.
<!-- In your PR template -->
## Documentation
- [ ] Updated relevant docs
- [ ] Added examples for new features
- [ ] Checked links still work
Write for Your Audience
# For developers
POST /api/payments
Content-Type: application/json
{"amount": 1999, "currency": "usd"}
# For product managers
Payments can be processed in 30+ currencies.
See [supported currencies](/docs/currencies).
Common Sections
- Overview - What and why
- Quick Start - Working example in 5 minutes
- Installation - Step by step
- Configuration - All options explained
- Examples - Common use cases
- API Reference - Complete details
- Troubleshooting - FAQs and fixes
