DDPQA API Documentation

Developer-friendly API documentation with interactive testing

API Overview

Welcome to the DDPQA API documentation. This API provides endpoints for user management and authentication using Laravel Sanctum for secure token-based authentication.

Quick Start

  1. Obtain an API token by logging in via the /api/login endpoint
  2. Include the token in the Authorization header: Bearer YOUR_TOKEN
  3. Make requests to protected endpoints

Base URL

https://api.ddpqa.enricharcane.cc/api

Response Format

All API responses are in JSON format. Successful responses will include the requested data, while error responses will include an error message and relevant details.

Status Codes

200 - OK
201 - Created
401 - Unauthorized
404 - Not Found
422 - Validation Error

Authentication

🔑 Token-based Authentication

This API uses Laravel Sanctum for authentication. You need to obtain a token by logging in and include it in subsequent requests.

How to Authenticate

  1. Send a POST request to /api/login with your credentials
  2. Extract the token from the response
  3. Include the token in the Authorization header for protected endpoints
Authorization: Bearer YOUR_ACCESS_TOKEN

Setting Global Token

API Endpoints

📑 Quick Navigation

🔐 Authentication 👥 User Management 🛡️ Role Management 👤 Profile 📦 Product Types 📏 Product Sizes 🎨 Design Orders 🎯 Design Products 📝 Design Items 📄 Design Files QA Rules 📋 QA Rule Sets 📊 QA Reports 🔍 QA Attempts 🔄 Order Sync 🌐 External API

🔐 Authentication

Endpoints for user authentication and session management

POST /login - User Authentication

Authenticate a user and receive an access token.

Request Body

Content-Type: application/json

{
    "email": "user@example.com",                 // Required
    "password": "password123"                    // Required
}

Field Requirements

  • email: Required - valid email address
  • password: Required - string

Try it out

Response (200 OK)

{
    "token": "your-access-token-here",
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "role_id": 2,
        "name": "John Doe",
        "email": "user@example.com",
        "status": "active",
        "email_verified_at": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}

Error Responses

422 - Invalid Credentials

Email or password is incorrect

422 - Account Deleted

"Your account has been deleted. Please contact support."

422 - Account Inactive

"Your account is inactive. Please contact support."

429 - Too Many Attempts

Rate limited after 5 failed login attempts

POST /logout - User Logout

Logout the authenticated user and revoke the current access token.

Authentication Required: Yes (Bearer Token)

Try it out

This endpoint requires authentication. Make sure you have set your token above.

Response (200 OK)

{
    "message": "Logged out (current token revoked)."
}

Error Responses

401 - Unauthenticated

User is not authenticated

500 - Server Error

Failed to logout due to server error

👥 User Management

Complete user management including CRUD operations, status updates, and user activation

GET /users/meta - Get User Creation Metadata

