Skip to content

Profit Loss Categories

This module is used to seperate profit loss items by category.

INFO

Make sure to add /api prefix in the API endpoint.

Get Profit Loss Categories Endpoint

http
GET /mstRoots
GET /mstRoots

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Query Parameter

NameTypeDescriptionNullable
pageintPage numberfalse

Response

200 OK
json
{
    "data": {
        "data": [
            {
                "id": 2,
                "name": "LABA KOTOR USAHA",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            {
                "id": 11,
                "name": "BEBAN USAHA",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            {
                "id": 22,
                "name": "KERUGIAN PERSEDIAAN BBM AKIBAT PENURUNAN HARGA BBM",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            // and so on...
        ]
    }
}
{
    "data": {
        "data": [
            {
                "id": 2,
                "name": "LABA KOTOR USAHA",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            {
                "id": 11,
                "name": "BEBAN USAHA",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            {
                "id": 22,
                "name": "KERUGIAN PERSEDIAAN BBM AKIBAT PENURUNAN HARGA BBM",
                "parent_name": "(1) Utama",
                "is_deletable": 0,
                "is_mandatory": null
            },
            // and so on...
        ]
    }
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}
404 Not Found
json
{
    "message": "Data tidak ditemukan"
}
{
    "message": "Data tidak ditemukan"
}

Used on pages

  • /profitloss

Create Profit Loss Category Endpoint

http
POST /mstRoots
POST /mstRoots

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Body

JSON Body
json
{
    "name": "Pembayaran ABC",
    "mst_root_id": 11
}
{
    "name": "Pembayaran ABC",
    "mst_root_id": 11
}
NameTypeDescriptionNullable
namestringProfit Loss Category Namefalse
mst_root_idintParent Profit Loss Category IDfalse

Response

200 OK
json
{
    "message": "Berhasil menambahkan Kategori Laba Rugi",
}
{
    "message": "Berhasil menambahkan Kategori Laba Rugi",
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}
422 Unprocessable Entity
json
{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "mst_root_id": [
            "The mst root id field is required."
        ]
    }
}
{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "mst_root_id": [
            "The mst root id field is required."
        ]
    }
}

Used on pages

  • /profitloss

Update Profit Loss Category Endpoint

http
PUT /mstRoots/{id}
PUT /mstRoots/{id}

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Path Variable

NameTypeDescription
idintProfit Loss Category ID

Body

JSON Body
json
{
    "name": "Pembayaran ABCD",
    "mst_root_id": 11
}
{
    "name": "Pembayaran ABCD",
    "mst_root_id": 11
}
NameTypeDescriptionNullable
namestringProfit Loss Category Namefalse
mst_root_idintParent Profit Loss Category IDfalse

Response

200 OK
json
{
    "message": "Berhasil mengubah Kategori Laba Rugi",
}
{
    "message": "Berhasil mengubah Kategori Laba Rugi",
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}
422 Unprocessable Entity
json
{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "mst_root_id": [
            "The mst root id field is required."
        ]
    }
}
{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "mst_root_id": [
            "The mst root id field is required."
        ]
    }
}

Used on pages

  • /profitloss

Delete Profit Loss Category Endpoint

http
DELETE /mstRoots/{id}
DELETE /mstRoots/{id}

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Path Variable

NameTypeDescription
idintProfit Loss Category ID

Response

200 OK
json
{
    "message": "Berhasil menghapus Kategori Laba Rugi",
}
{
    "message": "Berhasil menghapus Kategori Laba Rugi",
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}

Used on pages

  • /profitloss

Get Profit Loss Category Options Endpoint

http
GET /mst_root/select
GET /mst_root/select

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Response

200 OK
json
{
    "data": [
        {
            "id": 2,
            "text": "LABA KOTOR USAHA"
        },
        {
            "id": 11,
            "text": "BEBAN USAHA"
        }
    ]
}
{
    "data": [
        {
            "id": 2,
            "text": "LABA KOTOR USAHA"
        },
        {
            "id": 11,
            "text": "BEBAN USAHA"
        }
    ]
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}

Used on pages

  • /profitloss

Get Profit Loss Category Options to delete profit losses Endpoint

http
GET /mst_root/delete/select
GET /mst_root/delete/select

Headers

  • Content-Type: application/json
  • Authorization: Bearer {token}

Query Parameter

NameTypeDescriptionNullable
search_periode_start_atstringSearch by periode start atfalse
search_periode_end_atstringSearch by periode end atfalse

Response

200 OK
json
{
    "data": [
        {
            "id": 2,
            "text": "LABA KOTOR USAHA"
        },
        {
            "id": 11,
            "text": "BEBAN USAHA"
        },
        {
            "id": 22,
            "text": "KERUGIAN PERSEDIAAN BBM AKIBAT PENURUNAN HARGA BBM"
        }
    ]
}
{
    "data": [
        {
            "id": 2,
            "text": "LABA KOTOR USAHA"
        },
        {
            "id": 11,
            "text": "BEBAN USAHA"
        },
        {
            "id": 22,
            "text": "KERUGIAN PERSEDIAAN BBM AKIBAT PENURUNAN HARGA BBM"
        }
    ]
}
403 Forbidden
json
{
    "message": "Unauthorized"
}
{
    "message": "Unauthorized"
}

Used on pages

  • /profitloss

Released under the MIT License.