Repairrabbit API Documentation

This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.

Environments

Our Demo API is located at:

https://demo.repairrabbit.co

Versioning

This API uses versioning as identified in the URI. Newer versions MAY introduce breaking changes.

/api/v2

If you are currently using the v1 of the API, you should read the Upgrade Guide to see what changed.

Authentication

  • This API uses JWT TOKEN authentication.

  • Token MUST be provided for each request that requires authentication.

  • The jwt token will respond for 24 hour after creating.

  • You can request a Token by using api for login (e.g api/v1/login).

Example Header

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlfa2V5IjoiZjE5NzMzODEyNjZjN2NiMTgyZDk5ZDIxZWI2YTUxZDc5MThkZDZiZiIsInN1YiI6MSwiaXNzIjoiaHR0cDovL3JlcGFpcnJhYmJpdC50ZXN0L2FwaS92MS9sb2dpbiIsImlhdCI6MTUyODQ0MDE3NiwiZXhwIjoxNTI4NDQzNzc2LCJuYmYiOjE1Mjg0NDAxNzYsImp0aSI6InRmM215V0ZjbE5KdWlzcFgifQ.xz5wsg41KKO8H82zFzHb4jtYy4aD-PCvVZKKyggemBg

HTTP Methods

This API uses HTTP verbs (methods) as following:

  • GET - Read - used to read (or retrieve) a representation of a resource,

  • POST - Create - used to create new resources.

  • PUT - Update - used to update an existing resource identified by a URI.

  • DELETE - Delete - used to delete a resource identified by a URI.

Media Type

Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.

Content-type: application/json and Accept: application/json headers SHOULD be set on all requests if not stated otherwise.

Notational Conventions

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC2119.

Representatin of Date and Time

All exchange of date and time-related data MUST be done according to ISO 8601 standard and stored in UTC.

When returning date and time-related data YYYY-MM-DDThh:mm:ss.SSSZ format MUST be used.

Status Codes and Errors

This API uses HTTP status codes to communicate with the API consumer.

  • 200 OK - Response to a successful GET, PUT, PATCH or DELETE.

  • 201 Created - Response to a POST that results in a creation.

  • 204 No Content - Response to a successful request that won’t be returning a body (like a DELETE request).

  • 400 Bad Request - Malformed request; form validation errors.

  • 401 Unauthorized - When no or invalid authentication details are provided.

  • 403 Forbidden - When authentication succeeded but authenticated user doesn’t have access to the resource.

  • 404 Not Found - When a non-existent resource is requested.

  • 405 Method Not Allowed - Method not allowed.

  • 406 Not Acceptable - Could not satisfy the request.

  • 415 Unsupported Media Type - Unsupported media type in request.

Error response

This API returns both, machine-readable error codes and human-readable error messages in response body when an error is encountered.

Authentication

User login

Get user login.

POST https://demo.repairrabbit.co/api/v1/login
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "login": "[email protected]",
  "password": "QXR0mi38a2"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "login": {
      "type": "string",
      "description": "User email address"
    },
    "password": {
      "type": "string",
      "description": "User password"
    }
  },
  "required": [
    "login",
    "password"
  ]
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6Ly9yZXBhaXJyYWJiaXQudGVzdC9hcGkvdjEvbG9naW4iLCJpYXQiOjE1MjY2MzQwMTQsImV4cCI6MTUyNjYzNzYxNCwibmJmIjoxNTI2NjM0MDE0LCJqdGkiOiJnRkVjcUVFS1c0cEFVWTdoIn0.gS3U8tIP-gGNMdevYTn2oPFOlV6XunRESqg3KwKchbQ",
  "user_id": 1,
  "username": "Admin",
  "email": "[email protected]",
  "api_key": "f1973381266c7cb182d99d21eb6a51d7918dd6bf",
  "role": 1,
  "password": true,
  "message": "Success",
  "href": "api/v1/login"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "email": [
      "The email field is required."
    ],
    "password": [
      "The password field is required."
    ]
  },
  "href": "api/v1/login"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "User not found."
  ],
  "href": "api/v1/login"
}

User Login
POST/api/v1/login

Allows to retrieve a valid jwt token for email and password.

Endpoint information

Requires authentication No

User logout

Get user logout.

GET https://demo.repairrabbit.co/api/v1/logout
Requestsexample 1
Headers
Content-Type: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "User logged out Successfully",
  "href": "api/v1/logout"
}

User logout
GET/api/v1/logout

Endpoint information

Requires authentication Yes

User profile

Get user detail.

GET https://demo.repairrabbit.co/api/v1/admin/user_profile
Requestsexample 1
Headers
Content-Type: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 2,
  "name": "StoreAdmin",
  "role_id": 1,
  "email": "[email protected]",
  "api_key": "196e4aee9e2348cc9e690af72618a262b6248956",
  "created_by": 1,
  "modified_by": 1,
  "created_at": "2018-05-18 10:44:01",
  "updated_at": "2018-05-18 11:37:39"
}

User detail
GET/api/v1/admin/user_profile

Endpoint information

Requires authentication Yes

User Reset Password

Get user reset password.

PUT https://demo.repairrabbit.co/api/v1/reset-password
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "current_password": "123245678",
  "new_password": "123245679",
  "new_password_confirmation": "123245679"
}
Schema
{
  "type": "object",
  "properties": {
    "current_password": {
      "type": "string",
      "description": "The password for the user"
    },
    "new_password": {
      "type": "string",
      "description": "The password for the user",
      "rule": "The min length is 6 and the max length is 30"
    },
    "new_password_confirmation": {
      "type": "string",
      "description": "The password for the user",
      "rule": "This must be same as new_password value"
    }
  },
  "required": [
    "current_password",
    "new_password",
    "new_password_confirmation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlfa2V5IjoiZjE5NzMzODEyNjZjN2NiMTgyZDk5ZDIxZWI2YTUxZDc5MThkZDZiZiIsInN1YiI6MSwiaXNzIjoiaHR0cDovL3JlcGFpcnJhYmJpdC50ZXN0L2FwaS92MS9yZXNldC1wYXNzd29yZCIsImlhdCI6MTUyOTY0ODYwOSwiZXhwIjoxNTI5NzM1MDA5LCJuYmYiOjE1Mjk2NDg2MDksImp0aSI6Img4c21Yd2ozM1czVlhZVjQifQ.lbSgogjdnQP4IS4guleV1P--d-GtvcTtPPv2Q27V6VI",
  "message": "Password changed successfully.",
  "href": "api/v1/reset-password"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "message": {
    "current_password": [
      "The current password field is required."
    ],
    "new_password": [
      "The new password field is required."
    ]
  },
  "href": "api/v1/reset-password"
}

User Reset Password
PUT/api/v1/reset-password

Endpoint information

Requires authentication Yes

User Forgot Password

Update user password.

PUT https://demo.repairrabbit.co/api/v1/forgot-password
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "email": "[email protected]",
}
Schema
{
    "type": "object",
    "properties": {
        "email": {
            "type": "email",
            "description": "The email the employee",
            "rule": "The min length is 8 and the max length is 60 and must exists from available users"
        }
    },
    "required": [
        "email"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "message": "Password updated successfully, please check your mail.",
  "href": "api/v1/forgot-password"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "message": {
    "email": [
      "The email field is required."
    ]
  },
  "href": "api/v1/forgot-password"
}

User Forgot Password
PUT/api/v1/forgot-password

Endpoint information

Requires authentication Yes

Other apis

Gets all device category

Retrieves a list of device_categories

GET https://demo.repairrabbit.co/api/v1/admin/device_categories?order=asc, desc&orderBy=name, id, etc.&perPage=3&search=&page=3&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "device_categories": {
    "current_page": 1,
    "data": [
      {
        "id": 2,
        "name": "Samsung",
        "description": "Samsung repair",
        "image": null,
        "created_by": 1,
        "created_at": "2018-06-14 15:06:18",
        "modified_by": 1,
        "updated_at": "2018-06-14 15:06:18",
        "image_url": "http://repairrabbit.test/storage/images/device_category_images/demo-reparatie-629ixv.jpg"
      },
      {
        "id": 1,
        "name": "iPhone",
        "description": "iPhone repair",
        "image": null,
        "created_by": 1,
        "created_at": "2018-06-14 15:06:18",
        "modified_by": 1,
        "updated_at": "2018-06-14 15:06:18",
        "image_url": "http://repairrabbit.test/storage/images/device_category_images/demo-reparatie-624ixv.jpg"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/device_categories",
    "per_page": 10,
    "prev_page_url": null,
    "to": 2,
    "total": 2
  },
  "meta": {
    "orderBy": "name",
    "sortOrder": "desc",
    "items_per_page": 10,
    "deviceCategoriesItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/device_categories"
}

Gets all device category
GET/api/v1/admin/device_categories{?order,orderBy,perPage,search,page,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: name, id, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

store_id
number (optional) Example: 1

Gives only selected store’s device categories.


Gets all device

Retrieves a list of devices

GET https://demo.repairrabbit.co/api/v1/devices?order=asc, desc&orderBy=device_name, category_name, id, etc.&perPage=3&search=&page=3&filterStatus=0&device_category_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "devices": {
    "current_page": 1,
    "data": [
      {
        "id": 2,
        "isActive": 1,
        "name": "Samsung Galaxy J2",
        "description": "Samsung Galaxy",
        "repair_duration": 34,
        "category_id": 2,
        "deviceCategory": "Samsung",
        "image_url": "http://repairrabbit.test/storage/images/device_images/device_iphone_test-32DiZ1.jpg",
        "is_product_added": true
      },
      {
        "id": 1,
        "isActive": 1,
        "name": "iPhone 5",
        "description": "Apple iPhone 5",
        "repair_duration": 30,
        "category_id": 1,
        "deviceCategory": "iPhone",
        "image_url": "http://repairrabbit.test/storage/images/device_images/device_iphone_test-32DiZ1.jpg",
        "is_product_added": true
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/devices",
    "per_page": 10,
    "prev_page_url": null,
    "to": 2,
    "total": 2
  },
  "meta": {
    "orderBy": "id",
    "sortOrder": "desc",
    "items_per_page": 10,
    "devicesItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": "",
    "device_status_options": [
      "All Devices",
      "Active",
      "Inactive"
    ],
    "device_status_filter_id": ""
  },
  "message": "",
  "href": "api/v1/devices"
}

Gets all device
GET/api/v1/devices{?order,orderBy,perPage,search,page,filterStatus,device_category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: device_name, category_name, id, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

1 : active status of device & 0 : inactive status of device

device_category_id
number (optional) Example: 1

Gives only selected device_category’s devices.


Gets all store

Retrieves a list of Store

GET https://demo.repairrabbit.co/api/v1/stores?order=asc, desc&orderBy=name, email, etc.&perPage=3&search=&page=3&filterStatus=0&device_id=0
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "stores": {
    "current_page": 1,
    "data": [
      {
        "id": 1,
        "address": "Rajkot",
        "address_display": "University Road",
        "phone": "085-7602727",
        "opening_hour": "08:30:00",
        "closing_hour": "12:30:00",
        "open_days": "1,2,3,4,5,6,7",
        "email": "[email protected]",
        "address_lat": "52.385991",
        "address_lon": "4.838108",
        "small_img": "",
        "colour": "#3b5998",
        "status": 1,
        "created_by": 1,
        "created_at": "2018-06-11 18:48:35",
        "modified_by": null,
        "updated_at": "2018-06-11 18:48:35",
        "small_image_url": "http://repairrabbit.test/storage/images/store_map_images/maxresdefault-T6nMEj.jpg"
      }
    ],
    "from": 1,
    "last_page": 2,
    "next_page_url": "http://repairrabbit.test/api/v1/stores?page=2",
    "path": "http://repairrabbit.test/api/v1/stores",
    "per_page": "1",
    "prev_page_url": null,
    "to": 1,
    "total": 2
  },
  "meta": {
    "orderBy": "name",
    "sortOrder": "desc",
    "items_per_page": "1",
    "storeItemListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": "",
    "filterStatus": "",
    "store_status_options": [
      "All Stores",
      "Active",
      "Inactive"
    ],
    "device_filter_id": 0,
    "device_filter_options": [
      {
        "id": 75,
        "name": "Accessories"
      },
      {
        "id": 1,
        "name": "iPhone 5"
      },
      {
        "id": 2,
        "name": "Samsung Galaxy J2"
      },
      {
        "id": 3,
        "name": "Samsung J5"
      }
    ]
  },
  "message": "",
  "href": "api/v1/stores"
}

Gets all Store.
GET/api/v1/stores{?order,orderBy,perPage,search,page,filterStatus,device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: name, email, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

1 : active status of store & 0 : inactive status of store

device_id
number (optional) Example: 0

id of device to get all stores that have this device


Gets all Product

Retrieves a list of Products

GET https://demo.repairrabbit.co/api/v1/products?order=asc, desc&orderBy=name, sku, device_name etc.&perPage=3&search=&page=3&device_id=0
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "products": {
    "current_page": 1,
    "data": [
      {
        "id": 2,
        "name": "On off switch",
        "description": "We also recycle the old broken displays by sending them back to the manufacturer.",
        "sku": "A000223",
        "price": "99.90",
        "buy_price": "100",
        "install_fee": "0",
        "image": "product_images/product_iphone_test-1XMfm5.jpg",
        "image_url": "http://repairrabbit.test/storage/images/product_images/product_iphone_test-1XMfm5.jpg",
        "maintain_stock": 1,
        "device_id": 2,
        "deviceName": "Samsung Galaxy J2"
      },
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "description": "We also recycle the old broken displays by sending them back to the manufacturer.",
        "sku": "A000210",
        "price": "69.90",
        "buy_price": "90",
        "install_fee": "0",
        "image": "product_images/product_iphone_test-1XMfm5.jpg",
        "image_url": "http://repairrabbit.test/storage/images/product_images/product_iphone_test-1XMfm5.jpg",
        "maintain_stock": 1,
        "device_id": 1,
        "deviceName": "iPhone 5"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/products",
    "per_page": "4",
    "prev_page_url": null,
    "to": 2,
    "total": 2
  },
  "meta": {
    "orderBy": "id",
    "sortOrder": "desc",
    "items_per_page": "4",
    "productsItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "device_filter_id": "2",
    "device_filter_options": [
      {
        "id": 96,
        "name": "Accessories"
      },
      {
        "id": 1,
        "name": "iPhone 5"
      },
      {
        "id": 2,
        "name": "Samsung Galaxy J2"
      },
      {
        "id": 3,
        "name": "Samsung J5"
      }
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/products"
}

Gets all product
GET/api/v1/products{?order,orderBy,perPage,search,page,device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: name, sku, device_name etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

device_id
number (optional) Example: 0

id of device to get products of it


View a store

GET https://demo.repairrabbit.co/api/v1/stores/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "store": {
    "id": 1,
    "address": "Rajkot",
    "address_display": "University Road",
    "phone": "085-7602727",
    "opening_hour": "08:30:00",
    "closing_hour": "12:30:00",
    "open_days": {
      "1": "Monday",
      "3": "Wednesday",
      "4": "Thursday",
      "6": "Saturday",
      "7": "Sunday"
    },
    "email": "[email protected]",
    "address_lat": "52.385991",
    "address_lon": "4.838108",
    "small_img": "",
    "colour": "#3b5998",
    "status": 1,
    "created_by": 1,
    "created_at": "2018-07-05 18:18:54",
    "modified_by": null,
    "updated_at": "2018-07-06 11:20:14",
    "closed_days": {
      "2": "Tuesday",
      "5": "Friday"
    },
    "small_image_url": null,
    "devices": [
      {
        "id": 1,
        "name": "iPhone 5",
        "pivot": {
          "store_id": 1,
          "device_id": 1
        }
      }
    ]
  },
  "message": "Store detail.",
  "href": "api/v1/stores/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/stores/12"
}

View a store
GET/api/v1/stores/{store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store.


Get Available time-slots for appointment

Retrieves available time-slots for appointment to repair device

GET https://demo.repairrabbit.co/api/v1/stores/1/devices/1?appointment_date=2018-06-29
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "date": "2018-06-29",
  "store": "1",
  "device": "1",
  "timeslots": {
    "1": "08:30 - 09:00",
    "2": "08:40 - 09:10",
    "3": "08:50 - 09:20",
    "4": "09:10 - 09:40",
    "5": "09:20 - 09:50",
    "6": "09:30 - 10:00",
    "7": "09:40 - 10:10",
    "8": "09:50 - 10:20",
    "9": "10:00 - 10:30"
  },
  "message": "Available timeslots.",
  "href": "api/v1/stores/1/devices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "device": [
      "The device field is required."
    ],
    "appointment_date": [
      "The appointment date field is required."
    ],
    "store": [
      "The store field is required."
    ]
  },
  "href": "api/v1/stores/1/devices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "date": "2018-06-05",
  "store": "1",
  "device": "1",
  "messages": [
    "Available timeslot not found."
  ],
  "href": "api/v1/stores/1/devices/1"
}

Get Available time-slots for appointment.
GET/api/v1/stores/{store_id}/devices/{device_id}{?appointment_date}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1
device_id
number (required) Example: 1
appointment_date
string (required) Example: 2018-06-29

Check email for users

GET https://demo.repairrabbit.co/api/v1/email-check?email=[email protected]&user_id=4
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-status": true,
  "message": "A user did not exist with this email.",
  "href": "api/v1/employees/email-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-status": false,
  "message": "A user already exists with this email.",
  "href": "api/v1/employees/email-check"
}

Check email for users
GET/api/v1/email-check{?email,user_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email
string (required) Example: [email protected]

Email to check wheather is exists.

user_id
number (required) Example: 4

Id of user required when edit own users’s email in usersdetail.


Appointment

Gets all Appointments

Retrieves a list of all Appointments in the database

GET https://demo.repairrabbit.co/api/v1/admin/appointments?order=asc, desc&orderBy=customer_name, employee_name, device_name, etc.&perPage=3&filterStatus=confirmed, no_show, retarget, warranty&search=&page=3&store_id=1&customer_id=1&in_progress=1
Responses200
Headers
Content-Type: application/json
Body
{
    "success": true,
    "appointments": {
        "current_page": 1,
        "data": [
            {
                "id": 16,
                "user_id": 4,
                "device_id": 2,
                "store_id": 2,
                "defect_description": null,
                "date_start_time": "2018-05-30 09:15:00",
                "date_end_time": "2018-05-30 09:49:00",
                "assigned_to": 3,
                "reminder_sent": 0,
                "confirmed": 1,
                "confirm_url": "vAo6tKxAoMVAU4ygKBcXVAkhtaQRDZmj",
                "delete_token": "F05nreSX5vQcygpGWZOUqvbnjFk8OxuD",
                "no_show": null,
                "imei": "123412341111111",
                "retarget": null,
                "warranty": null,
                "ticket_id": null,
                "created_by": 1,
                "created_at": "2018-05-25 14:37:09",
                "modified_by": null,
                "updated_at": "2018-05-25 14:37:09",
                "device_name": "Samsung Galaxy J2",
                "customer_name": "customer",
                "customer_email": "[email protected]",
                "employee_name": "employee3",
                "store_name": "Rajkot"
            },
        ],
        "from": 1,
        "last_page": 2,
        "next_page_url": "http://repairrabbit.test/api/v1/admin/appointments?page=2",
        "path": "http://repairrabbit.test/api/v1/admin/appointments",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 13
    },
    "meta": {
        "orderBy": "id",
        "sortOrder": "desc",
        "items_per_page": 10,
        "appointmentsItemListOptions": [
            10,
            20,
            30,
            40,
            50
        ],
        "appointmentConfirmedCount": 4,
        "appointmentNoShowCount": 2,
        "appointmentRetargetedCount": 2,
        "appointmentWarrantyCount": 1,
        "appointmentTotalCount": 13,
        "searchString": ""
    },
    "message": "",
    "href": "api/v1/admin/appointments"
}

Gets all Appointments.
GET/api/v1/admin/appointments{?order,orderBy,perPage,filterStatus,search,page,store_id,customer_id,in_progress}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: customer_name, employee_name, device_name, etc.
perPage
number (optional) Default: 10 Example: 3
filterStatus
string (optional) Example: confirmed, no_show, retarget, warranty
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

store_id
number (optional) Example: 1

Gives only selected store’s appointment.

customer_id
number (optional) Example: 1

Gives only selected customer’s appointment.

in_progress
number (optional) Example: 1

Gives listing of appointment which has no ticket.


Create an appointment

POST https://demo.repairrabbit.co/api/v1/admin/appointments
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "products": [1], /* product_ids of device */
    "userId": 4,
    "device": 2,
    "store": 2,
    "date": "2018-05-30",
    "timeSlot": "09:15 - 10:14",
    "imei": 123412341111111
}
Schema
{
    "type": "object",
    "properties": {
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products"
        },
        "userId": {
            "type": "number",
            "description": "The Id for the user",
            "rule": "The userId must exists from available user as customer role"
        },
        "device": {
            "type": "number",
            "description": "The ID of device for the appointment",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices",
            "required_without": "The value required when ticket_id not given"
        },
        "date": {
            "type": "date",
            "description": "The date for the appointment",
            "rule": "The date format must be YYYY-MM-DD",
            "required_without": "The value required when ticket_id not given"
        },
        "timeSlot": {
            "type": "time",
            "description": "The time slot for the appointment",
            "rule": "The value must be in time 24h with regex:/(^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9] - ([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$)/u",
            "required_without": "The value required when ticket_id not given"
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the appointment",
            "rule": "The max number of digits is 10 and must exists from available stores",
            "required_without": "The value required when ticket_id not given"
        },
        "imei": {
            "type": "number",
            "description": "The imei of device for the appointment",
            "rule": "The value must be between 15 to 16"
        }
    },
    "required": [
        "products",
        "userId"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "appointment": {
    "id": 4,
    "ticket_id": null,
    "user_id": 4,
    "assigned_to": 2,
    "device_id": 1,
    "store_id": 1,
    "date_start_time": "2018-07-05 09:00:00",
    "date_end_time": "2018-07-05 09:30:00",
    "imei": "352091073963244",
    "confirmed": 0,
    "no_show": 1,
    "retarget": 1,
    "warranty": 1,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:01:13",
    "ticket": null,
    "device": {
      "id": 1,
      "name": "iPhone 5"
    },
    "store": {
      "id": 1,
      "name": "Rajkot",
      "address": "University Road"
    },
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "appointment_id": 4,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 2,
      "user_id": 3,
      "user": {
        "id": 3,
        "name": "employee"
      }
    }
  },
  "message": "Appointment created successfully.",
  "href": "api/v1/admin/appointments"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "userId": [
      "The user id field is required."
    ],
    "device": [
      "The device field is required."
    ],
    "products": [
      "The products must be an array.",
      "The products must have at least 1 items."
    ],
    "date": [
      "The date field is required."
    ],
    "timeSlot": [
      "The time slot field is required."
    ],
    "store": [
      "The store field is required."
    ]
  },
  "href": "api/v1/admin/appointments"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Time slot not available"
  ],
  "href": "api/v1/admin/appointments"
}

Create an appointment
POST/api/v1/admin/appointments

Endpoint information

Requires authentication Yes

View an appointment