Get metadata for creating a new user (available roles and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "roles": [
        {
            "id": 2,
            "name": "Admin",
            "slug": "admin"
        },
        {
            "id": 3,
            "name": "User",
            "slug": "user"
        }
    ],
    "userStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
GET /users/qa-analysts - Get QA Analysts

Retrieve a list of all active users with the QA Analyst role.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

[
    {
        "id": 5,
        "uuid": "770e8400-e29b-41d4-a716-446655440005",
        "role_id": 4,
        "name": "QA Analyst 1",
        "email": "qa1@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": "profile_pictures/1234567890_qa1.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_qa1.jpg",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
    },
    {
        "id": 6,
        "uuid": "880e8400-e29b-41d4-a716-446655440006",
        "role_id": 4,
        "name": "QA Analyst 2",
        "email": "qa2@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": null,
        "profile_picture_url": null,
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
    }
]
GET /users - Get All Users

Retrieve a list of all users.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

[
    {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "role_id": 1,
        "name": "Super Admin",
        "email": "superadmin@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": "profile_pictures/1234567890_abc123.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_abc123.jpg",
        "created_by": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "has_role": {
            "id": 1,
            "name": "Super Admin",
            "slug": "super-admin",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    },
    {
        "id": 2,
        "uuid": "660e8400-e29b-41d4-a716-446655440001",
        "role_id": 2,
        "name": "Admin User",
        "email": "admin@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": "profile_pictures/0987654321_def456.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/0987654321_def456.jpg",
        "created_by": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "has_role": {
            "id": 2,
            "name": "Admin",
            "slug": "admin",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    }
]
POST /users - Create User

Create a new user account.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: multipart/form-data

{
    "name": "John Doe",                          // Required
    "email": "john@example.com",                 // Required
    "password": "password123",                   // Required
    "password_confirmation": "password123",      // Required
    "role_id": 2,                                // Required
    "status": "active",                          // Required
    "profile_picture": "(file upload)"           // Optional
}

Field Requirements

  • name: Required - string, max 255 characters
  • email: Required - valid email, unique, max 255 characters
  • password: Required - string, min 8 characters, must be confirmed
  • password_confirmation: Required - must match password
  • role_id: Required - integer, must exist in roles table
  • status: Required - must be "active" or "inactive"
  • profile_picture: Optional - image file (jpeg, jpg, png), max 5MB

Try it out

Response (200 OK)

{
    "message": "User created successfully",
    "user": {
        "id": 2,
        "uuid": "660e8400-e29b-41d4-a716-446655440001",
        "role_id": 2,
        "name": "John Doe",
        "email": "john@example.com",
        "email_verified_at": null,
        "status": "active",
        "profile_picture": "profile_pictures/1234567890_xyz789.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_xyz789.jpg",
        "created_by": null,
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data or email already exists

GET /users/{id} - Get User by ID

Retrieve a specific user by their ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "role_id": 2,
        "name": "John Doe",
        "email": "john@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": "profile_pictures/1234567890_abc123.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_abc123.jpg",
        "created_by": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "has_role": {
            "id": 2,
            "name": "Admin",
            "slug": "admin",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    }
}
404 - Not Found

User not found

GET /users/{id}/meta - Get User Edit Metadata

Get user data along with metadata for editing (roles and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "role_id": 2,
        "name": "John Doe",
        "email": "john@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "active",
        "profile_picture": "profile_pictures/1234567890_abc123.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_abc123.jpg",
        "created_by": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "has_role": {
            "id": 2,
            "name": "Admin",
            "slug": "admin",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    },
    "roles": [
        {
            "id": 2,
            "name": "Admin",
            "slug": "admin"
        }
    ],
    "userStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

User not found

POST /users/{id} - Update User

Update an existing user's information. Note: Password and email cannot be updated via this endpoint.

Authentication Required: Yes (Bearer Token)

Method Override: Use POST with _method: PATCH in request body

Request Body

Content-Type: multipart/form-data

{
    "_method": "PATCH",                          // Required
    "name": "John Updated",                      // Required
    "role_id": 3,                                // Required
    "status": "inactive",                        // Required
    "profile_picture": "(file upload)"           // Optional
}

Field Requirements

  • _method: Required - must be "PATCH"
  • name: Required - string, max 255 characters
  • role_id: Required - integer, must exist in roles table
  • status: Required - must be "active" or "inactive"
  • profile_picture: Optional - image file (jpeg, jpg, png), max 5MB. If provided, replaces existing profile picture.

Try it out

Response (200 OK)

{
    "message": "User updated successfully",
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "role_id": 3,
        "name": "John Updated",
        "email": "john@example.com",
        "email_verified_at": "2024-01-01T00:00:00.000000Z",
        "status": "inactive",
        "profile_picture": "profile_pictures/1234567890_updated.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1234567890_updated.jpg",
        "created_by": null,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

User not found

422 - Validation Error

Invalid input data

PATCH /users/{id}/unblock - Unblock User

Unblock (activate) a specific user by setting their status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "User activated successfully",
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "status": "active",
        "updated_at": "2024-01-01T12:00:00.000000Z"
    }
}
PATCH /users/{id}/block - Block User

Block (deactivate) a specific user by setting their status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "User deactivated successfully",
    "user": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "status": "inactive",
        "updated_at": "2024-01-01T12:00:00.000000Z"
    }
}
DELETE /users/{id} - Delete User

Soft delete a user (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "success": true,
    "message": "User deleted successfully"
}
404 - Not Found

User not found

500 - Server Error

Failed to delete user

🛡️ Role Management

Manage roles and permissions for access control

GET /roles - Get All Roles

Retrieve a list of all roles.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

[
    {
        "id": 1,
        "name": "Administrator",
        "slug": "administrator",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    {
        "id": 2,
        "name": "Editor",
        "slug": "editor",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
]
GET /roles/meta - Get Role Creation Metadata

Get metadata for creating a new role (available permissions grouped by category and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "allPermissions": [
        {
            "category": "User Management",
            "permissions": [
                {
                    "id": 1,
                    "name": "View Users",
                    "slug": "users.view",
                    "permission_category_id": 1,
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024",
                    "category": {
                        "id": 1,
                        "name": "User Management",
                        "created_at": "2024-01-01T00:00:00.000000Z",
                        "updated_at": "2024-01-01T00:00:00.000000Z",
                        "created_at_human": "Jan 01, 2024",
                        "updated_at_human": "Jan 01, 2024"
                    }
                },
                {
                    "id": 2,
                    "name": "Create Users",
                    "slug": "users.create",
                    "permission_category_id": 1,
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024",
                    "category": {
                        "id": 1,
                        "name": "User Management",
                        "created_at": "2024-01-01T00:00:00.000000Z",
                        "updated_at": "2024-01-01T00:00:00.000000Z",
                        "created_at_human": "Jan 01, 2024",
                        "updated_at_human": "Jan 01, 2024"
                    }
                }
            ]
        },
        {
            "category": "Role Management",
            "permissions": [
                {
                    "id": 3,
                    "name": "View Roles",
                    "slug": "roles.view",
                    "permission_category_id": 2,
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024",
                    "category": {
                        "id": 2,
                        "name": "Role Management",
                        "created_at": "2024-01-01T00:00:00.000000Z",
                        "updated_at": "2024-01-01T00:00:00.000000Z",
                        "created_at_human": "Jan 01, 2024",
                        "updated_at_human": "Jan 01, 2024"
                    }
                },
                {
                    "id": 4,
                    "name": "Create Roles",
                    "slug": "roles.create",
                    "permission_category_id": 2,
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024",
                    "category": {
                        "id": 2,
                        "name": "Role Management",
                        "created_at": "2024-01-01T00:00:00.000000Z",
                        "updated_at": "2024-01-01T00:00:00.000000Z",
                        "created_at_human": "Jan 01, 2024",
                        "updated_at_human": "Jan 01, 2024"
                    }
                }
            ]
        }
    ],
    "roleStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
POST /roles - Create Role

Create a new role with associated permissions.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "name": "Content Manager",           // Required
    "status": "active",                  // Required
    "permissions": [1, 2, 3, 5]          // Required
}

Field Requirements

  • name: Required - string, max 255 characters
  • status: Required - must be "active" or "inactive"
  • permissions: Required - array of permission IDs that exist in permissions table

Try it out

Response (200 OK)

{
    "message": "Role created successfully",
    "role": {
        "id": 3,
        "name": "Content Manager",
        "slug": "content-manager",
        "status": "active",
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data

500 - Server Error

Failed to create role

GET /roles/{id} - Get Role by ID

Retrieve a specific role by its ID with associated permissions.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "role": {
        "id": 1,
        "name": "Administrator",
        "slug": "administrator",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "permissions": [
            {
                "id": 1,
                "name": "View Users",
                "slug": "users.view",
                "permission_category_id": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            {
                "id": 2,
                "name": "Create Users",
                "slug": "users.create",
                "permission_category_id": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        ]
    }
}
404 - Not Found

Role not found

500 - Server Error

Failed to retrieve role

GET /roles/{id}/meta - Get Role Edit Metadata

Get role data along with metadata for editing (available permissions and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "role": {
        "id": 1,
        "name": "Administrator",
        "slug": "administrator",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "permissions": [
            {
                "id": 1,
                "name": "View Users",
                "slug": "users.view",
                "permission_category_id": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        ]
    },
    "allPermissions": [
        {
            "category": "User Management",
            "permissions": [
                {
                    "id": 1,
                    "name": "View Users",
                    "slug": "users.view",
                    "permission_category_id": 1,
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024"
                }
            ]
        }
    ],
    "roleStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

Role not found

500 - Server Error

Failed to retrieve role metadata

PATCH /roles/{id} - Update Role

Update an existing role's information and permissions.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "name": "Updated Administrator",     // Required
    "status": "active",                  // Required
    "permissions": [1, 2, 4, 5]          // Required
}

Field Requirements

  • name: Required - string, max 255 characters
  • status: Required - must be "active" or "inactive"
  • permissions: Required - array of permission IDs that exist in permissions table

Try it out

Response (200 OK)

{
    "message": "Role updated successfully",
    "role": {
        "id": 1,
        "name": "Updated Administrator",
        "slug": "updated-administrator",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:30:00.000000Z",
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "permissions": [
            {
                "id": 1,
                "name": "View Users",
                "slug": "users.view",
                "permission_category_id": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            {
                "id": 2,
                "name": "Create Users",
                "slug": "users.create",
                "permission_category_id": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        ]
    }
}
404 - Not Found

Role not found

422 - Validation Error

Invalid input data

500 - Server Error

Failed to update role

DELETE /roles/{id} - Delete Role

Delete a role from the system. You cannot delete a role that is assigned to yourself.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Role deleted successfully"
}
403 - Forbidden

You cannot delete a role assigned to yourself

404 - Not Found

Role not found

500 - Server Error

Failed to delete role

👤 Profile

Endpoints for retrieving and managing the authenticated user's profile information

GET /profile - Get Current User Profile

Retrieve the authenticated user's profile information including role and permissio

Try it out

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "data": {
        "id": 1,
        "uuid": "dd9f2cea-30d0-40af-afa9-10bbd076072c",
        "role_id": 1,
        "name": "Super Admin",
        "email": "admin@enricharcane.com",
        "email_verified_at": "2025-10-21T09:21:55.000000Z",
        "profile_picture": "profile_pictures/1729505515_abc123def456.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1729505515_abc123def456.jpg",
        "status": "active",
        "created_by": null,
        "created_at": "2025-10-21T09:21:56.000000Z",
        "updated_at": "2025-10-21T09:21:56.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 21, 2025",
        "updated_at_human": "Oct 21, 2025",
        "has_role": {
            "id": 1,
            "name": "Super Admin",
            "slug": "super-admin",
            "status": "active",
            "created_at": "2025-10-21T09:21:55.000000Z",
            "updated_at": "2025-10-21T09:21:55.000000Z",
            "created_at_human": "Oct 21, 2025",
            "updated_at_human": "Oct 21, 2025"
        }
    }
}
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

GET /profile/meta - Get Profile Edit Metadata

Retrieve the authenticated user's profile information along with available roles and status options for editing.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "data": {
        "id": 2,
        "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "role_id": 2,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "email_verified_at": "2025-10-22T10:30:00.000000Z",
        "profile_picture": "profile_pictures/1729605180_def789ghi012.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1729605180_def789ghi012.jpg",
        "status": "active",
        "created_by": 1,
        "created_at": "2025-10-22T10:30:00.000000Z",
        "updated_at": "2025-10-22T10:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 22, 2025",
        "updated_at_human": "Oct 22, 2025",
        "has_role": {
            "id": 2,
            "name": "Admin",
            "slug": "admin",
            "status": "active",
            "created_at": "2025-10-22T10:30:00.000000Z",
            "updated_at": "2025-10-22T10:30:00.000000Z",
            "created_at_human": "Oct 22, 2025",
            "updated_at_human": "Oct 22, 2025"
        }
    },
    "roles": [
        {
            "value": 2,
            "label": "Admin",
            "created_at_human": "Oct 22, 2025",
            "updated_at_human": "Oct 22, 2025"
        },
        {
            "value": 3,
            "label": "Manager",
            "created_at_human": "Oct 22, 2025",
            "updated_at_human": "Oct 22, 2025"
        },
        {
            "value": 4,
            "label": "User",
            "created_at_human": "Oct 22, 2025",
            "updated_at_human": "Oct 22, 2025"
        }
    ],
    "userStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}

Response Fields

  • data: Current user's profile information
  • roles: Available roles (excludes Super Admin role)
  • userStatus: Available user status options
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

500 - Server Error

Failed to retrieve profile meta

POST /profile/update - Update Profile

Update the authenticated user's profile information including name and profile picture. Users can only update their own profile.

Authentication Required: Yes (Bearer Token)

HTTP Method: POST with _method: PATCH field (required for FormData)

Content-Type: multipart/form-data

Request Body (FormData)

{
    "_method": "PATCH",                          // Required
    "name": "Jane Smith",                        // Required
    "profile_picture": "[File Upload]"           // Optional
}

Field Requirements

  • _method: Required - must be "PATCH"
  • name: Required - string, max 255 characters
  • profile_picture: Optional - image file (jpeg, jpg, png), max 5MB (5120KB)

Notes

  • Use POST method with _method: PATCH field in FormData
  • When uploading a profile picture, the old profile picture will be automatically deleted
  • Profile pictures are stored in the storage/app/public/profile_pictures directory
  • If no profile picture is uploaded, the existing one will be retained

Try it out

Response (200 OK)

{
    "message": "Profile updated successfully",
    "data": {
        "id": 2,
        "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "role_id": 2,
        "name": "Jane Smith",
        "email": "jane.smith@example.com",
        "email_verified_at": "2025-10-22T10:30:00.000000Z",
        "profile_picture": "profile_pictures/1729605330_67890abcdef.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1729605330_67890abcdef.jpg",
        "status": "active",
        "created_by": 1,
        "created_at": "2025-10-22T10:30:00.000000Z",
        "updated_at": "2025-10-22T14:15:30.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 22, 2025",
        "updated_at_human": "Oct 22, 2025",
        "has_role": {
            "id": 2,
            "name": "Admin",
            "slug": "admin",
            "status": "active",
            "created_at": "2025-10-22T10:30:00.000000Z",
            "updated_at": "2025-10-22T10:30:00.000000Z",
            "created_at_human": "Oct 22, 2025",
            "updated_at_human": "Oct 22, 2025"
        }
    }
}
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

422 - Validation Error

Invalid input data (e.g., name is required or exceeds 255 characters)

500 - Server Error

Failed to update profile

PATCH /profile/update-password - Update Password

Update the authenticated user's password. Requires the current password for verification.

Authentication Required: Yes (Bearer Token)

Request Body

{
    "old_password": "currentPassword123",        // Required
    "new_password": "newPassword123",            // Required
    "new_password_confirmation": "newPassword123" // Required
}

Field Requirements

  • old_password: Required - string, current password for verification
  • new_password: Required - string, minimum 8 characters, must be confirmed
  • new_password_confirmation: Required - must match new_password

Try it out

Response (200 OK)

{
    "message": "Password updated successfully",
    "data": {
        "id": 2,
        "uuid": "b8e3f1a9-4c2d-4e5f-9a7b-3c8d9e1f2a3b",
        "role_id": 2,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "email_verified_at": "2025-10-22T10:30:00.000000Z",
        "profile_picture": "profile_pictures/1729605180_def789ghi012.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1729605180_def789ghi012.jpg",
        "status": "active",
        "created_by": 1,
        "created_at": "2025-10-22T10:30:00.000000Z",
        "updated_at": "2025-10-22T14:20:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 22, 2025",
        "updated_at_human": "Oct 22, 2025"
    }
}
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

422 - Validation Error

The provided password does not match our records, or validation failed (e.g., new password too short, passwords don't match)

500 - Server Error

Failed to update password

PATCH /profile/update-email - Update Email

Update the authenticated user's email address. Requires password verification and sets email_verified_at to null.

Authentication Required: Yes (Bearer Token)

Request Body

{
    "email": "newemail@example.com",             // Required
    "password": "currentPassword123"             // Required
}

Field Requirements

  • email: Required - valid email format, max 255 characters, must be unique
  • password: Required - string, current password for verification

Try it out

Response (200 OK)

{
    "message": "Email updated successfully. Please verify your new email address.",
    "data": {
        "id": 2,
        "uuid": "b8e3f1a9-4c2d-4e5f-9a7b-3c8d9e1f2a3b",
        "role_id": 2,
        "name": "John Doe",
        "email": "newemail@example.com",
        "email_verified_at": null,
        "profile_picture": "profile_pictures/1729605180_def789ghi012.jpg",
        "profile_picture_url": "http://localhost/storage/profile_pictures/1729605180_def789ghi012.jpg",
        "status": "active",
        "created_by": 1,
        "created_at": "2025-10-22T10:30:00.000000Z",
        "updated_at": "2025-10-22T14:25:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 22, 2025",
        "updated_at_human": "Oct 22, 2025"
    }
}
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

422 - Validation Error

Invalid email format, email already taken, or validation failed

500 - Server Error

Failed to update email

DELETE /profile - Delete Profile

Delete the authenticated user's profile. This action is permanent and cannot be undone.

Authentication Required: Yes (Bearer Token)

Note: The system will delete the authenticated user's own profile.

Try it out

Response (200 OK)

{
    "success": true,
    "message": "User deleted successfully"
}
401 - Unauthorized

Invalid or missing authentication token

404 - Not Found

User profile not found

500 - Server Error

Failed to delete user

📦 Product Type Management

Manage product types including CRUD operations and status updates

GET /product-types - Get All Product Types

Retrieve a list of all product types.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productTypes": [
        {
            "id": 1,
            "type_name": "Electronics",
            "description": "Electronic products and devices",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        {
            "id": 2,
            "type_name": "Clothing",
            "description": "Apparel and accessories",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    ]
}
GET /product-types/meta - Get Product Type Creation Metadata

Get metadata for creating a new product type (available status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productTypeStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
POST /product-types - Create Product Type

Create a new product type.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "type_name": "Electronics",                  // Required
    "description": "Electronic products and devices", // Optional
    "status": "active"                           // Required
}

Field Requirements

  • type_name: Required - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"

Try it out

Response (201 Created)

{
    "message": "Product type created successfully",
    "productType": {
        "id": 1,
        "type_name": "Electronics",
        "description": "Electronic products and devices",
        "status": "active",
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data

GET /product-types/{id} - Get Product Type by ID

Retrieve a specific product type by its ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productType": {
        "id": 1,
        "type_name": "Electronics",
        "description": "Electronic products and devices",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product type not found

GET /product-types/{id}/meta - Get Product Type Edit Metadata

Get product type data along with metadata for editing (status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productType": {
        "id": 1,
        "type_name": "Electronics",
        "description": "Electronic products and devices",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "productTypeStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

Product type not found

PATCH /product-types/{id} - Update Product Type

Update an existing product type's information.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "type_name": "Electronics Updated",          // Required
    "description": "Updated description for electronic products", // Optional
    "status": "inactive"                         // Required
}

Field Requirements

  • type_name: Required - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"

Try it out

Response (200 OK)

{
    "message": "Product type updated successfully",
    "productType": {
        "id": 1,
        "type_name": "Electronics Updated",
        "description": "Updated description for electronic products",
        "status": "inactive",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product type not found

422 - Validation Error

Invalid input data

PATCH /product-types/{id}/unblock - Unblock Product Type

Unblock (activate) a specific product type by setting its status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product type activated successfully"
}
404 - Not Found

Product type not found

PATCH /product-types/{id}/block - Block Product Type

Block (deactivate) a specific product type by setting its status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product type deactivated successfully"
}
404 - Not Found

Product type not found

DELETE /product-types/{id} - Delete Product Type

Soft delete a product type (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product type deleted successfully"
}
404 - Not Found

Product type not found

500 - Server Error

Failed to delete product type

📏 Product Size Management

Manage product sizes including CRUD operations and status updates

GET /product-sizes - Get All Product Sizes

Retrieve a list of all product sizes.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productSizes": [
        {
            "id": 1,
            "size_name": "Small",
            "size_code": "S",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        {
            "id": 2,
            "size_name": "Medium",
            "size_code": "M",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    ]
}
GET /product-sizes/meta - Get Product Size Creation Metadata

Get metadata for creating a new product size (available status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productSizeStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
POST /product-sizes - Create Product Size

Create a new product size.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "size_name": "Extra Large",                  // Required
    "size_code": "XL",                           // Required
    "status": "active"                           // Required
}

Field Requirements

  • size_name: Required - string, max 255 characters
  • size_code: Required - string, max 100 characters, must be unique
  • status: Required - must be "active" or "inactive"

Try it out

Response (201 Created)

{
    "message": "Product size created successfully",
    "productSize": {
        "id": 1,
        "size_name": "Extra Large",
        "size_code": "XL",
        "status": "active",
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data or size code already exists

GET /product-sizes/{id} - Get Product Size by ID

Retrieve a specific product size by its ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productSize": {
        "id": 1,
        "size_name": "Extra Large",
        "size_code": "XL",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product size not found

GET /product-sizes/{id}/meta - Get Product Size Edit Metadata

Get product size data along with metadata for editing (status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "productSize": {
        "id": 1,
        "size_name": "Extra Large",
        "size_code": "XL",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "productSizeStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

Product size not found

PATCH /product-sizes/{id} - Update Product Size

Update an existing product size's information.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "size_name": "Extra Extra Large",           // Required
    "size_code": "XXL",                          // Required
    "status": "active"                           // Required
}

Field Requirements

  • size_name: Required - string, max 255 characters
  • size_code: Required - string, max 100 characters, must be unique (except current record)
  • status: Required - must be "active" or "inactive"

Try it out

Response (200 OK)

{
    "message": "Product size updated successfully",
    "productSize": {
        "id": 1,
        "size_name": "Extra Extra Large",
        "size_code": "XXL",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product size not found

422 - Validation Error

Invalid input data or size code already exists

PATCH /product-sizes/{id}/unblock - Unblock Product Size

Unblock (activate) a specific product size by setting its status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product size activated successfully",
    "productSize": {
        "id": 1,
        "size_name": "Extra Large",
        "size_code": "XL",
        "status": "active",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product size not found

PATCH /product-sizes/{id}/block - Block Product Size

Block (deactivate) a specific product size by setting its status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product size deactivated successfully",
    "productSize": {
        "id": 1,
        "size_name": "Extra Large",
        "size_code": "XL",
        "status": "inactive",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
404 - Not Found

Product size not found

DELETE /product-sizes/{id} - Delete Product Size

Soft delete a product size (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Product size deleted successfully"
}
404 - Not Found

Product size not found

500 - Server Error

Failed to delete product size

🎨 Design Order Management

Manage design orders including CRUD operations, status and QA status tracking

GET /design-orders - Get All Design Orders

Retrieve a list of all design orders.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designOrders": [
        {
            "id": 1,
            "uuid": "563c3ef9-8bd0-49d6-9f66-13dcbf5e47a1",
            "order_name": "Summer Collection Design - 261377",
            "order_number": "DO-2024-001",
            "customer_name": "ABC Fashion Inc.",
            "description": "Design for summer collection clothing line with various styles and patterns.",
            "status": "active",
            "qa_status": "pending",
            "order_source": "internal",
            "created_by": {
                "id": 1,
                "uuid": "4b4bbf48-ab68-4551-80c2-6e62939fe009",
                "role_id": 1,
                "name": "Jane Smith",
                "email": "admin@example.com",
                "email_verified_at": "2025-10-24T03:45:05.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2025-10-24T03:45:06.000000Z",
                "updated_at": "2025-10-24T06:52:31.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Oct 24, 2025",
                "updated_at_human": "Oct 24, 2025"
            },
            "created_at": "2025-10-24T04:15:14.000000Z",
            "updated_at": "2025-10-24T04:15:14.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 24, 2025",
            "updated_at_human": "Oct 24, 2025"
        },
    ]
}
GET /design-orders/meta - Get Design Order Creation Metadata

Get metadata for creating a new design order (available status and QA status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designOrderStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
POST /design-orders - Create Design Order

Create a new design order.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "order_name": "Summer Collection Design",   // Required
    "order_number": "DO-2024-001",              // Required
    "customer_name": "ABC Fashion Inc.",        // Optional
    "description": "Design for summer collection clothing line", // Optional
    "status": "active",                         // Required
    "qa_status": "pending",                      // Required
}

Field Requirements

  • order_name: Required - string, max 255 characters
  • order_number: Required - string, max 100 characters
  • customer_name: Optional - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "approved", or "rejected"

Try it out

Response (201 Created)

{
    "message": "Design order created successfully",
    "designOrder": {
        "order_name": "Summer Collection Design",
        "order_number": "DO-2024-001",
        "customer_name": "ABC Fashion Inc.",
        "description": "Design for summer collection clothing line",
        "status": "active",
        "qa_status": "pending",
        "order_source": "internal",
        "created_by": 1,
        "uuid": "452f8288-38d1-42c0-aab7-652154642a13",
        "updated_at": "2025-10-24T08:54:45.000000Z",
        "created_at": "2025-10-24T08:54:45.000000Z",
        "id": 4,
        "created_at_human": "Oct 24, 2025",
        "updated_at_human": "Oct 24, 2025"
    }
}
422 - Validation Error

Invalid input data

GET /design-orders/{id} - Get Design Order by ID

Retrieve a specific design order by its ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "563c3ef9-8bd0-49d6-9f66-13dcbf5e47a1",
        "order_name": "Summer Collection Design - 261377",
        "order_number": "DO-2024-001",
        "customer_name": "ABC Fashion Inc.",
        "description": "Design for summer collection clothing line with various styles and patterns.",
        "status": "active",
        "qa_status": "pending",
        "order_source": "internal",
        "created_by": {
            "id": 1,
            "uuid": "4b4bbf48-ab68-4551-80c2-6e62939fe009",
            "role_id": 1,
            "name": "Jane Smith",
            "email": "admin@example.com",
            "email_verified_at": "2025-10-24T03:45:05.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-24T03:45:06.000000Z",
            "updated_at": "2025-10-24T06:52:31.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 24, 2025",
            "updated_at_human": "Oct 24, 2025"
        },
        "created_at": "2025-10-24T04:15:14.000000Z",
        "updated_at": "2025-10-24T04:15:14.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 24, 2025",
        "updated_at_human": "Oct 24, 2025",
        "design_products": [
            {
                "id": 1,
                "design_order_id": 1,
                "product_name": "001-P516 2-Ply Flag w Double Pole Sleeves and Grommets - 3'x5'",
                "product_type_id": 2,
                "status": "active",
                "qa_status": "pending",
                "qa_analyst_id": 4,
                "created_by": {
                    "id": 1,
                    "uuid": "b32bb961-90f8-4c03-8128-03e3a6da21ba",
                    "role_id": 1,
                    "name": "Super Admin",
                    "email": "admin@enricharcane.com",
                    "email_verified_at": "2025-10-29T05:12:35.000000Z",
                    "profile_picture": null,
                    "status": "active",
                    "created_by": null,
                    "created_at": "2025-10-29T05:12:35.000000Z",
                    "updated_at": "2025-10-29T05:12:35.000000Z",
                    "deleted_at": null,
                    "profile_picture_url": null,
                    "created_at_human": "Oct 29, 2025",
                    "updated_at_human": "Oct 29, 2025"
                },
                "created_at": "2025-10-29T05:14:38.000000Z",
                "updated_at": "2025-10-29T05:29:33.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 29, 2025",
                "updated_at_human": "Oct 29, 2025",
                "product_type": {
                    "id": 2,
                    "type_name": "Pant",
                    "description": "Pants and trousers including jeans, chinos, and joggers.",
                    "status": "active",
                    "created_at": "2025-10-29T05:12:36.000000Z",
                    "updated_at": "2025-10-29T05:12:36.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Oct 29, 2025",
                    "updated_at_human": "Oct 29, 2025"
                },
                "qa_analyst": {
                    "id": 4,
                    "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
                    "role_id": 4,
                    "name": "QA Analyst User",
                    "email": "qa.analyst@enricharcane.com",
                    "email_verified_at": "2025-10-29T05:12:35.000000Z",
                    "profile_picture": null,
                    "status": "active",
                    "created_by": null,
                    "created_at": "2025-10-29T05:12:36.000000Z",
                    "updated_at": "2025-10-29T05:12:36.000000Z",
                    "deleted_at": null,
                    "profile_picture_url": null,
                    "created_at_human": "Oct 29, 2025",
                    "updated_at_human": "Oct 29, 2025"
                }
            },
        ]
    }
}
404 - Not Found

Design order not found

GET /design-orders/{id}/meta - Get Design Order Edit Metadata

Get design order data along with metadata for editing (status and QA status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "563c3ef9-8bd0-49d6-9f66-13dcbf5e47a1",
        "order_name": "Summer Collection Design - 261377",
        "order_number": "DO-2024-001",
        "customer_name": "ABC Fashion Inc.",
        "description": "Design for summer collection clothing line with various styles and patterns.",
        "status": "active",
        "qa_status": "pending",
        "order_source": "internal",
        "created_by": 1,
        "created_at": "2025-10-24T04:15:14.000000Z",
        "updated_at": "2025-10-24T04:15:14.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 24, 2025",
        "updated_at_human": "Oct 24, 2025"
    },
    "designOrderStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
404 - Not Found

Design order not found

PATCH /design-orders/{id} - Update Design Order

Update an existing design order's information.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "order_name": "Summer Collection Design Updated", // Required
    "order_number": "DO-2024-001",              // Required
    "customer_name": "ABC Fashion Inc.",        // Optional
    "description": "Updated description for summer collection", // Optional
    "status": "active",                         // Required
    "qa_status": "approved"                     // Required
}

Field Requirements

  • order_name: Required - string, max 255 characters
  • order_number: Required - string, max 100 characters
  • customer_name: Optional - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "approved", or "rejected"

Try it out

Response (200 OK)

{
    "message": "Design order updated successfully",
    "designOrder": {
        "id": 2,
        "uuid": "1a25c950-722f-40f4-a771-571de3a952ef",
        "order_name": "Summer Collection Design Updated",
        "order_number": "DO-2024-001",
        "customer_name": "ABC Fashion Inc.",
        "description": "Updated description for summer collection",
        "status": "active",
        "qa_status": "approved",
        "order_source": "internal",
        "created_by": {
            "id": 1,
            "uuid": "4b4bbf48-ab68-4551-80c2-6e62939fe009",
            "role_id": 1,
            "name": "Jane Smith",
            "email": "admin@example.com",
            "email_verified_at": "2025-10-24T03:45:05.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-24T03:45:06.000000Z",
            "updated_at": "2025-10-24T06:52:31.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 24, 2025",
            "updated_at_human": "Oct 24, 2025"
        },
        "created_at": "2025-10-24T04:16:55.000000Z",
        "updated_at": "2025-10-24T06:00:51.000000Z",
        "deleted_at": null,
        "created_at_human": "Oct 24, 2025",
        "updated_at_human": "Oct 24, 2025"
    }
}
404 - Not Found

Design order not found

422 - Validation Error

Invalid input data

DELETE /design-orders/{id} - Delete Design Order

Soft delete a design order (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Design order deleted successfully"
}
404 - Not Found

Design order not found

500 - Server Error

Failed to delete design order

🎯 Design Product Management

Manage design products within orders including CRUD operations, status and QA status tracking

GET /design-products/meta - Get Design Product Creation Metadata

Get metadata required for creating design products including design order details, product types, and status options.

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "abc123-def456-ghi789",
        "order_name": "Sample Order Name",
        "order_number": "ORD-001",
        "customer_name": "John Doe",
        "description": "Sample order description for demonstration purposes.",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "productTypes": [
        {
            "value": 1,
            "label": "T-Shirt"
        },
        {
            "value": 2,
            "label": "Pant"
        },
        {
            "value": 3,
            "label": "Hoodie"
        }
    ],
    "qaAnalysts": [
        {
            "value": 2,
            "label": "Jane QA Analyst"
        },
        {
            "value": 3,
            "label": "John QA Analyst"
        },
        {
            "value": 4,
            "label": "Sarah QA Analyst"
        }
    ],
    "designProductStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In Progress"
        },
        {
            "value": "approved",
            "label": "Approved"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
GET /design-products - Get Design Products for a Design Order

Retrieve a list of all design products for a specific design order, including design order and product type details.

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "order-uuid-123",
        "order_name": "Sample Order Name",
        "order_number": "ORD-001",
        "customer_name": "John Doe",
        "description": "Sample order description for demonstration purposes.",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designProducts": [
        {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Sample Product Name",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_by": {
                "id": 1,
                "uuid": "b32bb961-90f8-4c03-8128-03e3a6da21ba",
                "role_id": 1,
                "name": "Super Admin",
                "email": "admin@enricharcane.com",
                "email_verified_at": "2025-10-29T05:12:35.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2025-10-29T05:12:35.000000Z",
                "updated_at": "2025-10-29T05:12:35.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Oct 29, 2025",
                "updated_at_human": "Oct 29, 2025"
            },
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "design_order": {
                "id": 1,
                "uuid": "order-uuid-123",
                "order_name": "Sample Order Name",
                "order_number": "ORD-001",
                "customer_name": "John Doe",
                "description": "Sample order description for demonstration purposes.",
                "status": "active",
                "qa_status": "pending",
                "created_by": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            "qa_analyst": {
                "id": 4,
                "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
                "role_id": 4,
                "name": "QA Analyst User",
                "email": "qa.analyst@enricharcane.com",
                "email_verified_at": "2025-10-29T05:12:35.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2025-10-29T05:12:36.000000Z",
                "updated_at": "2025-10-29T05:12:36.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Oct 29, 2025",
                "updated_at_human": "Oct 29, 2025"
            },
            "product_type": {
                "id": 1,
                "type_name": "T-Shirt",
                "description": "Men's and women's t-shirts in various sizes and designs.",
                "status": "active",
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        }
    ]
}
POST /design-products - Create Design Product

Create a new design product associated with a design order.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "design_order_id": 1,                        // Required
    "product_name": "Classic Logo T-Shirt",      // Required
    "product_type_id": 1,                        // Required
    "status": "active",                          // Required
    "qa_status": "pending",                      // Required
    "qa_analyst_id": 2                           // Optional
}

Field Requirements

  • design_order_id: Required - integer, must exist in design_orders table
  • product_name: Required - string, max 255 characters
  • product_type_id: Required - integer, must exist in product_types table
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "approved", or "rejected"
  • qa_analyst_id: Optional - integer, must exist in users table

Try it out

Response (201 Created)

{
    "designProduct": {
        "design_order_id": 1,
        "product_name": "Classic Logo T-Shirt",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": 1,
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "created_at": "2024-01-01T00:00:00.000000Z",
        "id": 1,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data

GET /design-products/{id} - Get Design Product by ID

Retrieve a specific design product by its ID with design order and product type details.

Authentication Required: Yes (Bearer Token)

Path Parameters

  • id: Required, integer, design product ID

Try it out

Response (200 OK)

{
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Sample Product Name",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "design_order": {
            "id": 1,
            "uuid": "order-uuid-123",
            "order_name": "Sample Order Name",
            "order_number": "ORD-001",
            "customer_name": "John Doe",
            "description": "Sample order description for demonstration purposes.",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "product_type": {
            "id": 1,
            "type_name": "T-Shirt",
            "description": "Men's and women's t-shirts in various sizes and designs.",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "qa_analyst": {
            "id": 4,
            "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
            "role_id": 4,
            "name": "QA Analyst User",
            "email": "qa.analyst@enricharcane.com",
            "email_verified_at": "2025-10-29T05:12:35.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-29T05:12:36.000000Z",
            "updated_at": "2025-10-29T05:12:36.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 29, 2025",
            "updated_at_human": "Oct 29, 2025"
        },
        "design_items": [
            {
                "id": 1,
                "design_order_id": 1,
                "design_product_id": 1,
                "item_name": "Classic Logo T-Shirt - Medium",
                "product_size_id": 2,
                "product_size": {
                    "id": 2,
                    "size_name": "M",
                    "size_code": "M",
                    "status": "active",
                    "created_at": "2025-10-29T09:00:25.000000Z",
                    "updated_at": "2025-10-29T09:00:25.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Oct 29, 2025",
                    "updated_at_human": "Oct 29, 2025"
                }
                "player_name": "John Player",
                "player_number": "10",
                "notes": "Special design requirements for logo placement.",
                "status": "active",
                "created_by": 1,
                "qa_status": "pending",
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "latest_design_file": {
                    "id": 1,
                    "design_product_id": 1,
                    "design_order_id": 1,
                    "design_item_id": 1,
                    "file": "files/sample_design_file.pdf",
                    "file_name": "Sample Design File",
                    "file_path": null,
                    "file_type": "pdf",
                    "file_size": null,
                    "preserve_ai_editing": 1,
                    "version": 1,
                    "uploaded_by": 1,
                    "status": "active",
                    "qa_status": "pending",
                    "created_at": "2024-01-01T00:00:00.000000Z",
                    "updated_at": "2024-01-01T00:00:00.000000Z",
                    "deleted_at": null,
                    "file_url": "http://example.com/storage/files/sample_design_file.pdf",
                    "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_thumb.jpg",
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024"
                },
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            {
                "id": 2,
                "design_order_id": 1,
                "design_product_id": 1,
                "item_name": "Classic Logo T-Shirt - Large",
                "product_size_id": 3,
                "product_size": {
                    "id": 3,
                    "size_name": "M",
                    "size_code": "M",
                    "status": "active",
                    "created_at": "2025-10-29T09:00:25.000000Z",
                    "updated_at": "2025-10-29T09:00:25.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Oct 29, 2025",
                    "updated_at_human": "Oct 29, 2025"
                }
                "player_name": "Jane Player",
                "player_number": "22",
                "notes": "No special requirements.",
                "status": "active",
                "created_by": 1,
                "qa_status": "pending",
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "latest_design_file": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        ]
    }
}
404 - Not Found

Design product not found

GET /design-products/{id}/meta - Get Design Product Edit Metadata

Get design product data along with metadata for editing (product types, status options, QA status options).

Authentication Required: Yes (Bearer Token)

Path Parameters

  • id: Required, integer, design product ID

Try it out

Response (200 OK)

{
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Sample Product Name",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "design_order": {
            "id": 1,
            "uuid": "order-uuid-123",
            "order_name": "Sample Order",
            "order_number": "ORD-001",
            "customer_name": "John Doe",
            "description": "Sample order description for demonstration.",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "product_type": {
            "id": 1,
            "type_name": "T-Shirt",
            "description": "Men's and women's t-shirts in various sizes and designs.",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "qa_analyst": {
            "id": 4,
            "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
            "role_id": 4,
            "name": "QA Analyst User",
            "email": "qa.analyst@enricharcane.com",
            "email_verified_at": "2025-10-29T05:12:35.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-29T05:12:36.000000Z",
            "updated_at": "2025-10-29T05:12:36.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 29, 2025",
            "updated_at_human": "Oct 29, 2025"
        }
    },
    "productTypes": [
        {
            "value": 1,
            "label": "T-Shirt"
        },
        {
            "value": 2,
            "label": "Pant"
        },
        {
            "value": 3,
            "label": "Hoodie"
        }
    ],
    "qaAnalysts": [
        {
            "value": 2,
            "label": "Jane QA Analyst"
        },
        {
            "value": 3,
            "label": "John QA Analyst"
        },
        {
            "value": 4,
            "label": "Sarah QA Analyst"
        }
    ],
    "designProductStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
404 - Not Found

Design product not found

PATCH /design-products/{id} - Update Design Product

Update an existing design product's information.

Authentication Required: Yes (Bearer Token)

Path Parameters

  • id: Required, integer, design product ID

Request Body

Content-Type: application/json

{
    "design_order_id": 1,                        // Required
    "product_name": "Classic Logo T-Shirt (Updated)", // Required
    "product_type_id": 1,                        // Required
    "status": "inactive",                        // Required
    "qa_status": "in_progress",                  // Required
    "qa_analyst_id": 3                           // Optional
}

Field Requirements

  • design_order_id: Required - integer, must exist in design_orders table
  • product_name: Required - string, max 255 characters
  • product_type_id: Required - integer, must exist in product_types table
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "approved", or "rejected"
  • qa_analyst_id: Optional - integer, must exist in users table

Try it out

Response (200 OK)

{
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Classic Logo T-Shirt (Updated)",
        "product_type_id": 1,
        "status": "inactive",
        "qa_status": "in_progress",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-02T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 02, 2024",
        "design_order": {
            "id": 1,
            "uuid": "order-uuid-123",
            "order_name": "Sample Order",
            "order_number": "ORD-001",
            "customer_name": "John Doe",
            "description": "Sample order description for demonstration.",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "product_type": {
            "id": 1,
            "type_name": "T-Shirt",
            "description": "Men's and women's t-shirts in various sizes and designs.",
            "status": "active",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "qa_analyst": {
            "id": 4,
            "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
            "role_id": 4,
            "name": "QA Analyst User",
            "email": "qa.analyst@enricharcane.com",
            "email_verified_at": "2025-10-29T05:12:35.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-29T05:12:36.000000Z",
            "updated_at": "2025-10-29T05:12:36.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 29, 2025",
            "updated_at_human": "Oct 29, 2025"
        }
    }
}
404 - Not Found

Design product not found

422 - Validation Error

Invalid input data

DELETE /design-products/{id} - Delete Design Product

Soft delete a design product (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Path Parameters

  • id: Required, integer, design product ID

Try it out

Response (200 OK)

{
    "message": "Design product deleted successfully"
}
404 - Not Found

Design product not found

500 - Server Error

Failed to delete design product

GET /design-products/{id}/qa-analysts - Get QA Analysts for Design Product

Retrieve the list of available QA analysts and the currently selected QA analyst for a specific design product.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "selectedQaAnalyst": 2,
    "qaAnalysts": [
        {
            "value": 2,
            "label": "Jane QA Analyst"
        },
        {
            "value": 3,
            "label": "John QA Analyst"
        },
        {
            "value": 4,
            "label": "Sarah QA Analyst"
        }
    ]
}
404 - Not Found

Design product not found

PATCH /design-products/{id}/update-qa-analyst - Update QA Analyst for Design Product

Assign or update the QA analyst for a specific design product.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "qa_analyst_id": 2                           // Required
}

Field Requirements

  • qa_analyst_id: Required - integer, must exist in users table

Try it out

Response (200 OK)

{
    "message": "QA analyst updated successfully",
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Sample Product Name",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "qa_analyst_id": 2,
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-02T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 02, 2024",
        "created_by": {
            "id": 1,
            "uuid": "user-uuid-123",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        },
        "qa_analyst": {
            "id": 4,
            "uuid": "98f13339-dc81-4034-ba68-530267f34d50",
            "role_id": 4,
            "name": "QA Analyst User",
            "email": "qa.analyst@enricharcane.com",
            "email_verified_at": "2025-10-29T05:12:35.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-10-29T05:12:36.000000Z",
            "updated_at": "2025-10-29T05:12:36.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Oct 29, 2025",
            "updated_at_human": "Oct 29, 2025"
        }
    }
}
404 - Not Found

Design product not found

422 - Validation Error

Invalid QA analyst ID

📝 Design Item Management

Manage individual design items within products including player information, sizes, and QA status

GET /design-items/meta - Get Design Item Creation Metadata

Get metadata for creating a new design item including design order, product info, status options, and QA status options.

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table
  • design_product_id: Required, integer, must exist in design_products table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "order_name": "Sample Order #001",
        "order_number": "ORD-2025-001",
        "customer_name": "John Smith",
        "description": "Custom team apparel order",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2025-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025"
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Team Jersey",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2025-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025"
    },
    "productSizes": [
        {
            "value": 1,
            "label": "XS"
        },
        {
            "value": 2,
            "label": "S"
        },
        {
            "value": 3,
            "label": "M"
        },
        {
            "value": 4,
            "label": "L"
        },
        {
            "value": 5,
            "label": "XL"
        }
    ],
    "productStyle": [
        {
            "value": 1,
            "label": "STYLE-001"
        },
        {
            "value": 2,
            "label": "STYLE-002"
        }
    ],
    "designItemStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
GET /design-items - Get All Design Items

Retrieve all design items for a specific design product.

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table
  • design_product_id: Required, integer, must exist in design_products table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "order_name": "Sample Order #001",
        "order_number": "ORD-2025-001",
        "customer_name": "John Smith",
        "description": "Custom team apparel order",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2025-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025",
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Team Jersey",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2025-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025"
    },
    "designItems": [
        {
            "id": 1,
            "design_order_id": 1,
            "design_product_id": 1,
            "item_name": "Custom Jersey - Size M - Player 10",
            "product_id": 1,
            "product_size_id": 1,
            "player_name": "Jane Smith",
            "player_number": "10",
            "notes": "Sample design notes for player jersey.",
            "status": "active",
            "created_by": {
                "id": 1,
                "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
                "role_id": 1,
                "name": "Admin User",
                "email": "admin@example.com",
                "email_verified_at": "2025-01-01T00:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 01, 2025",
                "updated_at_human": "Jan 01, 2025"
            },
            "qa_status": "pending",
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "latest_design_file": {
                "id": 1,
                "design_product_id": 1,
                "design_order_id": 1,
                "design_item_id": 1,
                "file": "files/sample_design.pdf",
                "file_name": "Jersey Design - Player 10",
                "file_path": null,
                "file_type": "pdf",
                "file_size": null,
                "preserve_ai_editing": 1,
                "version": 1,
                "uploaded_by": 1,
                "status": "active",
                "qa_status": "pending",
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "file_url": "http://localhost/storage/files/sample_design.pdf",
                "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_thumb.jpg",
                "created_at_human": "Jan 01, 2025",
                "updated_at_human": "Jan 01, 2025"
            },
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025",
            "product_size": {
                "id": 1,
                "size_name": "XS",
                "size_code": "XS",
                "status": "active",
                "created_at": "2025-10-28T04:17:39.000000Z",
                "updated_at": "2025-10-28T04:17:39.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025"
            },
            "product_style": {
                "id": 1,
                "style_number": "STYLE-001",
                "status": "active",
                "created_at": "2025-10-28T04:17:39.000000Z",
                "updated_at": "2025-10-28T04:17:39.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025"
            },
            "design_item_layers": [ // NEW LAYER DATA
                {
                    "id": 1,
                    "design_item_id": 1,
                    "layer_name": "Back Number",
                    "layer_type": "text",
                    "is_text_layer": true,
                    "is_logo_layer": false,
                    "text_content_details": {"content": "10", "font_name": "Bebas", "size_pt": 350},
                    "color_details": {"primary_fill": "DDP White"}
                }
            ]
        },
        {
            "id": 2,
            "design_order_id": 1,
            "design_product_id": 1,
            "item_name": "Custom Jersey - Size L - Player 23",
            "product_id": 1,
            "product_size_id": 2,
            "player_name": "John Doe",
            "player_number": "23",
            "notes": "Custom design with player name on back.",
            "status": "active",
            "created_by": {
                "id": 1,
                "uuid": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
                "role_id": 1,
                "name": "Admin User",
                "email": "admin@example.com",
                "email_verified_at": "2025-01-01T00:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 01, 2025",
                "updated_at_human": "Jan 01, 2025"
            },
            "qa_status": "pending",
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "latest_design_file": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025",
            "product_size": {
                "id": 2,
                "size_name": "S",
                "size_code": "S",
                "status": "active",
                "created_at": "2025-10-28T04:17:39.000000Z",
                "updated_at": "2025-10-28T04:17:39.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025"
            },
            "product_style": {
                "id": 1,
                "style_number": "STYLE-001",
                "status": "active",
                "created_at": "2025-10-28T04:17:39.000000Z",
                "updated_at": "2025-10-28T04:17:39.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025"
            },
            "design_item_layers": []
        }
    ]
}
POST /design-items - Create Design Item (with Layers)

Create a new design item within a design product and optionally associate critical layer data for QA purposes.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "design_order_id": 1,                       // Required
    "design_product_id": 1,                      // Required
    "item_name": "Jersey #10",                   // Required
    "product_id": 1,                             // Required (Product Style)
    "product_size_id": 1,                        // Optional
    "player_name": "John Doe",                   // Optional
    "player_number": "10",                       // Optional
    "notes": "Custom design with team logo",     // Optional
    "status": "active",                          // Required
    "qa_status": "pending",                      // Required
    "layers": [                                  // Optional - Array of layer details
        {
            "layer_name": "Player Number",
            "layer_type": "text",
            "is_text_layer": true,
            "text_details": {"content": "25", "font_name": "Austein Script"},
            "color_details": {"primary_fill": "DDP White"}
        },
        {
            "layer_name": "Front Logo",
            "layer_type": "logo",
            "is_logo_layer": true,
            "color_details": {"spot_colors": ["SGMA Cardinal", "DDP White"]}
        }
    ]
}

Field Requirements

  • **design_order_id:** Required - integer, must exist in design_orders table
  • **design_product_id:** Required - integer, must exist in design_products table
  • **item_name:** Required - string, max 255 characters
  • **product_id:** Required - integer, must exist in products table (Product Style)
  • **product_size_id:** Optional - integer, must exist in product_sizes table
  • **player_name:** Optional - string, max 255 characters
  • **player_number:** Optional - string, max 50 characters
  • **notes:** Optional - string
  • **status:** Required - must be "active" or "inactive"
  • **qa_status:** Required - must be "pending", "in_progress", "approved", or "rejected"
  • --- Layer Data (`layers`) ---
  • **layers:** Optional - Array of layer definition objects.
  • **layers.*.layer_name:** Required if layers array is sent - string, max 255.
  • **layers.*.layer_type:** Optional - string, max 50 (e.g., 'text', 'logo', 'body').
  • **layers.*.is_text_layer:** Optional - boolean.
  • **layers.*.is_logo_layer:** Optional - boolean.
  • **layers.*.text_details:** Optional - JSON/Array for text content, font details.
  • **layers.*.color_details:** Optional - JSON/Array for primary colors, swatch details.

Try it out

Layer Data (Raw JSON Array - Optional):

Response (201 Created)

{
    "message": "Design item created successfully.",
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Jersey #10",
        "product_id": 1,
        "product_size_id": 1,
        "player_name": "John Doe",
        "player_number": "10",
        "notes": "Custom design with team logo",
        "status": "active",
        "qa_status": "pending",
        "created_by": 1,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025",
        "design_item_layers": [ // NEW LAYER DATA
            {
                "id": 1,
                "design_item_id": 1,
                "layer_name": "Player Number",
                "layer_type": "text",
                "is_text_layer": true,
                "is_logo_layer": false,
                "text_content_details": {"content": "25", "font_name": "Austein Script"},
                "color_details": {"primary_fill": "DDP White"},
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z"
            }
        ]
    },
    "layerSyncResult": { "synced_count": 1 }
}
422 - Validation Error

Invalid input data or missing required layer fields (if 'layers' array is sent)

GET /design-items/{id} - Get Design Item by ID

Retrieve a specific design item by its ID with related data, including associated layers.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Custom Jersey - Size M - Player 10",
        "product_id": 1,
        "product_size_id": 1,
        "player_name": "Jane Smith",
        "player_number": "10",
        "notes": "Sample design notes for player jersey.",
        "status": "active",
        "qa_status": "pending",
        "created_by": 1,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "latest_design_file": {
            "id": 1,
            "design_product_id": 1,
            "design_order_id": 1,
            "design_item_id": 1,
            "file": "files/sample_design.pdf",
            "file_name": "Jersey Design - Player 10",
            "file_path": null,
            "file_type": "pdf",
            "file_size": null,
            "preserve_ai_editing": 1,
            "version": 1,
            "uploaded_by": 1,
            "status": "active",
            "qa_status": "pending",
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "file_url": "http://localhost/storage/files/sample_design.pdf",
            "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_thumb.jpg",
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025",
        "design_order": {
            "id": 1,
            "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "order_name": "Sample Order #001",
            "order_number": "ORD-2025-001",
            "customer_name": "John Smith",
            "description": "Custom team apparel order",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "design_product": {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Team Jersey",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "product_size": {
            "id": 1,
            "size_name": "XS",
            "size_code": "XS",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        },
        "product_style": {
            "id": 1,
            "style_number": "STYLE-001",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        },
        "design_item_layers": [ // NEW LAYER DATA
            {
                "id": 1,
                "design_item_id": 1,
                "layer_name": "Back Number",
                "layer_type": "text",
                "is_text_layer": true,
                "is_logo_layer": false,
                "text_content_details": {"content": "10", "font_name": "Bebas", "size_pt": 350},
                "color_details": {"primary_fill": "DDP White"},
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z"
            }
        ]
    }
}
404 - Not Found

Design item not found

GET /design-items/{id}/meta - Get Design Item Edit Metadata

Get design item data along with metadata for editing (status and QA status options), including associated layers.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Custom Jersey - Size M - Player 10",
        "product_id": 1,
        "product_size_id": 1,
        "player_name": "Jane Smith",
        "player_number": "10",
        "notes": "Sample design notes for player jersey.",
        "status": "active",
        "qa_status": "pending",
        "created_by": 1,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "design_item_layers": [ // NEW LAYER DATA
            {
                "id": 1,
                "design_item_id": 1,
                "layer_name": "Back Number",
                "layer_type": "text",
                "is_text_layer": true,
                "is_logo_layer": false,
                "text_content_details": {"content": "10", "font_name": "Bebas", "size_pt": 350},
                "color_details": {"primary_fill": "DDP White"},
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-01T00:00:00.000000Z"
            }
        ],
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 01, 2025",
        "design_order": {
            "id": 1,
            "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "order_name": "Sample Order #001",
            "order_number": "ORD-2025-001",
            "customer_name": "John Smith",
            "description": "Custom team apparel order",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "design_product": {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Team Jersey",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "product_size": {
            "id": 1,
            "size_name": "XS",
            "size_code": "XS",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        },
        "product_style": {
            "id": 1,
            "style_number": "STYLE-001",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        }
    },
    "productSizes": [
        {
            "value": 1,
            "label": "XS"
        },
        {
            "value": 2,
            "label": "S"
        },
        {
            "value": 3,
            "label": "M"
        },
        {
            "value": 4,
            "label": "L"
        },
        {
            "value": 5,
            "label": "XL"
        }
    ],
    "productStyle": [
        {
            "value": 1,
            "label": "STYLE-001"
        },
        {
            "value": 2,
            "label": "STYLE-002"
        }
    ],
    "designItemStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
404 - Not Found

Design item not found

PATCH /design-items/{id} - Update Design Item (with Layers)

Update an existing design item's information and optionally sync critical layer data.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "design_order_id": 1,                       // Required
    "design_product_id": 1,                      // Required
    "item_name": "Jersey #10 Updated",           // Required
    "product_id": 1,                             // Required (Product Style)
    "product_size_id": 2,                        // Optional
    "player_name": "John Smith",                 // Optional
    "player_number": "10",                       // Optional
    "notes": "Updated design notes",             // Optional
    "status": "active",                          // Required
    "qa_status": "approved",                     // Required
    "layers": [                                  // Optional - Array of layer details (Replaces all existing layers)
        {
            "layer_name": "Player Number",
            "layer_type": "text",
            "is_text_layer": true,
            "text_details": {"content": "10", "font_name": "HotSalsa Regular", "size_pt": 170.35},
            "color_details": {"primary_fill": "DDP Red"}
        }
    ]
}

Field Requirements

  • **design_order_id:** Required - integer, must exist in design_orders table
  • **design_product_id:** Required - integer, must exist in design_products table
  • **item_name:** Required - string, max 255 characters
  • **product_id:** Required - integer, must exist in products table (Product Style)
  • **product_size_id:** Optional - integer, nullable, must exist in product_sizes table
  • **player_name:** Optional - string, max 255 characters
  • **player_number:** Optional - string, max 50 characters
  • **notes:** Optional - string
  • **status:** Required - must be "active" or "inactive"
  • **qa_status:** Required - must be "pending", "in_progress", "approved", or "rejected"
  • --- Layer Data (`layers`) ---
  • **layers:** Optional - Array of layer definition objects. **If sent, it replaces all existing layer records.**
  • **layers.*.layer_name:** Required if layers array is sent - string, max 255.
  • **layers.*.layer_type:** Optional - string, max 50.
  • **layers.*.is_text_layer:** Optional - boolean.
  • **layers.*.is_logo_layer:** Optional - boolean.
  • **layers.*.text_details:** Optional - JSON/Array for text content, font details.
  • **layers.*.color_details:** Optional - JSON/Array for primary colors, swatch details.

Try it out

Layer Data (Raw JSON Array - Optional, Replaces existing):

Response (200 OK)

{
    "message": "Design item updated successfully.",
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Jersey #10 Updated",
        "product_id": 1,
        "product_size_id": 2,
        "player_name": "John Smith",
        "player_number": "10",
        "notes": "Updated design notes",
        "status": "active",
        "qa_status": "approved",
        "created_by": 1,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-01-02T00:00:00.000000Z",
        "deleted_at": null,
        "design_item_layers": [
            {
                "id": 1,
                "design_item_id": 1,
                "layer_name": "Player Number",
                "layer_type": "text",
                "is_text_layer": true,
                "is_logo_layer": false,
                "text_content_details": {"content": "10", "font_name": "HotSalsa Regular", "size_pt": 170.35},
                "color_details": {"primary_fill": "DDP Red"},
                "created_at": "2025-01-01T00:00:00.000000Z",
                "updated_at": "2025-01-02T00:00:00.000000Z"
            }
        ],
        "created_at_human": "Jan 01, 2025",
        "updated_at_human": "Jan 02, 2025",
        "design_order": {
            "id": 1,
            "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "order_name": "Sample Order #001",
            "order_number": "ORD-2025-001",
            "customer_name": "John Smith",
            "description": "Custom team apparel order",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "design_product": {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Team Jersey",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2025-01-01T00:00:00.000000Z",
            "updated_at": "2025-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2025",
            "updated_at_human": "Jan 01, 2025"
        },
        "product_size": {
            "id": 2,
            "size_name": "S",
            "size_code": "S",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        },
        "product_style": {
            "id": 1,
            "style_number": "STYLE-001",
            "status": "active",
            "created_at": "2025-10-28T04:17:39.000000Z",
            "updated_at": "2025-10-28T04:17:39.000000Z",
            "deleted_at": null,
            "created_at_human": "Oct 28, 2025",
            "updated_at_human": "Oct 28, 2025"
        }
    },
    "layerSyncResult": { "synced_count": 1 }
}
404 - Not Found

Design item not found

422 - Validation Error

Invalid input data

DELETE /design-items/{id} - Delete Design Item

Soft delete a design item (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Design item deleted successfully."
}
404 - Not Found

Design item not found

500 - Server Error

Failed to delete design item

📄 Design File Management

Manage design files (PDFs) for design items including upload, versioning, and QA status tracking

GET /design-files/meta - Get Design File Creation Metadata

Get metadata for creating a new design file (design order, product, item details and available options).

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table
  • design_product_id: Required, integer, must exist in design_products table
  • design_item_id: Required, integer, must exist in design_items table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "123e4567-e89b-12d3-a456-426614174000",
        "order_name": "Sample Order - 123456",
        "order_number": "ORD-001",
        "customer_name": "Sample Customer",
        "description": "Sample order description for testing purposes.",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-15T10:30:00.000000Z",
        "updated_at": "2024-01-15T10:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Sample Product Name",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-15T10:35:00.000000Z",
        "updated_at": "2024-01-15T10:35:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Sample Item Name - Size L",
        "product_size_id": 1,
        "player_name": "Sample Player",
        "player_number": "10",
        "notes": "Sample notes for this design item.",
        "status": "active",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "qa_status": "pending",
        "created_at": "2024-01-15T10:40:00.000000Z",
        "updated_at": "2024-01-15T10:40:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "fileType": [
        {
            "value": "pdf",
            "label": "Pdf"
        },
        {
            "value": "ai",
            "label": "Ai"
        }
    ],
    "designFileStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
GET /design-files - Get All Design Files

Retrieve a list of all design files for a specific design item.

Authentication Required: Yes (Bearer Token)

Query Parameters

  • design_order_id: Required, integer, must exist in design_orders table
  • design_product_id: Required, integer, must exist in design_products table
  • design_item_id: Required, integer, must exist in design_items table

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "123e4567-e89b-12d3-a456-426614174000",
        "order_name": "Sample Order - 123456",
        "order_number": "ORD-001",
        "customer_name": "Sample Customer",
        "description": "Sample order description for testing purposes.",
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-15T10:30:00.000000Z",
        "updated_at": "2024-01-15T10:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Sample Product Name",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-15T10:35:00.000000Z",
        "updated_at": "2024-01-15T10:35:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "Sample Item Name - Size L",
        "product_size_id": 1,
        "player_name": "Sample Player",
        "player_number": "10",
        "notes": "Sample notes for this design item.",
        "status": "active",
        "created_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "qa_status": "pending",
        "created_at": "2024-01-15T10:40:00.000000Z",
        "updated_at": "2024-01-15T10:40:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    },
    "designFiles": [
        {
            "id": 1,
            "design_product_id": 1,
            "design_order_id": 1,
            "design_item_id": 1,
            "file": "files/sample_design_file.pdf",
            "file_name": "Sample Design File v1",
            "file_path": "designs/samples/",
            "file_type": "pdf",
            "file_size": 2048576,
            "preserve_ai_editing": 1,
            "version": 1,
            "uploaded_by": 1,
            "status": "active",
            "qa_status": "pending",
            "created_at": "2024-01-15T10:45:00.000000Z",
            "updated_at": "2024-01-15T10:45:00.000000Z",
            "deleted_at": null,
            "file_url": "http://localhost/storage/files/sample_design_file.pdf",
            "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_file_thumb.jpg",
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        }
    ]
}
POST /design-files - Create Design File (AI + JSON Spec + 3D Model)

Upload a new design file (AI) along with its corresponding JSON specification file. Automatically generates 3D model from extracted layers.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: multipart/form-data

{
    "design_order_id": 1,                                     // Required
    "design_product_id": 1,                                   // Required
    "design_item_id": 1,                                       // Required
    "file": "(AI file upload, max 200MB)",                    // Required (AI file: *.ai)
    "json_spec_file": "(JSON file upload, max 50MB)",         // Required (JSON file: *.json)
    "file_name": "jersey_design_v1.ai",                       // Optional
    "file_path": "designs/jerseys/",                          // Optional
    "file_type": "ai",                                        // Required
    "preserve_ai_editing": true,                              // Required
    "version": 1,                                             // Required
    "status": "active",                                       // Required
    "qa_status": "pending"                                    // Required
}

Automatic Processing

  • Layer Extraction: AI file is processed to extract individual design layers
  • Template Masking: Layers are masked using base templates matching the product style
  • 3D Model Generation: Masked layers are used to generate a 3D GLTF model with textures
  • Storage: 3D model path is automatically saved in the database

Field Requirements

  • design_order_id: Required - integer, must exist in design_orders table
  • design_product_id: Required - integer, must exist in design_products table
  • design_item_id: Required - integer, must exist in design_items table. Product must have a valid style_number for template matching.
  • file: Required - must be an AI file (*.ai), max 200MB. **Base name must match json_spec_file.**
  • json_spec_file: Required - must be a JSON file (*.json), max 50MB. **Core base name must match AI file.**
  • file_name: Optional - string, max 255 characters (defaults to uploaded AI file name if not provided)
  • file_path: Optional - string, max 500 characters
  • file_type: Required - must be "pdf" or "ai"
  • preserve_ai_editing: Required - boolean (true/false)
  • version: Required - integer, min 1, must be unique for the specified design_item_id
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "completed", or "rejected"

Note: Both the AI file and the JSON specification file are **mandatory** and must share the same core name (e.g., `design.ai` and `design_full_spec.json`).

Try it out

Response (201 Created)

{
    "message": "Design file created successfully (Data Source: JSON Spec).",
    "designFile": {
        "id": 1,
        "design_product_id": 1,
        "design_order_id": 1,
        "design_item_id": 1,
        "file": "files/sample_design_file.ai",
        "file_name": "Sample Design File v1",
        "file_thumbnail": "thumbnails/thumb_abc123.jpg",
        "document_meta_data": { /* JSON data from AI spec */ },
        "text_objects_data": [ /* JSON data from AI spec */ ],
        "color_swatches_data": [ /* JSON data from AI spec */ ],
        "model_file": "3d_models/abc123/model.gltf",  // Path to generated 3D model
        "model_texture_file": "3d_models/abc123/textures/atlas.png",  // Path to atlas texture
        // ... (rest of fields)
    },
    "processing_data": {
        "source": "json_spec_file",
        "layer_images": [
            {
                "layer_name": "Front Design",
                "original_path": "storage/layer_images/.../Front_Design.png",
                "masked_path": "storage/layer_images/.../masked_layers/Front_Design.png",
                "full_path": "/absolute/path/to/Front_Design.png"
            }
        ],
        "extraction_method": "mutool",
        "total_processed": 5,
        "skipped_layers": [],
        "model_file": {
            "success": true,
            "gltf_model": {
                "path": "/absolute/path/to/model.gltf",
                "url": "http://localhost/storage/3d_models/abc123/model.gltf"
            },
            "textures": [
                {
                    "path": "/absolute/path/to/texture_front.png",
                    "url": "http://localhost/storage/3d_models/abc123/texture_front.png"
                }
            ],
            "textures_count": 4
        }
    }
}
400 - Bad Request

Base templates not found for the product's style number

422 - Validation Error

Invalid input data, missing required file, or file name mismatch.

500 - Server Error

Layer extraction or 3D model generation failed

GET /design-files/{id} - Get Design File by ID

Retrieve a specific design file by its ID with all related information including 3D model data.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designFile": {
        "id": 1,
        "design_product_id": 1,
        "design_order_id": 1,
        "design_item_id": 1,
        "file": "files/sample_design_file.ai",
        "file_name": "Sample Design File v1",
        "file_path": "designs/samples/",
        "file_type": "ai",
        "file_size": 2048576,
        "preserve_ai_editing": 1,
        "version": 1,
        "document_meta_data": { /* JSON data from AI spec */ },
        "text_objects_data": [ /* JSON data from AI spec */ ],
        "color_swatches_data": [ /* JSON data from AI spec */ ],
        "model_file": "3d_models/abc123/model.gltf",  // Storage-relative path to 3D model
        "model_texture_file": "3d_models/abc123/textures/atlas.png",  // Storage-relative path to atlas texture
        "uploaded_by": {
            "id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com"
        },
        "status": "active",
        "qa_status": "pending",
        "created_at": "2024-01-15T10:45:00.000000Z",
        "updated_at": "2024-01-15T10:45:00.000000Z",
        "deleted_at": null,
        "file_url": "http://localhost/storage/files/sample_design_file.ai",
        "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_file_thumb.jpg",
        "3d_model_url": "http://localhost/storage/3d_models/abc123/model.gltf",  // Full URL to 3D model
        "3d_texture_url": "http://localhost/storage/3d_models/abc123/textures/atlas.png",  // Full URL to atlas texture
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024",
        "design_order": {
            "id": 1,
            "uuid": "123e4567-e89b-12d3-a456-426614174000",
            "order_name": "Sample Order - 123456",
            "order_number": "ORD-001",
            "customer_name": "Sample Customer",
            "description": "Sample order description for testing purposes.",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "design_product": {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Sample Product Name",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-15T10:35:00.000000Z",
            "updated_at": "2024-01-15T10:35:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "design_item": {
            "id": 1,
            "design_order_id": 1,
            "design_product_id": 1,
            "item_name": "Sample Item Name - Size L",
            "product_size_id": 1,
            "player_name": "Sample Player",
            "player_number": "10",
            "notes": "Sample notes for this design item.",
            "status": "active",
            "created_by": 1,
            "qa_status": "pending",
            "created_at": "2024-01-15T10:40:00.000000Z",
            "updated_at": "2024-01-15T10:40:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        }
    }
}
404 - Not Found

Design file not found

GET /design-files/{id}/meta - Get Design File Edit Metadata

Get design file data along with metadata for editing.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designFile": {
        "id": 1,
        "design_product_id": 1,
        "design_order_id": 1,
        "design_item_id": 1,
        "file": "files/sample_design_file.pdf",
        "file_name": "Sample Design File v1",
        "file_path": "designs/samples/",
        "file_type": "pdf",
        "file_size": 2048576,
        "preserve_ai_editing": 1,
        "version": 1,
        // NEW JSON DATA FIELDS ADDED TO RESPONSE
        "document_meta_data": { /* JSON data from AI spec */ },
        "text_objects_data": [ /* JSON data from AI spec */ ],
        "color_swatches_data": [ /* JSON data from AI spec */ ],
        "model_file": "3d_models/abc123/model.gltf",  // Storage-relative path to 3D model
        "model_texture_file": "3d_models/abc123/textures/atlas.png",  // Storage-relative path to atlas texture
        // END NEW FIELDS
        "uploaded_by": {
            "id": 1,
            "uuid": "987e6543-e21b-12d3-a456-426614174001",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:30:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "status": "active",
        "qa_status": "pending",
        "created_at": "2024-01-15T10:45:00.000000Z",
        "updated_at": "2024-01-15T10:45:00.000000Z",
        "deleted_at": null,
        "file_url": "http://localhost/storage/files/sample_design_file.pdf",
        "file_thumbnail_url": "http://localhost/storage/thumbnails/sample_design_file_thumb.jpg",
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024",
        "design_order": {
            "id": 1,
            "uuid": "123e4567-e89b-12d3-a456-426614174000",
            "order_name": "Sample Order - 123456",
            "order_number": "ORD-001",
            "customer_name": "Sample Customer",
            "description": "Sample order description for testing purposes.",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "design_product": {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Sample Product Name",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-15T10:35:00.000000Z",
            "updated_at": "2024-01-15T10:35:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "design_item": {
            "id": 1,
            "design_order_id": 1,
            "design_product_id": 1,
            "item_name": "Sample Item Name - Size L",
            "product_size_id": 1,
            "player_name": "Sample Player",
            "player_number": "10",
            "notes": "Sample notes for this design item.",
            "status": "active",
            "created_by": 1,
            "qa_status": "pending",
            "created_at": "2024-01-15T10:40:00.000000Z",
            "updated_at": "2024-01-15T10:40:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        }
    },
    "fileType": [
        {
            "value": "pdf",
            "label": "Pdf"
        },
        {
            "value": "ai",
            "label": "Ai"
        }
    ],
    "designFileStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ],
    "qaStatus": [
        {
            "value": "pending",
            "label": "Pending"
        },
        {
            "value": "in_progress",
            "label": "In_progress"
        },
        {
            "value": "completed",
            "label": "Completed"
        },
        {
            "value": "rejected",
            "label": "Rejected"
        }
    ]
}
404 - Not Found

Design file not found

POST /design-files/{id} - Update Design File (AI + JSON Spec)

Update an existing design file's information and optionally replace the file/spec pair.

Authentication Required: Yes (Bearer Token)

Method Override: Use POST with _method: PATCH in request body

Request Body

Content-Type: multipart/form-data

{
    "_method": "PATCH",                                        // Required
    "design_order_id": 1,                                     // Required
    "design_product_id": 1,                                   // Required
    "design_item_id": 1,                                       // Required
    "file": "(AI file upload, optional)",                     // Optional (AI file: *.ai)
    "json_spec_file": "(JSON file upload, optional)",         // Optional (JSON file: *.json)
    "file_name": "jersey_design_v2.ai",                       // Optional
    "file_path": "designs/jerseys/",                          // Optional
    "file_type": "ai",                                        // Required
    "preserve_ai_editing": true,                              // Required
    "version": 2,                                             // Required
    "status": "active",                                       // Required
    "qa_status": "approved"                                   // Required
}

Field Requirements

  • _method: Required - must be "PATCH"
  • design_order_id: Required - integer, must exist in design_orders table
  • design_product_id: Required - integer, must exist in design_products table
  • design_item_id: Required - integer, must exist in design_items table
  • **file:** Optional - must be an AI file (*.ai), max 200MB. **Must be provided if `json_spec_file` is provided, and names must match.**
  • **json_spec_file:** Optional - must be a JSON file (*.json), max 50MB. **Must be provided if `file` is provided, and names must match.**
  • file_name: Optional - string, max 255 characters (defaults to uploaded AI file name if not provided)
  • file_path: Optional - string, max 500 characters
  • file_type: Required - must be "pdf" or "ai"
  • preserve_ai_editing: Required - boolean (true/false)
  • version: Required - integer, min 1, must be unique for the specified design_item_id (excluding current file)
  • status: Required - must be "active" or "inactive"
  • qa_status: Required - must be "pending", "in_progress", "completed", or "rejected"

Note: To update the AI file, both the `file` and `json_spec_file` must be uploaded together, and their base names must match.

Try it out

Response (200 OK)

{
    "message": "Design file updated successfully.",
    "designFile": {
        "id": 1,
        // ... (standard design file fields)
        "document_meta_data": { /* JSON data from AI spec */ },
        "text_objects_data": [ /* JSON data from AI spec */ ],
        "color_swatches_data": [ /* JSON data from AI spec */ ],
        "model_file": "3d_models/abc123/model.gltf",  // Storage-relative path to 3D model
        "model_texture_file": "3d_models/abc123/textures/atlas.png",  // Storage-relative path to atlas texture
        // ... (rest of fields)
    }
}
404 - Not Found

Design file not found

422 - Validation Error

Invalid input data, missing required file(s), or file name mismatch.

PATCH /design-files/{id}/unblock - Activate Design File

Activate a specific design file by setting its status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Design file activated successfully."
}
404 - Not Found

Design file not found

PATCH /design-files/{id}/block - Deactivate Design File

Deactivate a specific design file by setting its status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Design file deactivated successfully."
}
404 - Not Found

Design file not found

DELETE /design-files/{id} - Delete Design File

Soft delete a design file (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "Design file deleted successfully."
}
404 - Not Found

Design file not found

✅ QA Rules Management

Manage quality assurance rules for design file validation including format checks and physical inspections

GET /qa-rules/meta - Get QA Rule Creation Metadata

Get metadata for creating a new QA rule (available types, priorities, and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRuleTypes": [
        {
            "value": "format",
            "label": "Format"
        },
        {
            "value": "physical",
            "label": "Physical"
        }
    ],
    "priorities": [
        {
            "value": "low",
            "label": "Low"
        },
        {
            "value": "medium",
            "label": "Medium"
        },
        {
            "value": "high",
            "label": "High"
        }
    ],
    "qaRuleStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
GET /qa-rules - Get All QA Rules

Retrieve a list of all QA rules.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRules": [
        {
            "id": 1,
            "rule_name": "File Format Check",
            "description": "Ensure file is in correct format",
            "type": "format",
            "auto_check": false,
            "script_key": null,
            "priority": "high",
            "status": "active",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "created_by": {
                "id": 1,
                "uuid": "9a5f1c2e-3b4d-4e5f-6a7b-8c9d0e1f2a3b",
                "role_id": 1,
                "name": "Admin User",
                "email": "admin@example.com",
                "email_verified_at": "2024-01-01T00:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        },
        {
            "id": 2,
            "rule_name": "Physical Quality Check",
            "description": "Manual physical inspection required",
            "type": "physical",
            "auto_check": false,
            "script_key": null,
            "priority": "medium",
            "status": "active",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "created_by": {
                "id": 1,
                "uuid": "9a5f1c2e-3b4d-4e5f-6a7b-8c9d0e1f2a3b",
                "role_id": 1,
                "name": "Admin User",
                "email": "admin@example.com",
                "email_verified_at": "2024-01-01T00:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            }
        }
    ]
}
POST /qa-rules - Create QA Rule

Create a new QA rule.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "rule_name": "File Format Check",                        // Required
    "description": "Ensure file is in correct format",       // Optional
    "type": "format",                                        // Required
    "priority": "high",                                      // Required
    "status": "active"                                       // Required
}

Field Requirements

  • rule_name: Required - string, max 255 characters
  • description: Optional - string
  • type: Required - must be "format" or "physical"
  • priority: Required - must be "low", "medium", or "high"
  • status: Required - must be "active" or "inactive"

Try it out

Response (201 Created)

{
    "qaRule": {
        "id": 1,
        "rule_name": "File Format Check",
        "description": "Ensure file is in correct format",
        "type": "format",
        "auto_check": false,
        "script_key": null,
        "priority": "high",
        "status": "active",
        "created_by": 1,
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data

GET /qa-rules/{id} - Get QA Rule by ID

Retrieve a specific QA rule by its ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRule": {
        "id": 1,
        "rule_name": "File Format Check",
        "description": "Ensure file is in correct format",
        "type": "format",
        "auto_check": false,
        "script_key": null,
        "priority": "high",
        "status": "active",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "created_by": {
            "id": 1,
            "uuid": "9a5f1c2e-3b4d-4e5f-6a7b-8c9d0e1f2a3b",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    }
}
404 - Not Found

QA rule not found

GET /qa-rules/{id}/meta - Get QA Rule Edit Metadata

Get QA rule data along with metadata for editing (types, priorities, and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRule": {
        "id": 1,
        "rule_name": "File Format Check",
        "description": "Ensure file is in correct format",
        "type": "format",
        "auto_check": false,
        "script_key": null,
        "priority": "high",
        "status": "active",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "created_by": {
            "id": 1,
            "uuid": "9a5f1c2e-3b4d-4e5f-6a7b-8c9d0e1f2a3b",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    },
    "qaRuleTypes": [
        {
            "value": "format",
            "label": "Format"
        },
        {
            "value": "physical",
            "label": "Physical"
        }
    ],
    "priorities": [
        {
            "value": "low",
            "label": "Low"
        },
        {
            "value": "medium",
            "label": "Medium"
        },
        {
            "value": "high",
            "label": "High"
        }
    ],
    "qaRuleStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

QA rule not found

PATCH /qa-rules/{id} - Update QA Rule

Update an existing QA rule's information.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "rule_name": "File Format Check Updated",                        // Required
    "description": "Updated description for file format checking",   // Optional
    "type": "format",                                                // Required
    "priority": "medium",                                            // Required
    "status": "inactive"                                             // Required
}

Field Requirements

  • rule_name: Required - string, max 255 characters
  • description: Optional - string
  • type: Required - must be "format" or "physical"
  • priority: Required - must be "low", "medium", or "high"
  • status: Required - must be "active" or "inactive"

Try it out

Response (200 OK)

{
    "qaRule": {
        "id": 1,
        "rule_name": "File Format Check Updated",
        "description": "Updated description for file format checking",
        "type": "format",
        "auto_check": false,
        "script_key": null,
        "priority": "medium",
        "status": "inactive",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T12:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024",
        "created_by": {
            "id": 1,
            "uuid": "9a5f1c2e-3b4d-4e5f-6a7b-8c9d0e1f2a3b",
            "role_id": 1,
            "name": "Admin User",
            "email": "admin@example.com",
            "email_verified_at": "2024-01-01T00:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    }
}
404 - Not Found

QA rule not found

422 - Validation Error

Invalid input data

PATCH /qa-rules/{id}/unblock - Unblock QA Rule

Unblock (activate) a specific QA rule by setting its status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule activated successfully."
}
404 - Not Found

QA rule not found

PATCH /qa-rules/{id}/block - Block QA Rule

Block (deactivate) a specific QA rule by setting its status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule deactivated successfully."
}
404 - Not Found

QA rule not found

DELETE /qa-rules/{id} - Delete QA Rule

Soft delete a QA rule (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule deleted successfully."
}
404 - Not Found

QA rule not found

500 - Server Error

Failed to delete QA rule

📋 QA Rule Sets Management

Manage collections of QA rules that can be applied to design files for comprehensive quality assurance validation

GET /qa-rule-sets/meta - Get QA Rule Set Creation Metadata

Get metadata for creating a new QA rule set (available QA rules and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRules": [
        {
            "value": 1,
            "label": "Image Resolution Check"
        },
        {
            "value": 2,
            "label": "File Format Validation"
        },
        {
            "value": 3,
            "label": "Color Mode RGB"
        },
        {
            "value": 4,
            "label": "Text Layer Validation"
        }
    ],
    "qaRuleSetStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
GET /qa-rule-sets - Get All QA Rule Sets

Retrieve a list of all QA rule sets.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRuleSets": [
        {
            "id": 1,
            "qa_rule_set_name": "Standard Quality Rules",
            "description": "Standard quality checks for all products",
            "status": "active",
            "created_by": {
                "id": 1,
                "uuid": "550e8400-e29b-41d4-a716-446655440000",
                "role_id": 1,
                "name": "John Doe",
                "email": "john.doe@example.com",
                "email_verified_at": "2024-01-15T10:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2024-01-15T10:00:00.000000Z",
                "updated_at": "2024-01-15T10:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 15, 2024",
                "updated_at_human": "Jan 15, 2024"
            },
            "created_at": "2024-01-20T10:00:00.000000Z",
            "updated_at": "2024-01-20T10:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 20, 2024",
            "updated_at_human": "Jan 20, 2024"
        },
        {
            "id": 2,
            "qa_rule_set_name": "Premium Quality Rules",
            "description": "Enhanced quality checks for premium products",
            "status": "active",
            "created_by": {
                "id": 1,
                "uuid": "550e8400-e29b-41d4-a716-446655440000",
                "role_id": 1,
                "name": "John Doe",
                "email": "john.doe@example.com",
                "email_verified_at": "2024-01-15T10:00:00.000000Z",
                "profile_picture": null,
                "status": "active",
                "created_by": null,
                "created_at": "2024-01-15T10:00:00.000000Z",
                "updated_at": "2024-01-15T10:00:00.000000Z",
                "deleted_at": null,
                "profile_picture_url": null,
                "created_at_human": "Jan 15, 2024",
                "updated_at_human": "Jan 15, 2024"
            },
            "created_at": "2024-01-22T10:00:00.000000Z",
            "updated_at": "2024-01-22T10:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 22, 2024",
            "updated_at_human": "Jan 22, 2024"
        }
    ]
}
POST /qa-rule-sets - Create QA Rule Set

Create a new QA rule set.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "qa_rule_set_name": "Standard QA Set",                   // Required
    "description": "Standard quality assurance rule set",    // Optional
    "status": "active",                                      // Required
    "rule_ids": [1, 2, 3]                                    // Required
}

Field Requirements

  • qa_rule_set_name: Required - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"
  • rule_ids: Required - array of integers, each must exist in qa_rules table

Try it out

Response (201 Created)

{
    "qaRuleSet": {
        "qa_rule_set_name": "Standard QA Set",
        "description": "Standard quality assurance rule set",
        "status": "active",
        "created_by": 1,
        "updated_at": "2024-01-25T10:00:00.000000Z",
        "created_at": "2024-01-25T10:00:00.000000Z",
        "id": 3,
        "created_at_human": "Jan 25, 2024",
        "updated_at_human": "Jan 25, 2024"
    }
}
422 - Validation Error

Invalid input data

GET /qa-rule-sets/{id} - Get QA Rule Set by ID

Retrieve a specific QA rule set by its ID.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRuleSet": {
        "id": 1,
        "qa_rule_set_name": "Standard Quality Rules",
        "description": "Standard quality checks for all products",
        "status": "active",
        "created_by": {
            "id": 1,
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:00:00.000000Z",
            "updated_at": "2024-01-15T10:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-20T10:00:00.000000Z",
        "updated_at": "2024-01-20T10:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 20, 2024",
        "updated_at_human": "Jan 20, 2024",
        "qa_rules": [
            {
                "id": 1,
                "rule_name": "Color Mode RGB",
                "description": "File must be RGB",
                "type": "format",
                "auto_check": 1,
                "script_key": "color_mode",
                "priority": "low",
                "status": "active",
                "created_by": 1,
                "created_at": "2025-10-28T04:24:40.000000Z",
                "updated_at": "2025-10-28T05:12:55.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025",
                "pivot": {
                    "qa_rule_set_id": 5,
                    "qa_rule_id": 1
                }
            },
            {
                "id": 2,
                "rule_name": "Color Mode RGB",
                "description": null,
                "type": "format",
                "auto_check": 0,
                "script_key": null,
                "priority": "low",
                "status": "active",
                "created_by": 1,
                "created_at": "2025-10-28T04:54:46.000000Z",
                "updated_at": "2025-10-28T04:56:48.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025",
                "pivot": {
                    "qa_rule_set_id": 5,
                    "qa_rule_id": 2
                }
            }
        ]
    }
}
404 - Not Found

QA Rule Set not found

GET /qa-rule-sets/{id}/meta - Get QA Rule Set Edit Metadata

Get QA rule set data along with metadata for editing (available QA rules and status options).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "qaRuleSet": {
        "id": 1,
        "qa_rule_set_name": "Standard Quality Rules",
        "description": "Standard quality checks for all products",
        "status": "active",
        "created_by": {
            "id": 1,
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "role_id": 1,
            "name": "John Doe",
            "email": "john.doe@example.com",
            "email_verified_at": "2024-01-15T10:00:00.000000Z",
            "profile_picture": null,
            "status": "active",
            "created_by": null,
            "created_at": "2024-01-15T10:00:00.000000Z",
            "updated_at": "2024-01-15T10:00:00.000000Z",
            "deleted_at": null,
            "profile_picture_url": null,
            "created_at_human": "Jan 15, 2024",
            "updated_at_human": "Jan 15, 2024"
        },
        "created_at": "2024-01-20T10:00:00.000000Z",
        "updated_at": "2024-01-20T10:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 20, 2024",
        "updated_at_human": "Jan 20, 2024",
        "qa_rules": [
            {
                "id": 1,
                "rule_name": "Color Mode RGB",
                "description": "File must be RGB",
                "type": "format",
                "auto_check": 1,
                "script_key": "color_mode",
                "priority": "low",
                "status": "active",
                "created_by": 1,
                "created_at": "2025-10-28T04:24:40.000000Z",
                "updated_at": "2025-10-28T05:12:55.000000Z",
                "deleted_at": null,
                "created_at_human": "Oct 28, 2025",
                "updated_at_human": "Oct 28, 2025",
                "pivot": {
                    "qa_rule_set_id": 1,
                    "qa_rule_id": 1
                }
            }
        ]
    },
    "qaRules": [
        {
            "value": 1,
            "label": "Image Resolution Check"
        },
        {
            "value": 2,
            "label": "File Format Validation"
        },
        {
            "value": 3,
            "label": "Color Mode RGB"
        },
        {
            "value": 4,
            "label": "Text Layer Validation"
        }
    ],
    "qaRuleSetStatus": [
        {
            "value": "active",
            "label": "Active"
        },
        {
            "value": "inactive",
            "label": "Inactive"
        }
    ]
}
404 - Not Found

QA Rule Set not found

PATCH /qa-rule-sets/{id} - Update QA Rule Set

Update an existing QA rule set's information.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "qa_rule_set_name": "Updated QA Set",                    // Required
    "description": "Updated description",                    // Optional
    "status": "inactive",                                    // Required
    "rule_ids": [1, 2, 4]                                    // Required
}

Field Requirements

  • qa_rule_set_name: Required - string, max 255 characters
  • description: Optional - string
  • status: Required - must be "active" or "inactive"
  • rule_ids: Required - array of integers, each must exist in qa_rules table

Try it out

Response (200 OK)

{
    "qaRuleSet": {
        "id": 1,
        "qa_rule_set_name": "Updated QA Set",
        "description": "Updated description",
        "status": "active",
        "created_at": "2024-01-20T10:00:00.000000Z",
        "updated_at": "2024-01-25T15:30:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 20, 2024",
        "updated_at_human": "Jan 25, 2024"
    }
}
404 - Not Found

QA Rule Set not found

422 - Validation Error

Invalid input data

PATCH /qa-rule-sets/{id}/unblock - Unblock QA Rule Set

Unblock (activate) a specific QA rule set by setting its status to "active".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule Set activated successfully."
}
404 - Not Found

