Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 4 Next »

basePath = /smartfin/api/v1/whitelist

Company - Get

Get company

Get all company list that is visible to current user

Request

URL:

  • {basePath}

Method:

  • GET

Headers:

  • Content-Type: application/json

  • token

Parameters:

  • null

Body:

  • null

Response

{
    "error_code": 0,
    "value": {
        "items": [
            {
                "last_update_time": "2020-07-20 10:39:29",
                "user_id": 10,
                "entity_id": 2909,
                "create_by_name": "test10",
                "entity_name": "name",
                "entity_type": "",
                "country": "country",
                "address": "address",
                "company_id": 1,
                "create_time": "2020-07-20 10:39:29",
                "create_by": 10,
                "update_by": "",
                "tel": "tel",
                "update_by_name": "",
                "email": "email@example.com"
            },
            {
                "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",
                "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": "",
                "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"
        ]
    }
}

Notes

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

Company - Upsert ( Update/ Insert )

Update/insert company

Inserts/Update company

Request

URL:

  • {basePath}

Method:

  • POST

Headers:

  • Content-Type: application/json

  • token

JSON Body:

  • insert_list: company/s to be inserted

[
  {
    "entity_name": "name",
    "entity_type": "COUNTERPARTY",
    "address": "address",
    "email": "email@example.com",
    "tel": "tel",
    "country": "country"
  }
]
  • update_list: company/s to be updated

[
  {
    "entity_id": 2385,
    "entity_name": "updated name",
    "entity_type": "COUNTERPARTY",
    "address": "address",
    "email": "email@example.com",
    "tel": "tel",
    "country": "country"
  }
]

Response

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

Company - Delete

Delete company

Deletes single/ multiple company by id

Request

URL:

  • {basePath}

Method:

  • DELETE

Headers:

  • Content-Type: application/json

  • token

JSON Body:

  • del_id_list: list of ids to be deleted

[2824]

Response

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

Notes

Returns only ids that were successfully deleted

  • No labels