GET https://demo.repairrabbit.co/api/v1/admin/appointments/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "appointment": {
    "id": 4,
    "ticket_id": null,
    "user_id": 4,
    "assigned_to": 2,
    "device_id": 1,
    "store_id": 1,
    "date_start_time": "2018-07-05 09:00:00",
    "date_end_time": "2018-07-05 09:30:00",
    "imei": "352091073963244",
    "confirmed": 0,
    "no_show": 1,
    "retarget": 1,
    "warranty": 1,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:01:13",
    "ticket": null,
    "device": {
      "id": 1,
      "name": "iPhone 5"
    },
    "store": {
      "id": 1,
      "name": "Rajkot",
      "address": "University Road"
    },
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "appointment_id": 4,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 2,
      "user_id": 3,
      "user": {
        "id": 3,
        "name": "employee"
      }
    }
  },
  "message": "Appointment detail.",
  "href": "api/v1/admin/appointments/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Appointment not found."
  ],
  "href": "api/v1/admin/appointments/1"
}

View an appointment
GET/api/v1/admin/appointments/{appointment_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
appointment_id
number (required) Example: 1

Id of the appointment.


Edit an appointment

PUT https://demo.repairrabbit.co/api/v1/admin/appointments/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "products": [1], /* product_ids of device */
    "userId": 4,
    "device": 2,
    "store": 2,
    "date": "2018-05-30",
    "timeSlot": "08:40 - 09:14",
    "imei": "",
    "checkTime": 1 /* flag to change assign_to of appointment */
    "no_show": "",
    "confirmed": "",
    "retarget": "",
    "warranty": ""
}
Schema
{
    "type": "object",
    "properties": {
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products"
        },
        "userId": {
            "type": "number",
            "description": "The Id for the user",
            "rule": "The userId must exists from available user as customer role"
        },
        "device": {
            "type": "number",
            "description": "The ID of device for the appointment",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices",
            "required_without": "The value required when ticket_id not given"
        },
        "date": {
            "type": "date",
            "description": "The date for the appointment",
            "rule": "The date format must be YYYY-MM-DD",
            "required_without": "The value required when ticket_id not given"
        },
        "timeSlot": {
            "type": "time",
            "description": "The time slot for the appointment",
            "rule": "The value must be in time 24h with regex:/(^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9] - ([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$)/u",
            "required_without": "The value required when ticket_id not given"
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the appointment",
            "rule": "The max number of digits is 10 and must exists from available stores",
            "required_without": "The value required when ticket_id not given"
        },
        "imei": {
            "type": "number",
            "description": "The imei of device for the appointment",
            "rule": "The value must be between 15 to 16"
        },
        "no_show": {
            "type": "boolean",
            "description": "The no_show status for the appointment",
            "rule": "The value must be from 0 or 1"
        },
        "confirmed": {
            "type": "boolean",
            "description": "The confirmed status for the appointment",
            "rule": "The value must be from 0 or 1"
        },
        "retarget": {
            "type": "boolean",
            "description": "The retarget status for the appointment",
            "rule": "The value must be from 0 or 1"
        },
        "warranty": {
            "type": "boolean",
            "description": "The warranty status for the appointment",
            "rule": "The value must be from 0 or 1"
        }
    },
    "required": [
        "products",
        "userId"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "appointment": {
    "id": 4,
    "ticket_id": null,
    "user_id": 4,
    "assigned_to": 2,
    "device_id": 1,
    "store_id": 1,
    "date_start_time": "2018-07-05 09:00:00",
    "date_end_time": "2018-07-05 09:30:00",
    "imei": "352091073963244",
    "confirmed": 0,
    "no_show": 1,
    "retarget": 1,
    "warranty": 1,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:01:13",
    "ticket": null,
    "device": {
      "id": 1,
      "name": "iPhone 5"
    },
    "store": {
      "id": 1,
      "name": "Rajkot",
      "address": "University Road"
    },
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "appointment_id": 4,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 2,
      "user_id": 3,
      "user": {
        "id": 3,
        "name": "employee"
      }
    }
  },
  "message": "Appointment updated successfully.",
  "href": "api/v1/admin/appointments/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "userId": [
      "The user id field is required."
    ],
    "device": [
      "The device field is required."
    ],
    "products": [
      "The products must be an array.",
      "The products must have at least 1 items."
    ],
    "date": [
      "The date field is required."
    ],
    "timeSlot": [
      "The time slot field is required."
    ],
    "store": [
      "The store field is required."
    ]
  },
  "href": "api/v1/admin/appointments/1"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "messages": [
        "Time slot not available"
    ],
    "href": "api/v1/admin/appointments/1"
}
or
{
    "success": false,
    "messages": [
        "Appointment not found."
    ],
    "href": "api/v1/admin/appointments/1"
}

Edit an appointment
PUT/api/v1/admin/appointments/{appointment_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
appointment_id
number (required) Example: 1

Id of the appointment.


Delete an appointment

DELETE https://demo.repairrabbit.co/api/v1/admin/appointments/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Appointment deleted successfully.",
  "href": "api/v1/admin/appointments/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Appointment not found."
  ],
  "href": "api/v1/admin/appointments/1"
}

Delete an appointment
DELETE/api/v1/admin/appointments/{appointment_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
appointment_id
number (required) Example: 1

Id of the appointment.


Ticket

Gets all Tickets

Retrieves a list of all Tickets in the database

GET https://demo.repairrabbit.co/api/v1/admin/tickets?order=asc, desc&orderBy=customer_name, device_name, status, etc.&perPage=3&filterStatus=0&search=&page=3&store_id=1&customer_id=1&in_progress=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "tickets": {
    "current_page": 1,
    "data": [
      {
        "id": 1,
        "friendly_id": "YNT-400",
        "user_id": 4,
        "serial": "356476062721552",
        "device_id": 2,
        "store_id": 2,
        "employee_id": 3,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2017-07-05 17:33:14",
        "shipped_at": "2017-07-16 17:33:14",
        "paid_at": "2017-07-25 17:33:14",
        "access_code": "2890",
        "status_image": null,
        "problem_description": "Device picked up and paid at Donald on January 2nd.",
        "different_return_address": "Street 12, 80 ft. road\n                                         9698PA",
        "different_return_address_zip": "4878",
        "different_return_address_city": "Jamnagar",
        "status": 1,
        "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
        "internal_message": null,
        "payment_status": 0,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 1,
        "created_at": "2018-06-11 14:51:14",
        "modified_by": null,
        "updated_at": "2018-06-11 14:51:14",
        "status_image_url": "http://repairrabbit.test/storage/images/ticket_status_images/test-0rasPF.jpg",
        "customer_name": "customer",
        "customer_id": 1,
        "device_name": "Samsung Galaxy J2",
        "status_text": "Waiting for device",
        "store_name": "Ahmedabad",
        "employee_name": "employee3",
        "progress_bar_width": "100",
        "progress_bar_color": "progress-bar-danger"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/tickets",
    "per_page": "3",
    "prev_page_url": null,
    "to": 3,
    "total": 3
  },
  "meta": {
    "orderBy": "device_name",
    "sortOrder": "asc",
    "items_per_page": "3",
    "ticketsItemListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "waitingDeviceCount": 3,
    "inTransitCount": 0,
    "repairDoneCount": 0,
    "waitingForReplacedDeviceCount": 0,
    "deviceSentCount": 0,
    "mechanicWaitingCount": 0,
    "customerResWaitingCount": 0,
    "allTicketCount": 3,
    "ticket_status_filter_id": 0,
    "ticket_status_options": [
      {
        "id": 1,
        "name": "Waiting for device"
      },
      {
        "id": 2,
        "name": "In transit"
      },
      {
        "id": 3,
        "name": "Waiting for available mechanic"
      },
      {
        "id": 4,
        "name": "Device is investigated"
      },
      {
        "id": 5,
        "name": "Waiting for customer's response"
      },
      {
        "id": 9,
        "name": "Replacement device in process"
      },
      {
        "id": 10,
        "name": "Advanced level research needed"
      },
      {
        "id": 13,
        "name": "Device sent"
      },
      {
        "id": 14,
        "name": "Repair work done"
      },
      {
        "id": 16,
        "name": "Device manufacturer repair support"
      }
    ],
    "device_categories": [
      {
        "id": 1,
        "name": "iPhone"
      },
      {
        "id": 2,
        "name": "Samsung"
      }
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/tickets"
}

Gets all Tickets.
GET/api/v1/admin/tickets{?order,orderBy,perPage,filterStatus,search,page,store_id,customer_id,in_progress}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: updated_at Example: customer_name, device_name, status, etc.
perPage
number (optional) Default: 10 Example: 3
filterStatus
number (optional) Example: 0

status of tickets

search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

store_id
number (optional) Example: 1

Gives only selected store’s ticket.

customer_id
number (optional) Example: 1

Gives only selected customer’s ticket.

in_progress
number (optional) Example: 1

Gives listing of ticket which is not completed.


Create a ticket

POST https://demo.repairrabbit.co/api/v1/admin/tickets
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "device": 2
    "products": [1], /* product_ids of device */
    "userId": 4,
    "description": sdsdf,
    "serial": 123412341111111,
    "access_code": 123123,
    "status_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "device": {
            "type": "number",
            "description": "The ID of device for the ticket",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices",
        },
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products"
        },
        "userId": {
            "type": "number",
            "description": "The Id for the user",
            "rule": "The userId must exists from available user as customer role"
        },
        "description": {
            "type": "string",
            "description": "The description for the ticket"
        },
        "serial": {
            "type": "number",
            "description": "The serial of device for the ticket",
            "rule": "The value must be between 15 to 16"
        },
        "access_code": {
            "type": "string",
            "description": "The access_code of device for the ticket",
            "rule": "The max length is 30",
        },
        "status_image": {
            "type": "file",
            "description": "The device status image for the ticket",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        },
        "store_id": {
            "type": "number",
            "description": "The ID of store for the ticket",
            "rule": "The max number of digits is 10 and must exists from available active stores"
        }
    },
    "required": [
        "userId",
        "products",
        "device",
        "description",
        "serial",
        "access_code"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 2,
    "friendly_id": "XLP-620",
    "user_id": 4,
    "employee_id": 3,
    "device_id": 2,
    "store_id": 2,
    "serial": "358829051998292",
    "access_code": "2805",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2015-01-26 13:14:44",
    "status_image": "ticket_status_images/test-6TSUI1.jpg",
    "status_image_url": "http://repairrabbit.test/storage/images/ticket_status_images/test-6TSUI1.jpg",
    "problem_description": "Scherm defect.",
    "different_return_address": "Gokuldham society\n                                        9698PA",
    "different_return_address_zip": "4578745",
    "different_return_address_city": "Patan",
    "status": 1,
    "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:58:40",
    "ticket_status": {
      "id": 1,
      "name": "Waiting for device"
    },
    "device": {
      "id": 2,
      "name": "Samsung Galaxy J2"
    },
    "store": null,
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "ticket_id": 2,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": null
  },
  "message": "Ticket created successfully.",
  "href": "api/v1/admin/tickets"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "userId": [
      "The user id field is required."
    ],
    "products": [
      "The products must be an array.",
      "The products must have at least 1 items."
    ],
    "device": [
      "The device field is required."
    ],
    "description": [
      "The description field is required."
    ],
    "serial": [
      "The serial field is required."
    ],
    "access_code": [
      "The access code field is required."
    ]
  },
  "href": "api/v1/admin/tickets"
}

Create a ticket
POST/api/v1/admin/tickets

Endpoint information

Requires authentication Yes

View a ticket

GET https://demo.repairrabbit.co/api/v1/admin/tickets/XJH-856
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 2,
    "friendly_id": "XJH-856",
    "user_id": 4,
    "employee_id": 3,
    "device_id": 2,
    "store_id": 2,
    "serial": "358829051998292",
    "access_code": "2805",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2015-01-26 13:14:44",
    "status_image": "ticket_status_images/test-6TSUI1.jpg",
    "status_image_url": "http://repairrabbit.test/storage/images/ticket_status_images/test-6TSUI1.jpg",
    "problem_description": "Scherm defect.",
    "different_return_address": "Gokuldham society\n                                        9698PA",
    "different_return_address_zip": "4578745",
    "different_return_address_city": "Patan",
    "status": 1,
    "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:58:40",
    "ticket_status": {
      "id": 1,
      "name": "Waiting for device"
    },
    "device": {
      "id": 2,
      "name": "Samsung Galaxy J2"
    },
    "store": {
      "id": 2,
      "name": "Ahmedabad",
      "address": "Near City Mall"
    },
    "products": [
      {
        "id": 2,
        "name": "On off switch",
        "pivot": {
          "ticket_id": 2,
          "product_id": 2
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 3,
      "user_id": 6,
      "user": {
        "id": 6,
        "name": "employee3"
      }
    }
  },
  "message": "Ticket detail.",
  "href": "api/v1/admin/tickets/XLP-620"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/admin/tickets/XLP-620"
}

View a ticket
GET/api/v1/admin/tickets/{ticket_friendly_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: XJH-856

FriendlyId of the ticket.


Update a ticket

POST https://demo.repairrabbit.co/api/v1/admin/tickets/XJH-856
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "_method": "PUT",
    "device": 2,
    "products": [1], /* product_ids of device */
    "userId": 4,
    "serial": 123412341111111,
    "access_code": 123123,
    "status_image": "image/path",
    "store": 1,
    "different_return_address": "sdsf sfse",
    "different_return_address_city": "Rajkot",
    "different_return_address_zip": "360004",
    "stock_deducted_at": "2018-09-03",
    "status_id": 5
}
Schema
{
    "type": "object",
    "properties": {
        "device": {
            "type": "number",
            "description": "The ID of device for the ticket",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices",
            "required_without": "The value required when stock_deducted_at not given"
        },
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products",
            "required_without": "The value required when stock_deducted_at not given"
        },
        "userId": {
            "type": "number",
            "description": "The Id for the user",
            "rule": "The userId must exists from available user as customer role"
        },
        "serial": {
            "type": "number",
            "description": "The serial of device for the ticket",
            "rule": "The value must be between 15 to 16"
        },
        "access_code": {
            "type": "string",
            "description": "The access_code of device for the ticket",
            "rule": "The max length is 30",
        },
        "status_image": {
            "type": "file",
            "description": "The device status image for the ticket",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the ticket",
            "rule": "The max number of digits is 10 and must exists from available active stores"
        },
        "different_return_address":{
            "type": "string",
            "description": "The different_return_address for the ticket's user",
            "rule": "The max length is 255"
        },
        "different_return_address_city": {
            "type": "string",
            "description": "The different_return_address_city for the ticket's user",
            "rule": "The max length is 64"
        },
        "different_return_address_zip": {
            "type": "string",
            "description": "The different_return_address_zip for the ticket's user",
            "rule": "The max length is 16"
        },
        "stock_deducted_at": {
            "type": "date",
            "description": "The date for the ticket's stock deducted",
            "rule": "The date format must be YYYY-MM-DD"
        }
        "status_id": {
            "type": "number",
            "description": "The ID of ticket_status for the ticket",
            "rule": "The value must exists from available ticket_status"
        },
        "status_image": {
            "type": "file",
            "description": "The device status image for the ticket",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "userId",
        "serial",
        "access_code",
        "store"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 2,
    "friendly_id": "XLP-620",
    "user_id": 4,
    "employee_id": 3,
    "device_id": 2,
    "store_id": 2,
    "serial": "358829051998292",
    "access_code": "2805",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2015-01-26 13:14:44",
    "status_image": "ticket_status_images/test-6TSUI1.jpg",
    "status_image_url": "http://repairrabbit.test/storage/images/ticket_status_images/test-6TSUI1.jpg",
    "problem_description": "Scherm defect.",
    "different_return_address": "Gokuldham society\n                                        9698PA",
    "different_return_address_zip": "4578745",
    "different_return_address_city": "Patan",
    "status": 1,
    "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 1,
    "created_at": "2018-07-05 17:01:13",
    "modified_by": null,
    "updated_at": "2018-07-05 17:58:40",
    "ticket_status": {
      "id": 5,
      "name": "Waiting for customer's response"
    },
    "device": {
      "id": 1,
      "name": "iPhone 5"
    },
    "store": {
      "id": 1,
      "name": "Rajkot",
      "address": "University Road"
    },
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "ticket_id": 1,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": null
  },
  "message": "Ticket updated successfully.",
  "href": "api/v1/admin/tickets/YNT-400"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "userId": [
      "The user id field is required."
    ],
    "device": [
      "The device field is required when stock deducted at is not present."
    ],
    "products": [
      "The products field is required when stock deducted at is not present."
    ],
    "serial": [
      "The serial field is required."
    ],
    "access_code": [
      "The access code field is required."
    ],
    "store": [
      "The store field is required."
    ]
  },
  "href": "api/v1/admin/tickets/YNT-400"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/admin/tickets/YNT-400"
}

Update a ticket
POST/api/v1/admin/tickets/{ticket_friendly_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: XJH-856

FriendlyId of the ticket.


Delete a ticket

DELETE https://demo.repairrabbit.co/api/v1/admin/tickets/ZQK-195
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Ticket deleted successfully.",
  "href": "api/v1/admin/tickets/XLP-620"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/admin/tickets/XJH-856"
}

Delete a ticket
DELETE/api/v1/admin/tickets/{ticket_friendly_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: ZQK-195

FId of the ticket.


Deduct stock for a ticket

PUT https://demo.repairrabbit.co/api/v1/admin/tickets/XJH-856/deduct-stock'
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "friendly_id": "JCD-748",
    "message": "Stock deducted successfully for ticket.",
    "href": "api/v1/admin/tickets/JCD-748/deduct-stock"
}
or
{
    "success": true,
    "friendly_id": "JCD-748",
    "message": "Stock already deducted for ticket.",
    "href": "api/v1/admin/tickets/JCD-748/deduct-stock"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "messages": [
        "Ticket not found."
    ],
    "href": "api/v1/admin/tickets/JCD-748/deduct-stock"
}
or
{
    "success": false,
    "friendly_id": "JCD-748",
    "message": [
        "Please update ticket with available store."
    ],
    "href": "api/v1/admin/tickets/JCD-748/deduct-stock"
}

Deduct stock for a ticket
PUT/api/v1/admin/tickets/{ticket_friendly_id}/deduct-stock'

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: XJH-856

FriendlyId of the ticket.


Revert stock for a ticket

PUT https://demo.repairrabbit.co/api/v1/admin/tickets/XJH-856/revert-stock
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": false,
    "friendly_id": "JCD-748",
    "message": "Stock reverted successfully for ticket.",
    "href": "api/v1/admin/tickets/JCD-748/revert-stock"
}
or
{
    "success": true,
    "friendly_id": "JCD-748",
    "message": "Stock was not deducted for ticket.",
    "href": "api/v1/admin/tickets/JCD-748/revert-stock"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "messages": [
        "Ticket not found."
    ],
    "href": "api/v1/admin/tickets/JCD-748/revert-stock"
}
or
{
    "success": false,
    "friendly_id": "JCD-748",
    "message": [
        "Please update ticket with available store."
    ],
    "href": "api/v1/admin/tickets/JCD-748/revert-stock"
}

Revert stock for a ticket
PUT/api/v1/admin/tickets/{ticket_friendly_id}/revert-stock

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: XJH-856

FriendlyId of the ticket.


Restore a ticket

PUT https://demo.repairrabbit.co/api/v1/admin/tickets/JCD-748/restore
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "ticket": {
        "id": 3,
        "friendly_id": "JCD-748",
        "user_id": 4,
        "serial": "324892343594395",
        "device_id": 1,
        "store_id": 1,
        "employee_id": 2,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2015-01-26 13:14:44",
        "shipped_at": "2014-12-23 21:59:15",
        "paid_at": "2014-12-29 15:52:09",
        "access_code": "2805",
        "status_image": null,
        "problem_description": "Scherm defect.",
        "different_return_address": "Hoofdweg Wedderveer 17\n                                        9698PA",
        "different_return_address_zip": "232439",
        "different_return_address_city": "Wedde",
        "status": 1,
        "custom_message": "Toestel gerepareerd. Zodra de betaling binnen is sturen wij het toestel retour.",
        "internal_message": null,
        "payment_status": 0,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 3,
        "created_at": "2018-06-06 14:09:32",
        "modified_by": null,
        "updated_at": "2018-06-06 15:38:51"
    },
    "message": "Ticket restored successfully.",
    "href": "api/v1/admin/restore-ticket/JCD-748"
}
or
{
    "success": true,
    "ticket": {
        "id": 1,
        "friendly_id": "JCD-748",
        "user_id": 4,
        "serial": "356476062721552",
        "device_id": 2,
        "store_id": 2,
        "employee_id": 1,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2017-07-05 17:33:14",
        "shipped_at": "2017-07-16 17:33:14",
        "paid_at": "2017-07-25 17:33:14",
        "access_code": "2890",
        "status_image": null,
        "problem_description": "Device picked up and paid at Donald on January 2nd.",
        "different_return_address": "Street 12, 80 ft. road\n                                         9698PA",
        "different_return_address_zip": "4878",
        "different_return_address_city": "Jamnagar",
        "status": 1,
        "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
        "internal_message": null,
        "payment_status": 0,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 1,
        "created_at": "2018-06-06 16:17:30",
        "modified_by": null,
        "updated_at": "2018-06-06 16:20:49"
    },
    "message": "Ticket was already stored.",
    "href": "api/v1/admin/restore-ticket/JCD-748"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/admin/tickets/JCD-748/restore"
}

Restore a ticket
PUT/api/v1/admin/tickets/{ticket_friendly_id}/restore

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: JCD-748

FriendlyId of the ticket.


Add product damage reason for a ticket

POST https://demo.repairrabbit.co/api/v1/admin/tickets/damage-product
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "product": 1,
  "ticket_friendly_id": "MCD-748",
  "reason": "Screen damaged"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": "JCD-748",
  "message": "Damaged reason added successfully for product of given ticket.",
  "href": "api/v1/admin/tickets/damage-product"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "product": [
            "The product field is required."
        ],
        "ticket_friendly_id": [
            "The ticket friendly id field is required."
        ],
        "reason": [
            "The reason field is required."
        ]
    },
    "href": "api/v1/admin/tickets/damage-product"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Given product is not associated with the given ticket."
    ],
    "href": "api/v1/admin/tickets/damage-product"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "messages": [
        "Please update ticket with available store."
    ],
    "href": "api/v1/admin/tickets/damage-product"
}
or
{
    "success": false,
    "messages": [
        "Please assign ticket with available employee."
    ],
    "href": "api/v1/admin/tickets/damage-product"
}

Add product damage reason for a ticket
POST/api/v1/admin/tickets/damage-product

Endpoint information

Requires authentication Yes

Generate ticket from an appointment

