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

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT <<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:

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,
Code Block
{
    "error_code": 0,
    "value": {
          "create_by_name"items": "test10",[
            {
   "entity_name             "last_update_time": "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:33:45"",
                "create_bycountry": 10"country",
                "update_byaddress": "address",
                "telcompany_id": "tel"1,
                "creditcreate_amttime": "2020-07-20 10:33:45",
                "invoicecreate_codeby": ""10,
                "invoiceupdate_addby": "",
                "invoice_banktel": "tel",
                "regcredit_noamt": "",
                "creditinvoice_ccycode": "",
                "faxinvoice_noadd": "",
                "invalidinvoice_bank": "",
                "updatereg_by_nameno": "",
                "emailcredit_ccy": "email@example.com",
            },    "fax_no": "",
       {                 "last_update_time"invalid": "2020-07-20 10:29:33",
                "userupdate_by_idname": 10"",
                "entity_idemail": 2901, "email@example.com"
            },
           "create_by_name": "test10", {
                "entitylast_update_nametime": "name2020-07-20 10:29:33",
                "entityuser_typeid": ""10,
                "countryentity_id": "country"2901,
                "addresscreate_by_name": "addresstest10",
                "companyentity_idname": 1"name",
                "createentity_timetype": "2020-07-20 10:29:33",
                "create_bycountry": 10"country",
                "update_byaddress": "address",
                "creditcompany_amtid": ""1,
                "invoicecreate_codetime": "",
 2020-07-20 10:29:33",
                "invoicecreate_addby": ""10,
                "invoiceupdate_bankby": "",
                "regcredit_noamt": "",
                "creditinvoice_ccycode": "",
                "faxinvoice_noadd": "",
                "invalidinvoice_bank": "",
                "telreg_no": "tel",
                "updatecredit_by_nameccy": "",
                "emailfax_no": "email@example.com",
            },    "invalid": "",
       ..         ],
"tel": "tel",
       "company_type": [        "update_by_name": "",
   "OWNER",             "COUNTERPARTYemail": "email@example.com"
       ],     },
   "broker": [        ..
    "VANTAGE",    ],
        "BGC",company_type": [
            "STEEM1961OWNER",
            "SSYCOUNTERPARTY"
        ],
        "broker"company_name": [
            "VITOL SAVANTAGE",
            "nameBGC",
            "xyzSTEEM1961",
            "HYUNDAISSY",
        ],
    "BRITISH AIRWAYS",   "company_name": [
        "CHINA AVIATION OIL (SINGAPORE) CORPORATION"VITOL LTDSA",
            "yyyyname",
            "updated name2xyz",
            "SC SHIPPINGHYUNDAI",
            "qqqBRITISH AIRWAYS",
            "updatedCHINA name",AVIATION OIL (SINGAPORE) CORPORATION  LTD",
            "aaaaayyyy",
            "PTT"updated name2",
            ]"SC SHIPPING",
           }
}

Returns

  • a list of objects, 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

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 for the company data

Code Block
invalid - boolean

The company data’s status (true or false)

Update / Insert Company

 "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

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": "updated name"TEST_COMPANY_NAME",
         "entity_type": "COUNTERPARTY",
         "address": "address2",
         "email": "email@example.com2",
         "tel": "tel3",
    "country": "country"   }
]

Response

Code Block
{
 "fax_no":"3",
   "error_code": 0,     "valuecountry":"",
{         "updatecredit_listamt":"",
{             "failed": [],
  "credit_ccy":"",
         "updatedinvoice_code":"",
[             "invoice_add":"",
   {         "invoice_bank":"",
           "lastreg_update_timeno": "2020-07-13 17:01:42",
         "invalid":""
      }
   "user_id": 10],
   "update_list":[
      {
         "entity_id": 2385261472,
          "entity_name":"TEST_COMPANY_3",
         "createentity_by_nametype": "test10BROKER",
          "address":"",
         "entity_nameemail": "updated name",
          "tel":"",
         "entityfax_typeno": "COUNTERPARTY",
          "country":"",
         "countrycredit_amt": "country",
          "credit_ccy":"",
         "addressinvoice_code": "address",
         "invoice_add":"",
          "companyinvoice_idbank": 1,
   "",
                "create_time"reg_no": "2020-06-03 10:10:29",
         "invalid":""
      }
    "create_by": 10,
                    "update_by": 10,
                    "tel": "tel"]
}

Schema

...

Code Block
insert_list - array[object]

Code Block
update_list - array[object]

Response

Example:

Code Block
{
    "error_code": 0,
    "value": 
{
        
"
update
insert_
by_name
list": 
"test10",
[
            {
       
"email":
 
"email@example.com"
        "entity_id": 261485,
       
}
         
]
"company_id": 119,
       
},
         "
insert
entity_
list
name":
[
 "TEST_COMPANY_NAME",
                
{
"entity_type": "COUNTERPARTY",
                "
last_update_time
address": "
2020-07-13 17:01:42
2",
                "
user_id
email": 
10
"2",
                "
entity_id
tel": 
2876
"3",
                
"create_by_name":
"country": "
test10
",
                "
entity
create_
name
by": 
"name"
2,
                "
entity
create_
type
time": "
COUNTERPARTY
2023-11-07 14:59:42",
                "
country
update_by": "
country
",
                "
address
last_update_time": "
address
2023-11-07 14:59:42",
                "
company
user_id": 
1
2,
                "
create
credit_
time
amt": ""
2020-07-13 17:01:42
,
                "invoice_code": "",
                "
create
invoice_
by
add": 
10
"",
                "
update
invoice_
by
bank": "",
                "
tel
reg_no": "
tel
",
                "
update
credit_
by_name
ccy": "",
                "
email
fax_no": "
email@example.com
3",
            
}
    "invalid": "",
   
]
     
} }

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
        "create_by_name": "test2",
                "update_by_name": ""
            }
        ],
        "update_list": {
            "updated": [
                {
                    "entity_id": 261472,
                    "company_id": 119,
                    "entity_name": "TEST_COMPANY_3",
                    "entity_type": "BROKER",
                    "address": "",
                    "email": "",
                    "tel": "",
                    "country": "",
                    "create_by": 2,
                    "create_time": "2023-11-02 14:39:54",
                    "update_by": 2,
                    "last_update_time": "2023-11-07 14:59:42",
                    "user_id": 2,
                    "credit_amt": "",
                    "invoice_code": "",
                    "invoice_add": "",
                    "invoice_bank": "",
                    "reg_no": "",
                    "credit_ccy": "",
                    "fax_no": "",
                    "invalid": "",
                    "create_by_name": "test2",
                    "update_by_name": "test2"
                }
            ],
            "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 ''

Delete Company

...

DELETE/smartfin/api/v1/whitelist

Deletes single / multiple company

...

according to its entity_id

...

Request

URL:

  • {basePath}

Method:

  • DELETE

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.