FeaturesAPIDocsPricing

API Documentation

https://api.rapidmock.dev

Base Information

Response Format

{
  status: "success" | "fail",
  data?: any,
  error?: string | string[]
}

Users API

/users

Endpoint

/users/login

Request Body

{
  "username": "string",
  "password": "string"
}

Response Body

{
  "status": "success",
  "code": 200,
  "message": "login success",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidXNlcm5hbWUiLCJyb2xlIjoidXNlciIsImV4cCI6MTczNDc5NjExM30.VtnHZJJe8UcGx5FuLeNh5G2rK7nJ16biTJlGsoAa24Q"
  }
}

Endpoint

/users

Query Parameters

{
  "limit": "number (default: 10)",
  "page": "number (default: 1)"
}

Response Body

{
  "status": "success",
  "code": 200,
  "message": "",
  "data": {
    "items": [
      {
        "id": 1,
        "username": "jack",
        "email": "jack@gmail.com",
        "phone_number": "+17404630034",
        "password_hash": "e10adc3949ba59abbe56e057f20f883e",
        "role": "user",
        "first_name": "Luke",
        "last_name": "Worrall",
        "last_login": "2024-01-02T10:00:01.000Z",
        "is_verified": 0,
        "gender": "male",
        "birthday": "1990-10-12T00:00:00.000Z",
        "avatar_url": "",
        "status": "active",
        "created_at": "2010-10-10T10:11:11.000Z",
        "updated_at": "2010-11-10T10:11:11.000Z",
        "country": "american",
        "state": "ca",
        "city": "Los Angeles",
        "street": "221 N Los Angeles St"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "row_count": 55
    }
  }
}

Endpoint

/users/:id

Response Body

{
  "status": "success",
  "code": 200,
  "message": "",
  "data": {
    "id": 1,
    "username": "jack",
    "email": "jack@gmail.com",
    "phone_number": "+17404630034",
    "password_hash": "e10adc3949ba59abbe56e057f20f883e",
    "role": "user",
    "first_name": "Luke",
    "last_name": "Worrall",
    "last_login": "2024-01-02T10:00:01.000Z",
    "is_verified": 0,
    "gender": "male",
    "birthday": "1990-10-12T00:00:00.000Z",
    "avatar_url": "",
    "status": "active",
    "created_at": "2010-10-10T10:11:11.000Z",
    "updated_at": "2010-11-10T10:11:11.000Z",
    "country": "american",
    "state": "ca",
    "city": "Los Angeles",
    "street": "221 N Los Angeles St"
  }
}

Endpoint

/users

Request Body

{
  "username": "string",
  "email": "string",
  "password": "string",
  "phone_number": "string (optional)",
  "first_name": "string (optional)",
  "last_name": "string (optional)",
  "gender": "male|female|other|prefer_not_to_say (optional)",
  "birthday": "date (optional)",
  "avatar_url": "string (optional)",
  "street": "string (optional)",
  "city": "string (optional)",
  "state": "string (optional)",
  "country": "string (optional)"
}

Response Body

{}

Products API

/products

Endpoint

/products

Query Parameters

{
  "limit": "number (default: 10)",
  "page": "number (default: 1)"
}

Response Body

{
  "status": "success",
  "code": 200,
  "message": "",
  "data": {
    "items": [
      {
        "id": 1,
        "category_id": 3,
        "name": "Rent the Runway Dress",
        "brand": "Designer Brand",
        "description": "High-end designer dress available for rental, perfect for special occasions without the full purchase commitment.",
        "image": "https://img.rapidmock.dev/shop/693f60d0-abbb-11ef-b749-8bd93d9e632a.jpg",
        "price": 150,
        "stack_quantity": 10,
        "discount": "0.1",
        "created_at": "2023-01-01T00:00:00.000Z",
        "updated_at": "2023-01-10T00:00:00.000Z",
        "status": "available",
        "weight": "1.2",
        "discount_price": 135,
        "sku": "RTRD-001",
        "category": {
          "id": 3,
          "category_name": "dress"
        }
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "row_count": 79
    }
  }
}

Endpoint

/products/:id

Response Body

{
  "status": "success",
  "code": 200,
  "message": "",
  "data": {
    "id": 1,
    "category_id": 3,
    "name": "Rent the Runway Dress",
    "brand": "Designer Brand",
    "description": "High-end designer dress available for rental, perfect for special occasions without the full purchase commitment.",
    "image": "https://img.rapidmock.dev/shop/693f60d0-abbb-11ef-b749-8bd93d9e632a.jpg",
    "price": 150,
    "stack_quantity": 10,
    "discount": "0.1",
    "created_at": "2023-01-01T00:00:00.000Z",
    "updated_at": "2023-01-10T00:00:00.000Z",
    "status": "available",
    "weight": "1.2",
    "discount_price": 135,
    "sku": "RTRD-001",
    "category": {
      "id": 3,
      "category_name": "dress"
    }
  }
}

Endpoint

/products

Request Body

{
  "name": "string",
  "brand": "string",
  "description": "string",
  "image": "url",
  "price": "number",
  "category_id": "number (optional)",
  "stack_quantity": "number (default: 0)",
  "discount": "string (optional)",
  "status": "string (default: 'active')",
  "weight": "string (optional)",
  "discount_price": "number (optional)",
  "sku": "string (optional)"
}