> For the complete documentation index, see [llms.txt](https://shiply-integration-apis.gitbook.io/shiply-integration-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shiply-integration-apis.gitbook.io/shiply-integration-documentation/integration-apis/premium-customers/update-employee.md).

# Update Employee

```php
POST /premium-customer/employees/{id}
```

This API is used to update the information of a premium customer's employee.

{% hint style="info" %}
**Note:** Replace <mark style="color:blue;">{id}</mark> with the employee id of the employee whose information you want to update.
{% endhint %}

#### Headers

<table><thead><tr><th width="374">Key</th><th>Value</th></tr></thead><tbody><tr><td>Accept</td><td>application/json</td></tr><tr><td>Content-Type</td><td>application/json</td></tr></tbody></table>

#### Request body

Request parameters:

<table><thead><tr><th width="247">Field Name</th><th width="106">Required</th><th width="93">Type</th><th>Notes</th></tr></thead><tbody><tr><td>type</td><td>yes</td><td>string</td><td>The value can be either "employee" or "sales_representative".</td></tr><tr><td>first_name</td><td>yes</td><td>string</td><td></td></tr><tr><td>second_name</td><td>no</td><td>string</td><td></td></tr><tr><td>last_name</td><td>no</td><td>string</td><td></td></tr><tr><td>fixed_commission_value</td><td>no</td><td>numeric</td><td>Required if type = "sales_representative"</td></tr><tr><td>percent_commission_value</td><td>no</td><td>numeric</td><td>Required if type = "sales_representative"</td></tr><tr><td>start_work_at</td><td>no</td><td>string</td><td>The time when an employee begins their work shift or activity.</td></tr><tr><td>end_work_at</td><td>no</td><td>string</td><td>The time when an employee ends their work shift or activity.</td></tr><tr><td>active</td><td>yes</td><td>boolean</td><td>To indicate if the employee is active or not. </td></tr><tr><td>business_name</td><td>yes</td><td>string</td><td></td></tr><tr><td>phone_number</td><td>yes</td><td>string</td><td></td></tr><tr><td>password</td><td>no</td><td>string</td><td></td></tr><tr><td>city_id</td><td>no</td><td>integer</td><td>Fetched from this API: <a data-mention href="/shiply-integration-documentation/integration-apis/shipping-address/get-cities-and-villages.md">Get Cities And Villages</a></td></tr><tr><td>village_id</td><td>no</td><td>integer</td><td>fetched from this API: <a data-mention href="/shiply-integration-documentation/integration-apis/shipping-address/get-cities-and-villages.md">Get Cities And Villages</a></td></tr><tr><td>street</td><td>no</td><td>string</td><td></td></tr><tr><td>permissions</td><td>no</td><td>array of integers</td><td>To assign permissions to the employee. The list of available employee permissions is defined here <a data-mention href="/shiply-integration-documentation/general-definitions.md">General Definitions</a><br><br>Not sent -> Nothing changed<br>Empty array -> Remove all <br>Filled array -> Update permissions</td></tr></tbody></table>

Request body example:

{% code lineNumbers="true" %}

```json
{
    "type": "sales_representative",
    "first_name": "edit first name",
    "last_name": "edit last name",
    "fixed_commission_value": 100,
    "percent_commission_value": 100,
    "active": 1,
    "business_name": "business",
    "phone_number": "0599888888"
}
```

{% endcode %}

#### Response body

{% tabs %}
{% tab title="Success" %}
Status code: <mark style="color:green;">200 OK</mark>

{% code lineNumbers="true" %}

```json
{
    "success": true,
    "user": {
        "id": 7200,
        "first_name": "edit first name",
        "user_type_id": 10,
        "role_id": null,
        "second_name": "second name",
        "last_name": "edit last name",
        "email": "firstname@gmail.com",
        "email_verified_at": null,
        "phone_number": "0599888888",
        "phone_number_2": null,
        "landline_number": null,
        "account_status_id": 1,
        "created_at": "2024-12-19 12:54:51",
        "updated_at": "2024-12-19 13:08:20",
        "identity": null,
        "deleted_at": null,
        "start_work_at": "08:00",
        "end_work_at": "21:00",
        "private_note": null,
        "last_parcel_created_date": null,
        "profile_picture": null,
        "profile_picture_id": null,
        "app_id": null,
        "payment_account_enabled": 0,
        "wallet_enabled": 1,
        "can_borrow": 0,
        "customer_contacts": [],
        "customer_info": {
            "customer_user_id": 7200,
            "customer_code": "79u5",
            "business_name": "business",
            "customer_number": "7406",
            "event_webhook_url": "url",
            "delivered_parcel_cost": 20,
            "returned_parcel_cost": 10,
            "al_quds_delivered_parcel_cost": 35,
            "al_quds_returned_parcel_cost": 10,
            "occupied_lands_delivered_parcel_cost": 75,
            "occupied_lands_returned_parcel_cost": 10,
            "max_balance": 2000,
            "invoice_creation_limit": 705,
            "price_extra_fee_threshold": 3000,
            "price_extra_fee_percentage": 0.01,
            "price_extra_fee_percentage_returned": 0.005,
            "url": null,
            "fixed_commission_value": 100,
            "percent_commission_value": 100,
            "show_driver_phone": 1,
            "include_parcel_after_deliver_time": 30,
            "max_companions": 2,
            "extra_size_factor": 1,
            "default_parcel_length": 43,
            "default_parcel_width": 43,
            "default_parcel_height": 43,
            "customer_classification_id": null,
            "customer_success_manager": null,
            "max_price_for_parcel": 4000,
            "is_receive_returns_from_office": 0,
            "cell": null,
            "is_product_catalog_enabled": 1,
            "move_invoices_to_wallet": 0,
            "parcel_creation_mode_id": 3,
            "has_active_promotions": false,
            "permissions": []
        }
    }
}
```

{% endcode %}

The response includes a <mark style="color:blue;">user</mark> field, which contains the updated employee information.
{% endtab %}

{% tab title="Unauthorized access" %}
Status code: <mark style="color:green;">200 OK</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "errors": [
        "unauthorized"
    ]
}
```

{% endcode %}

This response is returned when the user is not a premium customer.
{% endtab %}

{% tab title="Fail" %}
Status code: <mark style="color:red;">401</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
}
```

{% endcode %}

This response is returned when a database error occurs while attempting to update an employee information.
{% endtab %}

{% tab title="Unauthorized" %}
Status code: <mark style="color:green;">200 OK</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "errors": [
        "unauthorized"
    ]
}
```

{% endcode %}

This response is returned when the <mark style="color:blue;">Shiply\_API\_KEY</mark> is not included in the request body.
{% endtab %}
{% endtabs %}
