Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

Base Url: /smartfin/api/v1/whitelist

...

GET /smartfin/api/v1/whitelist

Get all company data that are visible to current user.

Authentication / Authorization

  •  API Key

Headers

Schema

GET /smartfin/api/v1/whitelist

Headers:

  • Content-Type: application/json

Authorization:

  • string - Bearer <<YOUR_API_KEY_HERE>> (required)

Responses

Example:

...

Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

Base Url: /smartfin/api/v1/whitelist


Retrieve Company 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:

Code Block
{
    "error_code": 0,
    "value": {
        "items": [
          "create_by_name": "test10", {
                "entitylast_update_nametime": "name2020-07-20 10:33:45",
                "entityuser_typeid": ""10,
                "countryentity_id": "country"2905,
                "addresscreate_by_name": "addresstest10",
                "companyentity_idname": 1"name",
                "createentity_timetype": "2020-07-20 10:39:29",
                "create_bycountry": 10"country",
                "update_byaddress": "address",
                "telcompany_id": "tel"1,
                "updatecreate_by_nametime": "2020-07-20 10:33:45",
                "emailcreate_by": "email@example.com"10,
            },    "update_by": "",
       {         "tel": "tel",
      "last_update_time          "credit_amt": "2020-07-20 10:33:45",
                "userinvoice_idcode": 10"",
                "entityinvoice_idadd": 2905"",
                "createinvoice_by_namebank": "test10",
                "entityreg_nameno": "name",
                "entitycredit_typeccy": "",
                "countryfax_no": "country",
                "addressinvalid": "address",
                "companyupdate_idby_name": 1"",
                "create_timeemail": "2020-07-20 10:33:45","email@example.com"
            },
         "create_by": 10,   {
                "last_update_bytime": "2020-07-20 10:29:33",
                "teluser_id": "tel",10,
                "updateentity_by_nameid": ""2901,
                "emailcreate_by_name": "email@example.comtest10",
            },    "entity_name": "name",
       {                 "last_update_time"entity_type": "2020-07-20 10:29:33",
                "user_idcountry": 10"country",
                "entity_idaddress": 2901"address",
                "createcompany_by_nameid": "test10"1,
                "entitycreate_nametime": "name2020-07-20 10:29:33",
                "entitycreate_typeby": ""10,
                "countryupdate_by": "country",
                "addresscredit_amt": "address",
                "companyinvoice_idcode": 1"",
                "createinvoice_timeadd": ""2020-07-20 10:29:33",
,
                "createinvoice_bybank": 10"",
                "updatereg_byno": "",
                "telcredit_ccy": "tel",
                "updatefax_by_nameno": "",
                "emailinvalid": "email@example.com",
            },    "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

  • a list of objects named items, each representing a company (in descending order of entity_id)

  • a list of company_names present in the data

  • a list of company_types present in the data

  • a list of brokers present in the data

Company - Upsert ( Update/ Insert )

...

Update/insert company

...

Inserts/Update company

...

Request

...

URL:

  • {basePath}

Method:

  • POST

Headers:

  • Content-Type: application/json

Authorization:

  • JWT { token }

JSON Body:

  • insert_list: company/s to be inserted

Code Block
[
  {
    "entity_name": "name",
    "entity_type": "COUNTERPARTY",
    "address": "address",
    "email": "email@example.com",
    "tel": "tel",
    "country": "country"
  }
]
  • update_list: company/s to be updated

Code Block
[
  {
    "entity_id": 2385,
    "entity_name": "updated name",
    "entity_type": "COUNTERPARTY",
    "address": "address",
    "email": "email@example.com",
    "tel": "tel",
    "country": "country"
  }
]

...

Response

...

Schema

...

Code Block
last_update_time, update_by_name, update_by - string

Information about last updated time for the data and the user who updating the data.

Code Block
create_time, create_by, create_by_name - string

Information about created time for the data and the user who creating the data.

Code Block
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.

Code Block
entity_name, entity_type - string
  • entity_name - Company name

  • entity_type - Company type (COUNTERPARTY or BROKER)

Info

entity_name and entity_type cannot be duplicated,

  • Eg. entity_name of 'COMPANY NAME' will not allow to be stored if the same entity_name has been found in database.

  • Eg. entity_name of ‘COMPANY NAME' and entity_type of 'COUNTERPARTY’ will not allow to be stored if the same entity_name and entity_type has been found in database.

Code Block
address, email, tel, country, credit_amt, invoice_code, invoice_add, invoice_bank,
reg_no, credit_ccy, fax_no - string

Extra information of the company data

Code Block
invalid - boolean

The status of company data (true or false)

Update / Insert Company Data

...

POST/smartfin/api/v1/whitelist

Insert new or update existing company data in database

Authentication / Authorization

  •  API Key

Headers

Schema

...

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT <<YOUR_API_KEY_HERE>> (required)

Request

Example:

JSON Body:

Code Block
{
   "insert_list":[
      {
         "entity_name":"TEST_COMPANY_NAME",
         "entity_type":"COUNTERPARTY",
         "address":"2",
         "email":"2",
         "tel":"3",
         "fax_no":"3",
         "country":"",
         "credit_amt":"",
         "credit_ccy":"",
         "invoice_code":"",
         "invoice_add":"",
         "invoice_bank":"",
         "reg_no":"",
         "invalid":""
      }
   ],
   "update_list":[
      {
         "entity_id":261472,
         "entity_name":"TEST_COMPANY_3",
         "entity_type":"BROKER",
         "address":"",
         "email":"",
         "tel":"",
         "fax_no":"",
         "country":"",
         "credit_amt":"",
         "credit_ccy":"",
         "invoice_code":"",
         "invoice_add":"",
         "invoice_bank":"",
         "reg_no":"",
         "invalid":""
      }
   ]
}

Schema

...

Code Block
insert_list - array[object]

Code Block
update_list - array[object]

Response

Example:

Code Block
{
    "error_code": 0,
    "value": {
        "insert_list": [
            {
                "entity_id": 261485,
                "company_id": 119,
                "entity_name": "TEST_COMPANY_NAME",
                "entity_type": "COUNTERPARTY",
                "address": "2",
                "email": "2",
                "tel": "3",
                "country": "",
                "create_by": 2,
                "create_time": "2023-11-07 14:59:42",
                "update_by": "",
                "last_update_time": "2023-11-07 14:59:42",
                "user_id": 2,
                "credit_amt": "",
                "invoice_code": "",
                "
update
invoice_
list
add": 
{
"",
                "
failed
invoice_bank": 
[]
"",
             
"updated
   "reg_no": 
[
"",
                
{
"credit_ccy": "",
                
"
last
fax_
update_time
no": "
2020-07-13 17:01:42
3",
                
"user_id
"invalid": 
10
"",
                
"entity_id
"create_by_name": 
2385
"test2",
                
"
create
update_by_name": "
test10",
"
            }
        ],
        "
entity
update_
name
list":
"updated name",
 {
            "updated": [
               
"entity_type": "COUNTERPARTY",
 {
                    "
country
entity_id": 
"country"
261472,
                    "
address
company_id": 
"address"
119,
                    "
company
entity_
id
name": 
1
"TEST_COMPANY_3",
                    "
create
entity_
time
type": "
2020-06-03 10:10:29
BROKER",
                    "
create_by
address": 
10
"",
                    "
update_by
email": 
10
"",
                    "tel": "
tel
",
                    "
update_by_name
country": "
test10
",
                    "
email
create_by": 
"email@example.com"
2,
                
}
    "create_time": 
"2023-11-02 14:39:54",
     
]
         
},
      
"
insert
update_
list
by": 
[
2,
         
{
           
"last_update_time": "
2020
2023-11-07
-13
 
17
14:
01
59:42",
                    "user_id": 
10
2,
                    "
entity
credit_
id
amt": 
2876,
"",
                    "
create
invoice_
by_name
code": "
test10
"
,
,
                    "
entity
invoice_
name
add": "
name
",
                    "
entity
invoice_
type
bank": "
COUNTERPARTY
",
                    "
country
reg_no": "
country
",
                
"address
    "credit_ccy": "
address
",
                    "
company
fax_
id
no": 
1,
"",
                    "
create_time
invalid": 
"2020-07-13 17:01:42",
"",
                    "create_by_name": 
10
"test2",
                    "update_by_name": "
",
test2"
                }
     
"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
  "failed": []
        }
    }
}

Schema

...

Code Block
insert_list - array[object]

Code Block
update_list - object
updated - array[object]
failed - array[object]

  • Contain the same parameters as items in response body of https://mafint.atlassian.net/wiki/spaces/MAD/pages/2128150536/Entity+Management#Responses ( Refer to the definition of each parameter )

  • updated consists of data that has been updated successfully ,where failed consists of data that has not been updated in database.

  • The relevant error message will be returned if there are any duplicated data attempting to insert or update into the database.

Warning

Insert process will fail if there is an existing

...

company with the same entity_name, entity_type or same entity_name

Update

...

process will fail if there is an existing

...

company with the same entity_name, entity_type or same entity_name

entity_type can be empty ''

Company - Delete

...

Delete Company

...

DELETE/smartfin/api/v1/whitelist

Deletes single / multiple company

...

according to its entity_id

...

Request

URL:

  • {basePath}

Method:

...

Authentication / Authorization

  •  API Key

Headers

Schema

...

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT

...

  • <<YOUR_API_KEY_HERE>> (required)

Request

Example:

JSON Body:

Code Block
{
  "del_id_list":[261485]
}
Code Block
del_id_list

...

Code Block
[2824]

...

Response

 - array
  • A list that consists of unique entity_id, that user would like to delete from.

Response:

Example:

Code Block
{
  "error_code": 0,
  "value": [
    {
      "entity_id": 
2824
261485
    }
  ]
}

Notes

Returns only ids that were successfully deleted
  • Return a list of object named value, each object contains entity_id that indicates the company that has been deleted successfully.