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 Website | Record | NetSuite Field Name | NetSuite Field ID | Additional Comments |
| First Name | Customer | First Name | firstname | |
| Last Name | Customer | lastname | ||
| Company Name (optional) | Customer | Company Name | companyname | |
| Country/Region | Address | Country | country | |
| Street AddressNB: 2 Address lines | Address | Address 1 | addr1 | Default BillingDefault Shipping if “Deliver to a different address?” is not checked. |
| Address | Address 2 | addr2 | ||
| Town/City | Address | City | city | |
| County (optional) | Address | State | state | |
| Postcode | Address | ZIP | zip | |
| First NameLast Name | Address | Attention | attention | Default Shipping if “Deliver to a different address?” is checked. |
| Company Name (optional) | Address | Addressee (Only if Company Name is populated. Otherwise allow default. | addressee | |
| Street AddressNB: 2 Address lines | Address | Address 1 | addr1 | |
| Address | Address 2 | addr2 | ||
| Town/City | Address | City | city | |
| County (optional) | Address | State | state | |
| Postcode | Address | ZIP | zip | |
| Phone – We will use this number to arrange a delivery date | Customer | Phone | phone | |
| Email address | Customer | |||
| I would like to be informed of any future offers, savings and competitions. (check box) | Customer | Global Subscription Status | globalsubscriptionstatus | If 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 Website | Record | NetSuite Field Name | NetSuite Field ID | Additional Comments |
| Order Number? | Sales Order | Order# | tranid | Override the NetSuite Sales Order number with the order number produced in Website. |
| Product Code | Sales Order | Item | item | |
| Sales Order | Quantity | quantity | ||
| Total | Sales Order | Gross Amount | grossamount | |
| Order notes (optional) | Sales Order | Create a User Note on the Sales Order. | ||
| Sales Order | Apply for Finance | custbody_nbs547_finance | If 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 Website | Record | NetSuite Field Name | NetSuite Field ID | Additional Comments |
| Customer Deposit | Customer | customer | ||
| Customer Deposit | Payment Amount | payment | ||
| Customer Deposit | Sales Order | salesorder | NetSuite Sales Order | |
| Payment Method | Customer Deposit | Payment Method | paymentmethod | |
| Customer Deposit | CC Approved | ccapproved | Credit Card | |
| Transaction ID | Customer Deposit | P/N Ref. | pnrefnum | Credit Card |
| Customer Deposit | Auth. Code | authcode | Credit 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.
- If the customer doesn’t exist, the customer is created in NetSuite with the details from the WooCommerce order.
- 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
- The SKU from WooCommerce is the unique identifier and comparing this with the ITEM NAME/NUMBER field in NetSuite to identify the items.
- 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.
- Can you confirm this? Please advise which status applies to the success or failure of the payment.
- 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
- 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
- We weren’t able to test the PayPal Payment method in WooCoomerce staging purpose
Time
Total: 32 hrs