EDIT USER PROFILE - POST /profile

Body:

{
   "first_name":"First Name",
   "last_name":"Last Name",
   "phone":"600000111"
}

Response:

{
    "status": "ok",
    "user": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": null,
            "last_name": null,
            "address": null,
            "postcode": null,
            "country": null,
            "NIP": null,
            "birth_day": null
        },
        "avatar": null,
        "is_blocked": false,
        "is_mango_verified": false,
        "mango_pay_id": null,
        "favorites": []
    }
}

SHOW USER - GET /me

Request:

/me

Response:

{
    "status": "ok",
    "user": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": null,
            "last_name": null,
            "address": null,
            "postcode": null,
            "country": null,
            "NIP": null,
            "birth_day": null
        },
        "avatar": null,
        "is_blocked": false,
        "is_mango_verified": false,
        "mango_pay_id": null,
        "favorites": []
    }
}

EDIT CLIENT PROFILE - POST /client/profile

Body:

{
   "first_name":"First Name",
   "last_name":"Last Name",
   "phone":"600000111"
}

Response:

{
    "status": "ok",
    "client": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": null,
            "last_name": null,
            "address": null,
            "city": null,
            "postcode": null,
            "country": null,
            "NIP": null,
            "birth_day": null
        },
        "is_blocked": false
        "favorites": []
    }
}

SHOW CLIENT - GET /client/me

Request:

/client/me

Response:

{
    "status": "ok",
    "client": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": null,
            "last_name": null,
            "address": null,
            "postcode": null,
            "country": null,
            "NIP": null,
            "birth_day": null
        },
        "is_blocked": false,
        "favorites": []
    }
}

EDIT USER BILLING DATA - POST /billing-data

Body:

{
   "billing_company_name":"Company Name",
   "billing_owner_name":"Test Name",
   "billing_address":"Tczewska 12, Olsztyn",
   "billing_postcode":"10-666",
   "billing_country":"PL",
   "billing_nip":"123123123",
   "billing_birth_day":"1993-10-27"
}

Response:

{
    "status": "ok",
    "user": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": "Company Name",
            "last_name": "Test Name",
            "address": "Tczewska 12, Olsztyn",
            "postcode": "10-666",
            "country": "PL",
            "NIP": "123123123",
            "birth_day": "1993-10-27T00:00:00.000+01:00"
        },
        "avatar": null,
        "is_blocked": false,
        "is_mango_verified": false,
        "mango_pay_id": null,
        "favorites": []
    }
}

EDIT CLIENT BILLING DATA - POST /client/billing-data

Body:

{
   "billing_first_name":"Name",
   "billing_last_name":"LastName",
   "billing_address":"Tczewska 12",
   "billing_postcode":"10-666",
   "billing_country":"PL",
   "billing_city":"Olsztyn",
   "billing_nip":"123123123",
   "billing_birth_day":"1993-10-27"
}

Response:

{
    "status": "ok",
    "client": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": "Name",
            "last_name": "LastName",
            "address": "Tczewska 12",
            "postcode": "10-666",
            "country": "PL",
            "city": "Olsztyn",
            "NIP": "123123123",
            "birth_day": "1993-10-27T00:00:00.000+01:00"
        },
        "is_blocked": false,
        "favorites": []
    }
}

USER LOGO - POST /logo/{id}

Body:

{
    "logoWhite": "https://cloud.ord.to/logo/en/white.png",
    "logoBlack": "https://cloud.ord.to/logo/en/black.png"
}

Response:

{
    "status": "ok",
}

USER LOGO - POST /billing-tab/{id}

Body:

{
    "showBilling": 1
}

Response:

{
    "status": "ok",
    "client": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": "Name",
            "last_name": "LastName",
            "address": "Tczewska 12",
            "postcode": "10-666",
            "country": "PL",
            "city": "Olsztyn",
            "NIP": "123123123",
            "birth_day": "1993-10-27T00:00:00.000+01:00"
        },
        "is_blocked": false,
        "favorites": [],
        "showBilling": 1
    }
}

Allow user add companies - POST /user/{id}/allow-add-company

Body:

{
    "allowAddCompany": true
}

Response:

{
    "status": "ok",
    "client": {
        "id": 19,
        "created": "2021-06-08T14:00:10.000+02:00",
        "email": "email@example.com",
        "first_name": "First Name",
        "last_name": "Last Name",
        "phone": "600000111",
        "billing_data": {
            "first_name": "Name",
            "last_name": "LastName",
            "address": "Tczewska 12",
            "postcode": "10-666",
            "country": "PL",
            "city": "Olsztyn",
            "NIP": "123123123",
            "birth_day": "1993-10-27T00:00:00.000+01:00"
        },
        "is_blocked": false,
        "favorites": [],
        "showBilling": 1,
        "allowAddCompany": true
    }
}

