Skip to main content

User Info

A request to the following endpoint returns an object of the currently signed in user

Request

GET - {{url}}/api/public/merchant/user/get-current

Headers
{
"Accept": "application/json",
"Authorization": "Bearer {{ token }}",
"Content-Type": "application/json",
"X-tenant": "{{ tenant }}",
}

Response

Status - 200 - OK

Sample Response Object
{
"data": {
"id": 2,
"merchant_id": 2,
"first_name": "Mr. John",
"last_name": "Doe",
"email": "sales@testmerchant.com",
"user_name": "testuser",
"phone": "0779999999",
"is_active": true,
"api_token": "65",
"email_verified_at": null,
"activation_code": null,
"activation_code_expiry": null,
"created_at": "2022-02-12T12:21:03.000000Z",
"updated_at": "2022-03-23T04:41:58.000000Z",
"role": {
"id": 9,
"is_default": 1,
"name": "2-Admin",
"guard_name": "merchant-api",
"merchant_id": 2,
"description": null,
"created_at": "2022-02-12T12:21:03.000000Z",
"updated_at": "2022-03-08T08:53:06.000000Z",
"pivot": {
"model_id": 2,
"role_id": 9,
"model_type": "Modules\\TenentCore\\Entities\\MerchantUser"
}
},
"merchant": {
"id": 2,
"ref_no": "MC-0002",
"name": "Test Merchant (API)",
"is_active": true,
"rate_card_id": 1,
"created_at": "2022-02-12T12:21:02.000000Z",
"updated_at": "2022-03-23T04:40:01.000000Z"
},
"roles": [
{
"id": 9,
"is_default": 1,
"name": "2-Admin",
"guard_name": "merchant-api",
"merchant_id": 2,
"description": null,
"created_at": "2022-02-12T12:21:03.000000Z",
"updated_at": "2022-03-08T08:53:06.000000Z",
"pivot": {
"model_id": 2,
"role_id": 9,
"model_type": "Modules\\TenentCore\\Entities\\MerchantUser"
}
}
]
}
}

ERRORS

Invalid Bearer Token
{
"message": "Unauthenticated."
}