QA Rule Set not found

PATCH /qa-rule-sets/{id}/block - Block QA Rule Set

Block (deactivate) a specific QA rule set by setting its status to "inactive".

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule Set deactivated successfully."
}
404 - Not Found

QA Rule Set not found

DELETE /qa-rule-sets/{id} - Delete QA Rule Set

Soft delete a QA rule set (marks as deleted but keeps in database).

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "message": "QA Rule Set deleted successfully."
}
404 - Not Found

QA Rule Set not found

500 - Server Error

Failed to delete QA rule set

📊 QA Reports

View QA reports for design orders, products, items and their detailed QA attempts with results

GET /qa-report/orders - Get QA Orders

Retrieve a list of all design orders for QA reporting.

Authentication Required: Yes (Bearer Token)

Try it out

Response (200 OK)

{
    "designOrders": [
        {
            "id": 1,
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "order_name": "Sample Order 001",
            "order_number": "ORD-2024-001",
            "customer_name": "Acme Corporation",
            "description": "Sample design order for corporate branding",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024"
        }
    ]
}
GET /qa-report/order-products - Get Order Products for QA

Retrieve design products for a specific order for QA reporting.

Authentication Required: Yes (Bearer Token)

Query Parameters

{
    "design_order_id": 1    // Required - ID of the design order
}

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "order_name": "Sample Order 001",
        "order_number": "ORD-2024-001",
        "customer_name": "Acme Corporation",
        "description": "Sample design order for corporate branding",
        "status": "active",
        "qa_status": "in_progress",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designProducts": [
        {
            "id": 1,
            "design_order_id": 1,
            "product_name": "Corporate T-Shirt Design",
            "product_type_id": 1,
            "status": "active",
            "qa_status": "pending",
            "qa_analyst_id": 5,
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "qaAnalyst": {
                "id": 5,
                "name": "QA Analyst 1",
                "email": "qa1@example.com"
            }
        }
    ]
}
404 - Not Found

