Hi, I’m developing a pickuopoint delivery function for a shophfy plus.
Each pickuppoint has an internal ID and when a customer emits an order I need to save this ID in order data is possible, do it without using the other function and without showing it to the final user.
Because I saw that there are the possibility of setting metafields, but this is not inserted in the metafields of the order
Hi @Elia_Germanetto
When you use the Pickup Point Delivery Option Generator, you can attach custom metafields to each pickup point delivery option you add. These metafields are not shown to the customer during checkout—they are stored as part of the delivery option data and can be accessed later via the Admin API or Order API.
How to do it:
- In your function’s
run target, when you build the add operation for a pickup point, you can include a metafields array.
- Each metafield can contain your internal ID (or any other data you want to store).
- This data is not visible to the customer in the checkout UI.
Hi @Liam-Shopify Thanky you for response.
Now i am doing in this way:
function buildPickupPointDeliveryOption(externalApiDeliveryPoint: any) {
const details = externalApiDeliveryPoint.storeDetails;
const openingHours = externalApiDeliveryPoint.openingHours;
return {
cost: null,
metafields: [
{
namespace: "custom",
key: "pickup_point_id",
type: "single_line_text_field",
value: details.storeCode
}
],
pickupPoint: {
externalId: details.storeCode,
name: details.shopName,
provider: buildProvider(),
address: buildAddress(details),
businessHours: buildBusinessHours(openingHours)
},
};
}
But I can’t read the metafields and externalID values when the order is complete.
How can I read this data using the order graphQL?