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:

Code Block
{
    "error_code": 0,
    "value": {
        "entity_iditems": 2905,[
            {
    "create_by_name": "test10            "last_update_time": "2020-07-20 10:33:45",
                "entityuser_nameid": "name"10,
                "entity_typeid": ""2905,
                "countrycreate_by_name": "countrytest10",
                "addressentity_name": "addressname",
                "companyentity_idtype": 1"",
                "create_timecountry": "2020-07-20 10:33:45country",
                "create_byaddress": 10"address",
                "updatecompany_byid": ""1,
                "telcreate_time": "tel2020-07-20 10:33:45",
                "creditcreate_amtby": ""10,
                "invoiceupdate_codeby": "",
                "invoice_addtel": "tel",
                "invoicecredit_bankamt": "",
                "reginvoice_nocode": "",
                "creditinvoice_ccyadd": "",
                "faxinvoice_nobank": "",
                "invalidreg_no": "",
                "updatecredit_by_nameccy": "",
                "emailfax_no": "email@example.com",
            },    "invalid": "",
       {                 "last_update_time"update_by_name": "2020-07-20 10:29:33",
                "user_idemail": 10,"email@example.com"
            },
           "entity_id": 2901, {
                "createlast_byupdate_nametime": "test102020-07-20 10:29:33",
                "entityuser_nameid": "name"10,
                "entity_typeid": ""2901,
                "countrycreate_by_name": "countrytest10",
                "addressentity_name": "addressname",
                "companyentity_idtype": 1"",
                "create_timecountry": "2020-07-20 10:29:33country",
                "create_byaddress": 10"address",
                "updatecompany_byid": ""1,
                "creditcreate_amttime": "2020-07-20 10:29:33",
                "invoicecreate_codeby": ""10,
                "invoiceupdate_addby": "",
                "invoicecredit_bankamt": "",
                "reginvoice_nocode": "",
                "creditinvoice_ccyadd": "",
                "faxinvoice_nobank": "",
                "invalidreg_no": "",
                "telcredit_ccy": "tel",
                "updatefax_by_nameno": "",
                "emailinvalid": "email@example.com",
            },    "tel": "tel",
        ..         ]"update_by_name": "",
        "company_type": [             "OWNER","email": "email@example.com"
            "COUNTERPARTY"
        ]},
        "broker": [    ..
        "VANTAGE"],
            "BGC","company_type": [
            "STEEM1961OWNER",
            "SSYCOUNTERPARTY"
        ],
        "company_namebroker": [
            "VITOL SAVANTAGE",
            "nameBGC",
            "xyzSTEEM1961",
            "HYUNDAISSY",
        ],
   "BRITISH AIRWAYS",    "company_name": [
        "CHINA AVIATION OIL (SINGAPORE) CORPORATION"VITOL LTDSA",
            "yyyyname",
            "updated name2xyz",
            "SC SHIPPINGHYUNDAI",
            "qqqBRITISH AIRWAYS",
            "updated nameCHINA AVIATION OIL (SINGAPORE) CORPORATION LTD",
            "aaaaayyyy",
            "PTTupdated name2",
        ]     }
}

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

    Schema

    ...

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

    Extra information for of the company data

    Code Block
    invalid - boolean

    The status of company data’s status data (true or false)

    Update / Insert

    ...

    Company Data

    ...

    Update/insert company

    ...

    Inserts/Update company

    ...

    Request

    ...

    URL:

    • {basePath}

    Method:

    • POST

    Headers:

    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": "tel",     "countrytel": "country3",
      }
    ]
    • update_list: company/s to be updated

    Code Block
    [   {     "entityfax_idno":"3",
    2385,     "entity_name    "country": "updated name",
             "entitycredit_typeamt": "COUNTERPARTY",
          "address   "credit_ccy": "address",
         "email    "invoice_code": "email@example.com",
             "telinvoice_add": "tel",
        "country": "country"   }
    ]

    Response

    Code Block
    {
        "error_code": 0,
        "value": { "invoice_bank":"",
             "updatereg_listno":"",
    {             "failedinvalid":""
     [],     }
       ],
       "updatedupdate_list": [
          {
             {"entity_id":261472,
              "entity_name":"TEST_COMPANY_3",
             "lastentity_update_timetype": "2020-07-13 17:01:42"BROKER",
             "address":"",
              "user_idemail": 10"",
             "tel":"",
              "entityfax_idno": 2385"",
               "country":"",
             "createcredit_by_nameamt": "test10",
              "credit_ccy":"",
             "entityinvoice_namecode": "updated name",
              "invoice_add":"",
             "entityinvoice_typebank": "COUNTERPARTY",
              "reg_no":"",
             "countryinvalid": "country",
          }
                 "address": "address",
                        "company_id": 1,
                        "create_time": "2020-06-03 10:10:29",]
    }

    Schema

    ...

    Code Block
    insert_list - array[object]

    Code Block
    update_list - array[object]

    Response

    Example:

    Code Block
    {
        "error_code": 0,
        "value": {
            "insert_list": [
               
    "create_by": 10,
     {
                    
    "
    update
    entity_
    by
    id": 
    10
    261485,
                    
    "tel
    "company_id": 
    "tel"
    119,
                    
    "update_by_
    "entity_name": "
    test10
    TEST_COMPANY_NAME",
    
                    "
    email
    entity_type": "
    email@example.com
    COUNTERPARTY",
                    "address": "2",
       
    }
                 
    ]
    "email": "2",
           
    },
             "
    insert_list
    tel": 
    [
    "3",
                
    {
        "country": "",
                    "
    last
    create_
    update_time
    by": 
    "2020-07-13 17:01:42"
    2,
                    "
    user
    create_
    id
    time":
    10
     "2023-11-07 14:59:42",
                    "
    entity
    update_
    id
    by": 
    2876
    "",
                    "
    create
    last_
    by
    update_
    name
    time": "
    test10
    2023-11-07 14:59:42",
                    "
    entity
    user_
    name
    id": 
    "name"
    2,
                    "
    entity
    credit_
    type
    amt": "
    COUNTERPARTY
    ",
                    "
    country
    invoice_code": "
    country
    ",
                    "
    address
    invoice_add": "
    address
    ",
                    "
    company
    invoice_
    id
    bank": 
    1
    "",
                    "
    create
    reg_
    time
    no": "
    2020-07-13 17:01:42
    ",
                    "
    create
    credit_
    by
    ccy": 
    10
    "",
                    "
    update
    fax_
    by
    no": "3",
                    "
    tel
    invalid": "
    tel
    ",
                    "
    update
    create_by_name": "test2",
                    "
    email"
    update_by_name": "
    email@example.com
    "
                }
            ],
            "update_list": {
                "updated": [
                 
    } }

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