Customer Deposit
Efficiently synchronize customer deposits from OMS to NetSuite using Apache NiFi integration.
This integration flow is responsible to send the Customer Deposit Feed from OMS to NetSuite. This feed contains the information about order, its total amount and the payment method.
The data for the feed should be fetched incrementally i.e. an order once sent to NetSuite should not be sent in the subsequent feeds.
This feed is not applicable for Cash Sale i.e. orders with shipment method type id as POS_COMPLETED as they are already completed in stores. This feed will be sent to NetSuite for Online and Send Sale type orders.
Technical Implementation
This feed is generated in the integration layer using Apache NiFi.
In NiFi, the required order data is fetched by connecting to the OMS transactional database, and this data is prepared in the format required by NetSuite.
To ensure that same orders are not sent nultiple times in the feed, the fromDate column of OrderIdentification for the type NETSUITE_ORDER_ID is used to fetch the orders incrementally in NiFi. The generated feed file is put on SFTP.
NiFi Flow
The below processors are used to prepare the NiFi Flow
QueryDatabaseTableRecord
The QueryDatabaseTableRecord processor is used to execute the SQL on HC database and incrementally fetch the data based on a table column. Here it is fromDate column of OrderIdentification table for the order identification type ID as NETSUITE_ORDER_ID.
UpdateAttribute
Here the file name is prepared for the feed by appending the current time as per the timezone configured in OMS. This helps in identifying the time at which feed is being kept for NetSuite.
PutSFTP
Two PutSFTP processors are used here: the first for eligible records for NetSuite, the second for logging this feed file for OMS.
NetSuite Customer Deposit Feed File details
FTP locations
Path for NetSuite to consume the Customer Deposit Feed
Path for OMS where the Customer Deposit Feed is kept for logging purpose
Sample Feed File Name Format
Sample Feed File
Data model mapping
Following fields are prepared in the feed.
order_id
String
The NetSuite Order ID
OrderIdentification.id_value where order_identification_type_id = 'NETSUITE_ORDER_ID'
total_amount
String
The total amount of the order
OrderHeader.grand_total
payment_method
String
The payment method for the order
OrderPaymentPreference.payment_method_id mapped with IntegrationTypeMapping.mapping_value where integration_type_id = 'NETSUITE_PMT_MTHD'
shopify_order_no
String
The shopify order name of the order
OrderIdentification.id_value where order_identification_type_id = 'SHOPIFY_ORDER_NAME'
Last updated