This package has been deprecated

Author message:

Moved to @pinelab/vendure-plugin-myparcel

vendure-plugin-myparcel
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

Vendure MyParcel Plugin

Vendure version

Plugin for sending placed orders to MyParcel.

Getting started

  1. Add this to your plugins in vendure-config.ts:
import { MyparcelPlugin } from 'vendure-plugin-myparcel';

plugins: [
  MyparcelPlugin.init({
    vendureHost: 'https://your-vendure-host.io',
    syncWebhookOnStartup: true, // If you want to automatically set vendureHost as webhook on MyParcel account
  }),
  ...
]
  1. Add MyparcelPlugin.ui to your AdminUiPlugin extensions:
import { MyparcelPlugin } from 'vendure-plugin-myparcel';

plugins: [
  AdminUiPlugin.init({
    port: 3002,
    route: 'admin',
    app: compileUiExtensions({
      outputPath: path.join(__dirname, '__admin-ui'),
      extensions: [MyparcelPlugin.ui],
    }),
  }),
];

Read more about Admin UI compilation in the Vendure docs

  1. Start Vendure and go to Settings > MyParcel and fill in your MyParcel API key.
  2. Create a shipmentMethod with MyParcel fulfillment.
  3. Place an order and select the shippingMethod.
  4. Go to the Admin UI and click on fulfill
  5. Your shipment should be in your MyParcel account.

Customs information for shipments outside the EU

MyParcel requires additional customs information for shipments outside the EU. When you ship outside the EU, you should implement the getCustomsInformationFn when initializing the plugin:

MyparcelPlugin.init({
  vendureHost: 'https://your-vendure-host.io',
  getCustomsInformationFn: (orderItem) => {
    return {
      weightInGrams: (orderItem.line.productVariant.product.customFields as any)
        .weight,
      classification: (
        orderItem.line.productVariant.product.customFields as any
      ).hsCode,
      countryCodeOfOrigin: 'NL',
    };
  },
});

You can find more information about the classification codes here.

Readme

Keywords

none

Package Sidebar

Install

npm i vendure-plugin-myparcel

Weekly Downloads

0

Version

7.0.0

License

MIT

Unpacked Size

50.3 kB

Total Files

26

Last publish

Collaborators

  • mbrug