GuidesBilling
Billing endpoint renames — frontend integration
Billing endpoint renames — frontend integration
The two billing action endpoints were renamed to reflect what they actually do after the Paymob native-subscription migration. These are breaking route changes — update the frontend calls.
Renamed routes
| Old | New | What it does |
|---|---|---|
POST /api/v1/user/billing/payment-method | POST /api/v1/user/billing/checkout | Sets up the subscription + card via one hosted 3DS checkout. Returns { data: { redirect_url } } — redirect the browser there. On a trial the first charge is delayed to trial end (native free trial); a lapsed account is charged immediately to recover. Requires a paid plan. |
POST /api/v1/user/billing/subscribe | POST /api/v1/user/billing/change-plan | Changes which plan you're on. Free immediate swap during the trial; a prorated charge to the saved card when active. Returns { data: { charged, subscription } } — poll /usage when charged is true. |
Request/response bodies are unchanged — only the paths changed:
POST /checkoutbody:{ callback_url? }(unchanged from the old/payment-method).POST /change-planbody:{ plan_slug, period? }(unchanged from the old/subscribe).
Why
payment-methodnow creates the whole subscription (not just "adds a card"), so it's the checkout entry point.subscribeonly ever changed the plan — the actual subscribing happens at/checkout— so it's now change-plan.
Also note (unrelated to the rename)
GET /billing/payment-statusparam ispayment_id(the legacytap_idstill works as an alias).