Docs
JSON API
Invoices, checkout sessions and stats over plain JSON. Authenticate with a bearer key; a test key sees test data only.
Endpoints
EndpointWhat it does
- POST /api/v1/invoices
- Create an invoice with line items.
Idempotency-Keyrequired. Scopeinvoices:write. - GET /api/v1/invoices
- List, newest first.
limit(1 to 100),starting_after,status. Scopeinvoices:read. - GET /api/v1/invoices/:id
- Retrieve one.
- POST /api/v1/invoices/:id/void
- Void an open invoice; cancels any unfinished provider payment first.
- POST /api/v1/checkout/sessions
- Like an invoice with one
amount. Returns the Stripe-shaped session.Idempotency-Keyrequired. - GET /api/v1/checkout/sessions/:id
- Retrieve a session.
- POST /api/v1/checkout/sessions/:id/expire
- Expire an open session.
- GET /api/v1/stats
- Counts by status and paid volume per currency.
days1 to 365, default 30.
Create an invoice
curl https://cortanapay.com/api/v1/invoices \
-H "Authorization: Bearer ck_test_YOUR_KEY" \
-H "Idempotency-Key: inv-2026-0042" \
-H "Content-Type: application/json" \
-d '{
"currency": "usd",
"items": [
{ "description": "Design sprint", "quantity": 1, "unit_amount": 150000 },
{ "description": "Hosting", "quantity": 3, "unit_amount": 2000 }
],
"customer": { "email": "[email protected]" },
"external_id": "order_1042",
"template": "split",
"allowed_providers": ["stripe", "manual"],
"callback_url": "https://example.com/webhooks/cortana"
}'FieldNotes
- currency
- Three-letter ISO code. Amounts are integers in its smallest unit.
- items[]
- 1 to 100 lines: description, quantity (1 to 10,000), unit_amount.
- customer
- email and/or name.
- external_id
- Your own id. Unique per workspace.
- metadata
- Up to 20 string keys, returned in callbacks.
- allowed_providers[]
- Limit the methods offered:
stripe,whop,payerurl,manual. Omit for all connected. - template
- split, compact or classic.
- callback_url
- Must match an enabled webhook endpoint you registered in the same mode.
- success_url, cancel_url
- Public https URLs.
- expires_in_minutes
- 5 minutes to 30 days. Default 7 days.
Stats
Amounts in paid_volume are integer minor units, grouped by currency, so you never sum across currencies by accident.
Stats
curl "https://cortanapay.com/api/v1/stats?days=30" -H "Authorization: Bearer ck_test_YOUR_KEY"
{
"livemode": false,
"period_days": 30,
"invoices": { "open": 3, "processing": 0, "paid": 12, "void": 1, "expired": 2 },
"paid_volume": [{ "currency": "usd", "amount": 480000, "count": 12 }]
}