Design Products not found

422 - Validation Error

Invalid design_order_id parameter

GET /qa-report/order-product-items - Get Order Product Items for QA

Retrieve design items for a specific product within an order for QA reporting.

Authentication Required: Yes (Bearer Token)

Query Parameters

{
    "design_order_id": 1,      // Required - ID of the design order
    "design_product_id": 1     // Required - ID of the design product
}

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "order_name": "Sample Order 001",
        "order_number": "ORD-2024-001",
        "customer_name": "Acme Corporation",
        "description": "Sample design order for corporate branding",
        "status": "active",
        "qa_status": "in_progress",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Corporate T-Shirt Design",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "qa_analyst_id": 5,
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designItems": [
        {
            "id": 1,
            "design_order_id": 1,
            "design_product_id": 1,
            "item_name": "T-Shirt Design - Small",
            "product_size_id": 1,
            "player_name": "John Doe",
            "player_number": "42",
            "notes": "Sample notes for the design item",
            "status": "active",
            "qa_status": "pending",
            "created_by": 1,
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z",
            "deleted_at": null,
            "latest_design_file": {
                "id": 1,
                "file_name": "design_v1.pdf",
                "version": "1"
            },
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "product_size": {
                "id": 1,
                "size_name": "Small",
                "size_code": "S",
                "status": "active",
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            "createdBy": {
                "id": 1,
                "uuid": "a8e34a64-165f-4edd-8c78-9ffb9af0abec",
                "role_id": 1,
                "name": "Admin User",
                "email": "admin@example.com",
                "status": "active"
            }
        }
    ]
}
404 - Not Found

