Skip to Content

Billing

Get Plans (Public)

No authentication required.

GET /api/v1/billing/plans

Response: 200

[ { "id": "free", "name": "Free", "price": 0, "currency": "DZD", "limits": { "projects": 3, "domains_per_project": 1, "deploys_per_day": 10, "storage_mb": 500 } }, { "id": "pro", "name": "Pro", "price": 2000, "currency": "DZD", "limits": { "projects": 10, "domains_per_project": 5, "deploys_per_day": 50, "storage_mb": 5120 } } ]

Upgrade Plan

Initiate an upgrade to Pro via Chargily Pay (supports EDAHABIA and CIB).

POST /api/v1/billing/upgrade Authorization: Bearer TOKEN

Body:

{ "plan": "pro" }

Response: 200

{ "checkout_url": "https://pay.chargily.com/...", "payment_id": "pay_abc123" }

Redirect the user to checkout_url to complete payment.

Get Billing Status

GET /api/v1/billing/status Authorization: Bearer TOKEN

Response: 200

{ "plan": "pro", "status": "active", "current_period_end": "2025-02-15T10:30:00Z", "payment_method": "edahabia" }

Payment History

GET /api/v1/billing/payments Authorization: Bearer TOKEN

Webhook (Internal)

Chargily Pay sends payment confirmations to this endpoint. Verified via HMAC SHA256 signature.

POST /api/v1/billing/webhook