Efrito Accounts API
(full version)
Table of contents
- Description
- Commands
- RegisterPartner - register new partner. sent email for email confirmation (doc)
- Login - login by temporary_token, token, api_key or login and password. return account structure and access token (doc)
- LoginActivation - activate account. sent email with activation code (doc)
- PasswordChange - change password for account by used token (doc)
- PasswordReset - change user password used reset_code (generated by PasswordRecovery method) (doc)
- PasswordRecovery - get email address and sent email with instruction for password recovery (doc)
- CreateTemporaryUserToken - create one time usage token. used for login one time (doc)
- GetStaffList - return staff list for selected partner (doc)
- GetStaff - return staff structure (doc)
- SaveStaff - save partner staff. add or update staff for current partner. (doc)
- GetStaffGroups - return efrito staff types (groups) (doc)
- SetStaffAccess - set or remove staff server type(group). (doc)
- GetStaffWithPartner - return staff function. returned staff and partner structure by staff token (doc)
Description
https://accounts.efrito.com/api/v1.6/ - api entry point. call api functions by links:
https://accounts.efrito.com/api/v1.6/FUNCTION. where FUNCTION - called function name. if function required request parameters, need send JSON string with parameters into request body.
RegisterPartner
description: register new partner. not check access. create partner account witt email confirmation (sent email with confirmation link)
request post body:
{
"first_name":"Test",
"last_name":"Test last",
"country":"ru",
"city":"Minsk",
"company_name":"MyCompany3",
"phone":"+375-29-260-00-00",
"email":"a_bb@example3.com"
}
| Parameter | Type | Description |
| first_name | string | partner first name |
| last_name | string | partner last name |
| country | string | 2 letters country code |
| city | string | city name |
| company_name | string | company name |
| phone | string | contact phone |
| email | string | contact email |
usage example on PHP language
Login
description: some API functions required check user access. this function sign in partner account into efrito api system. return partner info, list of available servers and API commands. also return session id and session cookie variable name. need set this cookie variable for request functions required user login.
request post body example 1:
{
"login":"demo",
"key":"KEY"
}
request post body example 2:
{
"login":"demo",
"password":"PASSWORD"
}
| Parameter | Type | Description |
| login | string | user login |
| key | string | not required: user api key |
| password | string | not required: user password |
| token | string | not required: user token |
server answer body:
{
"id": 123,
"parent_id": null,
"login": "example",
"email": "example@example.com",
"registration_date": null,
"expiry_date": null,
"last_login_date": "2025-05-08 10:52:05.000000",
"last_ip": "46.4.66.165",
"last_client": "GuzzleHttp\/6.5.5 curl\/7.68.0 PHP\/7.4.3-4ubuntu2.18",
"uniq_key": "fdghjadsdhjahsjdkhasd",
"api_key": "xsxssasdjsakdjklsajdsss",
"session_id": "sadfksajdklsajdklasjdkasljd",
"session_time": "2025-05-08 10:52:05.000000",
"email_activation": true,
"is_active": true,
"is_deleted": false,
"is_default": false,
"additional_data": {
"first_name": "Name",
"last_name": "Last",
"country": "112",
"city": "City",
"company_name": "CompanyName",
"phone": "375-00-000-0-000",
"license": "",
"server_access_count": "11",
"sub_prices": "0",
"sub_offers": "0",
"fax": "375-00-000-0-000",
"address": "City, Street",
"remark": "\u0442\u0435\u0441\u0442"
},
"groups": [
{
"id": 3,
"name": "partner",
"signed_in_module_id": 24,
"def": "1"
},
{
"id": 5,
"name": "admin",
"signed_in_module_id": 42,
"def": null
}
],
"server_access": [
{
"server_prefix": "ae1",
"ftr_partner_id": 40,
"ftr_partner_group_id": 462,
"book_ol_cr": true,
"book_ol_dr": false,
"book_ol_wm": false,
"book_ol_pk": true,
"book_ol_tk": true,
"server_name": "Emirates",
"country_iso": "AE",
"ftr_partner_group_name": "VIP"
},
{
"server_prefix": "ru1",
"ftr_partner_id": 33,
"ftr_partner_group_id": 2,
"book_ol_cr": true,
"book_ol_dr": true,
"book_ol_wm": true,
"book_ol_pk": false,
"book_ol_tk": false,
"server_name": "Russia",
"country_iso": "RU",
"ftr_partner_group_name": "Normal"
}
],
"token": {
"owner_id": 461,
"token": "basdagFGFGHnbsdfbdsghGHGHGHU",
"expire": "2021-11-02 09:11:10.000000",
"is_temporary": false
}
}
| login response |
| Parameter | Type | Description |
| id | int | user id |
| login | string | user login |
| email | string | user email |
| registration_date | datetime | user registration date |
| last_ip | string | last user ip address |
| last_client | string | last user client |
| group_name | string | user group (partner|staff) |
| session_name | string | session variable name |
| session_id | string | session identifier |
| token | object | efrito auth token |
| server_access | array of server info | array of servers |
| command_access | array of string | array of api commands |
| auth token |
| Parameter | Type | Description |
| token | string | UNIQ token code |
| expire | datetime | token expiration date time |
| server info |
| Parameter | Type | Description |
| server_id | string | server id |
| name | string | server displayed name |
| country_id | string | server country from countries list |
or
"{
"error": {
"code": 10,
"message": "error description"
}
}"
usage example on PHP language
LoginActivation
description: activate login (confirm email) by code received from email sent RegisterPartner method.
request post body:
{
"activationcode":"f73A5k3DV6B8Ib8w2PebJR3Tn6KYMvAB"
}
| Parameter | Type | Description |
| activationcode | string | code from email confirmation email |
usage example on PHP language
PasswordChange
description: update password for user.
request post body:
{
"password":"123",
"password_confirm":"123",
"old_password": "321"
}
| Parameter | Type | Description |
| account_id | integer | account_id for password change. usable only admin (not required. default: current token user) |
| password | string | password string (required) |
| password_confirm | string | password confirmation string (required) |
| old_password | string | current user password (required) |
usage example on PHP language
PasswordReset
request post body:
{
"reset_code":"asdgy3tuRTRT54FHJghj6sa5dq",
"password":"123",
"password_confirm":"123",
}
| Parameter | Type | Description |
| reset_code | string | password reset code, received from PasswordRecovery |
| password | string | new password |
| password_confirm | string | new password confirmation |
usage example on PHP language
PasswordRecovery
description: send email with password reset link.
request post body:
{
"email":"a@a.a",
"user_group":"staff"
}
| Parameter | Type | Description |
| email | string | user email for password recovery. send reset password email to all users with this email address |
| user_group | string | string. not required. contained user group name |
usage example on PHP language
CreateTemporaryUserToken
description: admin function. create account token for one time login. after login token removed.
request post body:
{
"account_id":461
}
| Parameter | Type | Description |
| account_id | integer | account ID (required) |
usage example on PHP language
GetStaffList
description: partner and admin function. return array of partner staffs.
request post body:
{
"account_id":461
}
| Parameter | Type | Description |
| partner_account_id | integer | partner account ID (required) |
| is_deleted | boolean | not required. default: false. if true - return all staff (include deleted) |
answer:
[{
"account_id":462,
"parent_id":461,
"login":"it@afamiatourism.com",
"password":"ad36491d84e76f2b762b5fff9a52f416",
"email":"it@afamiatourism.com",
"registration_date":null,
"last_login_date":null,
"last_ip":"136.243.102.170",
"last_client":"testing\/1.0",
"session_id":null,
"session_name":null,
"is_default":true,
"first_name":"First",
"last_name":"Last",
"city":"City",
"remark":"\u0422\u0443\u0442 \u0440\u0435\u043c\u0430\u0440\u043a",
"is_active":true,
"is_deleted":false,
"server_access":[
{
"server_prefix":"ae1",
"ftr_id":50,
"ftr_partner_id":40,
"account_id":462,
"group_id":8,
"is_active":true,
"is_deleted":false
},
{
"server_prefix":"ru1",
"ftr_id":35,
"ftr_partner_id":33,
"account_id":462,
"group_id":11,
"is_active":true,
"is_deleted":false
}]
}]
usage example on PHP language
GetStaff
description: partner and admin function. return staff structure by account ID. or by FTR ID and FTR server prefix.
request post body:
{
"account_id":462
}
OR
{
"server_prefix":"ae1",
"ftr_staff_id":462
}
| Parameter | Type | Description |
| account_id | integer | account ID (required) |
| Parameter | Type | Description |
| server_prefix | String | FTR server prefix (required) |
| ftr_staff_id | integer | FTR staff ID (required) |
answer:
{
"account_id":462,
"parent_id":461,
"login":"it@afamiatourism.com",
"password":"ad36491d84e76f2b762b5fff9a52f416",
"email":"it@afamiatourism.com",
"registration_date":null,
"last_login_date":null,
"last_ip":"136.243.102.170",
"last_client":"testing\/1.0",
"session_id":null,
"session_name":null,
"is_default":true,
"first_name":"First",
"last_name":"Last",
"city":"City",
"remark":"\u0422\u0443\u0442 \u0440\u0435\u043c\u0430\u0440\u043a",
"is_active":true,
"is_deleted":false,
"server_access":[
{
"server_prefix":"ae1",
"ftr_id":50,
"ftr_partner_id":40,
"account_id":462,
"group_id":8,
"is_active":true,
"is_deleted":false
},
{
"server_prefix":"ru1",
"ftr_id":35,
"ftr_partner_id":33,
"account_id":462,
"group_id":11,
"is_active":true,
"is_deleted":false
}]
}
usage example on PHP language
SaveStaff
description: partner function. add or update staff.
request post body:
{
"account_id":461,
"password": "123",
"password_confirm": "123",
"is_deleted": false,
"first_name": "first",
"last_name": "last",
"email": "a@a.a",
"city": "Minsk",
"is_active": true,
"is_default": false
}
| Parameter | Type | Description |
| account_id | integer | staff account ID (not required. if not set - created new staff) |
| password | string | staff password string. (required. if add or update. if empty - not change password in edited staff) |
| password_confirm | string | password confirmation string. required same by 'password' field |
| is_deleted | bool | if true - delete staff. (not required. default: false) |
| first_name | string | staff first name. (required if add or update) |
| last_name | string | staff last name. (required if add or update) |
| email | string | staff email. this email also used for staff login. (required if add or update) |
| city | string | staff city. (required if add or update) |
| is_active | bool | enabled or disabled staff. |
| is_default | bool | if true - set staff to default partner staff. |
answer:
{
"result":"OK",
"account_id": 635
}
usage example on PHP language
GetStaffGroups
description: partner and admin function. return additional efrito groups list for staff.
request post body:
[]
answer:
[
{
"id": 7,
"name": "EFRITO-1"
},
{
"id": 8,
"name": "EFRITO-2"
},
{
"id": 9,
"name": "EFRITO-3"
},
{
"id": 10,
"name": "EFRITO-4"
},
{
"id": 11,
"name": "EFRITO-5"
}
]
groups description:
- EFRITO-1 (7) - see all prices. book all online. see balance & all partner orders with voucher & invoice.
- EFRITO-2 (8) - see all prices. book all online. see own orders. download voucher & invoices.
- EFRITO-1 (9) - see all prices. book all offline (on request). see own orders. download voucher & invoices.
- EFRITO-4 (10) - not have access to prices & booking. see balance & all partner orders with voucher & invoice.
- EFRITO-5 (11) - not have access to prices & booking. see own orders. download voucher & invoices.
usage example on PHP language
SetStaffAccess
description: update staff server group. can be set different for every DB.
request post body:
{
"account_id":123,
"server_prefix":"ae1",
"group_id": 8
}
| Parameter | Type | Description |
| account_id | integer | account ID. (required) |
| server_prefix | string | server prefix identificator from GetServerList (required) |
| group_id | integer | staff group ID from getStaffGroups for server server_prefix. (not required. default: null) |
usage example on PHP language
GetStaffWithPartner
description: staff function. return staff structure and staff owner (partner) structure
request post body:
[]
answer:
{
"staff":{
"account_id":462,
"parent_id":461,
"login":"it@afamiatourism.com",
"password":"ad36491d84e08d6b162b5fff9a521053",
"email":"it@afamiatourism.com",
"registration_date":null,
"last_login_date":null,
"last_ip":"46.4.66.165",
"last_client":"testing\/1.0",
"session_id":null,
"session_name":null,
"is_default":true,
"first_name":"First",
"last_name":"Last",
"city":"City",
"remark":"\u0422\u0443\u0442 \u0440\u0435\u043c\u0430\u0440\u043a",
"is_active":true,
"is_deleted":false,
"server_access":[
{
"server_prefix":"ae1",
"ftr_id":50,
"ftr_partner_id":40,
"account_id":462,
"group_id":8,
"is_active":true,
"is_deleted":false,
"server_name":"Emirates",
"country_iso":"AE"
},
{
"server_prefix":"ru1",
"ftr_id":35,
"ftr_partner_id":33,
"account_id":462,
"group_id":11,
"is_active":true,
"is_deleted":false,
"server_name":"Russia",
"country_iso":"RU"
}]
},
"partner":{
"account_id":461,
"login":"DurDooM",
"password":"4297f44b13979235245b2497399d7a93",
"api_key":"s5SjC1HVEfQA1SaMmske3Mjr1qj19BVO",
"email":"it@afamiatourism.com",
"registration_date":null,
"last_login_date":"2021-08-18 02:58:08.000000",
"last_ip":"136.243.102.170",
"last_client":"testing\/1.0",
"session_id":null,
"session_name":null,
"first_name":"Kostik",
"last_name":"Ashuiko",
"country_id":"112",
"city":"Minsk",
"company_name":"DurDooM",
"phone":" 375-56-240-9-340",
"address":"Sh. st. 21\/1-272",
"fax":"xxx",
"remark":"",
"is_active":true,
"is_deleted":false,
"server_access":[
{
"server_prefix":"ae1",
"ftr_partner_id":40,
"ftr_partner_group_id":461,
"book_ol_cr":true,
"book_ol_dr":false,
"book_ol_wm":true,
"book_ol_pk":false,
"server_name":"Emirates",
"country_iso":"AE",
"ftr_partner_group_name":"Normal"
},
{
"server_prefix":"ru1",
"ftr_partner_id":33,
"ftr_partner_group_id":2,
"book_ol_cr":true,
"book_ol_dr":true,
"book_ol_wm":true,
"book_ol_pk":false,
"server_name":"Russia",
"country_iso":"RU",
"ftr_partner_group_name":"Normal"
}],
"command_access":[],
"country_iso":"BY"
}
}
usage example on PHP language