Design Items not found

422 - Validation Error

Invalid parameters

GET /qa-report/order-product-item - Get Order Product Item with QA Attempts

Retrieve detailed information about a specific design item including all QA attempts and results.

Authentication Required: Yes (Bearer Token)

Query Parameters

{
    "design_order_id": 1,      // Required - ID of the design order
    "design_product_id": 1,    // Required - ID of the design product
    "design_item_id": 1        // Required - ID of the design item
}

Try it out

Response (200 OK)

{
    "designOrder": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "order_name": "Sample Order 001",
        "order_number": "ORD-2024-001",
        "customer_name": "Acme Corporation",
        "description": "Sample design order for corporate branding",
        "status": "active",
        "qa_status": "in_progress",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designProduct": {
        "id": 1,
        "design_order_id": 1,
        "product_name": "Corporate T-Shirt Design",
        "product_type_id": 1,
        "status": "active",
        "qa_status": "pending",
        "qa_analyst_id": 5,
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "designItem": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 1,
        "item_name": "T-Shirt Design - Small",
        "product_size_id": 1,
        "player_name": "John Doe",
        "player_number": "42",
        "notes": "Sample notes for the design item",
        "status": "active",
        "qa_status": "passed",
        "created_by": 1,
        "created_at": "2024-01-01T00:00:00.000000Z",
        "updated_at": "2024-01-01T00:00:00.000000Z",
        "deleted_at": null,
        "latest_design_file": {
            "id": 1,
            "file_name": "design_v1.pdf",
            "version": "1"
        },
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    },
    "qaAttempts": [
        {
            "id": 1,
            "design_order_id": 1,
            "design_product_id": 1,
            "design_item_id": 1,
            "qa_rule_set_id": 1,
            "attempted_by": 5,
            "status": "passed",
            "remarks": "All quality checks passed successfully",
            "created_at": "2024-01-01T12:00:00.000000Z",
            "updated_at": "2024-01-01T12:00:00.000000Z",
            "deleted_at": null,
            "created_at_human": "Jan 01, 2024",
            "updated_at_human": "Jan 01, 2024",
            "qaRuleSet": {
                "id": 1,
                "qa_rule_set_name": "Standard QA Rules",
                "description": "Standard quality assurance rules for apparel",
                "status": "active",
                "created_by": 1,
                "created_at": "2024-01-01T00:00:00.000000Z",
                "updated_at": "2024-01-01T00:00:00.000000Z",
                "deleted_at": null,
                "created_at_human": "Jan 01, 2024",
                "updated_at_human": "Jan 01, 2024"
            },
            "attemptedBy": {
                "id": 5,
                "uuid": "770e8400-e29b-41d4-a716-446655440005",
                "role_id": 4,
                "name": "QA Analyst 1",
                "email": "qa1@example.com",
                "status": "active"
            },
            "qaAttemptResults": [
                {
                    "id": 1,
                    "qa_attempt_id": 1,
                    "qa_rule_id": 1,
                    "result": "pass",
                    "remarks": "Color check passed - CMYK values verified",
                    "auto_check": 1,
                    "created_at": "2024-01-01T12:00:00.000000Z",
                    "updated_at": "2024-01-01T12:00:00.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024"
                },
                {
                    "id": 2,
                    "qa_attempt_id": 1,
                    "qa_rule_id": 2,
                    "result": "pass",
                    "remarks": "Text alignment verified and correct",
                    "auto_check": 0,
                    "created_at": "2024-01-01T12:00:00.000000Z",
                    "updated_at": "2024-01-01T12:00:00.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024"
                },
                {
                    "id": 3,
                    "qa_attempt_id": 1,
                    "qa_rule_id": 3,
                    "result": "pass",
                    "remarks": "Image resolution meets requirements",
                    "auto_check": 1,
                    "created_at": "2024-01-01T12:00:00.000000Z",
                    "updated_at": "2024-01-01T12:00:00.000000Z",
                    "deleted_at": null,
                    "created_at_human": "Jan 01, 2024",
                    "updated_at_human": "Jan 01, 2024"
                }
            ]
        }
    ]
}
404 - Not Found

