How to setup and configure WooCommerce for Pencil with DEAR and Xero Integration?

Please follow the steps below:

  1. Prerequisites

    1. You need an active PencilPay account. If you don’t have one, please go to Onboard Customers, Save Time and Get Paid Faster | PencilPay and register for a 30 day trial. Alternatively contact us via email at support@pencilpay.com and we’ll arrange a 20 minute demo of PencilPay.

    2. You need an active Xero account that is integrated with PencilPay. If you don’t have a Xero account, please go to Try Xero for Free and sign up for a free 30 day account.

    3. An active Wordpress and WooCommerce site that is in production mode as this extension is connected to our production environment. If you would like to test the extension and features on a development environment, please email support@pencilpay.com and we’ll arrange a time to demo Pencil and, if required, provide you with access to a demo environment for testing.

    4. You need an active DEAR Systems account Cloud ERP System Software | Automate your Business | DEAR with the following extension installed and connected: DEAR | WooCommerce Integration

  2. Installation Method

    1. Plugin Installation (upload zip plugin)

      1. In Wordpress, go to Plugins -> click “Add New” -> choose the PencilPay WooCommerce plugin zip file from your computer and click “Install Now”.

      2. Plugin Installation (via FTP or console)

        1. Extract the plugin package and upload to your-wordpress/wp-content/plugin/

  3. Activate the plugin at Admin Dashboard -> Plugins -> Installed Plugins -> WooCommerce PencilPay Payment Gateway

     
  4. PencilPay Configuration

     
    1. The settings in Admin Dashboard -> WooCommerce -> Settings -> Payments

    2. Enable the method

    3. Click on Manage button to update the settings by following the instructions

  5. In a separate tab, login to PencilPay -> Integrations -> WooCommerce -> so you can get PencilPay API details

    1. Update Customer import endpoint
      https://your-wordpress-website/wp-json/wc/pencilpay/v1/customer/import

    2. Copy these from Pencil to enter into your WooCommerce settings:

      1. API Endpoint Url for production mode: https://api.pencilpay.com/api/v1

      2. PencilPay API ID

      3. PencilPay API Key

    3. Then add the following: 
      1. Wordpress WooCommerce Customer API Url: https://WWW.YOURDOMAIN.COM/wp-json/wc/pencilpay/v1/customer/import

      2. Wordpress WooCommerce Payment Methods Available -> you can select from:

        1. Trade Credit: use this setting if you want your customers who are signed up in Pencil with a saved credit card and they have a credit limit you will allow them to check out with.

        2. Credit Card: This one is required and mandatory.

      3. Push Customers to WooCommerce -> if you want new customers to be automatically pushed to WooCommerce and have the Wordpress account creation email sent to the customer so they can set a password and log in to place orders.

      4. Enable Credit Card Pre-Authorisation -> If you want to pre-authorise the payment and then capture the amount once the order is complete in your inventory/accounting system (by default we recommend this to be OFF).

      5. Instant Payment Notifications Url: https://WWW.YOURDOMAIN.COM/wp-json/wc/pencilpay/v1/purchase-order/payment-status
        pencil-wordpress-woocommerce-api

    4. In “Wordpress WooCommerce Payment Methods Available” click in here and select if you want your customers to checkout using their available trade credit limit and/or credit card.

    5. If you don’t want your B2B customers to be pushed to WooCommerce when you approve their credit application in Pencil, toggle “Push Customers to WooCommerce” off, otherwise toggle on.

    6. Click on the Save button in your Pencil account.

    7. In the top right corner toggle WooCommerce ON.

       
  6. Next go back to the WooCommerce tab and paste the settings from: API Endpoint Url for production mode, PencilPay API ID and the PencilPay API Key in their related fields as detailed below:

    1. Xero Contact → check the “Enable” box.

    2. Title → this will be the name displayed as the payment method option in the check. Eg. “Credit Card”

    3. Description → enter a description of the payment method

    4. App Name → enter the name you want to display in Pencil → Purchase Orders so you can distinguish which sales platform the order/sale came from.

    5. App Logo → this will show on the payment page. You can use your own logo or https://app.pencilpay.com/assets/pencil-logo-dark-d5187d34c5df11b8c3a4b390e89258b3f155428cc31f36923fcc9a2372c9a72e.png

    6. API Endpoint Url for production mode: https://api.pencilpay.com/api/v1

    7. PencilPay API ID → use from what you copied from 5.b.ii above

    8. PencilPay API Key → use from what you copied from 5.b.iii above

    9. Xero Contact → Enable this

    10. PencilPay Payment Confirmation page -> set as “PencilPay Payment Gateway”

    11. PencilPay Order Payment Complete -> set as “PencilPay Order Payment Complete”

    12. PencilPay Order Payment Cancel -> if an order is cancelled on the payment page, we will redirect back to this page. We suggest selecting “Cart”.

    13. Update Saleslist → Enable this

    14. Dear Account ID → copy from DEAR API settings (you may need to add a new DEAR API or use an existing one)

    15. Dear Application Key → copy from DEAR API settings (you may need to add a new DEAR API or use an existing one)

    16. Dear Sale List → https://inventory.dearsystems.com/ExternalApi/v2/SaleList

    17. Payments API Url → https://inventory.dearsystems.com/ExternalApi/v2/sale/payment

    18. Payment Account ID → Go into your DEAR account: Settings → Reference Books → Chart of Accounts (https://inventory.dearsystems.com/ChartOfAccounts) and check the Asset → Accounts Receivable ID and enter here.

    19. The log system → Enable only for testing (disable once in Production/Live)

    20. For the DEAR settings follow the steps below, but first click on “Save Changes”

       
  7. Dear Inventory API Connection:

    1. Login to Dear Inventory, click on Integration on left menu

    2. Select WooCommerce under eCommerce category

    3. Add New Connection by click on + icon

       
    4. Provide the Name and Website url

    5. Follow the instructions, enter your WP admin username and password to finish the connection.

    6. Please check that you have also updated the PencilPay credit card payment method in "Link WooCommerce payment methods to payment accounts" and set the "Payment Account Code" to the "Pencil Clearing Account".
    7. For more information see: https://support.dearsystems.com/support/solutions/articles/11000048209-woocommerce-integration