POST https://demo.repairrabbit.co/api/v1/admin/appointments/3/tickets
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "ticket": {
        "id": 6,
        "friendly_id": "KWW-487",
        "user_id": 4,
        "employee_id": 3,
        "device_id": 2,
        "store_id": 2,
        "serial": "352091073963244",
        "access_code": null,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2018-07-05 18:07:08",
        "status_image": null,
        "status_image_url": null,
        "problem_description": null,
        "different_return_address": null,
        "different_return_address_zip": null,
        "different_return_address_city": null,
        "status": 3,
        "custom_message": null,
        "internal_message": null,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 1,
        "created_at": "2018-07-05 18:07:08",
        "modified_by": null,
        "updated_at": "2018-07-05 18:07:08",
        "ticket_status": {
            "id": 3,
            "name": "Waiting for available mechanic"
        },
        "device": {
            "id": 2,
            "name": "Samsung Galaxy J2"
        },
        "store": {
            "id": 2,
            "name": "Ahmedabad",
            "address": "Near City Mall"
        },
        "products": [
            {
                "id": 2,
                "name": "On off switch",
                "pivot": {
                    "ticket_id": 6,
                    "product_id": 2
                }
            }
        ],
        "user": {
            "id": 4,
            "name": "customer",
            "email": "[email protected]",
            "customer": {
                "id": 1,
                "user_id": 4,
                "phone": "0633836781",
                "company_name": "Samsung Service Center",
                "address_zip": "1424PN",
                "address_city": "Rajkot"
            }
        },
        "employee": {
            "id": 3,
            "user_id": 6,
            "user": {
                "id": 6,
                "name": "employee3"
            }
        }
    },
    "message": "Ticket Generated Successfully for this appointment.",
    "href": "api/v1/admin/appointments/3/tickets"
}
or
{
    "success": true,
    "ticket": {
        "id": 6,
        "friendly_id": "KWW-487",
        "user_id": 4,
        "employee_id": 3,
        "device_id": 2,
        "store_id": 2,
        "serial": "352091073963244",
        "access_code": null,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2018-07-05 18:07:08",
        "status_image": null,
        "status_image_url": null,
        "problem_description": null,
        "different_return_address": null,
        "different_return_address_zip": null,
        "different_return_address_city": null,
        "status": 3,
        "custom_message": null,
        "internal_message": null,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 1,
        "created_at": "2018-07-05 18:07:08",
        "modified_by": null,
        "updated_at": "2018-07-05 18:07:08",
        "ticket_status": {
            "id": 3,
            "name": "Waiting for available mechanic"
        },
        "device": {
            "id": 2,
            "name": "Samsung Galaxy J2"
        },
        "store": {
            "id": 2,
            "name": "Ahmedabad",
            "address": "Near City Mall"
        },
        "products": [
            {
                "id": 2,
                "name": "On off switch",
                "pivot": {
                    "ticket_id": 6,
                    "product_id": 2
                }
            }
        ],
        "user": {
            "id": 4,
            "name": "customer",
            "email": "[email protected]",
            "customer": {
                "id": 1,
                "user_id": 4,
                "phone": "0633836781",
                "company_name": "Samsung Service Center",
                "address_zip": "1424PN",
                "address_city": "Rajkot"
            }
        },
        "employee": {
            "id": 3,
            "user_id": 6,
            "user": {
                "id": 6,
                "name": "employee3"
            }
        }
    },
    "message": "Ticket already generated for this appointment.",
    "href": "api/v1/admin/appointments/3/tickets"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Appointment not found."
  ],
  "href": "api/v1/admin/appointments/3/tickets"
}

Ticket from an appointment
POST/api/v1/admin/appointments/{appointment_id}/tickets

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
appointment_id
string (required) Example: 3

Id of an appointment.


Get ticket history

GET https://demo.repairrabbit.co/api/v1/admin/tickets/XJH-856/history?order=asc, desc&orderBy=customer_name, device_name, store_name, employee_name, updatedBy_name, status, etc.&perPage=3&filterStatus=0&search=&page=3
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket_friendly_id": "YNT-400",
  "ticket_history": {
    "current_page": 1,
    "data": [
      {
        "ticket_friendly_id": "YNT-400",
        "id": 2,
        "paid_at": "2017-07-25 17:33:14",
        "ticket_id": 1,
        "status": "1",
        "device_id": 2,
        "store_id": null,
        "product": "",
        "employee_id": 6,
        "serial": null,
        "access_code": null,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_image": null,
        "problem_description": "thick point",
        "custom_message": "Too many damages!!",
        "polis_number": null,
        "internal_message": null,
        "different_return_address": null,
        "different_return_address_zip": null,
        "different_return_address_city": null,
        "created_by": 1,
        "created_at": "2018-06-07 14:49:11",
        "modified_by": null,
        "updated_at": "2018-06-07 14:49:11",
        "status_name": "Waiting for device",
        "status_last_changed_at": "2017-07-05 17:33:14",
        "device_name": "Samsung Galaxy J2",
        "updatedBy_name": null,
        "employee_name": "employee3",
        "store_address": null,
        "createdBy_name": "Admin"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/tickets/YNT-400/history",
    "per_page": "3",
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "status",
    "sortOrder": "asc",
    "items_per_page": "3",
    "tickethistorysItemListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/tickets/YNT-400/history"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/admin/tickets/YNT-400/history"
}

Get ticket history
GET/api/v1/admin/tickets/{ticket_friendly_id}/history{?order,orderBy,perPage,filterStatus,search,page}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: XJH-856

FriendlyId of the ticket.

order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: updated_at Example: customer_name, device_name, store_name, employee_name, updatedBy_name, status, etc.
perPage
number (optional) Default: 10 Example: 3
filterStatus
number (optional) Example: 0

status of tickets

search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data


Customer

Gets all customers

Retrieves a list of Customers

GET https://demo.repairrabbit.co/api/v1/admin/customers?order=asc, desc&orderBy=name, email, etc.&perPage=3&search=&page=3
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "customers": {
    "current_page": 1,
    "data": [
      {
        "user_id": 5,
        "salutation": "mr",
        "customer_name": "customer1",
        "customer_email": "[email protected]",
        "dob": "2017-05-20",
        "phone": "0633367813",
        "company_name": "MI care",
        "purpose": "business",
        "extra_instructions": null,
        "address": "150 ft. ring road",
        "address_zip": "1424PNsfw",
        "address_city": "Ahmedabad",
        "payment_exception": 0
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/customers",
    "per_page": 10,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "user_id",
    "sortOrder": "desc",
    "items_per_page": 10,
    "customersItemListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/customers"
}

Gets all Customers.
GET/api/v1/admin/customers{?order,orderBy,perPage,search,page}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: user_id Example: name, email, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data


Create a customer

POST https://demo.repairrabbit.co/api/v1/admin/customers
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Irving I Jama",
  "email": "[email protected]",
  "password": "123456",
  "phone": "006-317-1399",
  "address": "Marimbalaan 92",
  "address_zip": "3438 GB",
  "address_city": "Nieuwegein",
  "salutation": "er",
  "dob": "2018-06-10",
  "purpose": "business",
  "company_name": "Delchamps",
  "extra_instructions": "adaadsdasdasdsx",
  "payment_exception": "1"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the customer",
            "rule": "The max length is 250"
        },
        "email": {
            "type": "email",
            "description": "The email the customer",
            "rule": "The max length is 60 and must be unique"
        },
        "password": {
            "type": "string",
            "description": "The password for the customer",
            "rule": "The min length is 6 and the max length is 30"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the customer",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address": {
            "type": "string",
            "description": "The address for the customer",
            "rule": "The min length is 10 amd the max length is 150 with regex:/(^[a-zA-Z0-9\s,.-]*$)/"
        },
        "address_zip": {
            "type": "string",
            "description": "The address_zip for the customer",
            "rule": "The min length is 3 amd the max length is 16"
        },
        "address_city": {
            "type": "string",
            "description": "The address_city for the customer",
            "rule": "The min length is 3 amd the max length is 60 regex:/(^[a-zA-Z]+(?:[\s-.][a-zA-Z]+)*$)/"
        },
        "salutation": {
            "type": "string",
            "description": "The salutation for the customer",
            "rule": "The max length is 32"
        },
        "dob": {
            "type": "date",
            "description": "The dob for the customer",
            "rule": "The date format must be YYYY-MM-DD and must be date before current date"
        },
        "purpose": {
            "type": "string",
            "description": "The purpose for the customer",
            "rule": "The value must be from business,consumer"
        },
        "company_name": {
            "type": "string",
            "description": "The company_name for the customer",
            "rule": "The max length is 100",
            "required_if": "The purpose is business"
        },
        "extra_instructions": {
            "type": "string",
            "description": "The extra_instructions for the customer",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "payment_exception": {
            "type": "string",
            "description": "The payment_exception for the customer",
            "rule": "The value must be from 0,1"
        }
    },
    "required": [
        "name",
        "email",
        "password"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "customer": {
    "id": 17,
    "user_id": 22,
    "salutation": "er",
    "company_name": "Delchamps",
    "purpose": "business",
    "extra_instructions": "adaadsdasdasdsx",
    "address": "Marimbalaan 92",
    "address_zip": "3438 GB",
    "address_city": "Nieuwegein",
    "dob": "2018-06-10",
    "phone": "006-317-1399",
    "payment_exception": 1,
    "created_by": 3,
    "created_at": "2018-06-11 11:31:33",
    "modified_by": null,
    "updated_at": "2018-06-11 11:31:33",
    "user": {
      "id": 22,
      "name": "Irving I Jama",
      "role_id": 4,
      "email": "[email protected]",
      "api_key": null,
      "created_by": 3,
      "modified_by": null,
      "created_at": "2018-06-11 11:31:33",
      "updated_at": "2018-06-11 11:31:33"
    }
  },
  "message": "Customer created successfully.",
  "href": "api/v1/admin/customers"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email has already been taken."
    ]
  },
  "href": "api/v1/admin/customers"
}

Create a customer
POST/api/v1/admin/customers

Endpoint information

Requires authentication Yes

View a customer

GET https://demo.repairrabbit.co/api/v1/admin/customers/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "customer": {
    "id": 1,
    "user_id": 4,
    "salutation": "testing",
    "company_name": "Samsung Service Center",
    "purpose": "business",
    "extra_instructions": null,
    "address": "Street 5, M.G road",
    "address_zip": "1424PN",
    "address_city": "Rajkot",
    "dob": "2017-05-30",
    "phone": "0633836781",
    "payment_exception": 0,
    "created_by": 1,
    "created_at": "2018-06-11 10:43:53",
    "modified_by": 1,
    "updated_at": "2018-06-11 10:43:53",
    "user": {
      "id": 4,
      "name": "customer",
      "role_id": 4,
      "email": "[email protected]",
      "api_key": "c6c587bbc6893c6cb2417547647854bb2d4ff2a0",
      "created_by": 1,
      "modified_by": 1,
      "created_at": "2018-06-11 10:43:53",
      "updated_at": "2018-06-11 10:43:53"
    }
  },
  "message": "Customer detail.",
  "href": "api/v1/admin/customers/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Customer not found."
  ],
  "href": "api/v1/admin/customers/112"
}

View a customer
GET/api/v1/admin/customers/{customer_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
customer_id
number (required) Example: 1

Id of the customer.


Update a customer

PUT https://demo.repairrabbit.co/api/v1/admin/customers/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Irving I Jama",
  "email": "[email protected]",
  "password": "",
  "phone": "006-317-1399",
  "address": "Marimbalaangggg 92",
  "address_zip": "",
  "address_city": "",
  "salutation": "",
  "dob": "",
  "purpose": "",
  "company_name": "",
  "extra_instructions": "",
  "payment_exception": "1"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the customer",
            "rule": "The max length is 250"
        },
        "email": {
            "type": "email",
            "description": "The email the customer",
            "rule": "The max length is 60 and must be unique"
        },
        "password": {
            "type": "string",
            "description": "The password for the customer",
            "rule": "The min length is 6 and the max length is 30"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the customer",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address": {
            "type": "string",
            "description": "The address for the customer",
            "rule": "The min length is 10 amd the max length is 150 with regex:/(^[a-zA-Z0-9\s,.-]*$)/"
        },
        "address_zip": {
            "type": "string",
            "description": "The address_zip for the customer",
            "rule": "The min length is 3 amd the max length is 16"
        },
        "address_city": {
            "type": "string",
            "description": "The address_city for the customer",
            "rule": "The min length is 3 amd the max length is 60 regex:/(^[a-zA-Z]+(?:[\s-.][a-zA-Z]+)*$)/"
        },
        "salutation": {
            "type": "string",
            "description": "The salutation for the customer",
            "rule": "The max length is 32"
        },
        "dob": {
            "type": "date",
            "description": "The dob for the customer",
            "rule": "The date format must be YYYY-MM-DD and must be date before current date"
        },
        "purpose": {
            "type": "string",
            "description": "The purpose for the customer",
            "rule": "The value must be from business,consumer"
        },
        "company_name": {
            "type": "string",
            "description": "The company_name for the customer",
            "rule": "The max length is 100",
            "required_if": "The purpose is business"
        },
        "extra_instructions": {
            "type": "string",
            "description": "The extra_instructions for the customer",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "payment_exception": {
            "type": "string",
            "description": "The payment_exception for the customer",
            "rule": "The value must be from 0,1"
        }
    },
    "required": [
        "name",
        "email",
        "password"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "customer": {
    "id": 1,
    "user_id": 4,
    "salutation": "testing",
    "company_name": "Samsung Service Center",
    "purpose": "business",
    "extra_instructions": null,
    "address": "Marimbalaangggg 92",
    "address_zip": "1424PN",
    "address_city": "Rajkot",
    "dob": "2017-05-30",
    "phone": "006-317-1399",
    "payment_exception": 1,
    "created_by": 1,
    "created_at": "2018-06-11 11:34:04",
    "modified_by": 3,
    "updated_at": "2018-06-11 11:48:17",
    "user": {
      "id": 4,
      "name": "Irving I Jama",
      "role_id": 4,
      "email": "[email protected]",
      "api_key": "c6c587bbc6893c6cb2417547647854bb2d4ff2a0",
      "created_by": 1,
      "modified_by": 3,
      "created_at": "2018-06-11 11:34:04",
      "updated_at": "2018-06-11 11:48:17"
    }
  },
  "message": "Customer updated successfully.",
  "href": "api/v1/admin/customers/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email field is required."
    ]
  },
  "href": "api/v1/admin/customers/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Customer not found."
  ],
  "href": "api/v1/admin/customers/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Customer [email protected] already exists."
  ],
  "href": "api/v1/admin/customers/1"
}

Update a customer
PUT/api/v1/admin/customers/{customer_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
customer_id
number (required) Example: 1

Id of the customer.


Delete a customer

DELETE https://demo.repairrabbit.co/api/v1/admin/customers/ZQK-195
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Customer deleted successfully.",
  "href": "api/v1/admin/customers/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Customer not found."
  ],
  "href": "api/v1/admin/customers/24"
}

Delete a customer
DELETE/api/v1/admin/customers/{customer_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
customer_id
string (required) Example: ZQK-195

Id of the customer.


Check email for customer

GET https://demo.repairrabbit.co/api/v1/admin/customers/email-check?email=[email protected]&user_id=4
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-status": true,
  "message": "A user did not exist with this email.",
  "href": "api/v1/admin/customers/email-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-status": false,
  "message": "A user already exists with this email.",
  "href": "api/v1/admin/customers/email-check"
}

Check email for customer
GET/api/v1/admin/customers/email-check{?email,user_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email
number (required) Example: [email protected]

Email to check wheather is exists.

user_id
number (required) Example: 4

Id of user required when edit own email in customer profile.


Send password to customer

PUT https://demo.repairrabbit.co/api/v1/admin/customers/send-password
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Password send Successfully.",
  "href": "api/v1/admin/customers/send-password"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": {
    "email": [
      "The selected email is invalid."
    ]
  },
  "href": "api/v1/admin/customers/send-password"
}

Send password to customer
PUT/api/v1/admin/customers/send-password

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email
number (required) Example: [email protected]

Email to send password for that user.


Import Sample Cutomer Data

POST https://demo.repairrabbit.co/api/v1/admin/customers/import-excel
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "messages": "File Imported successfully.",
  "href": "api/v1/admin/customers/import-excel"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "import_file": [
      "The import file field is required."
    ]
  },
  "href": "api/v1/admin/customers/import-excel"
}

Import Sample Cutomer Data
POST/api/v1/admin/customers/import-excel

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
import_file
file (required) Example: CustomerData.csv

File to import customer data.


Export Sample Cutomer Data

GET https://demo.repairrabbit.co/api/v1/admin/customers/download/sample
Responses200400
Headers
Content-Type: multipart/form-data
Body
{
  "success": true,
  "data": "\"user_id\",\"customer_name\",\"customer_email\",\"id\",\"salutation\",\"company_name\",\"purpose\",\"extra_instructions\",\"address\",\"address_zip\",\"address_city\",\"dob\",\"phone\",\"payment_exception\",\"created_by\",\"created_at\",\"modified_by\",\"updated_at\",\"deleted_by\",\"deleted_at\"\n\"72\",\"customer\",\"[email protected]\",\"1\",\"Mrs.\",\"Bradtke-Kovacek\",\"business\",\"\",\"47038 Rene Mountain Suite 588\nNorth Myriamport, NV 67720-9871\",\"87216\",\"Jenniferside\",\"2012-03-24\",\"1-951-601-5251 x226\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"78\",\"Adrian Macejkovic\",\"[email protected]\",\"2\",\"Mrs.\",\"Dietrich, Gislason and Senger\",\"business\",\"\",\"5497 Brant Junction\nWest Kaycee, NJ 07069\",\"82769-7573\",\"New Javon\",\"1943-01-08\",\"767-280-1002 x29204\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"33\",\"Mrs. Alicia Funk DDS\",\"[email protected]\",\"3\",\"Mrs.\",\"Wiza-Lemke\",\"business\",\"\",\"979 Cathryn Creek Apt. 290\nPort Izabellamouth, MT 41146\",\"93305-6996\",\"Port Tre\",\"1919-07-25\",\"1-246-201-1769 x94646\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"94\",\"Lilly Effertz II\",\"[email protected]\",\"4\",\"Ms.\",\"Thiel LLC\",\"business\",\"\",\"17713 Sylvan Plaza Suite 808\nHauckhaven, ND 64276\",\"20155-9140\",\"Kunzetown\",\"1999-12-29\",\"1-607-979-2933 x700\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"37\",\"Jovany Kub\",\"[email protected]\",\"5\",\"Mrs.\",\"Towne, Predovic and Wisoky\",\"business\",\"\",\"26217 Lubowitz Lake\nMontyborough, IN 68888\",\"33995\",\"South Marcellusfort\",\"1959-08-14\",\"789.813.0515\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"42\",\"Dewayne Kunze DVM\",\"[email protected]\",\"6\",\"Mr.\",\"Bauch, Rogahn and Gorczany\",\"business\",\"\",\"996 Margot Stream Suite 969\nSadiemouth, AL 13902\",\"79212\",\"East Enricomouth\",\"2015-07-11\",\"485-955-9632 x880\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"75\",\"Brain Romaguera\",\"[email protected]\",\"7\",\"Ms.\",\"Streich-Krajcik\",\"business\",\"\",\"223 Mann Orchard\nStokesbury, KS 64170\",\"68498-6876\",\"Johnsonhaven\",\"1994-11-01\",\"405.416.1068\",\"\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"41\",\"Luisa Treutel\",\"[email protected]\",\"8\",\"Mr.\",\"Casper-Medhurst\",\"business\",\"\",\"89450 Lexie Extension Apt. 077\nNikoshire, OK 88892\",\"50761-5874\",\"Douglasland\",\"1940-09-22\",\"761.675.4022\",\"\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"77\",\"Jennyfer Koch\",\"[email protected]\",\"9\",\"Mr.\",\"Sanford Group\",\"business\",\"\",\"66150 Deshawn Track\nVeumland, TN 88082\",\"57858\",\"East Deronland\",\"1968-05-16\",\"734.959.9092\",\"\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\"33\",\"Jakob Graham\",\"[email protected]\",\"10\",\"Mr.\",\"Streich Inc\",\"business\",\"\",\"8379 Kihn Lock\nWalkerberg, KY 55968-7683\",\"69151-3980\",\"Tesstown\",\"1964-10-12\",\"(327) 636-7181\",\"1\",\"1\",\"2017-10-10 08:08:23\",\"\",\"2017-10-10 13:38:23\",\"\",\"\"\n\n",
  "href": "api/v1/admin/customers/download/sample"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": "File not found.",
  "href": "api/v1/admin/customers/download/sample"
}

Export Sample Cutomer Data
GET/api/v1/admin/customers/download/sample

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
import_file
file (required) Example: CustomerData.csv

File to import customer data.


Store

Create a store

POST https://demo.repairrabbit.co/api/v1/admin/stores
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "store_name": "qwe121",
    "address": "Utreate", /* product_ids of device */
    "phone": 1231233211,
    "address_lat": 12,
    "address_lon": 121,
    "opening_hour": "9:00",
    "closing_hour": "18:00",
    "working_days": [1,2,3,4,5],
    "email": '[email protected]',
    "colour": "#121313",
    "map_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "store_name": {
            "type": "string",
            "description": "The name for the store",
            "rule": "The min length is 3 and the max length is 50"
        },
        "address": {
            "type": "string",
            "description": "The address for the store",
            "rule": "The regex is /([- ,\/0-9a-zA-Z]+)/"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the store",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address_lat": {
            "type": "number",
            "description": "The address latitude for the store",
            "rule": "The regex is /(^(+|-)?(?:90(?:(?:.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:.[0-9]{1,6})?))$)/u"
        },
        "address_lon": {
            "type": "number",
            "description": "The address longitude for the store",
            "rule": "The regex is /(^(+|-)?(?:90(?:(?:.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:.[0-9]{1,6})?))$)/u"
        },
        "opening_hour": {
            "type": "time",
            "description": "The opening hours for the store",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
        },
        "closing_hour": {
            "type": "time",
            "description": "The closing hours for the store",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
        },
        "working_days": {
            "type": "array",
            "description": "The working days for the store",
            "rule": "The days must be from [1,2,3,4,5,6,7]"
        },
        "email": {
            "type": "email",
            "description": "The email the store",
            "rule": "The min length is 8 and the max length is 60"
        },
        "colour": {
            "type": "string",
            "description": "The colour for the store",
            "rule": "The regex is /(^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$)/u"
        },
        "map_image": {
            "type": "file",
            "description": "The map image for the store",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        },
        "status": {
            "type": "number",
            "description": "The status for the store",
            "rule": "The status from value true:1 or false:0"
        },
        "devices": {
            "type": "array",
            "description": "The ID of devices for the store",
            "rule": "The device id must be number and exists from devices"
        }
    },
    "required": [
        "store_name",
        "email",
        "address",
        "phone",
        "opening_hour",
        "closing_hour",
        "working_days"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "store": {
    "id": 3,
    "address": "qwe",
    "address_display": "qweqwe",
    "phone": "1231231231",
    "opening_hour": "09:00:00",
    "closing_hour": "18:00:00",
    "open_days": "1",
    "email": "[email protected]",
    "address_lat": "12.000000",
    "address_lon": "123.000000",
    "small_img": "store_map_images/maxresdefault-i0xwnd.jpg",
    "colour": "#121313",
    "status": 1,
    "created_by": 1,
    "created_at": "2018-06-12 11:00:24",
    "modified_by": null,
    "updated_at": "2018-06-12 11:00:24",
    "open_day_string": {
      "1": "Monday"
    },
    "small_image_url": "http://repairrabbit.test/storage/images/store_map_images/p2-nHYY6T.jpg",
    "devices": [
      {
        "id": 1,
        "name": "iPhone 5",
        "pivot": {
          "store_id": 1,
          "device_id": 1
        }
      }
    ]
  },
  "message": "Store created successfully.",
  "href": "api/v1/admin/stores"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "store_name": [
      "The store name has already been taken."
    ],
    "email": [
      "The email field is required."
    ],
    "phone": [
      "The phone field is required."
    ],
    "address": [
      "The address field is required."
    ],
    "opening_hour": [
      "The opening hour field is required."
    ],
    "closing_hour": [
      "The closing hour field is required."
    ],
    "working_days": [
      "The working days field is required."
    ],
    "colour": [
      "The colour field is required."
    ]
  },
  "href": "api/v1/admin/stores"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Store name 'qwe12134e' already exists."
  ],
  "href": "api/v1/admin/stores"
}

