B5CoderAngon / API
Flutter Batch 05 · API lab

Build with
B5-API.

A clean practice API for the CoderAngon Flutter Batch. Learn the full request cycle: send a method, read JSON, store a token, and ship a feature.

Start here

Run the Laravel server, then use these endpoints in Postman or your Flutter app.

http://127.0.0.1:8000/api/v1

Authentication

Register, login and protect private requests.

POST

/register

Create a new student account. Password confirmation is required.
{
"name": "Rahim",
"email": "rahim@example.com",
"password": "password123",
"password_confirmation": "password123"
}
POST

/login

Login and receive the token used in protected APIs.
{
"email": "student@example.com",
"password": "password"
}

// Save response.token
GET

/me

Get the currently authenticated user.
AUTH · Bearer token
{
"user": { "id": 1, "name": "Rahim" }
}
POST

/logout

Delete the current access token.
AUTH · Bearer token
{ "message": "Logged out successfully." }

Catalog

Public endpoints for your shop home screen.

GET

/categories

List active categories with product counts.
GET /categories

{ "data": { "data": [ ... ] } }
GET

/categories/{id}

Show one category and its active products.
GET /categories/1

{ "data": { "id": 1, "products": [ ... ] } }
GET

/products

List products. Filter with search, category_id, or per_page.
GET /products?search=flutter&category_id=1

{ "data": { "data": [ ... ] } }
GET

/products/{id}

Show one product with its category.
GET /products/1

{ "data": { "id": 1, "name": "Flutter API Masterclass" } }

Notes CRUD

Public notes for quick Flutter CRUD practice.

GET

/notes

Get all shared notes. No login required.
{ "message": "Notes fetched successfully.", "data": [ ... ] }
POST

/notes

Create a note with a title and details.
{
"title": "Flutter Class 01",
"details": "Learn JSON and HTTP methods."
}
GET

/notes/{id}

Get one note by its ID.
{ "data": { "id": 1, "title": "A", "details": "AASDsad" } }
PUT

/notes/{id}

Update title, details, or both.
PUT /notes/1
{
"title": "Updated title",
"details": "Updated details"
}
DELETE

/notes/{id}

Delete a note permanently.
{ "message": "Note deleted successfully." }

Orders

Protected endpoints for the checkout flow.

GET

/orders

List the logged-in user's orders with items.
AUTH · Bearer token
{ "data": { "data": [ ... ] } }
POST

/orders

Create an order and reduce product stock safely.
AUTH · Bearer token
{
"shipping_address": "Dhaka, Bangladesh",
"payment_method": "cash_on_delivery",
"items": [{ "product_id": 1, "quantity": 1 }]
}
GET

/orders/{id}

Show one of the logged-in user's orders.
AUTH · Bearer token
GET /orders/1

{ "data": { "id": 1, "status": "pending" } }
01 · Set headers

Every request sends Accept: application/json. Protected requests also send Authorization: Bearer token.

02 · Read JSON

Use the HTTP status code first, then read the message and data fields from the response.

03 · Hit from Flutter

Use the http package. Map response JSON into a model, then update your screen state.

+
+ +
+ + +