Design Item not found

422 - Validation Error

Invalid parameters

🔍 QA Attempts

Create and manage QA attempts for design items using specified rule sets

POST /qa-attempts - Create QA Attempt

Create a new QA attempt for a design item. This initiates a quality assurance check using a specified rule set.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "design_order_id": 1,                        // Required
    "design_product_id": 2,                      // Required
    "design_item_id": 3,                         // Required
    "design_file_id": 3,                         // Required
    "qa_rule_set_id": 1,                         // Required
    "status": "pending",                         // Required
    "remarks": "Initial QA check"                // Optional
}

Field Requirements

  • design_order_id: Required - integer, must exist in design_orders table
  • design_product_id: Required - integer, must exist in design_products table and belong to the specified design order
  • design_item_id: Required - integer, must exist in design_items table and belong to the specified design product
  • design_file_id: Required - integer, must exist in design_files table and belong to the specified design item
  • qa_rule_set_id: Required - integer, must exist in qa_rule_sets table
  • status: Required - must be one of: "pending", "in_progress", "completed", "rejected"
  • remarks: Optional - string, any additional notes or comments

Business Rules

  • The authenticated user will be automatically set as the attempted_by user (cannot be manually set)
  • A script key (script_key) will be automatically generated for tracking (cannot be manually set)
  • Cannot create duplicate QA attempts with the same design order, product, item, and status (unless status is "completed" or "rejected")
  • The design product must belong to the specified design order
  • The design item must belong to the specified design product

