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


Retrieve Company’s 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": "",
                "lastinvoice_update_timebank": "2020-07-20 10:33:45",
                "userreg_idno": 10"",
                "entitycredit_idccy": 2905"",
                "createfax_by_nameno": "test10",
                "entity_nameinvalid": "name",
                "entityupdate_by_typename": "",
                "countryemail": "countryemail@example.com",
                "address": "address"},
            {
   "company_id": 1,
                "createlast_update_time": "2020-07-20 10:29:33:45",
                "createuser_byid": 10,
                "updateentity_byid": ""2901,
                "telcreate_by_name": "teltest10",
                "update_byentity_name": "name",
                "emailentity_type": "email@example.com"",
                 },"country": "country",
              {  "address": "address",
                "last_updatecompany_id": 1,
                "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_by": 10,
                "update_by"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

...

  • 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

...

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

Code Block
{
    "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 entity_name, entity_type or same entity_name

Update would fail if there is an existing whitelist with the same entity_name, entity_type or same entity_name

entity_type can be empty ''

Delete Company

...

Delete company

Deletes single/ multiple company by id

Request

URL:

  • {basePath}

Method:

  • DELETE

Headers:

  • Content-Type: application/json

Authorization:

  • JWT { token }

JSON Body:

  • del_id_list: list of ids to be deleted

Code Block
[2824]

Response

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

Notes

Returns only ids that were successfully deleted