Collection

Collection is a group of your payments.



Endpoint


Method Desciption URI
POST Create Collection /api/v2/collections
GET Get List Collections /api/v2/collections
GET Get Collection By Id /api/v2/collections/{CODE}
PATCH Update Collection /api/v2/collections/{ID}



Required Headers


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


Create Collection

Parameters


Method URI
POST /api/v2/collections

Body:


Key Type Required
Name string Yes

Include Parameter:


Key Type
organization /api/v2/collections?include=organization

Example :

{
    'name' : 'Collection Name'
}

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "name": "new collection",
        "code": "HcGmbt3f",
        "organization_id": 1,
        "webhook_url": "https://malakatpay.com/malakatpay_gateway",
        "redirect_url": "https://malakatpay.com/malakatpay_gateway",
        "updated_at": "2020-06-23 13:03:15",
        "created_at": "2020-06-23 13:03:15",
        "id": 660
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-23 13:03:15 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Errors



Get Collections

Parameters


Method URI
GET /api/v2/collections

Response


{success} Success code : 200

{
    "current_page": 1,
    "data": [
        {
            "name": "new collection",
            "code": "HcGmbt3f",
            "organization_id": 1,
            "webhook_url": "https://malakatpay.com/malakatpay_gateway",
            "redirect_url": "https://malakatpay.com/malakatpay_gateway",
            "updated_at": "2020-06-23 13:03:15",
            "created_at": "2020-06-23 13:03:15",
            "id": 660
        }
    ],
    "first_page_url": "https://malakatpay.com/api/collections?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://malakatpay.com/api/collections?page=1",
    "next_page_url": null,
    "path": "https://malakatpay.com/api/collections",
    "per_page": 1,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

{info} For Error Reference, Related guide: Errors



Get Collection

Parameters


Method URI
GET /api/v2/collections/{CODE)

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "name": "new collection",
        "code": "HcGmbt3f",
        "organization_id": 1,
        "webhook_url": "https://malakatpay.com/malakatpay_gateway",
        "redirect_url": "https://malakatpay.com/malakatpay_gateway",
        "updated_at": "2020-06-23 13:03:15",
        "created_at": "2020-06-23 13:03:15",
        "id": 660
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-23 13:03:15 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Errors



Update Collection

Parameters


Method URI
PATCH /api/v2/collections/{ID)

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "name": "new collection",
        "code": "HcGmbt3f",
        "organization_id": 1,
        "webhook_url": "https://malakatpay.com/malakatpay_gateway",
        "redirect_url": "https://malakatpay.com/malakatpay_gateway",
        "updated_at": "2020-06-23 13:03:15",
        "created_at": "2020-06-23 13:03:15",
        "id": 660
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-23 13:03:15 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Errors