Plugin for sending placed orders to MyParcel.
- 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
}),
...
]
- 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
- Start Vendure and go to
Settings
>MyParcel
and fill in your MyParcel API key. - Create a shipmentMethod with
MyParcel fulfillment
. - Place an order and select the shippingMethod.
- Go to the Admin UI and click on
fulfill
- Your shipment should be in your MyParcel account.
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.