Create a store
POST/api/v1/admin/stores

Endpoint information

Requires authentication Yes

Update a store

GET https://demo.repairrabbit.co/api/v1/admin/stores/1
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "_method": "PUT",
    "store_name": "qwe121",
    "address": "Utreate",
    "phone": 1231233211,
    "address_lat": 12,
    "address_lon": 121,
    "opening_hour": "9:00",
    "closing_hour": "18:00",
    "working_days": [1,2,3,4,5],
    "email": '[email protected]',
    "colour": "#121313",
    "map_image": "image/path",
    "status": 1,
    "devices": [1],
    "sell_accessories": "yes"
}
Schema
{
    "type": "object",
    "properties": {
        "store_name": {
            "type": "string",
            "description": "The name for the store",
            "rule": "The min length is 3 and the max length is 50"
        },
        "address": {
            "type": "string",
            "description": "The address for the store",
            "rule": "The regex is /([- ,\/0-9a-zA-Z]+)/"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the store",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address_lat": {
            "type": "number",
            "description": "The address latitude for the store",
            "rule": "The regex is /(^(+|-)?(?:90(?:(?:.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:.[0-9]{1,6})?))$)/u"
        },
        "address_lon": {
            "type": "number",
            "description": "The address longitude for the store",
            "rule": "The regex is /(^(+|-)?(?:90(?:(?:.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:.[0-9]{1,6})?))$)/u"
        },
        "opening_hour": {
            "type": "time",
            "description": "The opening hours for the store",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
        },
        "closing_hour": {
            "type": "time",
            "description": "The closing hours for the store",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
        },
        "working_days": {
            "type": "array",
            "description": "The working days for the store",
            "rule": "The days must be from [1,2,3,4,5,6,7]"
        },
        "email": {
            "type": "email",
            "description": "The email the store",
            "rule": "The min length is 8 and the max length is 60"
        },
        "colour": {
            "type": "string",
            "description": "The colour for the store",
            "rule": "The regex is /(^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$)/u"
        },
        "map_image": {
            "type": "file",
            "description": "The map image for the store",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        },
        "status": {
            "type": "number",
            "description": "The status for the store",
            "rule": "The status from value true:1 or false:0"
        },
        "devices": {
            "type": "array",
            "description": "The ID of devices for the store",
            "rule": "The device id must be number and exists from devices"
        },
        "sell_accessories" {
            "type": "number",
            "description": "The sell_accessories status for the store",
            "rule": "The status from value true:1 or false:0"
        }
    },
    "required": [
        "store_name",
        "email",
        "address",
        "phone",
        "opening_hour",
        "closing_hour",
        "working_days",
        "sell_accessories"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "store": {
    "id": 1,
    "address": "qwe1sdf2134eqedssaasdd",
    "address_display": "qweqwe",
    "phone": "1231231231",
    "opening_hour": "09:00:00",
    "closing_hour": "18:00:00",
    "open_days": "1,2,4",
    "email": "[email protected]",
    "address_lat": "12.000000",
    "address_lon": "123.000000",
    "small_img": "",
    "colour": "#121313",
    "status": 1,
    "created_by": 1,
    "created_at": "2018-06-12 11:42:09",
    "modified_by": 1,
    "updated_at": "2018-06-12 15:14:09",
    "open_day_string": {
      "1": "Monday",
      "2": "Tuesday",
      "4": "Thursday"
    },
    "small_image_url": "http://repairrabbit.test/storage/images/store_map_images/maxresdefault-T6nMEj.jpg",
    "devices": [
      {
        "id": 1,
        "name": "iPhone 5",
        "pivot": {
          "store_id": 1,
          "device_id": 1
        }
      }
    ]
  },
  "message": "Store updated successfully.",
  "href": "api/v1/admin/stores/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/admin/stores/12"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Store name Rajkot already exists."
  ],
  "href": "api/v1/admin/customers/1"
}

Update a store
GET/api/v1/admin/stores/{store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store.


Delete a store

DELETE https://demo.repairrabbit.co/api/v1/admin/stores/112
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Store deleted successfully with their employees and holidays.",
    "href": "api/v1/admin/stores/1"
}
or
{
    "success": false,
    "message": "Sorry! To delete this item make sure to delete all the associated entities first.",
    "data": {
        "tickets": [
            {
                "ticket_friendly_id": "JCD-748"
            }
        ],
        "appointments": [
            {
                "appointment_id": 4
            }
        ]
    },
    "href": "api/v1/admin/stores/active/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/admin/stores/112"
}

Delete a store
DELETE/api/v1/admin/stores/{store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 112

Id of the store.


Check name for store

GET https://demo.repairrabbit.co/api/v1/admin/stores/name-check?name=Ahmedabad&store_id=4
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": true,
  "message": "A store did not exist with this name.",
  "href": "api/v1/admin/customers/name-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": false,
  "message": "A store already exists with this name.",
  "href": "api/v1/admin/stores/name-check"
}

Check name for store
GET/api/v1/admin/stores/name-check{?name,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
name
string (required) Example: Ahmedabad

Name to check wheather is exists.

store_id
number (required) Example: 4

Id of store required when edit own store’name in store detail.


Change status of store to activate

PUT https://demo.repairrabbit.co/api/v1/admin/stores/4/active
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Store activated successfully.",
    "href": "api/v1/admin/stores/1/active"
}
or
{
    "success": true,
    "message": "Store already activated.",
    "href": "api/v1/admin/stores/1/active"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/admin/stores/1/active"
}

Activate store
PUT/api/v1/admin/stores/{store_id}/active

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 4

Id of store required to change status of it.


Change status of store to deactivate

PUT https://demo.repairrabbit.co/api/v1/admin/stores/4/deactive
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Store deactivated successfully.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": true,
    "message": "Store already deactivated.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": false,
    "message": "Sorry! To deactivate, you need to clear all entities associated with it.",
    "data": {
        "tickets": [
            {
                "ticket_friendly_id": "JCD-748"
            }
        ],
        "appointments": [
            {
                "appointment_id": 4
            }
        ]
    },
    "href": "api/v1/admin/stores/1/deactive"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/admin/stores/1/deactive"
}

Deactivate store
PUT/api/v1/admin/stores/{store_id}/deactive

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 4

Id of store required to change status of it.


Employee

Gets all employee

Retrieves a list of Store

GET https://demo.repairrabbit.co/api/v1/admin/employees?order=asc, desc&orderBy=name, email, store_name etc.&perPage=3&search=&page=3&filterStatus=0&store_id=1
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "employees": {
        "current_page": 1,
        "data": [
            {
                "employee_id": 4,
                "email": "[email protected]",
                "name": "StoreAdmin",
                "role_id": 2,
                "user_id": 2,
                "store_id": 1,
                "isActive": 0,
                "address": "Rajkot",
                "work_start_time": "08:30:00",
                "work_end_time": "12:30:00",
                "break_start_time": "09:00:00",
                "break_end_time": "09:05:00",
                "work_days": "1,2,3,4,5,6,7"
            },
        ],
        "from": 1,
        "last_page": 1,
        "next_page_url": null,
        "path": "http://repairrabbit.test/api/v1/admin/employees",
        "per_page": 10,
        "prev_page_url": null,
        "to": 3,
        "total": 3
    },
    "meta": {
        "orderBy": "name",
        "sortOrder": "desc",
        "items_per_page": 10,
        "employeeListOptions": [
            10,
            20,
            30,
            40,
            50
        ],
        "searchString": "",
        "filterStatus": "",
        "employee_status_options": [
            "All Employees",
            "Active",
            "Inactive"
        ]
    },
    "message": "",
    "href": "api/v1/admin/employees"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Sorry! There are no employee in the system. Please create a store and add employee to it."
  ],
  "href": "api/v1/admin/employees"
}

Gets all employee.
GET/api/v1/admin/employees{?order,orderBy,perPage,search,page,filterStatus,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: name, email, store_name etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

1 : active status of employee & 0 : inactive status of employee

store_id
number (optional) Example: 1

Gives only selected store’s employee.


Create a employee

POST https://demo.repairrabbit.co/api/v1/admin/employees
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "name": "gret",
    "store": "1",   /* id of store */
    "email": "[email protected]",
    "password": "123456",
    "work_start_hrs": "09:00",
    "work_close_hrs": "12:00",
    "break_start_hrs": "10:00",
    "break_close_hrs": "10:30",
    "working_days": [4],
    "admin_privileges": "employee" /* ex: system_admin,store_admin,employee */
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the employee",
            "rule": "The min length is 3 and the max length is 50"
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the employee",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "email": {
            "type": "email",
            "description": "The email the employee",
            "rule": "The min length is 8 and the max length is 60 and must be unique"
        },
        "password": {
            "type": "string",
            "description": "The password for the employee",
            "rule": "The min length is 6 and the max length is 30"
        },
        "work_start_hrs": {
            "type": "time",
            "description": "The work start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store opening hours"
        },
        "work_close_hrs": {
            "type": "time",
            "description": "The work close time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store closing hours"
        },
        "break_start_hrs": {
            "type": "time",
            "description": "The break start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store opening hours"
        },
        "break_close_hrs": {
            "type": "time",
            "description": "The break start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store closing hours"
        },
        "working_days": {
            "type": "array",
            "description": "The working days for the employee",
            "rule": "The days must be from [1,2,3,4,5,6,7]"
        },
        "admin_privileges": {
            "type": "string",
            "description": "The admin privileges for the employee",
            "rule": "The admin privileges must be from system_admin,store_admin, employee"
        }
    },
    "required": [
        "name",
        "store",
        "email",
        "password",
        "work_start_hrs",
        "work_close_hrs",
        "break_start_hrs",
        "break_close_hrs",
        "working_days",
        "admin_privileges"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "employee": {
    "id": 16,
    "user_id": 19,
    "store_id": 1,
    "work_start_time": "09:00:00",
    "work_end_time": "12:00:00",
    "work_days": "4",
    "IsActive": 1,
    "break_start_time": "10:00:00",
    "break_end_time": "10:30:00",
    "restrict_calendar": 0,
    "created_by": 1,
    "created_at": "2018-06-13 12:18:29",
    "modified_by": null,
    "updated_at": "2018-06-13 12:18:29",
    "work_day_string": {
      "4": "Thursday"
    },
    "user": {
      "id": 19,
      "name": "gret",
      "email": "[email protected]"
    },
    "store": {
      "id": 1,
      "address": "Rajkot"
    }
  },
  "message": "Employee created successfully.",
  "href": "api/v1/admin/employees"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "name": [
            "The name field is required."
        ],
        "email": [
            "The email field is required."
        ],
        "password": [
            "The password field is required."
        ],
        "work_start_hrs": [
            "The work start hrs field is required."
        ],
        "work_close_hrs": [
            "The work close hrs field is required."
        ],
        "break_start_hrs": [
            "The break start hrs field is required."
        ],
        "break_close_hrs": [
            "The break close hrs field is required."
        ],
        "working_days": [
            "The working days field is required."
        ],
        "role_id": [
            "The role id field is required."
        ]
    },
    "href": "api/v1/admin/employees"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Please enter store to add employee."
    ],
    "href": "api/v1/admin/employees"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Store not found"
  ],
  "href": "api/v1/admin/employees"
}

Create a employee
POST/api/v1/admin/employees

Endpoint information

Requires authentication Yes

View a employee

GET https://demo.repairrabbit.co/api/v1/admin/employees/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "employee": {
    "id": 1,
    "user_id": 1,
    "store_id": 1,
    "work_start_time": "08:30:00",
    "work_end_time": "12:30:00",
    "work_days": "1,2,3,4,5,6,7",
    "IsActive": 1,
    "break_start_time": "09:00:00",
    "break_end_time": "09:30:00",
    "restrict_calendar": 1,
    "created_by": 1,
    "created_at": "2018-06-13 11:16:39",
    "modified_by": null,
    "updated_at": "2018-06-13 11:16:39",
    "work_day_string": {
      "1": "Monday",
      "2": "Tuesday",
      "3": "Wednesday",
      "4": "Thursday",
      "5": "Friday",
      "6": "Saturday",
      "7": "Sunday"
    },
    "user": {
      "id": 1,
      "name": "Admin",
      "email": "[email protected]"
    },
    "store": {
      "id": 1,
      "address": "Rajkot"
    }
  },
  "message": "Employee detail.",
  "href": "api/v1/admin/employees/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Employee not found."
  ],
  "href": "api/v1/admin/employees/123"
}

View a employee
GET/api/v1/admin/employees/{employee_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
employee_id
number (required) Example: 1

Id of the employee.


Update a employee

PUT https://demo.repairrabbit.co/api/v1/admin/employees/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "name": "gret",
    "store": "1",  /* id of store */
    "email": "[email protected]",
    "work_start_hrs": "09:30",
    "work_close_hrs": "12:00",
    "break_start_hrs": "10:00",
    "break_close_hrs": "10:30",
    "working_days": [1,2,3,4,5],
    "admin_privileges": "employee"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the employee",
            "rule": "The min length is 3 and the max length is 50"
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the employee",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "email": {
            "type": "email",
            "description": "The email the employee",
            "rule": "The min length is 8 and the max length is 60 and must be unique"
        },
        "password": {
            "type": "string",
            "description": "The password for the employee",
            "rule": "The min length is 6 and the max length is 30"
        },
        "work_start_hrs": {
            "type": "time",
            "description": "The work start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store opening hours"
        },
        "work_close_hrs": {
            "type": "time",
            "description": "The work close time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store closing hours"
        },
        "break_start_hrs": {
            "type": "time",
            "description": "The break start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store opening hours"
        },
        "break_close_hrs": {
            "type": "time",
            "description": "The break start time for the employee",
            "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from store closing hours"
        },
        "working_days": {
            "type": "array",
            "description": "The working days for the employee",
            "rule": "The days must be from [1,2,3,4,5,6,7]"
        },
        "admin_privileges": {
            "type": "string",
            "description": "The admin privileges for the employee",
            "rule": "The admin privileges must be from system_admin,store_admin, employee"
        }
    },
    "required": [
        "name",
        "store",
        "email",
        "password",
        "work_start_hrs",
        "work_close_hrs",
        "break_start_hrs",
        "break_close_hrs",
        "working_days",
        "admin_privileges"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "employee": {
    "id": 1,
    "user_id": 1,
    "store_id": 1,
    "work_start_time": "09:00:00",
    "work_end_time": "12:00:00",
    "work_days": "4",
    "IsActive": 1,
    "break_start_time": "10:00:00",
    "break_end_time": "10:30:00",
    "restrict_calendar": 1,
    "created_by": 1,
    "created_at": "2018-06-13 13:01:47",
    "modified_by": 1,
    "updated_at": "2018-06-13 13:07:04",
    "work_day_string": {
      "4": "Thursday"
    },
    "user": {
      "id": 1,
      "name": "gret",
      "email": "[email protected]"
    },
    "store": {
      "id": 1,
      "address": "Rajkot"
    }
  },
  "message": "Employee updated successfully.",
  "href": "api/v1/admin/employees/1"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "name": [
            "The name field is required."
        ],
        "email": [
            "The email field is required."
        ],
        "work_start_hrs": [
            "The work start hrs field is required."
        ],
        "work_close_hrs": [
            "The work close hrs field is required."
        ],
        "break_start_hrs": [
            "The break start hrs field is required."
        ],
        "break_close_hrs": [
            "The break close hrs field is required."
        ],
        "admin_privileges": [
            "The admin privileges field is required."
        ]
    },
    "href": "api/v1/admin/employees/2"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Please enter store to update employee."
    ],
    "href": "api/v1/admin/employees"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": [
        "Employee not found."
    ],
    "href": "api/v1/admin/employees/12"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Store not found"
    ],
    "href": "api/v1/admin/employees"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Employee [email protected] already exists."
  ],
  "href": "api/v1/admin/employees/2"
}

Update a employee
PUT/api/v1/admin/employees/{employee_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
employee_id
number (required) Example: 1

Id of the employee.


Delete a employee

DELETE https://demo.repairrabbit.co/api/v1/admin/employees/3
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Employee deleted successfully.",
    "href": "api/v1/admin/employees/2"
}
or
{
    "success": false,
    "message": "Sorry! To delete this item make sure to delete all the associated entities first.",
    "data": {
        "tickets": [
            {
                "f_id": "JCD-748"
            }
        ],
        "appointments": [
            {
                "appointmentId": 4
            }
        ]
    },
    "href": "api/v1/admin/employees/2"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Employee not found."
  ],
  "href": "api/v1/admin/employees/223"
}

Delete a employee
DELETE/api/v1/admin/employees/{employee_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
employee_id
string (required) Example: 3

Id of the employee.


Send password to employee

PUT https://demo.repairrabbit.co/api/v1/admin/employees/send-password
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Password send Successfully.",
  "href": "api/v1/admin/employees/send-password"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": {
    "email": [
      "The selected email is invalid."
    ]
  },
  "href": "api/v1/admin/employees/send-password"
}

Send password to employee
PUT/api/v1/admin/employees/send-password

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email
number (required) Example: [email protected]

Email to send password for that employee.


Change status of employee to activate

PUT https://demo.repairrabbit.co/api/v1/admin/employees/4/active
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Employee activated successfully.",
    "href": "api/v1/admin/stores/1/active"
}
or
{
    "success": true,
    "message": "Employee already activated.",
    "href": "api/v1/admin/stores/1/active"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Employee not found."
  ],
  "href": "api/v1/admin/stores/1/active"
}

Activate employee
PUT/api/v1/admin/employees/{employee_id}/active

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
employee_id
number (required) Example: 4

Id of employee required to change status of it.


Change status of employee to deactivate

PUT https://demo.repairrabbit.co/api/v1/admin/employees/4/deactive
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Employee deactivated successfully.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": true,
    "message": "Employee already deactivated.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": false,
    "message": "Sorry! To deactivate, you need to clear all entities associated with it.",
    "data": {
        "tickets": [
            {
                "ticket_friendly_id": "JCD-748"
            }
        ],
        "appointments": [
            {
                "appointment_id": 4
            }
        ]
    },
    "href": "api/v1/admin/stores/1/deactive"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Employee not found."
  ],
  "href": "api/v1/admin/stores/1/deactive"
}

Deactivate employee
PUT/api/v1/admin/employees/{employee_id}/deactive

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
employee_id
number (required) Example: 4

Id of employee required to change status of it.


Gets all employee leave

Retrieves a list of Holidays

GET https://demo.repairrabbit.co/api/v1/admin/leaves?order=asc, desc&orderBy=id, store_name, employee_name, store_id, date etc.&perPage=3&search=&page=3&store_id=1&employee_id=1&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "employeeLeaves": {
    "current_page": 1,
    "data": [
      {
        "id": 2,
        "date": "2018-07-05",
        "start_time": "14:00:00",
        "end_time": "22:00:00",
        "employee_id": 1,
        "employee_name": "Admin",
        "store_id": 1,
        "store_name": "Rajkot",
        "reason": "reason for testing"
      },
      {
        "id": 1,
        "date": "2017-07-05",
        "start_time": "09:00:00",
        "end_time": "12:00:00",
        "employee_id": 2,
        "employee_name": "employee",
        "store_id": 1,
        "store_name": "Rajkot",
        "reason": "testing"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/leaves",
    "per_page": "2",
    "prev_page_url": null,
    "to": 2,
    "total": 2
  },
  "meta": {
    "orderBy": "id",
    "sortOrder": "desc",
    "items_per_page": "2",
    "leavesItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/leaves"
}

Gets all employee leave
GET/api/v1/admin/leaves{?order,orderBy,perPage,search,page,store_id,employee_id,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: id, store_name, employee_name, store_id, date etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

store_id
number (required) Example: 1

Id of the store.

employee_id
number (required) Example: 1

Id of the employee.


Create an employee leave

POST https://demo.repairrabbit.co/api/v1/admin/leaves
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "date": "2018-08-15,2018-08-16",
  "start_time": "09:20",
  "end_time": "10:30",
  "reason": "sdsdfsdfssfsdf",
  "employee_id": "3"
}
Schema
{
  "type": "object",
  "properties": {
    "date": {
      "type": "date",
      "description": "The date for the employee leave",
      "rule": "The date format must be YYYY-MM-DD"
    },
    "start_time": {
      "type": "time",
      "description": "The start time for the employee leave",
      "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from employee working time"
    },
    "end_time": {
      "type": "time",
      "description": "The end time for the employee leave",
      "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm and must be from employee working time"
    },
    "reason": {
      "type": "string",
      "description": "The reason for the employee leave",
      "rule": "The min length is 10 and the max length is 255"
    },
    "employee_id": {
      "type": "number",
      "description": "The employee id to add leave",
      "rule": "The max number of digits is 10 and must exists from available employees"
    }
  },
  "required": [
    "date",
    "start_time",
    "end_time",
    "reason",
    "employee_id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "leaves": [
    {
      "id": 41,
      "date": "2018-08-15",
      "start_time": "09:20:00",
      "end_time": "10:30:00",
      "employee_id": 1,
      "employee_name": "Admin",
      "store_id": 1,
      "store_name": "Rajkot",
      "reason": "sdsdfsdfssfsdf"
    },
    {
      "id": 42,
      "date": "2018-08-16",
      "start_time": "09:20:00",
      "end_time": "10:30:00",
      "employee_id": 1,
      "employee_name": "Admin",
      "store_id": 1,
      "store_name": "Rajkot",
      "reason": "sdsdfsdfssfsdf"
    }
  ],
  "message": "Leave created successfully.",
  "href": "api/v1/admin/leaves"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "reason": [
            "The reason field is required."
        ],
        "date": [
            "The date field is required."
        ],
        "start_time": [
            "The start time field is required."
        ],
        "end_time": [
            "The end time field is required."
        ]
    },
    "href": "api/v1/admin/leaves"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Please enter employee to add leave."
    ],
    "href": "api/v1/admin/leaves"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Employee not found"
  ],
  "href": "api/v1/admin/leaves"
}

Create an employee leave
POST/api/v1/admin/leaves

Endpoint information

Requires authentication Yes

View an employee leave

GET https://demo.repairrabbit.co/api/v1/admin/leaves/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "leave": {
    "id": 4,
    "date": "2018-08-15",
    "start_time": "09:20:00",
    "end_time": "10:30:00",
    "employee_id": 1,
    "employee_name": "Admin",
    "store_id": 1,
    "store_name": "Rajkot",
    "reason": "sdsdfsdfssfsdf"
  },
  "message": "Leave detail.",
  "href": "api/v1/admin/leaves/4"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Leave not found."
  ],
  "href": "api/v1/admin/leaves/43"
}

