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’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:

Code Block
{
    "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

  • 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

...

Update / Insert Company’s Data

...

Update/insert company

...

Inserts/Update company

...

Request

...

URL:

  • {basePath}

Method:

  • POST

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
: company/s to be inserted
Code Block
":[
  {    {
         "entity_name": "nameTEST_COMPANY_NAME",
         "entity_type": "COUNTERPARTY",
         "address": "address2",
         "email": "email@example.com2",
         "tel": "tel3",
         "countryfax_no": "country3",
     }
]
  • update_list: company/s to be updated

Code Block
[    "country":"",
    {     "entitycredit_idamt": 2385,"",
         "entitycredit_nameccy": "updated name",
         "entityinvoice_typecode": "COUNTERPARTY",
    "address     "invoice_add": "address",
    "email     "invoice_bank": "email@example.com",

   "tel": "tel",     "countryreg_no": "country",
   } ]

Response

Code Block
{     "error_codeinvalid":""
0,     "value": {}
   ],
    "update_list":[
{      {
         "failedentity_id": []261472,
            "updated": ["entity_name":"TEST_COMPANY_3",
         "entity_type":"BROKER",
       {   "address":"",
                 "last_update_time"email": "2020-07-13 17:01:42",
         "tel":"",
          "userfax_idno": 10"",
          "country":"",
         "entitycredit_idamt": 2385"",
          "credit_ccy":"",
         "createinvoice_by_namecode": "test10",
         "invoice_add":"",
          "entityinvoice_namebank": "updated name",
                    "entity_type": "COUNTERPARTY",
   "reg_no":"",
                "country"invalid": "country",
      }
   ]
}

Schema

...

Code Block
insert_list 

...

- array[object]

Code Block
update_list - array[object]

Response

Example:

Code Block
{
    "error_code": 0,
    "value": {
        "insert_list": [
          
"create_time":
 
"2020-06-03 10:10:29",
 {
                
"
create
entity_
by
id": 
10
261485,

                "
update
company_
by
id": 
10
119,

                
"
tel
entity_name": "
tel
TEST_COMPANY_NAME",
                
"
update
entity_
by_name
type": "
test10
COUNTERPARTY",

                
"
email
address": "
email@example.com
2",
                "email": "2",
   
}
             
]
"tel": "3",
       
},
         "
insert_list
country": 
[
"",
            
{
    "create_by": 2,
           
"last_update
     "create_time": "
2020
2023-11-07
-13
 
17
14:
01
59:42",
                "
user
update_
id
by": 
10
"",
                "
entity
last_update_
id
time":
2876
 "2023-11-07 14:59:42",
                "
create
user_
by_name
id": 
"test10"
2,
                "
entity
credit_
name
amt": "
name
",
                "
entity
invoice_
type
code": "
COUNTERPARTY
",
                "
country
invoice_add": "
country
",
                "
address
invoice_bank": "
address
",
                "
company
reg_
id
no": 
1
"",
                "
create
credit_
time
ccy": "
2020-07-13 17:01:42
",
                "
create
fax_
by
no": 
10
"3",
                "
update_by
invalid": "",
                "
tel
create_by_name": "
tel
test2",
                "update_by_name": ""
,

            }
   
"email":
 
"email@example.com"
    ],
        
}
"update_list": {
            "updated": [
                {
                 
]
   "entity_id": 261472,
     
} }

Notes

The returned insert_list contains data of failed and successful inserts

The returned update_list contains data of failed and successful updates

Insert
               "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]

Warning

Insert process would fail if there is an existing

...

company with the same entity_name, entity_type or same entity_name

Update process would 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 company

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, each object contains entity_id that indicates the company that has been deleted successfully.