Loading...

MAKILLA API FUNCTIONS

Software package for successful business!

INTRODUCTION

TESTING & DEVELOP:

URL: pos.makilla.com/api/{function}

Authorization: None

PRODUCTION:

Before start using the api functions please create a token.

URL: {account_name}.makilla.com/api/{function}

Authorization: Bearer TOKEN_STRING


How to create token?

Token is created over admin panel:

FUNCTIONS

STORE AND STORAGE

Function name: /stores
Function description: return list of stores
Method: GET
Function call http://pos.makilla.com/api/stores

INPUT PARAMS

RESULTS

{
    "success": true,
    "code": 200,
    "data": [
    {
    "Store": {
        "id": "1",
        "name": "Test Store" }
    ]
    
Function name: /storages
Function description: return list of storages
Method: GET
Function call http://pos.makilla.com/api/storages

INPUT PARAMS

RESULTS

{
    "success": true,
    "code": 200,
    "data": [
    {
    "Storages": {
       "id": "1",
       "name": "Test Storages" }
    ]


CATEGORIES

Function name: /categories/
Function description: return list of the all visible categories
Method: GET
Function call http://pos.makilla.com/api/categories/

INPUT PARAMS

name = type, values = "list"
categories?type=list
return prepared list for select dropdown

RESULTS

{
"success": true,
"code": 200,
"data": [
            {
                "Category": {
                      "id": "63",
                      "category_id": null,
                      "code": "HW",
                      "name": "HARDWARE",
                      "is_active": true
                     },

                    "Subcategory": [
                        {
                           "id": "64",
                            "category_id": "63",
                            "code": "DI",
                            "name": "DISPLAY",
                            "description": "",
                            "is_visible": true,
                            "is_active": true
                        },

                        {
                            "id": "65",
                            "category_id": "63",
                            "code": "MB",
                            "name": "MAINBOARD",
                            "description": "",
                            "is_visible": true,
                            "is_active": true
                        }
                    ]
                }
            }
        ]
}
Function name: category/{id}
Function description: return name of the category based on id
Method: GET
Function call http://pos.makilla.com/api/category/{id}

INPUT PARAMS

id - category id

RESULTS

{
    "success": true,
    "code": 200,
    "data": {
    "id":"1",
    "category_id":null,
    "code":"C001",
    "name":"Akcija",
    "is_active":"1"
    }
    }
                        
Function name: category/add
Function description: add new product category to shop
Method: POST
Function call http://pos.makilla.com/api/category/add

INPUT PARAMS

Array [
name - category name
description - category description
code - category code
is_visible - default 1
is_active - default 1

RESULTS

{
    "success": true,
    "code": 200,
    "data": {
    "id":"1",
    "category_id":null,
    "code":"C001",
    "name":"Akcija",
    "is_active":"1"
    }
    }
                        
Function name: category/update
Function description: return name of the category based on id
Method: POST
Function call http://pos.makilla.com/api/category/update

INPUT PARAMS


RESULTS

{
    "success": true,
    "code": 200,
    }
                        
Function name: category/delete/{id}
Function description: delete product category based on id
Method: GET
Function call http://pos.makilla.com/api/category/delete/{id}

INPUT PARAMS

id - category id

RESULTS

{
    "success": true,
    "code": 200,
    "data": {
    "id":"1",
    "category_id":null,
    "code":"C001",
    "name":"Akcija",
    "is_active":"1"
    }
    }
                        

BRANDS

Function name: /brands/
Function description: return list of the all visible brends
Method: GET
Function call http://pos.makilla.com/api/brands/

INPUT PARAMS

{none}

RESULTS

 {
         "success":true,
         "code":200,
         "data":[                       [                  {
                  { "Brand":{
                      "id":"1",
                      "featured_image":null,
                      "name":"Vertrigo",
                      "is_active":true
                     }
                  },
                  . . .

                  { "Brand":{
                      "id":"9",
                      "featured_image":null,
                      "name":"Kingston",
                      "is_active":true
                     }
                  }
         ]
    }
                    
Function name: /brand/{id}
Function description: return name of the brand based on id
Method: GET
Function call http://pos.makilla.com/api/brand/{id}

INPUT PARAMS

id - brand id

RESULTS

{
    "success":true,
    "code":200,
    "data":
    {
      "Brand":{
         "id":"9",
         "featured_image":null,
         "name":"Kingston",
         "is_active":true
      }
    }
}
                        

ITEMS

Function name: /items/
Function description: return list of all items
Method: POST
Function call http://pos.makilla.com/api/items/?{query_condition}

INPUT PARAMS

{query_conditions}
?inventories_id = 5
?category_id = 2

example: ../getitems?inventories_id=5&category_id=10

RESULTS

{
    "success":true,
    "code":200,
    "data":
    [
      "0":{
         "Item":{
            "id":"123",
            "category_id":"24",
            "brand_id":"1",
            "supplier_id":null,
            "feature":false,
            "store_id":"0",
            "itemset_id":null,
            "category_code":null,
            "location_code":null,
            "prizm_code":"4486",
            "upc":"",
            "name":"\t DVD+-RW S-ATA 24X, SATA, M-DISC, Silent Play, Dual Layer, GH24ND1",
            "slug":"dvd-rw-s-ata-24x-sata-m-disc-silent-play-dual-layer-gh24nd1",
            "color":null,
            "short":null,
            "description":null,
            "is_non_item":true,
            "price":"1799",
            "selling_price":null,
            "discount_price":null,
            "discount_rate":null,
            "discount_started":null,
            "discount_ended":null,
            "tax":"18",
            "stock_in_hand":"1",
            "created_by":null,
            "created":null,
            "modified_by":null,
            "modified":null,
            "is_old":false,
            "web":true,
            "is_active":true
         },
         "Itemimage":[
            {
               "id":"23",
               "item_id":"123",
               "small_name":"1510084579_small.jpg",
               "small_type":null,
               "small_size":null,
               "big_name":"1510084579_big.jpg",
               "big_type":null,
               "big_size":"0",
               "thumb_name":"1510084579_thumbnails.jpg",
               "thumb_type":null,
               "thumb_size":"0",
               "is_default":"1"
            }
         ]
                    
Function name: /item/{id}
Function description: get item from store
Method: GET
Function call http://pos.makilla.com/api/item/{id}

INPUT PARAMS

RESULTS

{
    "success":true,
    "code":200,
    "data":
    [
                        [
   {
      "0":{
         "Item":{
            "id":"123",
            "category_id":"24",
            "brand_id":"1",
            "supplier_id":null,
            "feature":false,
            "store_id":"0",
            "itemset_id":null,
            "category_code":null,
            "location_code":null,
            "prizm_code":"4486",
            "upc":"",
            "name":"\t DVD+-RW S-ATA 24X, SATA, M-DISC, Silent Play, Dual Layer, GH24ND1",
            "slug":"dvd-rw-s-ata-24x-sata-m-disc-silent-play-dual-layer-gh24nd1",
            "color":null,
            "short":null,
            "description":null,
            "is_non_item":true,
            "price":"1799",
            "selling_price":null,
            "discount_price":null,
            "discount_rate":null,
            "discount_started":null,
            "discount_ended":null,
            "tax":"18",
            "stock_in_hand":"1",
            "created_by":null,
            "created":null,
            "modified_by":null,
            "modified":null,
            "is_old":false,
            "web":true,
            "is_active":true
         },
         "Itemimage":[
            {
               "id":"23",
               "item_id":"123",
               "small_name":"1510084579_small.jpg",
               "small_type":null,
               "small_size":null,
               "big_name":"1510084579_big.jpg",
               "big_type":null,
               "big_size":"0",
               "thumb_name":"1510084579_thumbnails.jpg",
               "thumb_type":null,
               "thumb_size":"0",
               "is_default":"1"
            }
         ]
                        }
    ]
                    
Function name: getfeatured
Function description: return items which are set as featured
Function call http://pos.makilla.com/api/item/featured

INPUT PARAMS

RESULTS

                        [
   {
      "0":{
         "Item":{
            "id":"123",
            "category_id":"24",
            "brand_id":"1",
            "supplier_id":null,
            "feature":false,
            "store_id":"0",
            "itemset_id":null,
            "category_code":null,
            "location_code":null,
            "prizm_code":"4486",
            "upc":"",
            "name":"\t DVD+-RW S-ATA 24X, SATA, M-DISC, Silent Play, Dual Layer, GH24ND1",
            "slug":"dvd-rw-s-ata-24x-sata-m-disc-silent-play-dual-layer-gh24nd1",
            "color":null,
            "short":null,
            "description":null,
            "is_non_item":true,
            "price":"1799",
            "selling_price":null,
            "discount_price":null,
            "discount_rate":null,
            "discount_started":null,
            "discount_ended":null,
            "tax":"18",
            "stock_in_hand":"1",
            "created_by":null,
            "created":null,
            "modified_by":null,
            "modified":null,
            "is_old":false,
            "web":true,
            "is_active":true
         },
         "Itemimage":[
            {
               "id":"23",
               "item_id":"123",
               "small_name":"1510084579_small.jpg",
               "small_type":null,
               "small_size":null,
               "big_name":"1510084579_big.jpg",
               "big_type":null,
               "big_size":"0",
               "thumb_name":"1510084579_thumbnails.jpg",
               "thumb_type":null,
               "thumb_size":"0",
               "is_default":"1"
            }
         ]
                    
Function name: add
Function description: create new item in the store
Method: POST
Function call http://pos.makilla.com/api/item/add/{id}

INPUT PARAMS

RESULTS

{
    
                    
Function name: update
Function description: update item in the store
Method: POST
Function call http://pos.makilla.com/api/item/update

INPUT PARAMS

RESULTS

{

                    

INVENTORIES

Function name: getinventory
Function description: return all items from location_id location
Method: GET
Function call http://pos.makilla.com/api/getinventory/{store_id}

INPUT PARAMS

token - user api token
store_id - store id

RESULTS

{
  "id": "1",
  "name": "Pera Peric",
  "street": "London Street" ...
}

CUSTOMER

Function name: customer/{id}
Function description: getcustomer
Method: GET
Function call http://pos.makilla.com/api/customer/{id}

INPUT PARAMS

token - user api token - header
id - customer id

RESULTS

{
     "status":sucess,
     "code": 200,
     "data" : {
         "id": 1,
         "customertype_id": 1,
         "firstname": "Pera",
         "lastname": "Pera",
         "mail": "office@timkom.net",
         "state": "USA",
         "city": "New York",
         "zipcode": "21000",
         "street": "Bulevar 21",
         "home_phone": "+38121666767",
         "mobile_phone": "+38167666767",
         "birthdate": "01/07/2018",
         "company_name": "Timkom",
         "company_address": "S.Miletica 12/1",
         "company_phone": "023772897",
         "company_state": "Brasil",
         "company_zipcode": "122 UG",
         "web": "122 UG",

     }
}
Function name: customer/get
Function description: result is json list of the customers (pagination included)
Method: POST
Function call http://pos.makilla.com/api/customer/get/

INPUT PARAMS

token - user api token

RESULTS

{
        "status":sucess,
        "code": 200,
        "data" : [
            {
                "id": 1,
                "customertype_id": 1,
                "firstname": "Pera",
                "lastname": "Pera",
                "mail": "office@timkom.net",
                "state": "USA",
                "city": "New York",
                "zipcode": "21000",
                "street": "Bulevar 21",
                "home_phone": "+38121666767",
                "mobile_phone": "+38167666767",
                "birthdate": "01/07/2018",
                "company_name": "Timkom",
                "company_address": "S.M 12/1",
                "company_phone": "023772897",
                "company_state": "Brasil",
                "company_zipcode": "122 UG",
                "web": "122 UG",
            },
            . . .
            {
                "id": 99,
                "customertype_id": 2,
                "firstname": "Pera",
                "lastname": "Pera",
                "mail": "office@timkom.net",
                "state": "USA",
                "city": "New York",
                "zipcode": "21000",
                "street": "Bulevar 21",
                "home_phone": "+38121666767",
                "mobile_phone": "+38167666767",
                "birthdate": "01/07/2018",
                "company_name": "Timkom",
                "company_address": "S.M 12/1",
                "company_phone": "023772897",
                "company_state": "Brasil",
                "company_zipcode": "122 UG",
                "web": "122 UG",
            }
          ]
        }
Function name: customer/add
Function description: result is json list of the customers (pagination included)
Method: POST
Function call http://pos.makilla.com/api/customer/add

INPUT PARAMS

token - user api token
id - for edit action set customer id
customertype_id - private or company customer
firsname - firstname of the customer
lastname - lastname of the customer
mail - customer mail
city - customer city
state - customer state
zipcode - customer zipcode
street - customer street
home_phone - customer phone
home_mobile - customer cell phone
birthdate - customer birthdate
company_name - company name
company_address - company address
company_phone - company phone
company_mail - company mail
company_pib - company pib
web - customer web site

RESULTS

{
        "status":sucess,
        "code": 200
}

SALES

Function name: sale/payment/
Function description: save payment request to database
Method: POST
Function call http://pos.makilla.com/api/sale/payment/

INPUT PARAMS

token - user api token
transaction - get from sale/add
customer id - deafult 1 - unknown customer
amount
store_id - store id

RESULTS

{
        "status":sucess,
        "code": 200
        }
Function name: addsale
Function description: save sale order to database
Method: POST
Function call http://pos.makilla.com/api/addsale

INPUT PARAMS

token - user api token
customer_id - customer id - deafult 1 - unknown customer
saleperson_id - default 0
store_id - store id
store_location
item_id
selling_price
qty
tax
total_amount
user_id
saleday_id
cashregister_id
id - customer id
item_id

RESULTS

{
        "status":sucess,
        "code": 200,
        "data": {
                  "transaction" : "12334545677"
                }
}

STORES

Function name: getstores
Function description: get list of the stores
Method: POST
Function call http://pos.makilla.com/api/getstores

INPUT PARAMS

RESULTS

{
  "transaction": "1343323445",
}
Function name: getstore
Function description: get description of the store
Method: POST
Function call http://pos.makilla.com/api/getstore/{store_id}

INPUT PARAMS

store_id - store id

RESULTS

{
  "transaction": "1343323445",
}