View an employee leave
GET/api/v1/admin/leaves/{leave_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
leave_id
number (required) Example: 1

Id of the leave.


Update an employee leave

PUT https://demo.repairrabbit.co/api/v1/admin/leaves/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "date": "2018-08-15",
  "start_time": "09:20",
  "end_time": "10:30",
  "reason": "sdsdfsdfssfsdf",
  "employee_id": "3"
}
Schema
{
  "type": "object",
  "properties": {
    "date": {
      "type": "date",
      "description": "The date for the employee leave",
      "rule": "The date format must be YYYY-MM-DD"
    },
    "start_time": {
      "type": "time",
      "description": "The start time for the employee leave",
      "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
    },
    "end_time": {
      "type": "time",
      "description": "The end time for the employee leave",
      "rule": "The time is in 24 hour and the format must be HH:mm - HH:mm"
    },
    "reason": {
      "type": "string",
      "description": "The reason for the employee leave",
      "rule": "The min length is 10 and the max length is 255"
    },
    "employee_id": {
      "type": "number",
      "description": "The employee id to add leave",
      "rule": "The max number of digits is 10 and must exists from available employees"
    }
  },
  "required": [
    "date",
    "start_time",
    "end_time",
    "reason",
    "employee_id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "leave": {
    "id": 4,
    "date": "2018-08-15",
    "start_time": "09:20:00",
    "end_time": "10:30:00",
    "employee_id": 1,
    "employee_name": "Admin",
    "store_id": 1,
    "store_name": "Rajkot",
    "reason": "sdsdfsdfssfsdf"
  },
  "message": "Leave updated successfully.",
  "href": "api/v1/admin/leaves/4"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "reason": [
            "The reason field is required."
        ],
        "date": [
            "The date field is required."
        ],
        "start_time": [
            "The start time field is required."
        ],
        "end_time": [
            "The end time field is required."
        ]
    },
    "href": "api/v1/admin/leaves"
}
or
{
    "success": false,
    "data": null,
    "messages": [
        "Please enter employee to update leave."
    ],
    "href": "api/v1/admin/leaves/4"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": [
        "Employee not found"
    ],
    "href": "api/v1/admin/leaves/4"
}
or
{
    "success": false,
    "messages": [
        "Leave not found."
    ],
    "href": "api/v1/admin/leaves/412"
}

Update an employee leave
PUT/api/v1/admin/leaves/{leave_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
leave_id
number (required) Example: 1

Id of the leave.


Delete an employee leave

DELETE https://demo.repairrabbit.co/api/v1/admin/leaves/11
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Leave deleted successfully.",
  "href": "api/v1/admin/leaves/4"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Leave not found."
  ],
  "href": "api/v1/admin/leaves/412"
}

Delete an employee leave
DELETE/api/v1/admin/leaves/{leave_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
leave_id
string (required) Example: 11

Id of the leave.


Holiday

Gets all holiday

Retrieves a list of Holidays

GET https://demo.repairrabbit.co/api/v1/admin/holidays?order=asc, desc&orderBy=title, date, etc.&perPage=3&search=&page=3&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "holidays": {
    "current_page": 1,
    "data": [
      {
        "id": 4,
        "store_id": 1,
        "title": "picnic",
        "date": "2018-09-15",
        "address": "Rajkot"
      },
      {
        "id": 5,
        "store_id": 1,
        "title": "independant day",
        "date": "2018-08-15",
        "address": "Rajkot"
      }
    ],
    "from": 1,
    "last_page": 3,
    "next_page_url": "http://repairrabbit.test/api/v1/admin/holidays?page=2",
    "path": "http://repairrabbit.test/api/v1/admin/holidays",
    "per_page": "4",
    "prev_page_url": null,
    "to": 4,
    "total": 9
  },
  "meta": {
    "orderBy": "store",
    "sortOrder": "desc",
    "items_per_page": "4",
    "holidaysItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/holidays"
}

Gets all holiday
GET/api/v1/admin/holidays{?order,orderBy,perPage,search,page,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: title, date, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

store_id
number (optional) Example: 1

Gives only selected store’s ticket.


Create a holiday

POST https://demo.repairrabbit.co/api/v1/admin/holidays
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "holidayDate": "2018-08-15",
  "store_id": "1",
  "title": "independant day"
}
Schema
{
  "type": "object",
  "properties": {
    "holidayDate": {
      "type": "date",
      "description": "The date for the holiday",
      "rule": "The date format must be YYYY-MM-DD"
    },
    "title": {
      "type": "string",
      "description": "The title for the holiday",
      "rule": "The max length is 255"
    },
    "store_id": {
      "type": "number",
      "description": "The store for the holiday to add",
      "rule": "The max number of digits is 10 and must exists from available stores"
    }
  },
  "required": [
    "holidayDate",
    "title",
    "store_id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "holiday": {
    "id": 10,
    "store_id": 1,
    "title": "independant day",
    "date": "2018-08-15",
    "created_by": 1,
    "created_at": "2018-06-13 14:17:13",
    "modified_by": null,
    "updated_at": "2018-06-13 14:17:13",
    "store": {
      "id": 1,
      "address": "Rajkot"
    }
  },
  "message": "Holiday created successfully.",
  "href": "api/v1/admin/holidays"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "holidayDate": [
      "The holiday date field is required."
    ],
    "title": [
      "The title field is required."
    ],
    "store_id": [
      "The store id field is required."
    ]
  },
  "href": "api/v1/admin/holidays"
}

Create a holiday
POST/api/v1/admin/holidays

Endpoint information

Requires authentication Yes

View a holiday

GET https://demo.repairrabbit.co/api/v1/admin/holidays/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "holiday": {
    "id": 1,
    "store_id": 2,
    "title": "republic day",
    "date": "2018-01-26",
    "created_by": 1,
    "created_at": "2018-06-06 16:34:23",
    "modified_by": null,
    "updated_at": "2018-06-13 14:17:10",
    "store": {
      "id": 2,
      "address": "Ahmedabad"
    }
  },
  "message": "Holiday detail.",
  "href": "api/v1/admin/holidays/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Holiday not found."
  ],
  "href": "api/v1/admin/holidays/15"
}

View a holiday
GET/api/v1/admin/holidays/{holiday_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
holiday_id
number (required) Example: 1

Id of the holiday.


Update a holiday

PUT https://demo.repairrabbit.co/api/v1/admin/holidays/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "holidayDate": "2018-01-26",
  "store_id": "2",
  "title": "republic day"
}
Schema
{
  "type": "object",
  "properties": {
    "holidayDate": {
      "type": "date",
      "description": "The date for the holiday",
      "rule": "The date format must be YYYY-MM-DD"
    },
    "title": {
      "type": "string",
      "description": "The title for the holiday",
      "rule": "The max length is 255"
    },
    "store_id": {
      "type": "number",
      "description": "The store for the holiday to add",
      "rule": "The max number of digits is 10 and must exists from available stores"
    }
  },
  "required": [
    "holidayDate",
    "title",
    "store_id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "holiday": {
    "id": 1,
    "store_id": 2,
    "title": "republic day",
    "date": "2018-01-26",
    "created_by": 1,
    "created_at": "2018-06-06 16:34:23",
    "modified_by": null,
    "updated_at": "2018-06-13 14:17:10",
    "store": {
      "id": 2,
      "address": "Ahmedabad"
    }
  },
  "message": "Holiday updated successfully.",
  "href": "api/v1/admin/holidays/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "holidayDate": [
      "The holiday date field is required."
    ],
    "title": [
      "The title field is required."
    ],
    "store_id": [
      "The store id field is required."
    ]
  },
  "href": "api/v1/admin/holidays"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Holiday not found."
  ],
  "href": "api/v1/admin/holidays/16"
}

Update a holiday
PUT/api/v1/admin/holidays/{holiday_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
holiday_id
number (required) Example: 1

Id of the holiday.


Delete a holiday

DELETE https://demo.repairrabbit.co/api/v1/admin/holidays/112
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Holiday deleted successfully.",
  "href": "api/v1/admin/holidays/6"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Holiday not found."
  ],
  "href": "api/v1/admin/holidays/15"
}

Delete a holiday
DELETE/api/v1/admin/holidays/{holiday_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
holiday_id
number (required) Example: 112

Id of the holiday.


Device

Create a device

POST https://demo.repairrabbit.co/api/v1/admin/devices
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "name": "iphone SE",
    "duration": "120",
    "description": "device of iphone category",
    "deviceCategory": 1, /* id of device_category */
    "device_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the device",
            "rule": "The min length is 3 and the max length is 64"
        },
        "duration": {
            "type": "number",
            "description": "The duration for the device",
            "rule": "The max value is 120"
        },
        "description": {
            "type": "string",
            "description": "The description for the device",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "deviceCategory": {
            "type": "number",
            "description": "The device category of device",
            "rule": "The max number of digits is 10 and must exists from available device_categories"
        },
        "device_image": {
            "type": "file",
            "description": "The image for the device",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "duration",
        "deviceCategory"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "devices": {
    "id": 121,
    "name": "iphone SE",
    "description": "device of iphone category",
    "category_id": 1,
    "repair_duration": 30,
    "isActive": 1,
    "image": "device_images/maxresdefault-x4FKp9.jpg",
    "created_by": 1,
    "created_at": "2018-06-14 12:12:35",
    "modified_by": null,
    "updated_at": "2018-06-14 12:12:35",
    "image_url": "http://repairrabbit.test/storage/images/device_images/p2-YomrfU.jpg",
    "category": {
      "id": 1,
      "name": "iPhone"
    }
  },
  "message": "Device created successfully.",
  "href": "api/v1/admin/devices"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "duration": [
      "The duration field is required."
    ],
    "deviceCategory": [
      "The device category field is required."
    ]
  },
  "href": "api/v1/admin/devices"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device iphonew already exists for the selected device category."
  ],
  "href": "api/v1/admin/devices"
}

Create a device
POST/api/v1/admin/devices

Endpoint information

Requires authentication Yes

View a device

GET https://demo.repairrabbit.co/api/v1/admin/devices/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "device": {
    "id": 1,
    "name": "iPhone 5",
    "description": "Apple iPhone 5",
    "category_id": 1,
    "repair_duration": 30,
    "isActive": 1,
    "image": null,
    "created_by": 1,
    "created_at": "2018-06-14 13:16:08",
    "modified_by": 1,
    "updated_at": "2018-06-14 13:16:08",
    "image_url": "http://repairrabbit.test/storage/images/device_images/p2-YomrfU.jpg",
    "category": {
      "id": 1,
      "name": "iPhone"
    }
  },
  "message": "Device detail.",
  "href": "api/v1/admin/devices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device not found."
  ],
  "href": "api/v1/admin/holidays/15"
}

View a device
GET/api/v1/admin/devices/{device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_id
number (required) Example: 1

Id of the device.


Update a device

POST https://demo.repairrabbit.co/api/v1/admin/devices/1
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "_method": "PUT"
    "name": "iphone SE",
    "duration": "120",
    "description": "device of iphone category",
    "deviceCategory": 1, /* id of device_category */
    "device_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the device",
            "rule": "The min length is 3 and the max length is 64"
        },
        "duration": {
            "type": "number",
            "description": "The duration for the device",
            "rule": "The max value is 120"
        },
        "description": {
            "type": "string",
            "description": "The description for the device",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "deviceCategory": {
            "type": "number",
            "description": "The device category of device",
            "rule": "The max number of digits is 10 and must exists from available device_categories"
        },
        "device_image": {
            "type": "file",
            "description": "The image for the device",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "duration",
        "deviceCategory"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "devices": {
    "id": 2,
    "name": "iPhone 5",
    "description": "device of iphone category",
    "category_id": 1,
    "repair_duration": 30,
    "isActive": 1,
    "image": "device_images/maxresdefault-lZhNoS.jpg",
    "created_by": 1,
    "created_at": "2018-06-13 18:32:38",
    "modified_by": 1,
    "updated_at": "2018-06-14 12:27:38",
    "image_url": "http://repairrabbit.test/storage/images/device_images/p2-YomrfU.jpg",
    "category": {
      "id": 1,
      "name": "iPhone"
    }
  },
  "message": "Device updated successfully.",
  "href": "api/v1/admin/devices/2"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "duration": [
      "The duration field is required."
    ],
    "deviceCategory": [
      "The device category field is required."
    ]
  },
  "href": "api/v1/admin/devices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device not found."
  ],
  "href": "api/v1/admin/devices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device iphonew already exists for the selected device category."
  ],
  "href": "api/v1/admin/devices/1"
}

Update a device
POST/api/v1/admin/devices/{device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_id
number (required) Example: 1

Id of the device.


Delete a device

DELETE https://demo.repairrabbit.co/api/v1/admin/devices/112
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Device deleted successfully.",
    "href": "api/v1/admin/devices/120"
}
or
{
    "success": false,
    "message": "Sorry! To delete this item make sure to delete all the associated entities first.",
    "data": {
        "tickets": [
            {
                "friendly_id": "YNT-400"
            },
            {
                "friendly_id": "XLP-620"
            }
        ],
        "appointments": [
            {
                "appointment_id": 1
            },
            {
                "appointment_id": 3
            }
        ],
        "products": [
            {
                "id": 1
            }
        ]
    },
    "href": "api/v1/admin/devices/2"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device not found."
  ],
  "href": "api/v1/admin/devices/15"
}

Delete a device
DELETE/api/v1/admin/devices/{device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_id
number (required) Example: 112

Id of the device.


Check name for device

GET https://demo.repairrabbit.co/api/v1/admin/devices/name-check?name=iphone&device_id=4&category_id=4
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": true,
  "message": "A device did not exist with this name.",
  "href": "api/v1/admin/customers/name-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": false,
  "message": "A device already exists with this name.",
  "href": "api/v1/admin/stores/name-check"
}

Check name for device
GET/api/v1/admin/devices/name-check{?name,device_id,category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
name
string (required) Example: iphone

Name to check wheather is exists.

device_id
number (required) Example: 4

Id of device required when edit own device’name in device detail.

category_id
number (required) Example: 4

Id of device category required.


Change status of device to activate

PUT https://demo.repairrabbit.co/api/v1/admin/devices/4/active
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Device activated successfully.",
    "href": "api/v1/admin/devices/1/active"
}
or
{
    "success": true,
    "message": "Device already activated.",
    "href": "api/v1/admin/devices/1/active"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device not found."
  ],
  "href": "api/v1/admin/devices/1/active"
}

Activate device
PUT/api/v1/admin/devices/{device_id}/active

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_id
number (required) Example: 4

Id of device required to change status of it.


Change status of device to deactivate

PUT https://demo.repairrabbit.co/api/v1/admin/devices/4/deactive
Responses200400
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Device deactivated successfully.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": true,
    "message": "Device already deactivated.",
    "href": "api/v1/admin/stores/1/deactive"
}
or
{
    "success": false,
    "message": "Sorry! To deactivate, you need to clear all entities associated with it.",
    "data": {
        "tickets": [
            {
                "ticket_friendly_id": "JCD-748"
            }
        ],
        "appointments": [
            {
                "appointment_id": 4
            }
        ]
    },
    "href": "api/v1/admin/stores/1/deactive"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device not found."
  ],
  "href": "api/v1/admin/stores/1/deactive"
}

Deactivate device
PUT/api/v1/admin/devices/{device_id}/deactive

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_id
number (required) Example: 4

Id of store required to change status of it.


Device Category

Create a device category

POST https://demo.repairrabbit.co/api/v1/admin/device_categories
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
  "name": "iphone",
  "description": "device category of iphone",
  "category_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the device category",
            "rule": "The min length is 3 and the max length is 64"
        },
        "description": {
            "type": "string",
            "description": "The description for the device category",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "category_image": {
            "type": "file",
            "description": "The image for the device category",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "device_category": {
    "id": 197,
    "name": "oneplus",
    "description": "oneplue category of mobile",
    "image": "device_category_images/maxresdefault-lFPHfs.jpg",
    "created_by": 1,
    "created_at": "2018-06-14 15:38:21",
    "modified_by": null,
    "updated_at": "2018-06-14 15:38:21",
    "image_url": "http://repairrabbit.test/storage/images/device_category_images/p2-97loeU.jpg"
  },
  "message": "Device category created successfully.",
  "href": "api/v1/admin/device_categories"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ]
  }
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device category oneplus already exists."
  ],
  "href": "api/v1/admin/device_categories"
}

Create a device category
POST/api/v1/admin/device_categories

Endpoint information

Requires authentication Yes

View a device category

GET https://demo.repairrabbit.co/api/v1/admin/device_categories/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "device_category": {
    "id": 1,
    "name": "iPhone",
    "description": "iPhone repair",
    "image": null,
    "created_by": 1,
    "created_at": "2018-06-14 15:06:18",
    "modified_by": 1,
    "updated_at": "2018-06-14 15:06:18",
    "image_url": "http://repairrabbit.test/storage/images/device_category_images/demo-reparatie-624ixv.jpg"
  },
  "message": "Device category detail.",
  "href": "api/v1/admin/device_categories/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device category not found."
  ],
  "href": "api/v1/admin/device_categories/134"
}

View a device category
GET/api/v1/admin/device_categories/{device_category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_category_id
number (required) Example: 1

Id of the device category.


Update a device

POST https://demo.repairrabbit.co/api/v1/admin/device_categories/1
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
  "_method": "PUT",
  "name": "iphone",
  "description": "device category of iphone",
  "device_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the device category",
            "rule": "The min length is 3 and the max length is 64"
        },
        "description": {
            "type": "string",
            "description": "The description for the device category",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "category_image": {
            "type": "file",
            "description": "The image for the device category",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "device_category": {
    "id": 1,
    "name": "oneplus6",
    "description": "oneplue category of mobile",
    "image": null,
    "created_by": 1,
    "created_at": "2018-06-14 15:06:18",
    "modified_by": 1,
    "updated_at": "2018-06-14 15:55:19",
    "image_url": null
  },
  "message": "Device category updated successfully.",
  "href": "api/v1/admin/device_categories/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ]
  },
  "href": "api/v1/admin/device_categories/134"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device category not found."
  ],
  "href": "api/v1/admin/device_categories/2324"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Device category oneplus already exists."
  ],
  "href": "api/v1/admin/device_categories/134"
}

Update a device
POST/api/v1/admin/device_categories/{device_category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_category_id
number (required) Example: 1

Id of the device category.


Delete a device category

DELETE https://demo.repairrabbit.co/api/v1/admin/device_categories/112
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Device category deleted successfully.",
    "href": "api/v1/admin/device_categories/197"
}
or
{
    "success": false,
    "message": "Sorry! To delete this item make sure to delete all the associated entities first.",
    "data": {
        "devices": [
            {
                "id": 208
            }
        ]
    },
    "href": "api/v1/admin/device_categories/197"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Device category not found."
  ],
  "href": "api/v1/admin/device_categories/2123"
}

Delete a device category
DELETE/api/v1/admin/device_categories/{device_category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
device_category_id
number (required) Example: 112

Id of the device category.


Check name for device category

GET https://demo.repairrabbit.co/api/v1/admin/device_categories/name-check?name=iphone&device_category_id=112
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": true,
  "message": "A device category did not exist with this name.",
  "href": "api/v1/admin/customers/name-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": false,
  "message": "A device category already exists with this name.",
  "href": "api/v1/admin/stores/name-check"
}

Check name for device category
GET/api/v1/admin/device_categories/name-check{?name,device_category_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
name
string (required) Example: iphone

Name to check wheather is exists.

device_category_id
number (required) Example: 112

Id of the device category.


Product

Create a product

POST https://demo.repairrabbit.co/api/v1/admin/products
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "name": "iPhone Charger",
    "sku": "dsfgsd3",
    "price": 120,
    "buy_price": 90
    "description": "Charger of iphone",
    "install_fee": 909,
    "device": 1,
    "maintain_stock": 0,
    "product_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the product",
            "rule": "The min length is 3 and the max length is 64"
        },
        "sku": {
            "type": "number",
            "description": "The sku for the product",
            "rule": "The max length is 50"
        },
        "price": {
            "type": "number",
            "description": "The price for the product",
            "rule": "The price with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "buy_price": {
            "type": "number",
            "description": "The buy price for the product",
            "rule": "The bye price with regex:/(^\d{1,10}$)/"
        },
        "description": {
            "type": "string",
            "description": "The description for the product",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "install_fee": {
            "type": "number",
            "description": "The install fee for the product",
            "rule": "The install fee with regex:/(^\d{1,10}$)/"
        },
        "device": {
            "type": "number",
            "description": "The ID of device for the product",
            "rule": "The max number of digits is 10 and must exists from available devices"
        },
        "maintain_stock": {
            "type": "number",
            "description": "The status for maintain stock of the product",
            "rule": "The status from value true:1 or false:0"
        },
        "product_image": {
            "type": "file",
            "description": "The product image for the product",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "sku",
        "price",
        "buy_price",
        "install_fee",
        "device",
        "maintain_stock"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "products": {
    "id": 8,
    "name": "iPhone Charger",
    "sku": "dsfgsd3",
    "price": "120.00",
    "install_fee": "909",
    "buy_price": "90",
    "description": "Charger of iphone",
    "device_id": 1,
    "maintain_stock": 0,
    "image": null,
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-14 15:42:38",
    "modified_by": null,
    "updated_at": "2018-06-14 15:42:38",
    "image_url": "http://repairrabbit.test/storage/images/product_images/maxresdefault-IieYH0.jpg",
    "device": {
      "id": 1,
      "name": "iPhone 5"
    }
  },
  "message": "Product created successfully.",
  "href": "api/v1/admin/products"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "sku": [
      "The sku field is required."
    ],
    "price": [
      "The price field is required."
    ],
    "buy_price": [
      "The buy price field is required."
    ],
    "install_fee": [
      "The install fee field is required."
    ],
    "device": [
      "The device field is required."
    ]
  },
  "href": "api/v1/admin/products"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Product iPhone 9 already exists for the selected device."
  ],
  "href": "api/v1/admin/products"
}

Create a product
POST/api/v1/admin/products

Endpoint information

Requires authentication Yes

View a product

GET https://demo.repairrabbit.co/api/v1/admin/products/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "product": {
    "id": 1,
    "name": "Display (LCD) damage, glass broken black",
    "sku": "A000210",
    "price": "69.90",
    "install_fee": "0",
    "buy_price": "0",
    "description": "We also recycle the old broken displays by sending them back to the manufacturer.",
    "device_id": 1,
    "maintain_stock": 1,
    "image": "",
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-14 16:30:52",
    "modified_by": null,
    "updated_at": "2018-06-14 16:30:52",
    "image_url": "http://repairrabbit.test/storage/images/product_images/maxresdefault-IieYH0.jpg",
    "device": {
      "id": 1,
      "name": "iPhone 5"
    }
  },
  "message": "Product detail.",
  "href": "api/v1/admin/products/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Product not found."
  ],
  "href": "api/v1/admin/products/14"
}

