Base Url: /smartfin/api/v1/whitelist
Retrieve Company’s Data
GET /smartfin/api/v1/whitelist
Get all company data that are visible to current user.
Authentication / Authorization
- API Key
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Responses
Example:
{ "error_code": 0, "value": { "items": [ { "last_update_time": "2020-07-20 10:33:45", "user_id": 10, "entity_id": 2905, "create_by_name": "test10", "entity_name": "name", "entity_type": "", "country": "country", "address": "address", "company_id": 1, "create_time": "2020-07-20 10:33:45", "create_by": 10, "update_by": "", "tel": "tel", "credit_amt": "", "invoice_code": "", "invoice_add": "", "invoice_bank": "", "reg_no": "", "credit_ccy": "", "fax_no": "", "invalid": "", "update_by_name": "", "email": "email@example.com" }, { "last_update_time": "2020-07-20 10:29:33", "user_id": 10, "entity_id": 2901, "create_by_name": "test10", "entity_name": "name", "entity_type": "", "country": "country", "address": "address", "company_id": 1, "create_time": "2020-07-20 10:29:33", "create_by": 10, "update_by": "", "credit_amt": "", "invoice_code": "", "invoice_add": "", "invoice_bank": "", "reg_no": "", "credit_ccy": "", "fax_no": "", "invalid": "", "tel": "tel", "update_by_name": "", "email": "email@example.com" }, .. ], "company_type": [ "OWNER", "COUNTERPARTY" ], "broker": [ "VANTAGE", "BGC", "STEEM1961", "SSY" ], "company_name": [ "VITOL SA", "name", "xyz", "HYUNDAI", "BRITISH AIRWAYS", "CHINA AVIATION OIL (SINGAPORE) CORPORATION LTD", "yyyy", "updated name2", "SC SHIPPING", "qqq", "updated name", "aaaaa", "PTT" ] } } |
Returns
|
Schema
last_update_time, update_by_name, update_by - string
Information about last updated time for the data and the user who updating the data.
create_time, create_by, create_by_name - string
Information about created time for the data and the user who creating the data.
user_id, entity_id, company_id - integer
user_id
- User Id ( who the data belongs to)entity_id
- A unique ID assigned to the data. This ID can be used to retrieve company data.company_id
- The main company Id for the data.
entity_name, entity_type - string
entity_name
- Company nameentity_type
- Company type (COUNTERPARTY
orBROKER
)
entity_name
and entity_type
cannot be duplicated,
Eg.
entity_name
of 'COMPANY NAME' will not allow to be stored if the sameentity_name
has been found in database.Eg.
entity_name
of ‘COMPANY NAME' andentity_type
of 'COUNTERPARTY’ will not allow to be stored if the sameentity_name
andentity_type
has been found in database.
address, email, tel, country, credit_amt, invoice_code, invoice_add, invoice_bank, reg_no, credit_ccy, fax_no - string
Extra information for the company data
invalid - boolean
The company data’s status (true or false)
Update / Insert Company’s Data
Update/insert company | Inserts/Update company |
---|---|
Request | URL:
Method:
Headers:
Authorization:
JSON Body:
[ { "entity_name": "name", "entity_type": "COUNTERPARTY", "address": "address", "email": "email@example.com", "tel": "tel", "country": "country" } ]
[ { "entity_id": 2385, "entity_name": "updated name", "entity_type": "COUNTERPARTY", "address": "address", "email": "email@example.com", "tel": "tel", "country": "country" } ] |
Response | { "error_code": 0, "value": { "update_list": { "failed": [], "updated": [ { "last_update_time": "2020-07-13 17:01:42", "user_id": 10, "entity_id": 2385, "create_by_name": "test10", "entity_name": "updated name", "entity_type": "COUNTERPARTY", "country": "country", "address": "address", "company_id": 1, "create_time": "2020-06-03 10:10:29", "create_by": 10, "update_by": 10, "tel": "tel", "update_by_name": "test10", "email": "email@example.com" } ] }, "insert_list": [ { "last_update_time": "2020-07-13 17:01:42", "user_id": 10, "entity_id": 2876, "create_by_name": "test10", "entity_name": "name", "entity_type": "COUNTERPARTY", "country": "country", "address": "address", "company_id": 1, "create_time": "2020-07-13 17:01:42", "create_by": 10, "update_by": "", "tel": "tel", "update_by_name": "", "email": "email@example.com" } ] } } |
Notes | The returned insert_list contains data of failed and successful inserts The returned update_list contains data of failed and successful updates Insert would fail if there is an existing whitelist with the same Update would fail if there is an existing whitelist with the same entity_type can be empty '' |
Delete Company
Delete company | Deletes single/ multiple company by id |
---|---|
Request | URL:
Method:
Headers:
Authorization:
JSON Body:
[2824] |
Response | { "error_code": 0, "value": [ { "entity_id": 2824 } ] } |
Notes | Returns only ids that were successfully deleted |