Versions Compared

Key

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

...

Base Url: /smartfin/api/v1/whitelist


Retrieve

...

Company Data

...

GET /smartfin/api/v1/whitelist

...

Authentication / Authorization

  •  API Key

Headers

Schema

GET /smartfin/api/v1/whitelist

...

Headers:

  • Content-Type: application/json

Authorization:

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

Responses

Example:

Code Block
{
    "error_code": 0,
    "value": {
        "items": [
            {
                "last_update_time": "2020-07-20 10:3933:2945",
                "user_id": 10,
                "entity_id": 29092905,
                "create_by_name": "test10",
                "entity_name": "name",
                "entity_type": "",
                "country": "country",
                "address": "address",
                "company_id": 1,
                "create_time": "2020-07-20 10:3933:2945",
                "create_by": 10,
                "update_by": "",
                "tel": "tel",
                "updatecredit_by_nameamt": "",
                "emailinvoice_code": "email@example.com",
            },    "invoice_add": "",
                 {"invoice_bank": "",
                "lastreg_update_timeno": "2020-07-20 10:33:45",
                "usercredit_idccy": 10"",
                "entityfax_idno": 2905"",
                "create_by_nameinvalid": "test10",
                "entityupdate_by_name": "name",
                "entity_typeemail": "email@example.com",
            },
    "country": "country",       {
         "address": "address       "last_update_time": "2020-07-20 10:29:33",
                "companyuser_id": 110,
                "createentity_timeid": "2020-07-20 10:33:45"2901,
                "create_by_name": 10"test10",
                "updateentity_byname": "name",
                "telentity_type": "tel",
                "update_by_namecountry": "country",
                "emailaddress": "email@example.comaddress",
            },    "company_id": 1,
       {
                "last_update_"create_time": "2020-07-20 10:29:33",
                "usercreate_idby": 10,
                "entityupdate_idby": 2901"",
                "createcredit_by_nameamt": "test10",
                "entityinvoice_namecode": "name",
                "entityinvoice_typeadd": "",
                "countryinvoice_bank": "country",
                "addressreg_no": "address",
                "companycredit_idccy": 1"",
                "createfax_timeno": "2020-07-20 10:29:33",
                "create_byinvalid": 10,                 "update_by": "",
                "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,

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    "fax_no": "country3",
   } ]

Response

Code Block
{     "error_codecountry": 0"",
    "value": {         "updatecredit_listamt": {
  "",
         "failedcredit_ccy": []"",
            "updated"invoice_code":"",
[         "invoice_add":"",
       {  "invoice_bank":"",
         "reg_no":"",
         "last_update_timeinvalid": "2020-07-13 17:01:42",
      }
   ],
         "user_id"update_list":[
10,      {
              "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",
                    "create_by"invalid":""
10,      }
              "update_by": 10,
                    "tel": "tel",
                    "update_by_name": "test10"]
}

Schema

...

Code Block
insert_list - array[object]

Code Block
update_list - array[object]

Response

Example:

Code Block
{
    "error_code": 0,
    
"value": {
        
"
email
insert_list": 
"email@example.com"
[
            {
   
}
             
]
"entity_id": 261485,
       
},
         "
insert
company_
list
id": 
[
119,
            
{
    "entity_name": "TEST_COMPANY_NAME",
                "
last
entity_
update_time
type": "
2020-07-13 17:01:42
COUNTERPARTY",
                "
user_id
address": 
10
"2",
                "
entity_id
email": 
2876
"2",
                "
create_by_name
tel": "
test10
3",
                "
entity_name
country": "
name
",
                "
entity
create_
type
by": 
"COUNTERPARTY"
2,
                "
country
create_time": "
country
2023-11-07 14:59:42",
                "
address
update_by": "
address
",
                "
company
last_update_
id
time": 
1
"2023-11-07 14:59:42",
                "
create
user_
time
id": 
"2020-07-13 17:01:42"
2,
                "
create
credit_
by
amt": 
10
"",
                "
update
invoice_
by
code": "",
                "
tel
invoice_add": "
tel
",
                "
update_by_name
invoice_bank": "",
                "reg_no": "",
                "credit_ccy": "",
                "fax_no": "3",
                "invalid": "",
                "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 

...

Notes

The returned insert_list contains data of failed and successful inserts

The returned update_list contains data of failed and successful updates

...

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