Try it out

Response (201 Created)

{
    "message": "QA Attempt created successfully.",
    "qaAttempt": {
        "id": 1,
        "design_order_id": 1,
        "design_product_id": 2,
        "design_item_id": 3,
        "design_file_id": 4,
        "qa_rule_set_id": 1,
        "script_key": "qa_20240101_abc123",
        "attempted_by": 5,
        "status": "pending",
        "remarks": "Initial QA check",
        "created_at": "2024-01-01T12:00:00.000000Z",
        "updated_at": "2024-01-01T12:00:00.000000Z",
        "deleted_at": null,
        "created_at_human": "Jan 01, 2024",
        "updated_at_human": "Jan 01, 2024"
    }
}
422 - Validation Error

Invalid input data or business rule violation

500 - Server Error

Failed to create QA attempt

POST /qa-attempts/auto-check - Run Auto QA Check

Execute an automated quality assurance check on an existing QA attempt. This runs the configured QA rules and updates the attempt with the results.

Authentication Required: Yes (Bearer Token)

Request Body

Content-Type: application/json

{
    "qa_attempt_id": 1                           // Required
}

Field Requirements

  • qa_attempt_id: Required - integer, must exist in qa_attempts table

Business Rules

  • The QA attempt must exist in the system
  • The auto check service will validate the design item against all rules in the associated rule set
  • Results will be automatically stored and the attempt status may be updated based on the check results