View a product
GET/api/v1/admin/products/{product_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
product_id
number (required) Example: 1

Id of the product.


Update a Product

POST https://demo.repairrabbit.co/api/v1/admin/products/1
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "name": "iph charger",
    "sku": "A2132",
    "price": 120,
    "buy_price": 90
    "description": "",
    "install_fee": 909,
    "device": 1,
    "maintain_stock": 1,
    "product_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the product",
            "rule": "The min length is 3 and the max length is 64"
        },
        "sku": {
            "type": "number",
            "description": "The sku for the product",
            "rule": "The max length is 50"
        },
        "price": {
            "type": "number",
            "description": "The price for the product",
            "rule": "The price with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "buy_price": {
            "type": "number",
            "description": "The buy price for the product",
            "rule": "The bye price with regex:/(^\d{1,10}$)/"
        },
        "description": {
            "type": "string",
            "description": "The description for the product",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "install_fee": {
            "type": "number",
            "description": "The install fee for the product",
            "rule": "The install fee with regex:/(^\d{1,10}$)/"
        },
        "device": {
            "type": "number",
            "description": "The ID of device for the product",
            "rule": "The max number of digits is 10 and must exists from available devices"
        },
        "maintain_stock": {
            "type": "number",
            "description": "The status for maintain stock of the product",
            "rule": "The status from value true:1 or false:0"
        },
        "product_image": {
            "type": "file",
            "description": "The product image for the product",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "sku",
        "price",
        "buy_price",
        "install_fee",
        "device",
        "maintain_stock"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "products": {
    "id": 1,
    "name": "iph charger",
    "sku": "A2132",
    "price": "25.00",
    "install_fee": "56",
    "buy_price": "123",
    "description": "We also recycle the old broken displays by sending them back to the manufacturer.",
    "device_id": 1,
    "maintain_stock": 1,
    "image": "",
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-06 16:34:23",
    "modified_by": 1,
    "updated_at": "2018-06-14 16:10:01",
    "image_url": "http://repairrabbit.test/storage/images/product_images/maxresdefault-IieYH0.jpg",
    "device": {
      "id": 1,
      "name": "iPhone 5"
    }
  },
  "message": "Product updated successfully.",
  "href": "api/v1/admin/products/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "sku": [
      "The sku field is required."
    ],
    "price": [
      "The price field is required."
    ],
    "buy_price": [
      "The buy price field is required."
    ],
    "install_fee": [
      "The install fee field is required."
    ],
    "device": [
      "The device field is required."
    ]
  },
  "href": "api/v1/admin/products/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Product not found."
  ],
  "href": "api/v1/admin/products/57"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Product On off switch already exists for the selected device."
  ],
  "href": "api/v1/admin/products/1"
}

Update a product
POST/api/v1/admin/products/{product_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
product_id
number (required) Example: 1

Id of the product.


Delete a product

DELETE https://demo.repairrabbit.co/api/v1/admin/products/3
Responses200404
Headers
Content-Type: application/json
Body
{
    "success": true,
    "message": "Product deleted successfully.",
    "href": "api/v1/admin/products/3"
}
or
{
    "success": false,
    "message": "Sorry! To delete this item make sure to delete all the associated entities first.",
    "data": {
        "tickets": [
            {
                "friendly_id": "JCD-748"
            },
            {
                "friendly_id": "MCD-748"
            }
        ],
        "appointments": [
            {
                "appointment_id": 2
            },
            {
                "appointment_id": 4
            }
        ]
    },
    "href": "api/v1/admin/products/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Product not found."
  ],
  "href": "api/v1/admin/products/3"
}

Delete a product
DELETE/api/v1/admin/products/{product_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
product_id
string (required) Example: 3

Id of the product.


Check name for product

GET https://demo.repairrabbit.co/api/v1/admin/products/name-check?name=iphone charger&device_id=4&product_id=4
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": true,
  "message": "A product did not exist with this name.",
  "href": "api/v1/admin/products/name-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": false,
  "message": "A product already exists with this name.",
  "href": "api/v1/admin/products/name-check"
}

Check name for product
GET/api/v1/admin/products/name-check{?name,device_id,product_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
name
string (required) Example: iphone charger

Name to check wheather is exists.

product_id
number (required) Example: 4

Id of product required when edit own product’name in product detail.

device_id
number (required) Example: 4

Device id of product required.


Accessory

Gets all Accessory

Retrieves a list of Accessory

GET https://demo.repairrabbit.co/api/v1/admin/accessories?order=asc, desc&orderBy=name, sku, etc.&perPage=3&search=&page=3
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "accessories": {
    "current_page": 1,
    "data": [
      {
        "id": 9,
        "price": "80.00",
        "sku": "A0002189",
        "name": "charger",
        "image": null,
        "install_fee": "90",
        "buy_price": "90",
        "maintain_stock": 1,
        "description": null,
        "deviceId": 365,
        "deviceName": "Accessories"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/accessories",
    "per_page": "4",
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "id",
    "sortOrder": "desc",
    "items_per_page": "4",
    "accessoriesItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/accessories"
}

Gets all accessory
GET/api/v1/admin/accessories{?order,orderBy,perPage,search,page}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: name, sku, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data


Create a accessory

POST https://demo.repairrabbit.co/api/v1/admin/accessories
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "name": "Charger nokia",
    "sku": "A123",
    "price": 120,
    "buy_price": 90
    "install_fee": 909,
    "maintain_stock": 0,
    "accessories_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the accessory",
            "rule": "The min length is 3 and the max length is 64"
        },
        "sku": {
            "type": "number",
            "description": "The sku for the accessory",
            "rule": "The max length is 50"
        },
        "price": {
            "type": "number",
            "description": "The price for the accessory",
            "rule": "The price with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "buy_price": {
            "type": "number",
            "description": "The buy price for the accessory",
            "rule": "The bye price with regex:/(^\d{1,10}$)/"
        },
        "description": {
            "type": "string",
            "description": "The description for the accessory",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "install_fee": {
            "type": "number",
            "description": "The install fee for the accessory",
            "rule": "The install fee with regex:/(^\d{1,10}$)/"
        },
        "maintain_stock": {
            "type": "number",
            "description": "The status for maintain stock of the accessory",
            "rule": "The status from value true:1 or false:0"
        },
        "accessories_image": {
            "type": "file",
            "description": "The accessory image for the accessory",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "sku",
        "price",
        "buy_price",
        "install_fee",
        "maintain_stock"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "accessories": {
    "id": 15,
    "name": "Charger nokia",
    "sku": "A123",
    "price": "100.00",
    "install_fee": "80",
    "buy_price": "50",
    "description": null,
    "device_id": 365,
    "maintain_stock": 0,
    "image": null,
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-14 18:29:31",
    "modified_by": null,
    "updated_at": "2018-06-14 18:29:31"
  },
  "message": "Accessories created successfully.",
  "href": "api/v1/admin/accessories"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "sku": [
      "The sku field is required."
    ],
    "price": [
      "The price field is required."
    ],
    "buy_price": [
      "The buy price field is required."
    ],
    "install_fee": [
      "The install fee field is required."
    ]
  },
  "href": "api/v1/admin/accessories"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Accessories Charger nokia already exists."
  ],
  "href": "api/v1/admin/accessories"
}

Create a accessory
POST/api/v1/admin/accessories

Endpoint information

Requires authentication Yes

View a accessory

GET https://demo.repairrabbit.co/api/v1/admin/accessories/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "accessories": {
    "id": 9,
    "name": "charger",
    "sku": "A0002189",
    "price": "80.00",
    "install_fee": "90",
    "buy_price": "90",
    "description": null,
    "device_id": 365,
    "maintain_stock": 1,
    "image": null,
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-14 17:49:27",
    "modified_by": null,
    "updated_at": "2018-06-14 17:49:27"
  },
  "message": "Accessories detail.",
  "href": "api/v1/admin/accessories/9"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Accessories not found."
  ],
  "href": "api/v1/admin/accessories/3"
}

View a accessory
GET/api/v1/admin/accessories/{access_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
access_id
number (required) Example: 1

Id of the accessory.


Update a Accessory

POST https://demo.repairrabbit.co/api/v1/admin/accessories/1
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "_method": "PUT",
    "name": "iph charger",
    "sku": "A2132",
    "price": 25,
    "buy_price": 123
    "description": "",
    "install_fee": 56,
    "maintain_stock": 1,
    "accessories_image": "image/path"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the accessory",
            "rule": "The min length is 3 and the max length is 64"
        },
        "sku": {
            "type": "number",
            "description": "The sku for the accessory",
            "rule": "The max length is 50"
        },
        "price": {
            "type": "number",
            "description": "The price for the accessory",
            "rule": "The price with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "buy_price": {
            "type": "number",
            "description": "The buy price for the accessory",
            "rule": "The bye price with regex:/(^\d{1,10}$)/"
        },
        "description": {
            "type": "string",
            "description": "The description for the accessory",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        },
        "install_fee": {
            "type": "number",
            "description": "The install fee for the accessory",
            "rule": "The install fee with regex:/(^\d{1,10}$)/"
        },
        "maintain_stock": {
            "type": "number",
            "description": "The status for maintain stock of the accessory",
            "rule": "The status from value true:1 or false:0"
        },
        "accessories_image": {
            "type": "file",
            "description": "The accessory image for the accessory",
            "rule": "The max size is 1MB with type of jpeg or jpg or png"
        }
    },
    "required": [
        "name",
        "sku",
        "price",
        "buy_price",
        "install_fee",
        "maintain_stock"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "accessories": {
    "id": 9,
    "name": "iph charger",
    "sku": "A2132",
    "price": "25.00",
    "install_fee": "56",
    "buy_price": "123",
    "description": null,
    "device_id": 365,
    "maintain_stock": 1,
    "image": null,
    "stuurop_only": 0,
    "admin_only": 0,
    "advanced_time": null,
    "created_by": 1,
    "created_at": "2018-06-14 17:49:27",
    "modified_by": 1,
    "updated_at": "2018-06-15 10:26:40"
  },
  "message": "Accessory updated successfully.",
  "href": "api/v1/admin/accessories/9"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "sku": [
      "The sku field is required."
    ],
    "price": [
      "The price field is required."
    ],
    "buy_price": [
      "The buy price field is required."
    ],
    "install_fee": [
      "The install fee field is required."
    ]
  },
  "href": "api/v1/admin/accessories/9"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Accessories not found."
  ],
  "href": "api/v1/admin/accessories/56"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Accessories Charger nokia already exists."
  ],
  "href": "api/v1/admin/accessories/9"
}

Update a accessory
POST/api/v1/admin/accessories/{access_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
access_id
number (required) Example: 1

Id of the accessory.


Delete a accessory

DELETE https://demo.repairrabbit.co/api/v1/admin/accessories/3
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Accessory deleted successfully.",
  "href": "api/v1/admin/accessories/9"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Accessories not found."
  ],
  "href": "api/v1/admin/accessories/9"
}

Delete a accessory
DELETE/api/v1/admin/accessories/{access_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
access_id
string (required) Example: 3

Id of the accessory.


Check name for accessory

GET https://demo.repairrabbit.co/api/v1/admin/accessories/name-check?name=charger&access_id=4&device_id=365
Responses200409
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": true,
  "message": "A accessory did not exist with this name.",
  "href": "api/v1/admin/accessories/name-check"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "name-status": false,
  "message": "A accessory already exists with this name.",
  "href": "api/v1/admin/accessories/name-check"
}

Check name for accessory
GET/api/v1/admin/accessories/name-check{?name,access_id,device_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
name
string (required) Example: charger

Name to check wheather is exists.

access_id
number (required) Example: 4

Id of accessory required when edit own accessory’name in accessory detail.

device_id
number (required) Example: 365

Device id of accessory required.


Stock

Gets all Stock

Retrieves a list of stocks

GET https://demo.repairrabbit.co/api/v1/admin/products?order=asc, desc&orderBy=device_name, product_name, sku, price, install_fee, etc.&perPage=3&search=&page=3&filterStatus=0&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "stocks": {
    "current_page": 1,
    "data": [
      {
        "device": "iPhone 5",
        "store": "Rajkot",
        "storeId": 1,
        "productId": 1,
        "product": "Display (LCD) damage, glass broken black",
        "sku": "A000210",
        "quantity": 40,
        "price": "69.90",
        "install_fee": "0"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/stocks",
    "per_page": "2",
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "install_fee",
    "sortOrder": "desc",
    "items_per_page": "2",
    "stockListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "device_options": [
      {
        "id": 1,
        "isActive": 1,
        "device_name": "iPhone 5"
      },
      {
        "id": 2,
        "isActive": 1,
        "device_name": "Samsung Galaxy J2"
      },
      {
        "id": 3,
        "isActive": 1,
        "device_name": "Samsung J5"
      }
    ],
    "device_filter_id": "",
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/stocks"
}

Gets all stock
GET/api/v1/admin/products{?order,orderBy,perPage,search,page,filterStatus,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: device_name, product_name, sku, price, install_fee, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

id of active device to get filter

store_id
number (optional) Example: 1

Gives only selected store’s stock


Add stock in store

POST https://demo.repairrabbit.co/api/v1/admin/stocks
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "store": 1,     /* id of the store to add stock in that store. */
    "stocks": [
        {
            "productId": 1,
            "quantity": 1,
            "reason": "required stock"
        },
        {
            "productId": 2,
            "quantity": 1,
            "reason": "stock reason"
        }
    ]
}
Schema
{
    "type": "object",
    "properties": {
        "store": {
            "type": "number",
            "description": "The ID of store for the stock",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "stocks": {
            "type": "array",
            "description": "The product's id array",
            "subproperties": {
                "productId": {
                    "type": "number",
                    "description": "The ID of product for the stock",
                    "rule": "The max number of digits is 10 and must exists from available products",
                    "required": "true"
                },
                "quantity": {
                    "type": "number",
                    "description": "The quantity of product for the stock",
                    "rule": "The max number of digits 11 are allowed",
                    "required": "true"
                },
                "reason": {
                    "type": "string",
                    "description": "The reason for the stock to add",
                    "rule": "The reason max length is 250"
                }
            }
        }
    },
    "required": [
        "store",
        "stocks"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "message": "Stock added successfully to store.",
  "href": "api/v1/admin/stocks"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "stocks": [
      "The stocks field is required."
    ]
  },
  "href": "api/v1/admin/stocks"
}

Add stock in store
POST/api/v1/admin/stocks

Endpoint information

Requires authentication Yes

Transfer stock in store

PUT https://demo.repairrabbit.co/api/v1/admin/stocks
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "source_store": 1,      /* id of the store from that the stock transfer into another. */
    "target_store": 2,      /* id of the store to get stock transfers. */
    "stocks": [
        {
            "productId": 1,
            "quantity": 1,
            "reason": "Stock transfered"
        },
        {
            "productId": 2,
            "quantity": 1,
            "reason": "Stock transfered because of needs"
        }
    ]
}
Schema
{
    "type": "object",
    "properties": {
        "source_store": {
            "type": "number",
            "description": "The source store id to transfer products",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "target_store": {
            "type": "number",
            "description": "The target store id to get transfer products",
            "rule": "The max number of digits is 10 and must exists from available stores and must be different from source_store"
        },
        "stocks": {
            "type": "array",
            "description": "The product's id array",
            "subproperties": {
                "productId": {
                    "type": "number",
                    "description": "The ID of product for the stock",
                    "rule": "The max number of digits is 10 and must exists from available products",
                    "required": "true"
                },
                "quantity": {
                    "type": "number",
                    "description": "The quantity of product for the stock",
                    "rule": "The max number of digits 11 are allowed and it can not be greater than source_store's stock",
                    "required": "true"
                },
                "reason": {
                    "type": "string",
                    "description": "The reason for the stock to add",
                    "rule": "The reason max length is 250"
                }
            }
        }
    },
    "required": [
        "source_store",
        "target_store",
        "stocks"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "message": "Stock transfered successfully.",
  "href": "api/v1/admin/stocks"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "stocks": [
      "The stocks field is required."
    ]
  },
  "href": "api/v1/admin/stocks"
}

Transfer stock in store
PUT/api/v1/admin/stocks

Endpoint information

Requires authentication Yes

Return stock from store

DELETE https://demo.repairrabbit.co/api/v1/admin/stocks
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "store": 1,     /* id of the store from that the stock return. */
    "stocks": [
        {
            "productId": 1,
            "quantity": 1,
            "reason": "Stock return"
        },
        {
            "productId": 2,
            "quantity": 1,
            "reason": "Stock return because of damage"
        }
    ]
}
Schema
{
    "type": "object",
    "properties": {
        "store": {
            "type": "number",
            "description": "The ID of store for the stock",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "stocks": {
            "type": "array",
            "description": "The product's id array",
            "subproperties": {
                "productId": {
                    "type": "number",
                    "description": "The ID of product for the stock",
                    "rule": "The max number of digits is 10 and must exists from available products",
                    "required": "true"
                },
                "quantity": {
                    "type": "number",
                    "description": "The quantity of product for the stock",
                    "rule": "The max number of digits 11 are allowed and it can not be greater than store's stock",
                    "required": "true"
                },
                "reason": {
                    "type": "string",
                    "description": "The reason for the stock to add",
                    "rule": "The reason max length is 250"
                }
            }
        }
    },
    "required": [
        "store",
        "stocks"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "message": "Stock returned successfully.",
  "href": "api/v1/admin/stocks"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "stocks": [
      "The stocks field is required."
    ]
  },
  "href": "api/v1/admin/stocks"
}

Return stock from store
DELETE/api/v1/admin/stocks

Endpoint information

Requires authentication Yes

Gets all Stock History

Retrieves a list of stock history

GET https://demo.repairrabbit.co/api/v1/admin/stocks/history?order=asc, desc&orderBy=employee, product_name, store_name, sku, ticket_fid, etc.&perPage=3&search=&page=3&filterStatus=0&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "stocks_histories": {
    "current_page": 1,
    "data": [
      {
        "employee": "employee",
        "ticket_friendly_id": "JCD-748",
        "ticket_id": 3,
        "reason": "device used in ticket JCD-748",
        "diff": -1,
        "old_diff": 38,
        "new_diff": 37,
        "productId": 1,
        "sku": "A000210",
        "product": "Display (LCD) damage, glass broken black",
        "storeId": 1,
        "store_name": "Rajkot",
        "updated_at": "2018-06-18 10:38:08"
      },
      {
        "employee": null,
        "ticket_friendly_id": null,
        "ticket_id": null,
        "reason": "initial stock",
        "diff": 10,
        "old_diff": 10,
        "new_diff": 20,
        "productId": 1,
        "sku": "A000210",
        "product": "Display (LCD) damage, glass broken black",
        "storeId": 2,
        "store_name": "Ahmedabad",
        "updated_at": "2018-06-15 18:26:10"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/stocks/history",
    "per_page": 10,
    "prev_page_url": null,
    "to": 7,
    "total": 7
  },
  "meta": {
    "orderBy": "updated_at",
    "sortOrder": "desc",
    "items_per_page": 10,
    "stockHistoryListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "stock_history_options": [
      "All Reasons",
      "Added",
      "Return",
      "Transfer",
      "Repaired",
      "Damaged",
      "Ticket Closed"
    ],
    "stock_history_filter_id": "",
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/stocks/history"
}

Gets all stock history
GET/api/v1/admin/stocks/history{?order,orderBy,perPage,search,page,filterStatus,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: employee, product_name, store_name, sku, ticket_fid, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

id of stock history options to get filter like add, return, transfer, etc.

store_id
number (optional) Example: 1

Gives selected store’s stock history


Gets Product Stock History

Retrieves a list of product stock history

GET https://demo.repairrabbit.co/api/v1/admin/stocks/products/1/history/1?order=asc, desc&orderBy=employee, updated_at, etc.&perPage=3&search=&page=3&filterStatus=0
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "product_history": {
    "current_page": 1,
    "data": [
      {
        "employee": "Admin",
        "product": "Display (LCD) damage, glass broken black",
        "diff": 20,
        "created_by": 1,
        "reason": "initial stock",
        "updated_at": "2018-06-18 10:55:35"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/stocks/products/1/history/1",
    "per_page": 10,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "updated_at",
    "sortOrder": "desc",
    "items_per_page": 10,
    "productHistoryListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "product_history_options": [
      "all",
      "added",
      "return",
      "transfer",
      "repaired",
      "damaged",
      "tickets closed"
    ],
    "product_history_filter_id": "",
    "searchString": "",
    "provisionalQty": 1,
    "productInfo": {
      "product": "Display (LCD) damage, glass broken black",
      "store": "Rajkot",
      "availableQty": 40,
      "productId": 1,
      "storeId": 1
    }
  },
  "message": "",
  "href": "api/v1/admin/stocks/products/1/history/1"
}

Gets product stock history
GET/api/v1/admin/stocks/products/{product_id}/history/{store_id}{?order,orderBy,perPage,search,page,filterStatus}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: employee, updated_at, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

id of product history options to get filter like add, return, transfer, etc.

store_id
number (required) Example: 1

Gives selected store’s product history

product_id
number (required) Example: 1

Gives selected product’s history


Gets Required Stock Products

Retrieves a list of required stock product

GET https://demo.repairrabbit.co/api/v1/admin/stocks/required-products/?order=asc, desc&orderBy=device_name, product_name, install_fee, sku, price, store_name, available_qty, provisional_qty, etc.&perPage=3&search=&page=3&filterStatus=0&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "required_products": {
    "current_page": 1,
    "data": [
      {
        "provisional_qty": 2,
        "available_qty": 1,
        "product_id": 2,
        "name": "On off switch",
        "sku": "A000223",
        "price": "99.90",
        "install_fee": "10",
        "store_id": 2,
        "device_name": "Samsung Galaxy J2",
        "store_name": "Ahmedabad"
      },
      {
        "provisional_qty": 1,
        "available_qty": -1,
        "product_id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "sku": "A000210",
        "price": "69.90",
        "install_fee": "0",
        "store_id": 1,
        "device_name": "iPhone 5",
        "store_name": "Rajkot"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/admin/stocks/required-products",
    "per_page": 10,
    "prev_page_url": null,
    "to": 2,
    "total": 2
  },
  "meta": {
    "orderBy": "provisional_qty",
    "sortOrder": "desc",
    "items_per_page": 10,
    "stockProductListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "device_options": [
      {
        "id": 1,
        "isActive": 1,
        "device_name": "iPhone 5"
      },
      {
        "id": 2,
        "isActive": 1,
        "device_name": "Samsung Galaxy J2"
      },
      {
        "id": 3,
        "isActive": 1,
        "device_name": "Samsung J5"
      }
    ],
    "device_filter_id": "",
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/admin/stocks/required-products"
}

Gets required stock product
GET/api/v1/admin/stocks/required-products/{?order,orderBy,perPage,search,page,filterStatus,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: device_name, product_name, install_fee, sku, price, store_name, available_qty, provisional_qty, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

filterStatus
number (optional) Example: 0

id of device options to get filter

store_id
number (optional) Example: 1

Gives selected store’s required products


Invoice

Gets all Invoice

Retrieves a list of all invoice.

GET https://demo.repairrabbit.co/api/v1/admin/invoices?order=asc, desc&orderBy=customer_name, employee_name, device_name, etc.&perPage=3&search=&page=3&customer_id=1&start_date=2018-05-19&end_date=2018-06-19&label=last 30 Days&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
    "success": true,
    "invoices": {
        "current_page": 1,
        "data": [
            {
                "id": 3,
                "friendly_id": 17000012,
                "ticket_id": null,
                "user_id": 4,
                "store_id": 1,
                "discount_description": "17000012",
                "amount": "199.80",
                "vat_percentage": "21.00",
                "vat_amount": "24.26",
                "discount": "0.00",
                "discount_amount": "0.00",
                "discount_in": "amount",
                "payment_mode": "card",
                "on_account": null,
                "generated_by": 2,
                "invoice_description": "test 123",
                "created_by": 1,
                "created_at": "2018-06-15 12:38:41",
                "modified_by": null,
                "updated_at": "2018-06-15 12:38:41",
                "store_name": "Rajkot",
                "ticket_fid": null
            },
        ],
        "from": 1,
        "last_page": 1,
        "next_page_url": null,
        "path": "http://repairrabbit.test/api/v1/admin/invoices",
        "per_page": "3",
        "prev_page_url": null,
        "to": 3,
        "total": 3
    },
    "meta": {
        "orderBy": "id",
        "sortOrder": "desc",
        "items_per_page": "3",
        "start_date": "2018-05-15",
        "end_date": "2018-06-15",
        "cashPayment": 99.9,
        "cardPayment": 299.7,
        "invoiceAmount": 399.6,
        "dateFilterLabel": "Last 30 days",
        "searchString": "",
        "invoiceListOptions": [
            10,
            20,
            30,
            40,
            50
        ]
    },
    "message": "",
    "href": "api/v1/admin/invoices"
}

Gets all invoice.
GET/api/v1/admin/invoices{?order,orderBy,perPage,search,page,customer_id,start_date,end_date,label,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: id Example: customer_name, employee_name, device_name, etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data

customer_id
number (optional) Example: 1

Gives only selected customer’s invoice.

start_date
number (optional) Example: 2018-05-19

Date in formate of Y-m-d to get data from that starting date.

end_date
number (optional) Example: 2018-06-19

Date in formate of Y-m-d to get data from that ending date.

label
string (optional) Example: last 30 Days

Label selected for calendar.

store_id
number (optional) Example: 1

Gives only selected store’s ticket.


Create an invoice

POST https://demo.repairrabbit.co/api/v1/admin/invoices
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "products": [
    {
      "product_id": 1,
      "quantity": 1,
      "item_type": "product"
    },
    {
      "product_id": 2,
      "quantity": 1,
      "item_type": "product"
    }
  ],
  "store": 1,
  "customer_id": 4,
  "invoice_description": "test invoice",
  "wants_in_mail": 0,
  "discount_description": "",
  "discount": 0,
  "discount_option": "amount",
  "payment_mode": "cash",
  "on_account": 0
}
Schema
{
    "type": "object",
    "properties": {
        "products": {
            "type": "array",
            "description": "The product's id array",
            "subproperties": {
                "product_id": {
                    "type": "number",
                    "description": "The ID of product for the invoice",
                    "rule": "The max number of digits is 10 and must exists from available products",
                    "required": "true"
                },
                "quantity": {
                    "type": "number",
                    "description": "The quantity of product for the invoice",
                    "rule": "Product's quantity can not be greater than the max quantity added in stock of store",
                    "required": "true"
                },
                "item_type": {
                    "type": "string",
                    "description": "The type of product for the invoice",
                    "rule": "The type must be from product or accessory"
                }
            }
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the invoice",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "customer_id": {
            "type": "number",
            "description": "The ID of customer for the invoice",
            "rule": "The max number of digits is 10 and must exists from available customers"
        },
        "invoice_description": {
            "type": "string",
            "description": "The description for the invoice"
        },
        "wants_in_mail": {
            "type": "string",
            "description": "The status to get invoice in mail",
            "rule": "The value must be from 0 or 1"
        },
        "discount_description": {
            "type": "string",
            "description": "The discount_description for the invoice"
            "rule": "The discount_description max length is 100"
        },
        "discount": {
            "type": "email",
            "description": "The discount for the invoice",
            "rule": "The discount with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "discount_option": {
            "type": "string",
            "description": "The discount_option for the invoice",
            "rule": "The discount_option must be from percent,amount"
        },
        "payment_mode": {
            "type": "string",
            "description": "The payment_mode for the invoice",
            "rule": "The payment_mode must be from cash,card"
        },
        "on_account": {
            "type": "string",
            "description": "The count of days with that the amount of invocie is paid",
            "rule": "The on_account must be from 0,7,14,21,45,60"
        }
    },
    "required": [
        "customer_id",
        "store",
        "invoice_description",
        "products"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "invoice": [
    {
      "id": 9,
      "friendly_id": 18008745,
      "ticket_id": null,
      "user_id": 4,
      "store_id": 1,
      "discount_description": null,
      "amount": "169.80",
      "vat_percentage": "21.00",
      "vat_amount": "29.47",
      "discount": "0.00",
      "discount_amount": "0.00",
      "discount_in": "amount",
      "payment_mode": "cash",
      "on_account": 0,
      "generated_by": 1,
      "invoice_description": "test invoice",
      "created_by": 1,
      "created_at": "2018-06-15 16:38:35",
      "modified_by": null,
      "updated_at": "2018-06-15 16:38:35"
    }
  ],
  "meta": {
    "invoiceProducts": [
      {
        "name": "Display (LCD) damage, glass broken black",
        "sku": "A000210",
        "product_id": 1,
        "unit_price": "99.90",
        "quantity": 40,
        "price": "69.90"
      },
      {
        "name": "iphone charger",
        "sku": "A000123",
        "product_id": 2,
        "unit_price": "99.90",
        "quantity": 1,
        "price": "99.90"
      }
    ],
    "total_price": 2895.9,
    "vat_divisor": 1.21
  },
  "message": "Invoice created successfully.",
  "href": "api/v1/admin/invoices"
}
Headers
Content-Type: application/json
Body
{
    "success": false,
    "data": null,
    "messages": {
        "customer_id": [
            "The customer id field is required."
        ],
        "store": [
            "The store field is required."
        ],
        "invoice_description": [
            "The invoice description field is required."
        ],
        "products": [
            "The products field is required."
        ],
    },
    "href": "api/v1/admin/invoices"
}

Create an invoice
POST/api/v1/admin/invoices

Endpoint information

Requires authentication Yes

View an invoice

GET https://demo.repairrabbit.co/api/v1/admin/invoices/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "invoice": {
    "id": 1,
    "friendly_id": 17028744,
    "ticket_id": null,
    "user_id": 4,
    "store_id": 2,
    "discount_description": "17028744",
    "amount": "99.90",
    "vat_percentage": "21.00",
    "vat_amount": "17.34",
    "discount": "0.00",
    "discount_amount": "0.00",
    "discount_in": "amount",
    "payment_mode": "card",
    "on_account": null,
    "generated_by": 2,
    "invoice_description": "test Description",
    "created_by": 1,
    "created_at": "2018-06-15 12:38:41",
    "modified_by": null,
    "updated_at": "2018-06-15 12:38:41",
    "user": {
      "id": 4,
      "name": "customer",
      "customer": {
        "id": 1,
        "user_id": 4
      }
    },
    "store": {
      "id": 2,
      "address": "Ahmedabad"
    }
  },
  "meta": {
    "invoiceProducts": [
      {
        "name": "Display (LCD) damage, glass broken black",
        "sku": "A000210",
        "product_id": 1,
        "unit_price": "99.90",
        "quantity": 2,
        "price": "69.90",
        "quantity_price": 199.8
      }
    ],
    "total_price": 99.9,
    "total_product_price": 99.9,
    "total_price_extraItems": 0,
    "extraInvoiceItems": [],
    "vat_divisor": 1.21,
    "on_account_day_list": [
      0,
      7,
      14,
      21,
      45,
      60
    ]
  },
  "message": "Invoice detail.",
  "href": "api/v1/admin/invoices/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Invoice not found."
  ],
  "href": "api/v1/admin/invoices/14"
}

View an invoice
GET/api/v1/admin/invoices/{invoice_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
invoice_id
number (required) Example: 1

Id of the invoice.


Delete an invoice

DELETE https://demo.repairrabbit.co/api/v1/admin/invoices/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": "Invoice deleted successfully.",
  "href": "api/v1/admin/invoices/2"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Invoice not found."
  ],
  "href": "api/v1/admin/invoices/14"
}