Dictionary - Language - GET /language

Response:

{
    "status": "ok",
    "data": [
        {
            "id": 1,
            "name": "English"
        },
        {
            "id": 2,
            "name": "Polski"
        },
        {
            "id": 3,
            "name": "Russian"
        }
    ]
}

Dictionary - Country - GET /country

Response:

{
    "status": "ok",
    "data": [
        {
            "id": 1,
            "name": "Poland",
            "short": "PL"
        },
        {
            "id": 2,
            "name": "Afghanistan",
            "short": "AF"
        }
    ]
}

Dictionary - Currency - GET /currency

Response:

{
    "status": "ok",
    "data": [
        {
            "id": 1,
            "name": "USD",
            "short": "$",
            "direction": false
        },
        {
            "id": 2,
            "name": "PLN",
            "short": "zł",
            "direction": true
        }
    ]
}

Dictionary - Product template - GET /product-template

Response:

{
    "status": "ok",
    "data": [
        {
            "id": 1,
            "name": "Properties"
        },
        {
            "id": 2,
            "name": "Vehicles"
        }.
    ]
}

Add company - POST /user/{id}/company

Body:

{
    "name": "Test",
    "country": 1,
    "currency": 1,
    "subdomain": "test",
    "language": 1,
    "email": "test@example.com",
    "productTemplate": 2
}

Response:

{
    "status": "ok",
    "data": {
        "id": 17,
        "created": "2023-06-06T09:44:41.529+00:00",
        "name": "Test",
        "email": "test@example.com",
        "phone": null,
        "tax_id": null,
        "owner": 2,
        "subdomain": "test",
        "comission": null,
        "offers": {},
        "orders": {},
        "fields": {},
        "clients": {},
        "country": {
            "id": 1,
            "name": "Poland",
            "short": "PL"
        },
        "domains": {},
        "currency": {
            "id": 1,
            "name": "USD",
            "short": "$",
            "direction": false
        },
        "logo": null,
        "billing_data": {
            "company_name": null,
            "address": null,
            "postcode": null,
            "country": null,
            "city": null,
            "NIP": null,
            "account_number": null,
            "birth_day": null
        },
        "language": "1",
        "default_number_of_days": 1,
        "unit_name": "Size",
        "asset_name": null,
        "asset_name_plural": null,
        "payment_type": null,
        "display_type": 1,
        "availability_type": 1,
        "user_limit": 100,
        "config": {
            "login_enabled": true,
            "register_enabled": true,
            "add_offer_enabled": true,
            "rent_offer_enabled": true,
            "mango_pay_api_key": null,
            "mango_pay_client_id": null
        },
        "pages": {},
        "documents": {},
        "auto_approve_offers": true,
        "auto_accept_offers": false,
        "search_by_price": false,
        "search_by_space": false,
        "search_text": null,
        "country_city_lock": false,
        "country_lock_data": null,
        "city_lock_data": null
    }
}

Add company - PUT /company/{id}/logo

Body:

{
    "logo": "https://ui-avatars.com/api/?background=random&bold=true&name=Moja+platforma"
}

Response:

{
    "status": "ok",
    "data": {
        "id": 17,
        "created": "2023-06-06T09:44:41.000+00:00",
        "name": "Test",
        "email": "test@example.com",
        "phone": null,
        "tax_id": null,
        "owner": 2,
        "subdomain": "mmm1",
        "comission": null,
        "offers": {},
        "orders": {},
        "fields": {},
        "clients": {},
        "country": {
            "id": 1,
            "name": "Poland",
            "short": "PL"
        },
        "domains": {},
        "currency": {
            "id": 1,
            "name": "USD",
            "short": "$",
            "direction": false
        },
        "logo": "/uploads/company/vfzgj7ljaj0rta4v4d4hk9funpj76fz1.png",
        "billing_data": {
            "company_name": null,
            "address": null,
            "postcode": null,
            "country": null,
            "city": null,
            "NIP": null,
            "account_number": null,
            "birth_day": null
        },
        "language": "1",
        "default_number_of_days": 1,
        "unit_name": "Size",
        "asset_name": null,
        "asset_name_plural": null,
        "payment_type": null,
        "display_type": 1,
        "availability_type": 1,
        "user_limit": 100,
        "config": {
            "login_enabled": true,
            "register_enabled": true,
            "add_offer_enabled": true,
            "rent_offer_enabled": true,
            "mango_pay_api_key": null,
            "mango_pay_client_id": null
        },
        "pages": {},
        "documents": {},
        "auto_approve_offers": true,
        "auto_accept_offers": false,
        "search_by_price": false,
        "search_by_space": false,
        "search_text": null,
        "country_city_lock": false,
        "country_lock_data": null,
        "city_lock_data": null
    }
}