WooCommerce Integration Proposal

Proposal summary

This proposal details how the integration between WooCommerce Orders with NetSuite is handled.

Requirement 

Overview

Create CustomerCustomer visits the Oakworld Website to place an order. The first step once items are chosen is to enter their information. This information should be used to create a Customer Record on NetSuite.
Sales OrderA Sales Order needs to be created in NetSuite for the items chosen on the website.
Payment/DepositPayment is taken via the website using several methods – Credit/Debit Card; Paypal; Finance. A Customer Deposit should be created for successful Credit Card and Paypal payments.
WebsiteStaging Site https://staging-oakworld.kinsta.cloud/wp-admin/Website https://www.oakworld.co.uk/?gclid=EAIaIQobChMI_MG-s4vq8AIVQ7TtCh2myApcEAAYAiAAEgIcNfD_BwE 


Create a Customer Record

On website, once customer has chosen all items to buy, they choose to complete the Purchase by selecting “Proceed To Checkout”. Billing Information is entered at this point.

Required: 

  • A Customer Record should be created on Successful Payment if Payment Method is Secure Card Payment via SagePay or Paypal. (Note, all Mandatory fields should have been completed including terms and conditions checkbox.)
  • If payment is unsuccessful, Customer Record should still be created.
  • If “Apply for Finance” is selected, a Customer Record should be created when the customer successfully (all mandatory fields have been completed including terms and conditions checkbox) clicks “Place Order” at the end of the checkout.
  • Recognise email: If the email already exists in NetSuite, do not create a new customer. Use the already existing customer record to create a Sales Order.
  • Fields on the customer record need to be populated as per the table below.