Try it out

Response (200 OK)

{
    "message": "Auto QA Check completed successfully."
}
404 - Not Found

QA Attempt not found

400 - Bad Request

Auto QA Check failed (e.g., invalid configuration or rule execution error)

422 - Validation Error

Invalid QA attempt ID

500 - Server Error

Failed to run Auto QA Check

🔄 Order Sync

Retrieve and sync order data from external systems

POST /order-sync/get-from-external - Retrieve Order from External System

Fetch order details from the external system without syncing to the database.

Authentication Required: Yes (Bearer Token)

Request Body

{
    "order_number": "ORD-2024-001"              // Required
}

Field Requirements

  • order_number: Required - string, the order number to retrieve from external system

Try it out

Response (200 OK)

{
    "message": "Order sync from external system initiated successfully.",
    "data": {
        "order": {
            "id": 12345,
            "order_no": "ORD-2024-001",
            "customer_ref_no": "Sample Order Reference",
            "customer_id": "100",
            "customer": {
                "id": 100,
                "name": "Sample Customer Inc."
            }
        },
        "child_orders": [
            {
                "id": 1001,
                "order_no": "ORD-2024-001-1"
            },
            {
                "id": 1002,
                "order_no": "ORD-2024-001-2"
            },
            {
                "id": 1003,
                "order_no": "ORD-2024-001-3"
            }
        ]
    }
}
422 - Validation Error

Order number is required or invalid

500 - Server Error

Failed to fetch order from external system

POST /order-sync/sync-from-external - Sync Order from External System

Sync order data from external system and create design orders, products, and items in the database.

Authentication Required: Yes (Bearer Token)

Request Body

{
    "order_number": "ORD-2024-001",             // Required
    "child_order_ids": [1, 2, 3]                // Required, array of child order IDs to sync
}

Field Requirements

  • order_number: Required - string, the order number to sync
  • child_order_ids: Required - array of integers, child order IDs to include in sync

Try it out

Response (200 OK)

{
    "message": "Order sync from external system completed successfully.",
    "designOrder": {
        "order_name": "ORD-2024-001 - Sample Customer Inc.",
        "order_number": "ORD-2024-001",
        "customer_name": "Sample Customer Inc.",
        "description": "Sample Product Description",
        "status": "active",
        "qa_status": "pending",
        "order_source": "external",
        "created_by": 1,
        "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "updated_at": "2024-01-15T10:30:00.000000Z",
        "created_at": "2024-01-15T10:30:00.000000Z",
        "id": 1,
        "created_at_human": "Jan 15, 2024",
        "updated_at_human": "Jan 15, 2024"
    }
}

Process Details

This endpoint performs the following operations:

  • Fetches order data from external system using provided order number and child order IDs
  • Creates a design order with customer information
  • Creates design products for each child order's product type
  • Creates design items for each order within the child orders
  • Automatically matches product types and sizes based on external data
  • Sets player name and player number from external data if available
  • All created records are set to "active" status with "pending" QA status
422 - Validation Error

Order number or child order IDs are missing or invalid

500 - Server Error

Failed to sync order from external system

🌐 External API Documentation

External system API endpoints that the Order Sync system integrates with

EXTERNAL External API Endpoints Documentation
⚠️

⚠️ CAUTION - External Live System

This is a separate live production system. These endpoints are maintained and hosted externally. Any changes or issues with these endpoints must be coordinated with the external system administrators. Do not attempt to modify or test aggressively without proper authorization.

Base URL: https://ddpoms.us/api

These are the external API endpoints that the Order Sync system calls to retrieve order data.

1. Get Order Details

Endpoint: GET /order

Description: Retrieve order details by order number

Query Parameters

  • order_number: Required - string, the order number to retrieve

Example Request

GET https://ddpoms.us/api/order?order_number=ORD-2024-001

Response Structure

{
    "order": {
        "id": 12345,
        "order_no": "ORD-2024-001",
        "customer_ref_no": "Sample Order Reference",
        "customer_id": "100",
        "customer": {
            "id": 100,
            "name": "Sample Customer Inc."
        }
    },
    "child_orders": [
        {
            "id": 1001,
            "order_no": "ORD-2024-001-1"
        },
        {
            "id": 1002,
            "order_no": "ORD-2024-001-2"
        },
        {
            "id": 1003,
            "order_no": "ORD-2024-001-3"
        }
    ]
}

2. Get Child Orders Details

Endpoint: POST /child-orders

Description: Retrieve detailed information for specific child orders

Request Body

{
    "order_number": "ORD-2024-001",
    "child_order_ids": [1001, 1002, 1003]
}

Body Parameters

  • order_number: Required - string, the parent order number
  • child_order_ids: Required - array of integers, child order IDs to retrieve

Response Structure

{
    "order": {
        "id": 12345,
        "order_no": "ORD-2024-001",
        "customer_ref_no": "Sample Order Reference",
        "customer_id": "100",
        "customer": {
            "id": 100,
            "name": "Sample Customer Inc."
        }
    },
    "child_orders": [
        {
            "product_id": 2001,
            "product_name": "Jersey",
            "orders": [
                {
                    "id": 5001,
                    "order_no": "ORD-2024-001-1-001",
                    "description": "Custom Jersey",
                    "size_code": "M",
                    "player_name": "player_name001",
                    "player_number": "10"
                },
                {
                    "id": 5002,
                    "order_no": "ORD-2024-001-1-002",
                    "description": "Custom Jersey",
                    "size_code": "L",
                    "player_name": "player_name002",
                    "player_number": "10"
                }
            ]
        },
        {
            "product_id": 2002,
            "product_name": "Shorts",
            "orders": [
                {
                    "id": 5003,
                    "order_no": "ORD-2024-001-2-001",
                    "description": "Custom Shorts",
                    "size_code": "M",
                    "player_name": "player_name003",
                    "player_number": "10"
                }
            ]
        }
    ]
}

Response Fields Description

  • order: Parent order information including customer details
  • child_orders: Array of child orders with detailed items
    • product_name: Product type name (used to match with Product Types in the system)
    • orders: Array of individual order items
      • size_code: Size code (used to match with Product Sizes in the system)
      • order_no: Individual item order number

Important Notes

Data Matching

The sync process automatically matches product_name from external API with Product Types and size_code with Product Sizes in the system. Ensure these values match exactly with your master data.

Configuration

External API URL is configured in .env file as EXTERNAL_API_URL and can be accessed via config('services.external_api.url')

Code Examples

Next.js/TypeScript with Axios

// types/api.ts
interface User {
    id: number;
    uuid: string;
    role_id: number;
    name: string;
    email: string;
    status: 'active' | 'inactive';
    email_verified_at: string | null;
    created_at: string;
    updated_at: string;
    deleted_at: string | null;
    created_at_human: string;
    updated_at_human: string;
    role?: {
        id: number;
        name: string;
        slug: string;
    };
}

interface LoginRequest {
    email: string;
    password: string;
}

interface LoginResponse {
    token: string;
    user: User;
}

interface CreateUserRequest {
    name: string;
    email: string;
    password: string;
    password_confirmation: string;
    role_id: number;
    status: 'active' | 'inactive';
}

interface UpdateUserRequest {
    name: string;
    role_id: number;
    status: 'active' | 'inactive';
}

// lib/api.ts
import axios from 'axios';

const API_BASE_URL = 'https://api.ddpqa.enricharcane.cc/api';

// Create axios instance
const api = axios.create({
    baseURL: API_BASE_URL,
    headers: {
        'Content-Type': 'application/json',
    },
});

// Add auth token to requests
api.interceptors.request.use((config) => {
    const token = localStorage.getItem('authToken');
    if (token) {
        config.headers.Authorization = `Bearer ${token}`;
    }
    return config;
});

// Auth API
export const authAPI = {
    login: async (credentials: LoginRequest): Promise => {
        const response = await api.post('/login', credentials);
        return response.data;
    },

    logout: async (): Promise => {
        await api.post('/logout');
    },
};

// Users API
export const usersAPI = {
    getMeta: async () => {
        const response = await api.get('/users/meta');
        return response.data;
    },

    getAll: async (page = 1, perPage = 15) => {
        const response = await api.get(`/users?page=${page}&per_page=${perPage}`);
        return response.data;
    },

    getById: async (id: number) => {
        const response = await api.get(`/users/${id}`);
        return response.data;
    },

    getEditMeta: async (id: number) => {
        const response = await api.get(`/users/${id}/edit-meta`);
        return response.data;
    },

    create: async (userData: CreateUserRequest) => {
        const response = await api.post('/users', userData);
        return response.data;
    },

    update: async (id: number, userData: UpdateUserRequest) => {
        const response = await api.put(`/users/${id}`, userData);
        return response.data;
    },

    activate: async (id: number) => {
        const response = await api.put(`/users/${id}/activate`);
        return response.data;
    },

    deactivate: async (id: number) => {
        const response = await api.put(`/users/${id}/deactivate`);
        return response.data;
    },

    delete: async (id: number): Promise => {
        await api.delete(`/users/${id}`);
    },
};

// Usage in React component
const LoginComponent = () => {
    const handleLogin = async (email: string, password: string) => {
        try {
            const { token, user } = await authAPI.login({ email, password });
            localStorage.setItem('authToken', token);
            // Handle successful login
        } catch (error) {
            console.error('Login failed:', error);
        }
    };

    const handleGetUsers = async () => {
        try {
            const users = await usersAPI.getAll();
            console.log(users);
        } catch (error) {
            console.error('Failed to fetch users:', error);
        }
    };
};