Group v2

Group is a group of your payer.



Endpoint


Method Desciption URI
POST Create Group /api/v2/groups
GET Get Groups /api/v2/groups
GET Get Group By Id /api/v2/groups/{ID)
PATCH Update Group /api/v2/groups/{ID}
DELETE Delete Group /api/v2/groups/{ID}


Required Headers


Key Value
Accept application/json
Content-Type application/json
Authorization Bearer {ACCESS-TOKEN}


Create Group

Parameters


Method URI
POST https://stg-console-api.malakatpay.com/api/v2/groups

Body


Key Type Required
name string Yes

Example :



{
    "name": "new test group"
}

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "organization_id": 5,
        "name": "new test group",
        "updated_at": "2020-06-29 03:37:54",
        "created_at": "2020-06-29 03:37:54",
        "id": 11
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-29 03:37:54 UTC",
        "timezone": "UTC"
    }
}


Get Groups

Parameters


Method URI
GET https://stg-console-api.malakatpay.com/api/v2/groups

Success Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 10,
                "name": "new group",
                "created_at": "2020-06-29 03:34:12",
                "updated_at": "2020-06-29 03:34:12",
                "organization_id": 5
            },
            {
                "id": 11,
                "name": "new test group",
                "created_at": "2020-06-29 03:37:54",
                "updated_at": "2020-06-29 03:37:54",
                "organization_id": 5
            }
        ],
        "first_page_url": "{SERVER_URL}/api/v2/groups?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "{SERVER_URL}/api/v2/groups?page=1",
        "next_page_url": null,
        "path": "{SERVER_URL}/api/v2/groups",
        "per_page": 15,
        "prev_page_url": null,
        "to": 2,
        "total": 2
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-29 03:38:41 UTC",
        "timezone": "UTC"
    }
}


Get Group by Id

Parameters


Method URI
GET https://stg-console-api.malakatpay.com/api/v2/groups/{id}

Success Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "id": 5,
        "name": "PIlOT1",
        "created_at": "2019-07-23 03:37:04",
        "updated_at": "2019-07-23 03:37:04",
        "organization_id": 14
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-29 03:39:41 UTC",
        "timezone": "UTC"
    }
}


Update Group

Parameters


Method URI
PATCH https://stg-console-api.malakatpay.com/api/v2/groups/{id}

Body:


Key Type Required
name string no

Example :


{
    "name": "change name 2"
}

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "id": 11,
        "name": "change name 2",
        "created_at": "2020-06-29 03:37:54",
        "updated_at": "2020-06-29 03:40:58",
        "organization_id": 5
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-29 03:40:58 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Erros


Delete Group

Parameters


Method URI
PATCH https://stg-console-api.malakatpay.com/api/v2/group/{id}

Response


{success} Success code : 200

{
    "success": true,
    "data": {},
    "errors": null,
    "meta": {
        "timestamp": "2020-06-29 03:42:15 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Erros