1.3.14 • Published 5 months ago

medusa-plugin-brightpearl v1.3.14

Weekly downloads
278
License
MIT
Repository
github
Last release
5 months ago

Brightpearl

Manage and streamline your business processes using Brightpearl.

Medusa Website | Medusa Repository

Features

  • Send and sync orders with Brightpearl.
  • Listen for inventory and stock movements in Brightpearl.
  • Handle order returns through Brightpearl.

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm install medusa-plugin-brightpearl

2. Set the following environment variables in .env:

BRIGHTPEARL_ACCOUNT=<YOUR_ACCOUNT>
BRIGHTPEARL_CHANNEL_ID=<YOUR_CHANNEL_ID>
BRIGHTPEARL_BACKEND_URL=<YOUR_BACKEND_URL>
BRIGHTPEARL_EVENT_OWNER=<YOUR_EVENT_OWNER>
BRIGHTPEARL_WAREHOUSE=<YOUR_WAREHOUSE>
BRIGHTPEARL_DEFAULT_STATUS_ID=<YOUR_DEFAULT_STATUS_ID>
BRIGHTPEARL_SWAP_STATUS_ID=<YOUR_SWAP_STATUS_ID>
BRIGHTPEARL_CLAIM_STATUS_ID=<YOUR_CLAIM_STATUS_ID>
BRIGHTPEARL_PAYMENT_METHOD_CODE=<YOUR_PAYMENT_METHOD_CODE>
BRIGHTPEARL_SALES_ACCOUNT_CODE=<YOUR_SALES_ACCOUNT_CODE>
BRIGHTPEARL_SHIPPING_ACCOUNT_CODE=<YOUR_SHIPPING_ACCOUNT_CODE>
BRIGHTPEARL_DISCOUNT_ACCOUNT_CODE=<YOUR_DISCOUNT_ACCOUNT_CODE>
BRIGHTPEARL_GIFT_CARD_ACCOUNT_CODE=<YOUR_GIFT_CARD_ACCOUNT_CODE>
BRIGHTPEARL_INVENTORY_SYNC_CRON=<YOUR_INVENTORY_SYNC_CRON>
BRIGHTPEARL_COST_PRICE_LIST=<YOUR_COST_PRICE_LIST>
BRIGHTPEARL_BASE_CURRENCY=<YOUR_BASE_CURRENCY>

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // ...
  {
    resolve: `medusa-plugin-brightpearl`,
    options: {
      account: process.env.BRIGHTPEARL_ACCOUNT, // required, the Brightpearl account
      channel_id: process.env.BRIGHTPEARL_CHANNEL_ID, // required, channel id to map sales and credits to
      backend_url: process.env.BRIGHTPEARL_BACKEND_URL, // required, the url where the Medusa server is running, needed for webhooks
      event_owner: process.env.BRIGHTPEARL_EVENT_OWNER, // required, the id of the user who will own goods out events]
      warehouse: process.env.BRIGHTPEARL_WAREHOUSE, // required, the warehouse id to allocate orders from
      default_status_id: process.env.BRIGHTPEARL_DEFAULT_STATUS_ID, // (default: `3`), the status id to assign new orders with
      swap_status_id: process.env.BRIGHTPEARL_SWAP_STATUS_ID, // (default: `3`), the status id to assign new swaps
      claim_status_id: process.env.BRIGHTPEARL_CLAIM_STATUS_ID, // (default: `3`), the status id to assign new claims
      payment_method_code: process.env.BRIGHTPEARL_PAYMENT_METHOD_CODE, // (default: `1220`), the method code to register payments with
      sales_account_code: process.env.BRIGHTPEARL_SALES_ACCOUNT_CODE, // (defaults: `4000`), nominal code to assign line items to
      shipping_account_code: process.env.BRIGHTPEARL_SHIPPING_ACCOUNT_CODE, // (default: `4040`), nominal code to assign shipping line to
      discount_account_code: process.env.BRIGHTPEARL_DISCOUNT_ACCOUNT_CODE, // optional, nominal code to use for Discount-type refunds
      gift_card_account_code: process.env.BRIGHTPEARL_GIFT_CARD_ACCOUNT_CODE, // (default: `4000`), nominal code to use for gift card products and redeems
      inventory_sync_cron: process.env.BRIGHTPEARL_INVENTORY_SYNC_CRON, // optional, cron pattern for inventory sync, if left out the job will not be created
      cost_price_list: process.env.BRIGHTPEARL_COST_PRICE_LIST, // (default: `1`) the ID of the price list to assign to created claims
      base_currency: process.env.BRIGHTPEARL_BASE_CURRENCY, // (default: `EUR`) the ISO 3 character code of the currency to assign to created claims.
    },
  },
]

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

npm run start

2. On placing an order, you should see that order appear on Brightpearl.


Additional Information

Orders

When an order is created in Medusa it will automatically be sent to Brightpearl and allocated there. Once allocated it is up to Brightpearl to figure out how the order is to be fulfilled - the plugin listens for goods out notes and tries to map each of these to a Medusa order, if the matching succeeds Medusa will send the order to the fulfillment provider associated with the shipping method selected by the Customer.

When line items on an order are returned the plugin will generate a sales credit in Brightpearl.

Products

The plugin doesn't automatically create products in Medusa, but listens for inventory changes in Brightpearl. The plugin updates each product variant to reflect the inventory quantity listed in Brightpearl, thereby ensuring that the inventory levels in Medusa are always in sync with Brightpearl.

OAuth

The plugin registers an OAuth app in Medusa allowing installation at https://medusa-commerce.com/a/settings/apps. The OAuth tokens are refreshed every hour to prevent unauthorized requests.

