{"info":{"_postman_id":"325860a2-674e-48d6-bc82-558e98cec23c","name":"supscriptions","description":"<html><head></head><body><p>StartFragment</p>\n<h1 id=\"subscription-lifecycle-api\">🚀 Subscription Lifecycle API</h1>\n<h2 id=\"📌-overview\">📌 Overview</h2>\n<p>This API provides a complete subscription lifecycle management system that simulates real-world SaaS behavior.</p>\n<p>It handles all stages of a subscription:</p>\n<ul>\n<li><p>Free trials</p>\n</li>\n<li><p>Payments</p>\n</li>\n<li><p>Failed payments &amp; retries</p>\n</li>\n<li><p>Grace periods</p>\n</li>\n<li><p>Cancellation</p>\n</li>\n<li><p>Automated lifecycle transitions</p>\n</li>\n</ul>\n<p>The system is built using <strong>Laravel</strong> with a clean architecture approach.</p>\n<hr>\n<h2 id=\"🧱-architecture\">🧱 Architecture</h2>\n<p>The project follows a <strong>Service + Repository Pattern</strong>:</p>\n<ul>\n<li><p><strong>Controller</strong> → Handles HTTP requests/responses</p>\n</li>\n<li><p><strong>Service Layer</strong> → Contains business logic</p>\n</li>\n<li><p><strong>Repository Layer</strong> → Handles database operations</p>\n</li>\n<li><p><strong>Policy Layer</strong> → Manages authorization</p>\n</li>\n<li><p><strong>Enums</strong> → Manages subscription states</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"⚙️-tech-stack\">⚙️ Tech Stack</h2>\n<ul>\n<li><p>Laravel</p>\n</li>\n<li><p>Laravel Sanctum (Authentication)</p>\n</li>\n<li><p>MySQL</p>\n</li>\n<li><p>Postman (API Testing &amp; Documentation)</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"🔐-authentication\">🔐 Authentication</h2>\n<p>All protected endpoints require:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">Authorization: Bearer {token}\n\n</code></pre>\n<hr>\n<h2 id=\"👥-roles--permissions\">👥 Roles &amp; Permissions</h2>\n<h3 id=\"👨💼-admin\">👨‍💼 Admin</h3>\n<p>Responsible for managing subscription plans.</p>\n<p><strong>Permissions:</strong></p>\n<ul>\n<li><p>Create plans</p>\n</li>\n<li><p>Update plans</p>\n</li>\n<li><p>Delete plans</p>\n</li>\n</ul>\n<hr>\n<h3 id=\"👤-user\">👤 User</h3>\n<p>Responsible for interacting with subscriptions.</p>\n<p><strong>Permissions:</strong></p>\n<ul>\n<li><p>Start trial</p>\n</li>\n<li><p>Pay subscription</p>\n</li>\n<li><p>Retry failed payments</p>\n</li>\n<li><p>Cancel subscription</p>\n</li>\n<li><p>View own subscriptions only</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"🔒-authorization-rules\">🔒 Authorization Rules</h2>\n<ul>\n<li><p>Users can only access <strong>their own subscriptions</strong></p>\n</li>\n<li><p>Policies are used to enforce ownership:</p>\n<ul>\n<li><code>SubscriptionPolicy</code></li>\n</ul>\n</li>\n<li><p>Admin-only access for plan management</p>\n</li>\n<li><p>Unauthorized actions return <strong>403 Forbidden</strong></p>\n</li>\n</ul>\n<hr>\n<h2 id=\"🔄-subscription-lifecycle\">🔄 Subscription Lifecycle</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-text\">trialing → past_due → canceled\n       ↘\n         active → canceled\n\n</code></pre>\n<hr>\n<h2 id=\"📊-subscription-states\">📊 Subscription States</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>trialing</td>\n<td>User is in free trial</td>\n</tr>\n<tr>\n<td>active</td>\n<td>Subscription is paid and active</td>\n</tr>\n<tr>\n<td>past_due</td>\n<td>Payment failed, user in grace period</td>\n</tr>\n<tr>\n<td>canceled</td>\n<td>Subscription terminated</td>\n</tr>\n</tbody>\n</table>\n</div><hr>\n<h2 id=\"🧠-business-rules\">🧠 Business Rules</h2>\n<ul>\n<li><p>A user can have <strong>only one active or trial subscription</strong></p>\n</li>\n<li><p>Payment is <strong>not allowed during trial</strong></p>\n</li>\n<li><p>Payment success → moves subscription to <strong>active</strong></p>\n</li>\n<li><p>Payment failure → moves subscription to <strong>past_due</strong></p>\n</li>\n<li><p>Grace period lasts <strong>3 days</strong></p>\n</li>\n<li><p>Retry is only allowed when status = <strong>past_due</strong></p>\n</li>\n<li><p>Canceled subscriptions cannot be modified</p>\n</li>\n<li><p>Trial expiration automatically moves to <strong>past_due</strong></p>\n</li>\n</ul>\n<hr>\n<h2 id=\"⏰-scheduler-automation\">⏰ Scheduler (Automation)</h2>\n<p>A scheduled command runs daily:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">php artisan subscriptions:check\n\n</code></pre>\n<h3 id=\"responsibilities\">Responsibilities:</h3>\n<ul>\n<li><p>Move expired trials → <code>past_due</code></p>\n</li>\n<li><p>Move expired grace periods → <code>canceled</code></p>\n</li>\n</ul>\n<hr>\n<h2 id=\"📡-api-endpoints\">📡 API Endpoints</h2>\n<h3 id=\"🔹-start-trial\">🔹 Start Trial</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/subscriptions/start-trial\n\n</code></pre>\n<p><strong>Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"plan_id\": 1\n}\n\n</code></pre>\n<hr>\n<h3 id=\"🔹-pay-subscription\">🔹 Pay Subscription</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/subscriptions/{id}/pay\n\n</code></pre>\n<p><strong>Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success | failed\"\n}\n\n</code></pre>\n<hr>\n<h3 id=\"🔹-retry-payment\">🔹 Retry Payment</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/subscriptions/{id}/retry\n\n</code></pre>\n<hr>\n<h3 id=\"🔹-cancel-subscription\">🔹 Cancel Subscription</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/subscriptions/{id}/cancel\n\n</code></pre>\n<hr>\n<h3 id=\"🔹-get-user-subscriptions\">🔹 Get User Subscriptions</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">GET /api/subscriptions\n\n</code></pre>\n<hr>\n<h2 id=\"💳-payments\">💳 Payments</h2>\n<p>Tracks:</p>\n<ul>\n<li><p>Payment amount</p>\n</li>\n<li><p>Currency</p>\n</li>\n<li><p>Payment status (paid / failed)</p>\n</li>\n<li><p>Payment date</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"🔁-payment-attempts\">🔁 Payment Attempts</h2>\n<p>Tracks all attempts:</p>\n<ul>\n<li><p>attempt number</p>\n</li>\n<li><p>success / failure</p>\n</li>\n<li><p>timestamp</p>\n</li>\n</ul>\n<p>Used for:</p>\n<ul>\n<li><p>retry logic</p>\n</li>\n<li><p>analytics</p>\n</li>\n<li><p>debugging</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"🧪-example-workflow\">🧪 Example Workflow</h2>\n<ol>\n<li><p>User starts trial → <code>trialing</code></p>\n</li>\n<li><p>Trial expires → <code>past_due</code></p>\n</li>\n<li><p>User retries payment:</p>\n<ul>\n<li><p>success → <code>active</code></p>\n</li>\n<li><p>failure → stays <code>past_due</code></p>\n</li>\n</ul>\n</li>\n<li><p>Grace period ends → <code>canceled</code></p>\n</li>\n</ol>\n<hr>\n<h2 id=\"⚠️-notes\">⚠️ Notes</h2>\n<ul>\n<li><p>Payments are <strong>simulated</strong> (no real gateway integration)</p>\n</li>\n<li><p>System designed to mimic real SaaS platforms like Stripe</p>\n</li>\n<li><p>Easily extendable to integrate real payment gateways</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"👨💻-author\">👨‍💻 Author</h2>\n<p>Ahmed Abdulhamid</p>\n<p>EndFragment</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"🚀 Subscription Lifecycle API","slug":"subscription-lifecycle-api"}],"owner":"29985463","collectionId":"325860a2-674e-48d6-bc82-558e98cec23c","publishedId":"2sBXiqEp7J","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-06T07:19:15.000Z"},"item":[{"name":"users","item":[{"name":"create user","id":"7004a8c9-8cfb-4475-ac1c-be69824800af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"ahmed\",\r\n    \"email\":\"ahmed@gmail.com\",\r\n    \"role\":\"user\",\r\n    \"password\":\"password\",\r\n  \r\n    \r\n   \r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/register","urlObject":{"path":["register"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"6be17d06-6aa5-44f8-b20c-888264fc54e6","name":"create user","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"ahmed\",\r\n    \"email\":\"ahmed@gmail.com\",\r\n    \"role\":\"user\",\r\n    \"password\":\"password\",\r\n    \"password_confirmation\":\"password\"\r\n  \r\n    \r\n   \r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/register"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 04:42:36 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User registered successfully\",\n    \"data\": {\n        \"id\": 4,\n        \"name\": \"ahmed\",\n        \"email\": \"ahmed@gmail.com\",\n        \"role\": \"user\",\n        \"created_at\": \"2026-04-06 \"\n    },\n    \"code\": 201\n}"}],"_postman_id":"7004a8c9-8cfb-4475-ac1c-be69824800af"},{"name":"login user","id":"a5ac37a0-4ea6-4aa1-96ac-1d00b528ad25","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \r\n    \"password\":\"password\",\r\n    \"email\":\"test2@example.com\"\r\n    \r\n   \r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/login","urlObject":{"path":["login"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"67df9cae-7be8-48e8-9141-0e5111288bcc","name":"login user","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \r\n    \"password\":\"password\",\r\n    \"email\":\"test2@example.com\"\r\n    \r\n   \r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/login"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 04:40:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User logged in successfully\",\n    \"data\": {\n        \"user\": {\n            \"id\": 3,\n            \"name\": \"Test User2\",\n            \"email\": \"test2@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"token\": \"7|oCGW2hkIJ1FUxJqvJOscMezfPhr54LsERWO64dCdfefc71c5\"\n    },\n    \"code\": 200\n}"}],"_postman_id":"a5ac37a0-4ea6-4aa1-96ac-1d00b528ad25"},{"name":"logout user","id":"cff7ce20-36e3-4203-911a-b526173442a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{supscriptions_url}}/logout","urlObject":{"path":["logout"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"16c68de4-abe5-4938-a17b-d6d88935679e","name":"logout user","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{supscriptions_url}}/logout"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 06:47:13 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User logged out successfully\",\n    \"data\": null,\n    \"code\": 200\n}"}],"_postman_id":"cff7ce20-36e3-4203-911a-b526173442a4"}],"id":"a2c9f876-61ee-4043-9b84-f39b8a699559","_postman_id":"a2c9f876-61ee-4043-9b84-f39b8a699559","description":""},{"name":"plans","item":[{"name":"getAllPlans","id":"f6da8fa9-1b98-4300-a994-8d458bd4ead8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/plans/currency/USD","urlObject":{"path":["plans","currency","USD"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"41b7fe0c-af35-47ae-866f-2b71be702999","name":"getAllPlans","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/plans/currency/USD"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 06:36:28 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plans retrieved successfully\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"Basic Monthly\",\n            \"price\": \"9.99\",\n            \"currency_code\": \"USD\",\n            \"currency\": {\n                \"id\": 1,\n                \"code\": \"USD\",\n                \"name\": \"US Dollar\"\n            },\n            \"interval\": \"monthly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        {\n            \"id\": 2,\n            \"name\": \"Pro Quarterly\",\n            \"price\": \"24.99\",\n            \"currency_code\": \"USD\",\n            \"currency\": {\n                \"id\": 1,\n                \"code\": \"USD\",\n                \"name\": \"US Dollar\"\n            },\n            \"interval\": \"quarterly\",\n            \"trial_days\": 14,\n            \"is_active\": true\n        }\n    ],\n    \"code\": 200\n}"}],"_postman_id":"f6da8fa9-1b98-4300-a994-8d458bd4ead8"},{"name":"getPlansByCurrency","id":"8c10b785-d7f2-4ba6-8a76-dcf8673b556c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/plans/currency/USD","urlObject":{"path":["plans","currency","USD"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"c4eb2f45-21b4-4ef0-82ee-8a177d7e5355","name":"getPlansByCurrency","originalRequest":{"method":"GET","header":[],"url":"{{supscriptions_url}}/plans/currency/USD"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 06:40:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plans retrieved successfully\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"Basic Monthly\",\n            \"price\": \"9.99\",\n            \"currency_code\": \"USD\",\n            \"currency\": {\n                \"id\": 1,\n                \"code\": \"USD\",\n                \"name\": \"US Dollar\"\n            },\n            \"interval\": \"monthly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        {\n            \"id\": 2,\n            \"name\": \"Pro Quarterly\",\n            \"price\": \"24.99\",\n            \"currency_code\": \"USD\",\n            \"currency\": {\n                \"id\": 1,\n                \"code\": \"USD\",\n                \"name\": \"US Dollar\"\n            },\n            \"interval\": \"quarterly\",\n            \"trial_days\": 14,\n            \"is_active\": true\n        }\n    ],\n    \"code\": 200\n}"},{"id":"e589d4cf-af18-4126-885c-3d9a3640b74e","name":"getPlansByCurrency","originalRequest":{"method":"GET","header":[],"url":"{{supscriptions_url}}/plans/currency/USD"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 04:43:42 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plans retrieved successfully\",\n    \"data\": [\n        {\n            \"id\": 2,\n            \"name\": \"Pro Quarterly\",\n            \"price\": \"24.99\",\n            \"currency_code\": \"USD\",\n            \"currency\": {\n                \"id\": 1,\n                \"code\": \"USD\",\n                \"name\": \"US Dollar\"\n            },\n            \"interval\": \"quarterly\",\n            \"trial_days\": 14,\n            \"is_active\": true\n        }\n    ],\n    \"code\": 200\n}"}],"_postman_id":"8c10b785-d7f2-4ba6-8a76-dcf8673b556c"},{"name":"ShowPlan","id":"b2dc67a0-69e1-4444-bb45-4a9a2bd48f6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/plans/basic-monthly","urlObject":{"path":["plans","basic-monthly"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"a7d12f94-35c9-428c-bdc7-433ad6260f0d","name":"ShowPlan","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/plans/basic-monthly"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 06:53:41 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plan retrieved successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Basic Monthly\",\n        \"price\": \"9.99\",\n        \"currency_code\": \"USD\",\n        \"currency\": {\n            \"id\": 1,\n            \"code\": \"USD\",\n            \"name\": \"US Dollar\"\n        },\n        \"subscriptions\": [\n            {\n                \"id\": 1,\n                \"status\": \"active\",\n                \"trial_ends_at\": null,\n                \"current_period_start\": \"2026-04-05\",\n                \"current_period_end\": \"2026-05-05\",\n                \"grace_period_end\": null,\n                \"canceled_at\": null,\n                \"auto_renew\": true\n            }\n        ],\n        \"interval\": \"monthly\",\n        \"trial_days\": 7,\n        \"is_active\": true\n    },\n    \"code\": 200\n}"}],"_postman_id":"b2dc67a0-69e1-4444-bb45-4a9a2bd48f6b"},{"name":"storePlan","id":"471a1362-10bb-4a95-b7b3-21807e0e1845","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"plan2 name\",\r\n    \"price\":500.00,\r\n    \"currency_id\":2,\r\n    \"interval\":\"yearly\",\r\n    \"trial_days\":7,\r\n    \"is_active\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans","description":"<p>StartFragment</p>\n<h2 id=\"🧾-create-plan-admin-only\">🧾 Create Plan (Admin Only)</h2>\n<p>Creates a new subscription plan.</p>\n<p>EndFragment</p>\n","urlObject":{"path":["plans"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"a2b94d1c-2720-4ab2-be34-7f19c7f6c246","name":"storePlan","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"plan2 name\",\r\n    \"price\":500.00,\r\n    \"currency_id\":2,\r\n    \"interval\":\"yearly\",\r\n    \"trial_days\":7,\r\n    \"is_active\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 07:53:42 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plan created successfully\",\n    \"data\": {\n        \"id\": 7,\n        \"name\": \"plan2 name\",\n        \"price\": \"500.00\",\n        \"currency_code\": \"EGP\",\n        \"currency\": {\n            \"id\": 2,\n            \"code\": \"EGP\",\n            \"name\": \"Egyptian Pound\"\n        },\n        \"interval\": \"yearly\",\n        \"trial_days\": 7,\n        \"is_active\": true\n    },\n    \"code\": 201\n}"}],"_postman_id":"471a1362-10bb-4a95-b7b3-21807e0e1845"},{"name":"updatePlan","id":"08bf30a6-18ef-4a1c-afb2-b44764617700","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"hello world\",\r\n    \"price\":500.00,\r\n    \"currency_id\":2,\r\n    \"interval\":\"yearly\",\r\n    \"trial_days\":7,\r\n    \"is_active\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans/basic-monthly-yearly-2","description":"<p>StartFragment</p>\n<h2 id=\"🧾-update-plan-admin-only\">🧾 Update Plan (Admin Only)</h2>\n<p>Update a subscription plan.</p>\n<p>EndFragment</p>\n","urlObject":{"path":["plans","basic-monthly-yearly-2"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"c4c5564c-51f5-467c-acba-720c48534cb1","name":"updatePlan","originalRequest":{"method":"PUT","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"hello world\",\r\n    \"price\":500.00,\r\n    \"currency_id\":2,\r\n    \"interval\":\"yearly\",\r\n    \"trial_days\":7,\r\n    \"is_active\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans/basic-monthly-yearly-2"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 08:01:01 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plan updated successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"hello world\",\n        \"price\": \"500.00\",\n        \"currency_code\": \"EGP\",\n        \"currency\": {\n            \"id\": 2,\n            \"code\": \"EGP\",\n            \"name\": \"Egyptian Pound\"\n        },\n        \"interval\": \"yearly\",\n        \"trial_days\": 7,\n        \"is_active\": true\n    },\n    \"code\": 200\n}"}],"_postman_id":"08bf30a6-18ef-4a1c-afb2-b44764617700"},{"name":"DeletePlan","id":"51019e99-1580-4a04-9169-446b46cec93e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans/plan2 name-yearly-2","description":"<p>StartFragment</p>\n<h2 id=\"🧾-delete-plan-admin-only\">🧾 Delete Plan (Admin Only)</h2>\n<p>Deletes a subscription plan.</p>\n<p>EndFragment</p>\n","urlObject":{"path":["plans","plan2 name-yearly-2"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"cf2ee15a-6f41-4bb5-86e6-2062b6d957ee","name":"DeletePlan","originalRequest":{"method":"DELETE","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/plans/hello world-yearly-2"},"status":"OK","code":200,"_postman_previewlanguage":"","header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 08:09:04 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Plan deleted successfully\",\n    \"data\": null,\n    \"code\": 200\n}"}],"_postman_id":"51019e99-1580-4a04-9169-446b46cec93e"}],"id":"183dd919-d8f2-493d-a74d-eda2a0e642de","_postman_id":"183dd919-d8f2-493d-a74d-eda2a0e642de","description":""},{"name":"subscriptions","item":[{"name":"getAllSubscriptions","id":"002a1b8c-6812-4b94-8df6-0d0c6268973f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[{"id":"1f9ce698-3413-41fa-b268-e22e977da075","name":"getAllSubscriptions","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{supscriptions_url}}/subscriptions"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 10:19:17 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Subscriptions retrieved successfully\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"user\": {\n                \"id\": 2,\n                \"name\": \"Test User\",\n                \"email\": \"test@example.com\",\n                \"role\": \"user\",\n                \"created_at\": \"2026-04-05 \"\n            },\n            \"plan\": {\n                \"id\": 1,\n                \"name\": \"hello world\",\n                \"price\": \"500.00\",\n                \"currency_code\": \"EGP\",\n                \"currency\": {\n                    \"id\": 2,\n                    \"code\": \"EGP\",\n                    \"name\": \"Egyptian Pound\"\n                },\n                \"interval\": \"yearly\",\n                \"trial_days\": 7,\n                \"is_active\": true\n            },\n            \"status\": \"active\",\n            \"trial_ends_at\": null,\n            \"current_period_start\": \"2026-04-05\",\n            \"current_period_end\": \"2026-05-05\",\n            \"grace_period_end\": null,\n            \"canceled_at\": null,\n            \"auto_renew\": true\n        },\n        {\n            \"id\": 2,\n            \"user\": {\n                \"id\": 3,\n                \"name\": \"Test User2\",\n                \"email\": \"test2@example.com\",\n                \"role\": \"user\",\n                \"created_at\": \"2026-04-05 \"\n            },\n            \"plan\": {\n                \"id\": 3,\n                \"name\": \"Premium Yearly\",\n                \"price\": \"499.99\",\n                \"currency_code\": \"EGP\",\n                \"currency\": {\n                    \"id\": 2,\n                    \"code\": \"EGP\",\n                    \"name\": \"Egyptian Pound\"\n                },\n                \"interval\": \"yearly\",\n                \"trial_days\": 30,\n                \"is_active\": true\n            },\n            \"status\": \"trialing\",\n            \"trial_ends_at\": \"2026-0505\",\n            \"current_period_start\": null,\n            \"current_period_end\": null,\n            \"grace_period_end\": null,\n            \"canceled_at\": null,\n            \"auto_renew\": true\n        }\n    ],\n    \"code\": 200\n}"}],"_postman_id":"002a1b8c-6812-4b94-8df6-0d0c6268973f"},{"name":"show subscription","id":"821c8481-e703-47a4-a0c5-418206d63d17","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[{"id":"231de8f9-be13-4ab2-95db-40cf546938f3","name":"show subscription","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/1"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 10:25:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Subscription retrieved successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"user\": {\n            \"id\": 2,\n            \"name\": \"Test User\",\n            \"email\": \"test@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"status\": \"active\",\n        \"trial_ends_at\": null,\n        \"current_period_start\": \"2026-04-05\",\n        \"current_period_end\": \"2026-05-05\",\n        \"grace_period_end\": null,\n        \"canceled_at\": null,\n        \"auto_renew\": true\n    },\n    \"code\": 200\n}"}],"_postman_id":"821c8481-e703-47a4-a0c5-418206d63d17"},{"name":"startTrial","id":"1487de4a-2702-46dd-b159-caa9a9926595","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"plan_id\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/start-trial","urlObject":{"path":["subscriptions","start-trial"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"ef3243e4-90bf-4545-9b78-d60b90ee96c6","name":"startTrial","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\r\n    \"plan_id\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/start-trial"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 04:53:18 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Trial started successfully\",\n    \"data\": {\n        \"id\": 12,\n        \"user\": {\n            \"id\": 3,\n            \"name\": \"Test User2\",\n            \"email\": \"test2@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"payments\": [],\n        \"payment_attempts\": [],\n        \"status\": \"trialing\",\n        \"trial_ends_at\": \"2026-04-13\",\n        \"current_period_start\": null,\n        \"current_period_end\": null,\n        \"grace_period_end\": null,\n        \"canceled_at\": null,\n        \"auto_renew\": true\n    },\n    \"code\": 201\n}"},{"id":"f41dfaa2-ad62-41b7-b8ae-af6fab061153","name":"startTrial","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\r\n    \"plan_id\":1\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/start-trial"},"status":"Conflict","code":409,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 05:08:58 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"User already has an active or trial subscription\",\n    \"errors\": [],\n    \"code\": 409\n}"}],"_postman_id":"1487de4a-2702-46dd-b159-caa9a9926595"},{"name":"paySubscription","id":"002d27b7-a28f-4248-a60a-38dcc39259c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\":\"failed\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/1/pay","urlObject":{"path":["subscriptions","1","pay"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"9a47a86a-17be-44a1-be4c-9909f14b0609","name":"paySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\":\"success\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/1/pay"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 15:30:13 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"Subscription already active\",\n    \"errors\": [],\n    \"code\": 400\n}"},{"id":"9fdb2808-dd59-41b3-a911-97244631eeaa","name":"paySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"failed\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/1/pay"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 01:14:57 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Payment failed, subscription moved to past_due\",\n    \"data\": {\n        \"id\": 1,\n        \"user\": {\n            \"id\": 2,\n            \"name\": \"Test User\",\n            \"email\": \"test@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"payments\": [\n            {\n                \"id\": 7,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"paid_at\": null\n            },\n            {\n                \"id\": 8,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"paid_at\": null\n            },\n            {\n                \"id\": 9,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"paid\",\n                \"payment_method\": null,\n                \"paid_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 10,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"paid_at\": null\n            }\n        ],\n        \"payment_attempts\": [\n            {\n                \"id\": 3,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 11,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 12,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 14,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 15,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 17,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            }\n        ],\n        \"status\": \"past_due\",\n        \"trial_ends_at\": \"2026-0405\",\n        \"current_period_start\": \"2026-04-05\",\n        \"current_period_end\": \"2027-04-05\",\n        \"grace_period_end\": \"2026-04-09\",\n        \"canceled_at\": \"2026-04-06\",\n        \"auto_renew\": false\n    },\n    \"code\": 200\n}"},{"id":"60360cc6-063f-4fc6-b8aa-7bea2617a611","name":"paySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"failed\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/12/pay"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 04:56:29 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"Cannot pay for a trial subscription, wait until trial ends\",\n    \"errors\": [],\n    \"code\": 400\n}"},{"id":"c0c00b45-d54e-4ba7-bd7d-5583b7ea817a","name":"paySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"success\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{supscriptions_url}}/subscriptions/12/pay"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 05:05:04 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Payment successful, subscription active\",\n    \"data\": {\n        \"id\": 12,\n        \"user\": {\n            \"id\": 3,\n            \"name\": \"Test User2\",\n            \"email\": \"test2@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"payments\": [\n            {\n                \"id\": 14,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"paid\",\n                \"payment_method\": null,\n                \"paid_at\": \"2026-04-06\"\n            }\n        ],\n        \"payment_attempts\": [\n            {\n                \"id\": 23,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 24,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 25,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 26,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 27,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 28,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 29,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            },\n            {\n                \"id\": 30,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            }\n        ],\n        \"status\": \"active\",\n        \"trial_ends_at\": \"2026-04-05\",\n        \"current_period_start\": \"2026-04-06\",\n        \"current_period_end\": \"2027-04-06\",\n        \"grace_period_end\": null,\n        \"canceled_at\": null,\n        \"auto_renew\": true\n    },\n    \"code\": 200\n}"}],"_postman_id":"002d27b7-a28f-4248-a60a-38dcc39259c2"},{"name":"cancelSupscription","id":"49e7ec23-5f49-4909-992c-4ac953679923","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/8/cancel","urlObject":{"path":["subscriptions","8","cancel"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"8a251ddf-0092-4913-a77a-fc4ad2576e77","name":"cancelSupscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/1/cancel"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Sun, 05 Apr 2026 16:30:32 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Subscription canceled successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"user\": {\n            \"id\": 2,\n            \"name\": \"Test User\",\n            \"email\": \"test@example.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-05 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"payments\": [\n            {\n                \"id\": 7,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"paid_at\": null\n            },\n            {\n                \"id\": 8,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"paid_at\": null\n            },\n            {\n                \"id\": 9,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"paid\",\n                \"payment_method\": null,\n                \"paid_at\": \"2026-04-05\"\n            }\n        ],\n        \"payment_attempts\": [\n            {\n                \"id\": 3,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 11,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 12,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 14,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"failed\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            },\n            {\n                \"id\": 15,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-05\"\n            }\n        ],\n        \"status\": \"canceled\",\n        \"trial_ends_at\": null,\n        \"current_period_start\": \"2026-04-05\",\n        \"current_period_end\": \"2027-04-05\",\n        \"grace_period_end\": null,\n        \"canceled_at\": \"2026-04-05\",\n        \"auto_renew\": false\n    },\n    \"code\": 200\n}"}],"_postman_id":"49e7ec23-5f49-4909-992c-4ac953679923"},{"name":"retrySubscription","id":"6fb80f5f-f93f-4683-8a2d-346e5bd2c62a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/13/retry","urlObject":{"path":["subscriptions","13","retry"],"host":["{{supscriptions_url}}"],"query":[],"variable":[]}},"response":[{"id":"9a7987e4-59f6-45e4-8c9a-57e4e0d9f9ae","name":"retrySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/12/retry"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 05:08:19 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"Retry only allowed for past_due subscriptions\",\n    \"errors\": [],\n    \"code\": 400\n}"},{"id":"17b9ede3-4e3b-45c0-a75a-57fd5bab8482","name":"retrySubscription","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"{{supscriptions_url}}/subscriptions/13/retry"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Host","value":"127.0.0.1:8000"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.2.12"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Mon, 06 Apr 2026 05:13:05 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Retry successful, subscription active\",\n    \"data\": {\n        \"id\": 13,\n        \"user\": {\n            \"id\": 4,\n            \"name\": \"ahmed\",\n            \"email\": \"ahmed@gmail.com\",\n            \"role\": \"user\",\n            \"created_at\": \"2026-04-06 \"\n        },\n        \"plan\": {\n            \"id\": 1,\n            \"name\": \"hello world\",\n            \"price\": \"500.00\",\n            \"currency_code\": \"EGP\",\n            \"currency\": {\n                \"id\": 2,\n                \"code\": \"EGP\",\n                \"name\": \"Egyptian Pound\"\n            },\n            \"interval\": \"yearly\",\n            \"trial_days\": 7,\n            \"is_active\": true\n        },\n        \"payments\": [\n            {\n                \"id\": 15,\n                \"amount\": \"500.00\",\n                \"currency_code\": null,\n                \"status\": \"paid\",\n                \"payment_method\": null,\n                \"paid_at\": \"2026-04-06\"\n            }\n        ],\n        \"payment_attempts\": [\n            {\n                \"id\": 31,\n                \"amount\": null,\n                \"currency_code\": null,\n                \"status\": \"success\",\n                \"payment_method\": null,\n                \"attempted_at\": \"2026-04-06\"\n            }\n        ],\n        \"status\": \"active\",\n        \"trial_ends_at\": \"2026-04-05\",\n        \"current_period_start\": \"2026-04-06\",\n        \"current_period_end\": \"2027-04-06\",\n        \"grace_period_end\": null,\n        \"canceled_at\": null,\n        \"auto_renew\": true\n    },\n    \"code\": 200\n}"}],"_postman_id":"6fb80f5f-f93f-4683-8a2d-346e5bd2c62a"}],"id":"5f1f116d-c9f9-4c00-bbdc-8e93327a8184","_postman_id":"5f1f116d-c9f9-4c00-bbdc-8e93327a8184","description":""}]}