Accountancy Service Integration Guide

Integration

Accountacy Service uses Logstash as a data ingestion and server-side data processing pipeline. The data sent to Logstash are forwarded to Elasticsearch for persistence after executing certain ingestion pipelines; and then Kibana dashboards are automatically updated based on the certain fields stored on Elasticsearch. In other words, Accountancy Service uses a basic data model for visualization.

For the integration, all there is needed to do is to send a POST request (with Content-Type header set to application/json) to the Logstash endpoint with a JSON body related with the action conforming to the data model described in the next section. This will be enough for the Accountancy Service to capture the data and update the dashboards. Following data model should be used for specific events.

Data Model

LOGIN

This event is sent to Logstash when a user logs in to the EFPF Portal.

Example data:
{
    "action": "LOGIN",
    "userId": "1",
    "platform": "EFPF"
} 

Fields:

  • action: Default “LOGIN” value for identifying login events among all the data kept on Elasticsearch
  • userId: Identifier of the user assigned by the platform
  • platform: Default “EFPF” value as the name of the platform

REGISTER_COMPANY

This event is sent to Logstash when a new company is registered to the EFPF Portal.

Example data:
{
    "action": "REGISTER_COMPANY",
    "companyId": "100",
    "platform": "EFPF",
}

Fields:

  • action: Default “REGISTER_COMPANY" value for identifying company registrations among all the data kept on Elasticsearch
  • companyId: Identifier of the company assigned by the platform
  • platform: Default “EFPF” value as the name of the platform

REGISTER_USER

This event is sent to Logstash when a user registers to the EFPF Portal.

Example data:
{
    "action": "REGISTER_USER",
    "userId": "1",
    "companyId": "100",
    "platform": "EFPF”
}

Fields:

  • action: Default “REGISTER_USER” value for identifying user registrations among all the data kept on Elasticsearch
  • userId: Identifier of the user assigned by the platform
  • companyId: Identifier of the company that the user belongs to
  • platform: Default “EFPF” value as the name of the platform

PLATFORM_VISIT

This event is sent to Logstash when a user visits a base platform through the EFPF Portal.

Example data:
{
    "action": "PLATFORM_VISIT",
    "userId": "1",
    "platform": "EFPF",
    "visitedPlatform": "NIMBLE"
}

Fields:

  • action: Default “PLATFORM_VISIT" value for identifying platform visit events among all the data kept on Elasticsearch
  • userId: Identifier of the user visiting the platform
  • platform: Default “EFPF” value as the name of the platform
  • visitedPlatform: The name of the platform visited by the authenticated user

TOOL_VISIT

This event is sent to Logstash when a user visits a tool/service offered by the EFPF Platform.

Example data:
{
    "action": "TOOL_VISIT",
    "userId": "1",
    "platform": "EFPF",
    "visitedTool": "WASP"
}

Fields:

  • action: Default “TOOL_VISIT" value for identifying tool/service visit events among all the data kept on Elasticsearch
  • userId: Identifier of the user visiting the tool/service
  • platform: Default “EFPF” value as the name of the platform
  • visitedTool: The name of the tool/service visited by the authenticated user

SEARCH_EVENT

This event is sent to Logstash when a user searches for products/services or companies on EFPF Portal.

Example data:
{
    "action": "SEARCH_EVENT",
    "userId": "1",
    "query": "*",
    "searchType": "COMPANY_SEARCH",
    "queriedPlatforms": ["NIMBLE", "COMPOSITION"]
    "platform": "EFPF"
}

Fields:

  • action: Default “SEARCH_EVENT” value for identifying product/service/company search events among all the data kept on Elasticsearch
  • userId: Identifier of the user performing the search operation
  • query: The search keyword
  • searchType: Depending on the type of the search, it can be either COMPANY_SEARCH or PRODUCT_SEARCH
  • queriedPlatforms: Names of the target platforms that the current search operation executed on
  • platform: Default “EFPF” value as the name of the platform

PAYMENT

This event is sent to Logstash when a user purchases products/services on base marketplace if the user initiated his/her journey from EFPF Portal.

Example data:
{
    "action": "PAYMENT",
    "originPlatform": "EFPF",
    "platform": "NIMBLE",
    "status": "completed",
    "buyerId": "133858",
    "sellerId": "133837",
    "transactionId": "531befd5-ca14-494f-8812-3ef182821397"
    "totalAmount": 10000,
    "products": [{
    	"productId": "51a2e6b0-51d7-47aa-ae55-9ae4214276a3",
    	"productName": "Product 1",
    	"unitPrice": 1000,
    	"productCount": 3,
    	"totalPrice": 3000
    }, {
    	"productId": "a67407a8-dfe4-4773-98e8-9eeef29307e0",
    	"productName": "Product 2",
    	"unitPrice": 3500,
    	"productCount": 2,
    	"totalPrice": 7000
    }], 
    ...
}

Fields:

  • action: Default “PAYMENT” value for identifying payment events among all the data kept on Elasticsearch
  • originPlatform: If the user is coming from EFPF Platform, “EFPF” constant value must be used since this is essential for the cashback mechanism to work, otherwise the value will be null or this field is omitted
  • platform: Name of the platform that realizes the transaction: NIMBLE, SMECluster, VF-OS, etc.
  • transactionId: If available. Indicates the identifier of this transaction.
  • buyerId: If available. Indicates the identifier of the buying company/user on the platform that realizes the transaction
  • sellerId: If available. Indicates the identifier of the selling company/user on the platform that realizes the transaction
  • totalAmount: The total amount paid by the buyer company/user. Please note that, this field should be a numeric value
  • status: Status of the payment and can be “pending”, “completed” or “cancelled”
  • products: List of products purchased
    • productId: Identifier of the product
    • productName: Name of the product
    • unitPrice: Price of the single product
    • productCount: Number of the current products purchased in this transaction
    • totalPrice: Total price of products (unitPrice x productCount)
Previous
Next