Delete an invoice
DELETE/api/v1/admin/invoices/{invoice_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
invoice_id
number (required) Example: 1

Id of the invoice.


List of store product with accessories

GET https://demo.repairrabbit.co/api/v1/admin/store/4/products-with-accessories?fromDirectInvoice=0
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "products": [
    {
      "productId": 1,
      "product_name": "Display (LCD) damage, glass broken black",
      "price": "69.90",
      "sku": "A000210",
      "quantity": 26,
      "maintain_stock": 1,
      "device_name": "iPhone 5"
    }
  ],
  "accessories": [
    {
      "productId": 4,
      "product_name": "iphone charger",
      "price": "99.90",
      "sku": "A000123",
      "maintain_stock": 1,
      "quantity": 10,
      "device_name": "Accessories"
    }
  ],
  "href": "api/v1/admin/store/1/products-with-accessories"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Store not found."
  ],
  "href": "api/v1/admin/store/198/products-with-accessories"
}

List of store product with accessories
GET/api/v1/admin/store/{store_id}/products-with-accessories{?fromDirectInvoice}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 4

Id of store for get list of product or accessories.

fromDirectInvoice
number (required) Example: 0

Flag required for generate invoice from ticket and display only accessories if store contains.


Generate an invoice from ticket

POST https://demo.repairrabbit.co/api/v1/admin/tickets/1/invoice
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "accessories": [
        {
            "product_id": 17,
            "quantity": 1,
            "item_type": "accessories"
        },
    ],
    "store": 1,
    "customer_id": 4,
    "invoice_description": "",
    "wants_in_mail": 0,
    "discount_description": "",
    "discount": 0,
    "discount_option": "amount",
    "payment_mode": "cash",
    "on_account": 0
}
Schema
{
    "type": "object",
    "properties": {
        "accessories": {
            "type": "array",
            "description": "The accessory's id array",
            "subproperties": {
                "product_id": {
                    "type": "number",
                    "description": "The ID of product for the invoice",
                    "rule": "The max number of digits is 10 and must exists from available products",
                    "required": "true"
                },
                "quantity": {
                    "type": "number",
                    "description": "The quantity of product for the invoice",
                    "rule": "Product's quantity can not be greater than the max quantity added in stock of store",
                    "required": "true"
                },
                "item_type": {
                    "type": "string",
                    "description": "The type of product for the invoice",
                    "rule": "The type must be from product or accessory"
                }
            }
        },
        "store": {
            "type": "number",
            "description": "The ID of store for the invoice",
            "rule": "The max number of digits is 10 and must exists from available stores"
        },
        "customer_id": {
            "type": "number",
            "description": "The ID of customer for the invoice",
            "rule": "The max number of digits is 10 and must exists from available customers"
        },
        "invoice_description": {
            "type": "string",
            "description": "The description for the invoice"
        },
        "wants_in_mail": {
            "type": "string",
            "description": "The status to get invoice in mail",
            "rule": "The value must be from 0 or 1"
        },
        "discount_description": {
            "type": "string",
            "description": "The discount_description for the invoice"
            "rule": "The discount_description max length is 100"
        },
        "discount": {
            "type": "email",
            "description": "The discount for the invoice",
            "rule": "The discount with regex:/(^\d{1,10}(.\d{1,2})?$)/"
        },
        "discount_option": {
            "type": "string",
            "description": "The discount_option for the invoice",
            "rule": "The discount_option must be from percent,amount"
        },
        "payment_mode": {
            "type": "string",
            "description": "The payment_mode for the invoice",
            "rule": "The payment_mode must be from cash,card"
        },
        "on_account": {
            "type": "string",
            "description": "The count of days with that the amount of invocie is paid",
            "rule": "The on_account must be from 0,7,14,21,45,60"
        },
        "extra_items": {
            "type": "array",
            "description": "The extra_items for the invoice",
            "subproperties": {
                "sku": {
                    "type": "string",
                    "description": "The sku of the extra item for the invoice",
                    "rule": "The sku max length is 64",
                    "required": "true"
                },
                "name": {
                    "type": "number",
                    "description": "The name of extra item for the invoice",
                    "rule": "The name max length is 96",
                    "required": "true"
                },
                "description": {
                    "type": "string",
                    "description": "The description of extra item for the invoice",
                },
                "price": {
                    "type": "string",
                    "description": "The type of product for the invoice",
                    "rule": "The price with regex:/(^\d{1,10}(.\d{1,2})?$)/",
                    "required": "true"
                }
            }
        }
    },
    "required": [
        "invoice_description"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "invoice": [
    {
      "id": 32,
      "friendly_id": 18018747,
      "ticket_id": 1,
      "user_id": 4,
      "store_id": 1,
      "discount_description": null,
      "amount": "179.90",
      "vat_percentage": "21.00",
      "vat_amount": "31.22",
      "discount": "0.00",
      "discount_amount": "0.00",
      "discount_in": "amount",
      "payment_mode": "cash",
      "on_account": 0,
      "generated_by": 1,
      "invoice_description": "test",
      "created_by": 1,
      "created_at": "2018-06-19 18:15:01",
      "modified_by": null,
      "updated_at": "2018-06-19 18:15:01",
      "ticket_fid": "YNT-400"
    }
  ],
  "meta": {
    "invoiceProducts": [
      {
        "id": 2,
        "product_id": 2,
        "product_name": "On off switch",
        "sku": "A000223",
        "product_price": "99.90",
        "install_fee": "20",
        "deviceDelete": null,
        "device_name": "Samsung Galaxy J2"
      }
    ],
    "accessories": [],
    "extraInvoiceItems": [
      {
        "name": "1sdfsdf2",
        "sku": "swdfsd",
        "price": "123.00",
        "description": "accessoriesfcsdfdf"
      }
    ],
    "total_price": 222.9,
    "total_product_price": 99.9,
    "total_price_extraItems": 123,
    "vat_divisor": 1.21
  },
  "message": "Invoice created successfully.",
  "href": "api/v1/admin/tickets/1/invoice"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "invoice_description": [
      "The invoice description field is required."
    ],
    "store": [
      "The store field is required."
    ]
  },
  "href": "api/v1/admin/tickets/1/invoice"
}
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 34,
    "friendly_id": 18018747,
    "ticket_id": 1,
    "user_id": 4,
    "store_id": 1,
    "discount_description": null,
    "amount": "179.90",
    "vat_percentage": "21.00",
    "vat_amount": "31.22",
    "discount": "0.00",
    "discount_amount": "0.00",
    "discount_in": "amount",
    "payment_mode": "cash",
    "on_account": 0,
    "generated_by": 1,
    "invoice_description": "test",
    "created_by": 1,
    "created_at": "2018-06-19 18:21:31",
    "modified_by": null,
    "updated_at": "2018-06-19 18:21:31"
  },
  "messages": "Invocie already generated for this ticket.For any change in this invocie please delete this.",
  "href": "api/v1/admin/tickets/1/invoice"
}

Generate an invoice from ticket
POST/api/v1/admin/tickets/{ticket_id}/invoice

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_id
number (required) Example: 1

Id of ticket for generate invoice for that ticket.


Dashboard

Gets dashboard data

GET https://demo.repairrabbit.co/api/v1/admin/dashboard?store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "appointmentsToday": [],
  "stores": [
    {
      "address": "Rajkot",
      "id": 1
    }
  ],
  "stocks": [
    {
      "productId": 1,
      "product_name": "Display (LCD) damage, glass broken black",
      "quantity": "40",
      "total_price": "400"
    }
  ],
  "ytdConfirmedAppointments": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "ytdPrevYearConfirmedAppointments": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "ytdUnconfirmedAppointments": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "PrevYearUnconfirmedAppointments": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "activeEmployees": 3,
  "deactiveEmployees": 0,
  "activeStores": 1,
  "deactiveStores": 0,
  "ytdClosedTickets": [
    {
      "id": 6,
      "short_name": "Jun",
      "count": 1
    },
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "ytdPrevYearClosedTickets": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "ytdStartTickets": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "PrevYearStartTickets": [
    {
      "id": 1,
      "short_name": "Jan",
      "count": 0
    },
    {
      "id": 2,
      "short_name": "Feb",
      "count": 0
    },
    {
      "id": 3,
      "short_name": "Mar",
      "count": 0
    },
    {
      "id": 4,
      "short_name": "Apr",
      "count": 0
    },
    {
      "id": 5,
      "short_name": "May",
      "count": 0
    },
    {
      "id": 6,
      "short_name": "Jun",
      "count": 0
    },
    {
      "id": 7,
      "short_name": "Jul",
      "count": 0
    },
    {
      "id": 8,
      "short_name": "Aug",
      "count": 0
    },
    {
      "id": 9,
      "short_name": "Sep",
      "count": 0
    },
    {
      "id": 10,
      "short_name": "Oct",
      "count": 0
    },
    {
      "id": 11,
      "short_name": "Nov",
      "count": 0
    },
    {
      "id": 12,
      "short_name": "Dec",
      "count": 0
    }
  ],
  "requiredProducts": 1,
  "meta": {
    "store_id": "1",
    "start_date": "2018-06-14",
    "end_date": "2018-06-24"
  },
  "message": "",
  "href": "api/v1/admin/dashboard"
}

Gets dashboard data
GET/api/v1/admin/dashboard{?store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store to get data of one store.


Gets count of total repairs

GET https://demo.repairrabbit.co/api/v1/admin/tickets/count?store_id=1&employee_id=1&start_date=2018-05-19&end_date=2018-06-19
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticketCount": [
    {
      "date": "2018-06-18",
      "count": 1
    }
  ],
  "totalRepairCount": 1,
  "meta": {
    "store_id": "1",
    "employee_id": "2",
    "start_date": "2018-05-19",
    "end_date": "2018-06-19"
  },
  "message": "",
  "href": "api/v1/admin/dashboard/tickets/count"
}

Gets count of total repairs
GET/api/v1/admin/tickets/count{?store_id,employee_id,start_date,end_date}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store to get data of one store.

employee_id
number (required) Example: 1

Id of the employee to get data of one employee.

start_date
number (required) Example: 2018-05-19

Date in formate of Y-m-d to get data from that starting date.

end_date
number (required) Example: 2018-06-19

Date in formate of Y-m-d to get data from that ending date.


Gets stock total price

GET https://demo.repairrabbit.co/api/v1/admin/stocks/total-price?store_id=1&product_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "stocksTotalPrice": 400,
  "stocksTotalQuantity": 40,
  "meta": {
    "store_id": "1",
    "product_id": "1"
  },
  "message": "",
  "href": "api/v1/admin/dashboard/stocks/total-price"
}

Gets stock total price
GET/api/v1/admin/stocks/total-price{?store_id,product_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store to get data of one store.

product_id
number (required) Example: 1

Id of the product to get data of one product.


Gets invoice total amount

GET https://demo.repairrabbit.co/api/v1/admin/invoices/total-amount?store_id=1&start_date=2018-05-19&end_date=2018-06-19
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "invoiceFinalAmount": 299.7,
  "invoiceAmounts": [
    {
      "store_id": 1,
      "address": "Rajkot",
      "total_amount": "299.70"
    }
  ],
  "currency": "€",
  "meta": {
    "store_id": "1",
    "start_date": "2018-05-19",
    "end_date": "2018-06-19"
  },
  "message": "",
  "href": "api/v1/admin/dashboard/invoices/total-amount"
}

Gets invoice total amount
GET/api/v1/admin/invoices/total-amount{?store_id,start_date,end_date}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
store_id
number (required) Example: 1

Id of the store to get data of one store.

start_date
number (required) Example: 2018-05-19

Date in formate of Y-m-d to get data from that starting date.

end_date
number (required) Example: 2018-06-19

Date in formate of Y-m-d to get data from that ending date.


Agenda

Gets data of agenda

Retrieves data of Agenda

GET https://demo.repairrabbit.co/api/v1/admin/agenda?start_date=2018-05-19&end_date=2018-06-19&store_id=1
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "agenda": {
    "appointments": [
      {
        "id": 4,
        "title": "iPhone 5 - Display (LCD) damage, glass broken black ",
        "start": "2018-06-21T17:58:47+05:30",
        "end": "2018-06-21T17:58:47+05:30",
        "allDay": false,
        "type": "appointment",
        "borderColor": "#ffffff",
        "backgroundColor": "#102929",
        "textColor": "#FFF"
      }
    ],
    "employeeLeaves": [
      {
        "id": "0",
        "title": "employee",
        "start": "2017-07-05T09:00:00+05:30",
        "end": "2017-07-05T12:00:00+05:30",
        "allDay": false,
        "type": "on_leave",
        "borderColor": "rgb(41, 161, 230)",
        "backgroundColor": "rgb(41, 161, 230)",
        "textColor": "#fff"
      },
      {
        "id": "0",
        "title": "Admin",
        "start": "2017-07-05T14:00:00+05:30",
        "end": "2017-07-05T22:00:00+05:30",
        "allDay": false,
        "type": "on_leave",
        "borderColor": "rgb(41, 161, 230)",
        "backgroundColor": "rgb(41, 161, 230)",
        "textColor": "#fff"
      }
    ],
    "storeHoliday": [
      {
        "title": "Diwali ( Rajkot ) ",
        "start": "2017-08-20T00:00:00+05:30",
        "allDay": true,
        "type": "holiday",
        "borderColor": "#fff",
        "backgroundColor": "#ffc266",
        "textColor": "#fff"
      },
      {
        "title": "vacation ( Ahmedabad ) ",
        "start": "2017-09-10T00:00:00+05:30",
        "allDay": true,
        "type": "holiday",
        "borderColor": "#fff",
        "backgroundColor": "#ffc266",
        "textColor": "#fff"
      }
    ]
  },
  "meta": {
    "start_date": "2018-05-21",
    "end_date": "2018-06-21"
  },
  "message": "Agenda details",
  "href": "api/v1/admin/agenda"
}

Gets data of agenda
GET/api/v1/admin/agenda{?start_date,end_date,store_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
start_date
number (optional) Example: 2018-05-19

Date in formate of Y-m-d to get appointment data from that starting date.

end_date
number (optional) Example: 2018-06-19

Date in formate of Y-m-d to get appointment data from that ending date.

store_id
number (optional) Example: 1

Gives only selected store’s data.


Email Template

Gets all email template

Retrieves a list of email template

GET https://demo.repairrabbit.co/api/v1/admin/email-templates?filterStatus=0
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-templates": [
    {
      "id": 1,
      "status": 0,
      "name": "Appointment status says \"customer didn't appear\"",
      "subject": "We missed you!"
    }
  ],
  "meta": {
    "email_status_options": [
      "All Templates",
      "Active",
      "Inactive"
    ],
    "email_status_filter_id": ""
  },
  "message": "",
  "href": "api/v1/admin/email-templates"
}

Gets all email template
GET/api/v1/admin/email-templates{?filterStatus}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
filterStatus
number (optional) Example: 0

1 : active status of email template & 0 : inactive status of email template


