diff --git a/.changeset/weak-waves-watch.md b/.changeset/weak-waves-watch.md new file mode 100644 index 0000000000..8f6c4fc153 --- /dev/null +++ b/.changeset/weak-waves-watch.md @@ -0,0 +1,5 @@ +--- +"medusa-plugin-brightpearl": patch +--- + +fix(brightpearl): split externalRef to get product id diff --git a/packages/medusa-plugin-brightpearl/src/services/brightpearl.js b/packages/medusa-plugin-brightpearl/src/services/brightpearl.js index e1007cdc51..b3eb85870b 100644 --- a/packages/medusa-plugin-brightpearl/src/services/brightpearl.js +++ b/packages/medusa-plugin-brightpearl/src/services/brightpearl.js @@ -1705,7 +1705,7 @@ class BrightpearlService extends BaseService { const { fulfillments: existingFulfillments, sales_channel } = await this.orderService_ .withTransaction(transactionManager) - .retrieve(order.externalRef, { + .retrieve(order.externalRef.split(".")[0], { relations: ["fulfillments", "sales_channel"], })