1.3.14

5 months ago

1.3.13

1 year ago

1.3.12

1 year ago

1.3.10

1 year ago

1.3.11

1 year ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.7-rc.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.3-alpha.0

2 years ago

1.3.2-next.0

2 years ago

1.3.2-alp.0

2 years ago

1.3.2-nxt.0

2 years ago

1.3.2-alpha.0

2 years ago

1.3.2-test.0

2 years ago

1.3.1-nxt.129

2 years ago

1.3.1-next.35

3 years ago

1.3.1-nxt.130

2 years ago

1.3.1-next.24

3 years ago

1.3.1-next.26

3 years ago

1.3.1-next.27

3 years ago

1.3.1-next.108

2 years ago

1.3.1-next.100

2 years ago

1.3.1-next.101

2 years ago

1.3.1-next.99

2 years ago

2.0.0-next.0

2 years ago

1.3.1

2 years ago

1.3.1-next.41

3 years ago

1.3.1-next.44

3 years ago

1.1.47-next.0

3 years ago

1.1.46

3 years ago

1.3.1-next.14

3 years ago

1.3.0

3 years ago

1.1.46-alpha.63

3 years ago

1.2.2-dev.56

3 years ago

1.2.2-dev.53

3 years ago

1.2.2-dev.47

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.41

3 years ago

1.1.40

3 years ago

1.1.45

3 years ago

1.1.44

3 years ago

1.1.43

3 years ago

1.1.42

3 years ago

1.1.44-alpha.4

3 years ago

1.1.44-adminc.21

3 years ago

1.1.42-next.14

3 years ago

1.1.41-alpha.15

3 years ago

1.1.41-alpha.14

3 years ago

1.1.41-alpha.13

3 years ago

1.1.38

3 years ago

1.1.37

3 years ago

1.1.36

3 years ago

1.1.39

3 years ago

1.1.35

3 years ago

1.1.31-next.54

3 years ago

1.1.34

3 years ago

1.1.33-next.0

3 years ago

1.1.30-meilis.0

3 years ago

1.1.31

3 years ago

1.1.31-next.27

3 years ago

1.1.29-meilis.37

3 years ago

1.1.29-meili.42

3 years ago

1.1.29-meili.39

3 years ago

1.1.29-meili.41

3 years ago

1.1.29-meili.40

3 years ago

1.1.29-alpha.37

3 years ago

1.1.29-meili.37

3 years ago

1.1.29-next.40

3 years ago

1.1.29-next.36

3 years ago

1.1.30

3 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.27

3 years ago

1.1.21-next.16

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.21-alpha.9

3 years ago

1.1.21-alpha.6

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.21-next.10

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.21-next.7

4 years ago

1.1.21-alpha.4

4 years ago

1.1.15-next.9

4 years ago

1.1.17-next.0

4 years ago

1.1.20

4 years ago

1.1.15

4 years ago

1.1.13-next.10

4 years ago

1.1.13-next.9

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11-next.9

4 years ago

1.1.11-next.10

4 years ago

1.1.11

4 years ago

1.1.11-next.2

4 years ago

1.1.10

4 years ago

1.1.9-next.2

4 years ago

1.1.9-next.1

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.5-next.23

4 years ago

1.1.5-alpha.19

4 years ago

1.1.5-alpha.16

4 years ago

1.1.5

4 years ago

1.1.5-alpha.4

4 years ago

1.1.4

4 years ago

1.1.4-next.16

4 years ago

1.1.3

4 years ago

1.1.3-alpha.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.21-alpha.222

4 years ago

1.0.21-alpha.186

4 years ago

1.0.21-alpha.176

4 years ago

1.0.21-alpha.177

4 years ago

1.0.21-alpha.35

4 years ago

1.0.26

4 years ago

1.0.21-alpha.34

4 years ago

1.0.21-alpha.33

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.16-alpha.22

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.15-alpha.7

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.15-alpha.446

4 years ago

1.0.14-alpha.13

4 years ago

1.0.14-alpha.14

4 years ago

1.0.14-alpha.15

4 years ago

1.0.14

4 years ago

1.0.14-alpha.12

4 years ago

1.0.14-alpha.10

4 years ago

1.0.14-alpha.11

4 years ago

1.0.14-alpha.8

4 years ago

1.0.14-alpha.6

4 years ago

1.0.14-alpha.3

4 years ago

1.0.10

4 years ago

1.0.14-alpha.2

4 years ago

1.0.13

4 years ago

1.0.14-alpha.1

4 years ago

1.0.7

4 years ago

1.0.1

4 years ago

1.0.1-alpha.1

4 years ago

1.0.1-beta.0

4 years ago

1.0.0

4 years ago

1.0.0-y.23

4 years ago

1.0.0-y.22

4 years ago

1.0.0-y.21

4 years ago

1.0.0-y.19

4 years ago

1.0.0-alpha.30

4 years ago

1.0.0-alpha.32

4 years ago

1.0.0-alpha.31

4 years ago

1.0.0-alpha.29

4 years ago

1.0.0-alpha.33

4 years ago

1.0.0-alpha.28

4 years ago

1.0.0-alpha.27

4 years ago

1.0.0-alpha.25

4 years ago

1.0.0-alpha.24

4 years ago

1.0.0-alpha.23

4 years ago

1.0.0-alpha.22

4 years ago

1.0.0-alpha.21

4 years ago

1.0.0-alpha.20

4 years ago

1.0.0-alpha.19

4 years ago

1.0.0-alpha.16

4 years ago

1.0.0-alpha.18

4 years ago

1.0.0-alpha.17

4 years ago

1.0.0-alpha.3

4 years ago