View an email-template

GET https://demo.repairrabbit.co/api/v1/admin/email-templates/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-template": {
    "id": 1,
    "name": "Appointment status says \"customer didn't appear\"",
    "status": 0,
    "subject": "We missed you!",
    "plaintext_content": "Dear (full_name),\n\n            You have made an appointment on (appointment_datetime) at (store_name) but you forgot to appear.  Do you still need a repair?  Simply create a New Appointment.\n            (store_address)",
    "html_content": "<p>Dear (full_name),</p>\n\n            <p>You have made an appointment&nbsp;on (appointment_datetime) at (store_name) but you forgot to appear.&nbsp;&nbsp;Do you still need a repair? &nbsp;Simply create a <a href=\"(new_appointment_url)\">New Appointment</a>.</p>\n\n            <p><strong>(store_address)</strong></p>"
  },
  "message": "Email template detail.",
  "href": "api/v1/admin/email-templates/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Email template not found."
  ],
  "href": "api/v1/admin/email-templates/1123"
}

View an email-template
GET/api/v1/admin/email-templates/{email_template_id}

  • Here (variable_name) that are exists with double curly braces in database.

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email_template_id
number (required) Example: 1

Id of the email template.


Update an email template

PUT https://demo.repairrabbit.co/api/v1/admin/email-templates/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "ticket update",
  "status": 1,
  "subject": "ticket update",
  "htmlContent": "<b>(sdcszdcs) dsfc dfsdf defsdef desdf \n edfsdf desdfs</b>"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name for the email-template",
      "rule": "The min length is 3 and the max length is 100"
    },
    "status": {
      "type": "number",
      "description": "The status for the email-template",
      "rule": "The status from value true:1 or false:0"
    },
    "subject": {
      "type": "string",
      "description": "The subject for the email-template",
      "rule": "The min length is 10 and the max length is 150"
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "email-template": {
    "id": 1,
    "name": "ticket update",
    "status": 0,
    "subject": "ticket update",
    "plaintext_content": "(full_name) ticket updated",
    "html_content": "<b>(full_name) ticket updated</b>",
    "default_content": "",
    "created_by": 1,
    "created_at": "2018-06-19 17:18:17",
    "modified_by": 1,
    "updated_at": "2018-06-19 18:04:37"
  },
  "message": "Email template updated successfully.",
  "href": "api/v1/admin/email-templates/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "name": [
      "The name field is required."
    ]
  },
  "href": "api/v1/admin/email-templates/1"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Email template not found."
  ],
  "href": "api/v1/admin/email-templates/12312"
}

Update an email template
PUT/api/v1/admin/email-templates/{email_template_id}

  • Add (variable_name) with double curly braces in request body.

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email_template_id
number (required) Example: 1

Id of the email template.


Change an email template status

PUT https://demo.repairrabbit.co/api/v1/admin/email-templates/1/change-status
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "status": 1
}
Schema
{
  "type": "object",
  "properties": {
    "status": {
      "type": "number",
      "description": "The status for email-template",
      "rule": "The status from value true:1 or false:0"
    }
  },
  "required": [
    "status"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404422
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": null,
  "message": "Email template status updated successfully.",
  "href": "api/v1/admin/email-templates/1/change-status"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "status": [
      "The selected status is invalid."
    ]
  },
  "href": "api/v1/admin/email-templates/1/change-status"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Email template not found."
  ],
  "href": "api/v1/admin/email-templates/12312"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": [
    "Please check your mail configuration from settings to enable mail."
  ],
  "href": "api/v1/admin/email-templates/1/change-status"
}

Change an email template status
PUT/api/v1/admin/email-templates/{email_template_id}/change-status

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
email_template_id
number (required) Example: 1

Id of the email template to change status.


Customer Profile

Customer Register

Get customer register.

POST https://demo.repairrabbit.co/api/v1/register
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "john deon",
  "email": "[email protected]gmail.com",
  "password": "abcxyz",
  "salutation": "Mr",
  "company_name": "",
  "purpose": "consumer",
  "extra_instructions": "",
  "address": "",
  "address_zip": "",
  "address_city": "",
  "dob": "",
  "phone": ""
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the user",
            "rule": "The max length is 250"
        },
        "email": {
            "type": "email",
            "description": "The email the user",
            "rule": "The min length is 8 and the max length is 60 and must be unique"
        },
        "password": {
            "type": "string",
            "description": "The password for the customer",
            "rule": "The min length is 6 and the max length is 30"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the user",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address": {
            "type": "string",
            "description": "The address for the user",
            "rule": "The min length is 10 amd the max length is 150 with regex:/(^[a-zA-Z0-9\s,.-]*$)/"
        },
        "address_zip": {
            "type": "string",
            "description": "The address_zip for the user",
            "rule": "The min length is 3 amd the max length is 16"
        },
        "address_city": {
            "type": "string",
            "description": "The address_city for the user",
            "rule": "The min length is 3 amd the max length is 60 regex:/(^[a-zA-Z]+(?:[\s-.][a-zA-Z]+)*$)/"
        },
        "salutation": {
            "type": "string",
            "description": "The salutation for the user",
            "rule": "The max length is 32"
        },
        "dob": {
            "type": "date",
            "description": "The dob for the user",
            "rule": "The date format must be YYYY-MM-DD and must be date before current date"
        },
        "purpose": {
            "type": "string",
            "description": "The purpose for the user",
            "rule": "The value must be from business,consumer"
        },
        "company_name": {
            "type": "string",
            "description": "The company_name for the user",
            "rule": "The max length is 100",
            "required_if": "The purpose is business"
        },
        "extra_instructions": {
            "type": "string",
            "description": "The extra_instructions for the user",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        }
    },
    "required": [
        "name",
        "email",
        "password"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "user": {
    "id": 12,
    "name": "john deon",
    "role_id": 4,
    "email": "[email protected]",
    "api_key": null,
    "created_by": null,
    "modified_by": null,
    "created_at": "2018-06-20 15:14:26",
    "updated_at": "2018-06-20 15:14:26",
    "customer": {
      "id": 6,
      "user_id": 12,
      "salutation": "Mr",
      "company_name": null,
      "purpose": "consumer",
      "extra_instructions": null,
      "address": null,
      "address_zip": null,
      "address_city": null,
      "dob": null,
      "phone": null,
      "payment_exception": null,
      "created_by": null,
      "created_at": "2018-06-20 15:14:26",
      "modified_by": null,
      "updated_at": "2018-06-20 15:14:26"
    }
  },
  "message": "Customer registered Successfully.",
  "href": "api/v1/register"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "message": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email field is required."
    ],
    "password": [
      "The password field is required."
    ]
  },
  "href": "api/v1/register"
}

Customer Register
POST/api/v1/register

Endpoint information

Requires authentication No

Customer Profile

Get customer profile.

GET https://demo.repairrabbit.co/api/v1/customers/profile
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "user": {
    "id": 6,
    "name": "john deon",
    "role_id": 4,
    "email": "[email protected]",
    "api_key": null,
    "password": "$2y$10$b1wLnd8v0lv0wTmQOgf.7eC/NS8imXOQd/xTBNzbWChaNH9TlMPMq",
    "created_by": null,
    "modified_by": null,
    "remember_token": null,
    "created_at": "2018-06-20 15:14:26",
    "updated_at": "2018-06-20 15:14:26",
    "user_id": 12,
    "salutation": "Mr",
    "company_name": null,
    "purpose": "consumer",
    "extra_instructions": null,
    "address": null,
    "address_zip": null,
    "address_city": null,
    "dob": null,
    "phone": null,
    "payment_exception": null
  },
  "meta": {
    "total_appointments": 0,
    "total_tickets": 0
  },
  "message": "Customer profile data.",
  "href": "api/v1/customers/profile"
}

Customer Profile
GET/api/v1/customers/profile

Endpoint information

Requires authentication No

Customer Profile Update

Update customer profile.

PUT https://demo.repairrabbit.co/api/v1/customers/profile/edit
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "john deon",
  "email": "[email protected]",
  "salutation": "Mr",
  "company_name": "",
  "purpose": "consumer",
  "extra_instructions": "",
  "address": "",
  "address_zip": "",
  "address_city": "",
  "dob": "",
  "phone": "7896541230"
}
Schema
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The name for the user",
            "rule": "The max length is 250"
        },
        "email": {
            "type": "email",
            "description": "The email the user",
            "rule": "The min length is 8 and the max length is 60 and must be unique"
        },
        "phone": {
            "type": "number",
            "description": "The phone for the user",
            "rule": "The regex is /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/"
        },
        "address": {
            "type": "string",
            "description": "The address for the user",
            "rule": "The min length is 10 amd the max length is 150 with regex:/(^[a-zA-Z0-9\s,.-]*$)/"
        },
        "address_zip": {
            "type": "string",
            "description": "The address_zip for the user",
            "rule": "The min length is 3 amd the max length is 16"
        },
        "address_city": {
            "type": "string",
            "description": "The address_city for the user",
            "rule": "The min length is 3 amd the max length is 60 regex:/(^[a-zA-Z]+(?:[\s-.][a-zA-Z]+)*$)/"
        },
        "salutation": {
            "type": "string",
            "description": "The salutation for the user",
            "rule": "The max length is 32"
        },
        "dob": {
            "type": "date",
            "description": "The dob for the user",
            "rule": "The date format must be YYYY-MM-DD and must be date before current date"
        },
        "purpose": {
            "type": "string",
            "description": "The purpose for the user",
            "rule": "The value must be from business,consumer"
        },
        "company_name": {
            "type": "string",
            "description": "The company_name for the user",
            "rule": "The max length is 100",
            "required_if": "The purpose is business"
        },
        "extra_instructions": {
            "type": "string",
            "description": "The extra_instructions for the user",
            "rule": "The min length is 10 and the max length is 255 with regex:/(^[a-zA-Z0-9][\s\d-_\w\/\,=;@#$.^*&!+]*$)/"
        }
    },
    "required": [
        "name",
        "email"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "customer": {
    "id": 6,
    "user_id": 12,
    "salutation": "Mr",
    "company_name": null,
    "purpose": "consumer",
    "extra_instructions": null,
    "address": "",
    "address_zip": "",
    "address_city": "",
    "dob": null,
    "phone": "7896541230",
    "payment_exception": null,
    "created_by": null,
    "created_at": "2018-06-20 15:14:26",
    "modified_by": 12,
    "updated_at": "2018-06-20 15:23:07",
    "user": {
      "id": 12,
      "name": "john deon",
      "email": "[email protected]"
    }
  },
  "message": "Customer profile updated successfully.",
  "href": "api/v1/customers/profile/edit"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email field is required."
    ]
  },
  "href": "api/v1/customers/profile/edit"
}

Customer Profile Update
PUT/api/v1/customers/profile/edit

Endpoint information

Requires authentication No

Customer Ticket

Gets all Tickets

Retrieves a list of all Tickets in the database

GET https://demo.repairrabbit.co/api/v1/tickets?order=asc, desc&orderBy=device_name, id, created_at etc.&perPage=3&search=&page=3
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "tickets": {
    "current_page": 1,
    "data": [
      {
        "id": 1,
        "friendly_id": "YNT-400",
        "user_id": 4,
        "serial": "356476062721552",
        "device_id": 2,
        "store_id": 2,
        "employee_id": 3,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_last_changed_at": "2017-07-05 17:33:14",
        "shipped_at": "2017-07-16 17:33:14",
        "paid_at": "2017-07-25 17:33:14",
        "access_code": "2890",
        "status_image": null,
        "problem_description": "Device picked up and paid at Donald on January 2nd.",
        "different_return_address": "Street 12, 80 ft. road\n 9698PA",
        "different_return_address_zip": "4878",
        "different_return_address_city": "Jamnagar",
        "status": 1,
        "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
        "internal_message": null,
        "payment_status": 0,
        "polis_number": null,
        "stock_deducted_at": null,
        "created_by": 1,
        "created_at": "2018-06-20 16:23:33",
        "modified_by": null,
        "updated_at": "2018-06-20 16:23:33",
        "status_image_url": "http://repairrabbit.test/storage/images/ticket_status_images/test-0rasPF.jpg",
        "device_name": "Samsung Galaxy J2",
        "status_text": "Waiting for device",
        "invoiceId": null,
        "progress_bar_width": "25",
        "progress_bar_color": "progress-bar-danger"
      }
    ],
    "from": 1,
    "last_page": 5,
    "next_page_url": "http://repairrabbit.test/api/v1/customers/tickets?page=2",
    "path": "http://repairrabbit.test/api/v1/customers/tickets",
    "per_page": "1",
    "prev_page_url": null,
    "to": 1,
    "total": 5
  },
  "meta": {
    "orderBy": "updated_at",
    "sortOrder": "desc",
    "items_per_page": "1",
    "ticketsItemList": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/customers/tickets"
}

Gets all Tickets.
GET/api/v1/tickets{?order,orderBy,perPage,search,page}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
order
string (optional) Default: desc Example: asc, desc
orderBy
string (optional) Default: updated_at Example: device_name, id, created_at etc.
perPage
number (optional) Default: 10 Example: 3
search
string (optional) 
page
number (optional) Default: 1 Example: 3

page number to get data


Create a ticket

POST https://demo.repairrabbit.co/api/v1/customers/tickets
Requestsexample 1
Headers
Content-Type: multipart/form-data
Body
{
    "device": 1,
    "products": [1], /* product_ids of device */
    "serial": "123456789087906",
    "description": "test ticket",
    "access_code": "123456789087906"
}
Schema
{
    "type": "object",
    "properties": {
        "device": {
            "type": "number",
            "description": "The ID of device for the ticket",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices"
        },
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products"
        },
        "serial": {
            "type": "number",
            "description": "The serial of device for the ticket",
            "rule": "The value must be between 15 to 16"
        },
        "description": {
            "type": "string",
            "description": "The description for the ticket"
        },
        "access_code": {
            "type": "string",
            "description": "The access_code of device for the ticket",
            "rule": "The max length is 30",
        },
        "polis_number": {
            "type": "number",
            "description": "The polis_number of device for the ticket",
            "rule": "The max length is 32",
        }
    },
    "required": [
        "device",
        "products",
        "serial",
        "description",
        "access_code"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses201400
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 10,
    "friendly_id": "JBG-888",
    "user_id": 4,
    "employee_id": null,
    "device_id": 1,
    "store_id": null,
    "serial": "123456789087906",
    "access_code": "123456789087906",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2018-07-05 18:43:59",
    "status_image": null,
    "status_image_url": null,
    "problem_description": "test ticket",
    "different_return_address": null,
    "different_return_address_zip": null,
    "different_return_address_city": null,
    "status": 2,
    "custom_message": null,
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 4,
    "created_at": "2018-07-05 18:43:59",
    "modified_by": null,
    "updated_at": "2018-07-05 18:43:59",
    "ticket_status": {
      "id": 2,
      "name": "In transit"
    },
    "device": {
      "id": 1,
      "name": "iPhone 5"
    },
    "store": null,
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "ticket_id": 10,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": null
  },
  "message": "Ticket created successfully.",
  "href": "api/v1/customers/tickets"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "device": [
      "The device field is required."
    ],
    "products": [
      "The products must be an array.",
      "The products must have at least 1 items."
    ],
    "serial": [
      "The serial field is required."
    ],
    "description": [
      "The description field is required."
    ],
    "access_code": [
      "The access code field is required."
    ]
  },
  "href": "api/v1/customers/tickets"
}

Create a ticket
POST/api/v1/customers/tickets

Endpoint information

Requires authentication Yes

View a ticket

GET https://demo.repairrabbit.co/api/v1/customers/tickets/YNT-400
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 1,
    "friendly_id": "YNT-400",
    "user_id": 4,
    "employee_id": 3,
    "device_id": 2,
    "store_id": 2,
    "serial": "356476062721552",
    "access_code": "2890",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2017-07-05 17:33:14",
    "status_image": null,
    "status_image_url": null,
    "problem_description": "Device picked up and paid at Donald on January 2nd.",
    "different_return_address": "Street 12, 80 ft. road\n                                         9698PA",
    "different_return_address_zip": "4878",
    "different_return_address_city": "Jamnagar",
    "status": 1,
    "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 1,
    "created_at": "2018-07-05 18:18:54",
    "modified_by": null,
    "updated_at": "2018-07-05 18:18:54",
    "ticket_status": {
      "id": 1,
      "name": "Waiting for device"
    },
    "device": {
      "id": 2,
      "name": "Samsung Galaxy J2"
    },
    "store": {
      "id": 2,
      "name": "Ahmedabad",
      "address": "Near City Mall"
    },
    "products": [
      {
        "id": 2,
        "name": "On off switch",
        "pivot": {
          "ticket_id": 1,
          "product_id": 2
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 3,
      "user_id": 6,
      "user": {
        "id": 6,
        "name": "employee3"
      }
    }
  },
  "message": "Ticket detail.",
  "href": "api/v1/customers/tickets/HNB-891"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/customers/tickets/avc-400"
}

View a ticket
GET/api/v1/customers/tickets/{ticket_friendly_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: YNT-400

FriendlyId of the ticket.


Update a ticket

PUT https://demo.repairrabbit.co/api/v1/customers/tickets/HNB-891
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "device": 1, /* id of device*/
    "products": [1], /* id of products*/
    "serial": "1231231212312378",
    "access_code": "1231312",
    "polis_number": "",
    "stock_deducted_at": "2018-06-21 16:40:37"
}
Schema
{
    "type": "object",
    "properties": {
        "device": {
            "type": "number",
            "description": "The ID of device for the ticket",
            "rule": "The max number of digits is 10 and it must be active and must exists from available devices",
            "required_without": "The value required when stock_deducted_at not given"
        },
        "products": {
            "type": "array",
            "description": "The product's id array",
            "rule": "The product id must be in number and at least 1 required and exists from available products",
            "required_without": "The value required when stock_deducted_at not given"
        },
        "serial": {
            "type": "number",
            "description": "The serial of device for the ticket",
            "rule": "The value must be between 15 to 16"
        },
        "access_code": {
            "type": "string",
            "description": "The access_code of device for the ticket",
            "rule": "The max length is 30",
        },
        "polis_number": {
            "type": "number",
            "description": "The polis_number of device for the ticket",
            "rule": "The max length is 32",
        },
        "stock_deducted_at": {
            "type": "date",
            "description": "The date for the ticket's stock deducted",
            "rule": "The date format must be YYYY-MM-DD"
        }
    },
    "required": [
        "serial",
        "access_code"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Responses200400404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket": {
    "id": 1,
    "friendly_id": "YNT-400",
    "user_id": 4,
    "employee_id": 3,
    "device_id": 2,
    "store_id": 2,
    "serial": "356476062721552",
    "access_code": "2890",
    "customer_reference": null,
    "customer_reference_from": null,
    "status_last_changed_at": "2017-07-05 17:33:14",
    "status_image": null,
    "status_image_url": null,
    "problem_description": "Device picked up and paid at Donald on January 2nd.",
    "different_return_address": "Street 12, 80 ft. road\n                                         9698PA",
    "different_return_address_zip": "4878",
    "different_return_address_city": "Jamnagar",
    "status": 1,
    "custom_message": "Device repaired. Once the payment is received, we will send the device back.",
    "internal_message": null,
    "polis_number": null,
    "stock_deducted_at": null,
    "created_by": 1,
    "created_at": "2018-07-05 18:18:54",
    "modified_by": null,
    "updated_at": "2018-07-05 18:18:54",
    "ticket_status": {
      "id": 1,
      "name": "Waiting for device"
    },
    "device": {
      "id": 2,
      "name": "Samsung Galaxy J2"
    },
    "store": {
      "id": 2,
      "name": "Ahmedabad",
      "address": "Near City Mall"
    },
    "products": [
      {
        "id": 1,
        "name": "Display (LCD) damage, glass broken black",
        "pivot": {
          "ticket_id": 1,
          "product_id": 1
        }
      }
    ],
    "user": {
      "id": 4,
      "name": "customer",
      "email": "[email protected]",
      "customer": {
        "id": 1,
        "user_id": 4,
        "phone": "0633836781",
        "company_name": "Samsung Service Center",
        "address_zip": "1424PN",
        "address_city": "Rajkot"
      }
    },
    "employee": {
      "id": 3,
      "user_id": 6,
      "user": {
        "id": 6,
        "name": "employee3"
      }
    }
  },
  "message": "Ticket updated successfully.",
  "href": "api/v1/customers/tickets/HNB-891"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "data": null,
  "messages": {
    "device": [
      "The device field is required when stock deducted at is not present."
    ],
    "products": [
      "The products field is required when stock deducted at is not present."
    ],
    "serial": [
      "The serial field is required."
    ],
    "access_code": [
      "The access code field is required."
    ]
  },
  "href": "api/v1/customers/tickets/HNB-891"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."
  ],
  "href": "api/v1/customers/tickets/HNB-891"
}

Update a ticket
PUT/api/v1/customers/tickets/{ticket_friendly_id}

Endpoint information

Requires authentication Yes
URI Parameters
HideShow
ticket_friendly_id
string (required) Example: HNB-891

FriendlyId of the ticket.


Get ticket history

GET https://demo.repairrabbit.co/api/v1/tickets/XJH-856/history?order=asc, desc&orderBy=customer_name, device_name, store_name, employee_name, updatedBy_name, status, etc.&perPage=3&filterStatus=0&search=&page=3
Responses200404
Headers
Content-Type: application/json
Body
{
  "success": true,
  "ticket_friendly_id": "YNT-400",
  "ticket_history": {
    "current_page": 1,
    "data": [
      {
        "ticket_friendly_id": "YNT-400",
        "id": 2,
        "paid_at": "2017-07-25 17:33:14",
        "ticket_id": 1,
        "status": "1",
        "device_id": 2,
        "store_id": null,
        "product": "",
        "employee_id": 6,
        "serial": null,
        "access_code": null,
        "customer_reference": null,
        "customer_reference_from": null,
        "status_image": null,
        "problem_description": "thick point",
        "custom_message": "Too many damages!!",
        "polis_number": null,
        "internal_message": null,
        "different_return_address": null,
        "different_return_address_zip": null,
        "different_return_address_city": null,
        "created_by": 1,
        "created_at": "2018-06-21 17:38:47",
        "modified_by": null,
        "updated_at": "2018-06-21 17:38:47",
        "status_name": "Waiting for device",
        "status_last_changed_at": "2017-07-05 17:33:14",
        "device_name": "Samsung Galaxy J2",
        "updatedBy_name": null,
        "employee_name": "employee3",
        "store_address": null,
        "createdBy_name": "Admin"
      }
    ],
    "from": 1,
    "last_page": 1,
    "next_page_url": null,
    "path": "http://repairrabbit.test/api/v1/customers/tickets/YNT-400/history",
    "per_page": "3",
    "prev_page_url": null,
    "to": 1,
    "total": 1
  },
  "meta": {
    "orderBy": "updated_at",
    "sortOrder": "asc",
    "items_per_page": "3",
    "tickethistorysItemListOptions": [
      10,
      20,
      30,
      40,
      50
    ],
    "searchString": ""
  },
  "message": "",
  "href": "api/v1/customers/tickets/YNT-400/history"
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "messages": [
    "Ticket not found."