Field Label on WebsiteRecordNetSuite Field NameNetSuite Field IDAdditional Comments
First NameCustomerFirst Namefirstname
Last NameCustomerlastname
Company Name (optional)CustomerCompany Namecompanyname
Country/RegionAddressCountrycountry
Street AddressNB: 2 Address linesAddressAddress 1addr1Default BillingDefault Shipping if “Deliver to a different address?” is not checked.
AddressAddress 2addr2
Town/CityAddressCitycity
County (optional)AddressStatestate
PostcodeAddressZIPzip
First NameLast NameAddressAttentionattentionDefault Shipping if “Deliver to a different address?” is checked.
Company Name (optional)AddressAddressee (Only if Company Name is populated. Otherwise allow default.addressee
Street AddressNB: 2 Address linesAddressAddress 1addr1
AddressAddress 2addr2
Town/CityAddressCitycity
County (optional)AddressStatestate
PostcodeAddressZIPzip
Phone – We will use this number to arrange a delivery dateCustomerPhonephone
Email addressCustomerEmailemail
I would like to be informed of any future offers, savings and competitions. (check box)CustomerGlobal Subscription StatusglobalsubscriptionstatusIf Checked → Soft Opt-In→ Check SofaItalia Subscription


Create a Sales Order

Customer information has been entered, the customer can proceed to checkout. This takes them to a secure payment screen. 

Required:

As per creating a Customer Record, and using the customer details,

  • A Sales Order should be created on Successful Payment if Payment Method is Secure Card Payment via SagePay or Paypal.
  • If Payment method is unsuccessful, Sales Order should still be created.
  • If “Apply for Finance” is selected, a Sales Order should be created when the customer successfully (all mandatory fields have been completed including terms and conditions checkbox) clicks “Place Order” at the end of the checkout.
  • The information of the items being bought needs to be on this Sales Order.
Field Name on WebsiteRecordNetSuite Field NameNetSuite Field IDAdditional Comments
Order Number?Sales OrderOrder#tranidOverride the NetSuite Sales Order number with the order number produced in Website.
Product CodeSales OrderItemitem
Sales OrderQuantityquantity
TotalSales OrderGross Amountgrossamount
Order notes (optional)Sales Order
Create a User Note on the Sales Order.
Sales OrderApply for Financecustbody_nbs547_financeIf Finance is chosen as the Payment Method, check this box.


Payment/Deposit

Payment is made by Paypal, Credit Card, or Finance.

Required:

  • A Customer Deposit record to be created if successfully paid by Credit Card or Paypal.
  • If payment is unsuccessful, do not create Customer Deposit.
  • A Customer Deposit record is not required if “Apply for Finance” is chosen.

Payment details:

Field Name on WebsiteRecordNetSuite Field NameNetSuite Field IDAdditional Comments
Customer DepositCustomercustomer
Customer DepositPayment Amountpayment
Customer DepositSales OrdersalesorderNetSuite Sales Order
Payment MethodCustomer DepositPayment Methodpaymentmethod
Customer DepositCC ApprovedccapprovedCredit Card
Transaction IDCustomer DepositP/N Ref.pnrefnumCredit Card
Customer DepositAuth. CodeauthcodeCredit Card

Solution

  • All the order the orders with the following condition is fetched from WooCommerce
    • Payment method should be any of SagePay  (Secure Card Payment via SagePay), PayPal (PayPal Express Checkout), or cheque (Apply for Finance – Minimum Purchase £500)
    • Order status any of completed or failed.
  • A custom record will store the order information and the purpose of this custom record is to handle error handling and notification.
  • The email Id in the order is used to uniquely identify the customer in NetSuite.
    • If the customer doesn’t exist, the customer is created in NetSuite with the details from the WooCommerce order.
      • The primary details on the customer record will be set using the shipping address from WooCommerce
      • The phone number will be retrieved from the billing address
    •  If the customer exists, we wouldn’t update any information on the customer record.
  • The Sales Order is created for the customer with all the necessary information in Pending Approval status.
    • The SKU from WooCommerce is the unique identifier and comparing this with the ITEM NAME/NUMBER field in NetSuite to identify the items.
      If there is a mismatch, the Sales Order won’t be created and it will be flagged in the custom record.
    • The order notes in WooCommerce will be added as the User Notes in Sales Order
    • The NetSuite Sales Order document number will be WooCoomerce Order Number
    • Set the Sales Order Item Line Gross amount as WooCommerce Line level Item Total and Tax Total
    • If the payment method is ‘Apply for Finance – Minimum Purchase £500’, then Sales Order gets created with the checkbox ‘APPLY FOR FINANCE’ as checked
  • If the Payment in WooCommerce is successful and the payment method is SagePay or PayPal, a customer deposit is created for the Sales Order with the necessary information.

Assumptions

  • We will create API keys in WooCommerce Website with Read-Only permission and this will be hardcoded in the script
  • No discount or coupon codes are considered while creating the Sales Order
  • No tax details will be considered while creating the Sales Order. The tax details should be automatically sourced by NetSuite and we won’t override any Tax Information.
  • We won’t consider any shipping lines in WooCommerce. 
  • The Shipping Method in NetSuite won’t be overridden.
  • The Sales Order currency will be always GBP
  • The Sales Order will be created as Pending Approval
  • We have to consider only one WooCommerce website
  • We will hardcode the Payment Method in NetSuite while creating a Customer Deposit for SagePay or PayPal
  • If there is a customer with the given Email Id but is inactive in NetSuite, a new customer will be created before creating Sales Order
  • We have been using the following items for UI testing as not all items are loaded in WooCoommerce
    • 15253
    • 15254
    • 15255
    • 15256
    • 15257

Question

  • The WooCommerce Order status is pending, processing, on-hold, completed, cancelled, refunded, failed and trash of which we will consider only completed and failed.
    1. Can you confirm this? Please advise which status applies to the success or failure of the payment.
    2. All the orders in WooCommerce have ‘On Hold’ status on the WooCommerce staging website.
      Is this applicable only on the Staging website but different for the production website?
  • In WooCommerce, we need the field id exposed on the API for subscription (I would like to be informed of any future offers, savings, and competitions..) checkbox, or do you know the id if it is available?
  • We need the field id for the Sagepay/Paypal transaction in the Order on Woocommerce.
  • Regarding Payment Method
    1. When we test in staging website suing SagePay, we are being redirected to Live Payment URL. So for the testing purpose, we cannot use this payment method
    2. We weren’t able to test the PayPal Payment method in WooCoomerce staging purpose

Time

Total: 32 hrs

Leave a comment

Your email address will not be published. Required fields are marked *