Customer v1

Customer is a group of your payer.



Endpoint


Method Desciption URI
POST Create Customer /api/customers
GET Get Customers /api/customers
GET Get Customer By Id /api/customers/{ID)
PATCH Update Customer /api/customers/{ID}
DELETE Delete Customer /api/customers/{ID}


Required Headers


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


Create Customer

Parameters


Method URI
POST https://raudhahpay.com/api/customers

Body


Key Type Required
first_name string Yes
last_name string Yes
address string No
email string Yes
mobile string Yes

Example :



{
    "first_name": "Anas",
    "last_name": "Abdrahman",
    "address": "kedah",
    "email": "anas@raudhahpay.com",
    "mobile": "60135323922"
}

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "id": 588,
        "acc_no": "817740449604",
        "first_name": "Anas",
        "last_name": "Abdrahman",
        "address": "kedah",
        "email": "anas@raudhahpay1.com",
        "mobile": "60135323922",
        "organization_id": 5,
        "created_at": "2020-06-25 07:38:11",
        "updated_at": "2020-06-25 07:38:11",
        "deleted_at": null
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-25 07:38:11 UTC",
        "timezone": "UTC"
    }
}


Get Customers

Parameters


Method URI
GET https://raudhahpay.com/api/customers

Include Parameter:


Key Type
organization /api/customers?include=organization
account-groups /api/customers?include=account-groups
account-groups.group /api/collections?include=account-groups.group

Success Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1,
                "acc_no": "941961423864",
                "first_name": "SYED",
                "last_name": "NASHARUDIN",
                "address": "Klang",
                "email": "syednasharudin@raudhahpay.com",
                "mobile": "60193729340",
                "organization_id": 5,
                "created_at": "2019-05-20 04:10:59",
                "updated_at": "2019-05-20 04:10:59",
                "deleted_at": null
            },
            {
                "id": 5,
                "acc_no": "697762922008",
                "first_name": "FARID",
                "last_name": "YUSOF",
                "address": "Dengkil",
                "email": "farid@raudhahpay.com",
                "mobile": "60123124555",
                "organization_id": 5,
                "created_at": "2019-05-20 04:29:49",
                "updated_at": "2019-05-20 04:29:49",
                "deleted_at": null
            },
        ],
        "first_page_url": "{SERVER_URL}/api/customers?page=1",
        "from": 1,
        "last_page": 3,
        "last_page_url": "{SERVER_URL}/api/customers?page=3",
        "next_page_url": "{SERVER_URL}/api/customers?page=2",
        "path": "{SERVER_URL}/api/customers",
        "per_page": 2,
        "prev_page_url": null,
        "to": 2,
        "total": 38
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-25 08:09:34 UTC",
        "timezone": "UTC"
    }
}


Get Customer by Id

Parameters


Method URI
GET https://raudhahpay.com/api/customers/{id}

Success Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "id": 588,
        "acc_no": "817740449604",
        "first_name": "Anas",
        "last_name": "Abdrahman",
        "address": "kedah",
        "email": "anas@raudhahpay1.com",
        "mobile": "60135323922",
        "organization_id": 5,
        "created_at": "2020-06-25 07:38:11",
        "updated_at": "2020-06-25 07:38:11",
        "deleted_at": null
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-25 08:17:30 UTC",
        "timezone": "UTC"
    }
}


Update Customer

Parameters


Method URI
PATCH https://raudhahpay.com/api/customers/{id}

Body:


Key Type Required
first_name string no
last_name string no
address string no
mobile string no

Example :


{
    "first_name": "AZARUL",
    "last_name": "HAKIM",
    "address": "Cyberjaya",
    "mobile": "60195519000"
}

Response


{success} Success code : 200

{
    "success": true,
    "data": {
        "id": 588,
        "acc_no": "817740449604",
        "first_name": "AZARUL",
        "last_name": "HAKIM",
        "address": "Cyberjaya",
        "email": "anas@raudhahpay1.com",
        "mobile": "60195519000",
        "organization_id": 5,
        "created_at": "2020-06-25 07:38:11",
        "updated_at": "2020-06-25 08:29:17",
        "deleted_at": null
    },
    "errors": null,
    "meta": {
        "timestamp": "2020-06-25 08:29:17 UTC",
        "timezone": "UTC"
    }
}


Delete Customer

Parameters


Method URI
PATCH https://raudhahpay.com/api/customers/{id}

Response


{success} Success code : 200

{
    "success": true,
    "data": [],
    "errors": null,
    "meta": {
        "timestamp": "2020-06-25 08:32:46 UTC",
        "timezone": "UTC"
    }
}

{info} For Error Reference, Related guide: Erros