Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Shipping Labels and Deliveries
Status: Implemented 2026-09-03 (phases 1–6; phase 7 is 6.1 cleanup)
Target: Spree 6.0
Depends on: 6.0-fulfillment-and-delivery.md (status model, PurchaseLabel, UpdateTracking), 6.0-delivery-rate-provider.md (EasyPost reference provider), 6.0-returns-exchanges-claims.md (the Return owner). Coordinates with: 6.0-b2b-wholesale-shipping.md (freight consignments are deliveries too; freight paperwork is not a label), 6.1-b2b-order-documents.md (where a bill of lading goes).
Author: Damian Legawiec
Last updated: 2026-09-03
Summary
A shipping label is today three provider-private keys written into
fulfillment.metadata by the EasyPost gem, surfaced through a per-read
provider.documents(fulfillment) call, and bought or refunded through a
PATCH .../purchase_label member action. That leaves Spree not knowing what the
merchant paid the carrier, unable to reprint once the carrier's hosted URL is
gone, unable to buy a second label after a refund, and with nowhere to put a
return label. The carrier journey of a parcel is in the same shape: one tracking
number and one carrier status per fulfillment, in seven columns on
spree_fulfillments, with a spree_fulfillment_trackings model deferred to 6.1
and required to absorb that whole axis when it comes.
This plan promotes both into first-class records now, while 6.0 is still the
breaking window. Spree::ShippingLabel is a purchased (or uploaded)
carrier document with a cost, a file in private storage, a lifecycle
(purchased → refund_requested → refunded) and a polymorphic owner — a
Fulfillment for outbound parcels, a Return for inbound ones.
Spree::Delivery is one tracked consignment's carrier journey — a parcel,
or three pallets under one PRO number — with tracking number, carrier,
tracking status, estimate and arrival time, the same polymorphic owner, and
optionally born from a label. The fulfillment keeps its merchant lifecycle
(unfulfilled → fulfilled → delivered) and rolls delivered up from its
deliveries. Both become nested REST resources under the fulfillment in the
Admin API; purchase_label and mark_delivered stop being the only doors.
Key Decisions (do not deviate without discussion)
- The label is a record, the delivery is a record, delivered stays a
transition (2026-09-03, probed and confirmed).
POST .../deliverieswas considered as the way to say "it arrived" and rejected, because a delivery row is born when a tracking number is attached — at fulfil time or label purchase, days before anything arrives — soPOSTalready means "this fulfilment went out as another consignment". Arrival is a state change on an existing row, and every lifecycle transition in the Admin API (fulfill,cancel,capture,approve,receive) is aPATCHmember action. The fulfilment-levelmark_deliveredstays beside a per-delivery twin for three reasons: some fulfilments have no delivery rows at all (pickup, hand delivery, freight with no carrier feed) and still need to becomedeliveredfor the returns window; staff saying "it arrived" outranks the carrier and closes every open consignment in one call; andFulfillments::MarkDeliveredalready carries public hooks. The alternative — redefining a delivery as a handover so a pickup gets a row with no tracking number anddelivered_atset, making the status a pure rollup — was rejected because that row would be a flag wearing a table. Spree::Deliveryis the name (2026-09-03, revisited twice). The row must be modality-neutral:6.0-b2b-wholesale-shipping.mduses "parcel" as the antonym of freight ("different from parcel shipping"), and a freight consignment is one PRO or container number covering several pallets, soSpree::Parcel— briefly chosen — contradicted the sibling plan's fixed vocabulary.Spree::Trackingis the tracking industry's own resource name but collides permanently withFulfillment#tracking, the 5.6 string field that stays;TrackingStatusnames one column of the row;FulfillmentTracking(the 6.1 deferral's name) is wrong for aReturnowner. Carriers say "track your delivery" for a parcel and a pallet alike. Accepted trade-off: the word now carries two meanings in the codebase —DeliveryMethod,DeliveryRate,DeliveryProfileandDeliveryZonedescribe what a store offers, aDeliveryis one consignment actually travelling. Workflows live underSpree::Deliveries::, which no existing namespace uses.- Polymorphic
owneron both tables (2026-09-03). One concept — a carrier document, a consignment in flight — held by different kinds of party, which is the 2026-08-22 tax-identifier ruling, not the dual-FK case (a type string hiding several meanings).FulfillmentandReturnare the 6.0 owners; exchanges ship their replacements through fulfillments, so they need no owner of their own. Cardinality is declared owner-side: a fulfillmenthas_manyof each, a returnhas_manyof each. - The delivery absorbs the entire carrier axis (honours decisions.md
2026-08-11).
tracking,tracking_carrier,tracking_status,tracking_details,estimated_delivery_atmove tospree_deliveries. Webhooks match a delivery row,UpdateTrackingtakes adelivery:, and a fulfillment isdeliveredwhen every one of its deliveries is — or when staff say so for a fulfillment that has none.delivered_aton the fulfillment stays as the lifecycle stamp (the returns window and withdrawal anchor), exactly likefulfilled_at: it is when the fulfillment became delivered, a rollup, not a second copy of the carrier's report. - The fulfillment keeps
trackingandtracking_url, nothing else (2026-09-03). Those two fields shipped in the 5.6 Store API, so they stay permanently as a read-only summary of the primary delivery (the earliest row) — single-parcel storefronts and the fulfilled email stay one-field simple, andtracking:(withtracking_carrier:) onFulfillments::Fulfill/Updatestays as the write shortcut that creates or corrects that delivery. Everything the 6.0 edge added to the fulfillment —tracking_carrier,tracking_carrier_name,tracking_status,tracking_details,estimated_delivery_at— is removed from the serializers and the table rather than bridged: it was never released, so there is nobody to bridge for, and the four columns come out of their own 20260811 migrations in place (the unreleased-edge rule the catalog and company work already used).delivered_atandfulfilled_atstay: they are lifecycle stamps, not carrier data. - One label, at most one delivery (2026-09-03). A purchased label mints a
delivery carrying its tracking number; the delivery points back through
shipping_label_id(unique). Hand-entered tracking is a delivery with no label. A refunded label's delivery is removed only if the consignment never moved (the fulfillment is stillunfulfilled); once fulfilled, the journey is history and stays. - Idempotency moves into core (2026-09-03).
Fulfillments::PurchaseLabelrefuses when the owner already has a non-refunded label. Providers no longer needmetadatakeys to avoid double-buying; the contract forcreate_fulfillmentidempotency (decisions.md 2026-08-12) is retired because the workflow never asks twice. - Purchase is a typed result, never a hash (2026-09-03). A label-generating
provider implements
purchase_label(owner)returning aSpree::LabelPurchasevalue object (ActiveModel::Model+Attributes:external_id,carrier,service,tracking_number,tracking_url,cost,currency,format,file_url,metadata) andrefund_label(shipping_label)returning the resulting status.create_fulfillment/cancel_fulfillmentstay for providers whose dispatch is not a label (a 3PL pick, a pickup counter).documents(owner)stays for documents that are not the label — customs forms, commercial invoices — and stops reporting the label. - The file lives in Spree (2026-09-03). Right after purchase the label
file is fetched from the provider's URL into a private-storage attachment on
the row (same declaration and spoofing protection as
po_document). The download endpoint streams the attachment, and proxies the provider URL only while the fetch is still pending. Merchants reprint without the carrier account being connected, and a disconnected integration never breaks a warehouse. - Cost is recorded, never displayed to the shopper (2026-09-03).
cost+currencyon the label is what the merchant paid the carrier — accounting data, admin-only. It never touches the order's shipping charge (coston the fulfillment is what the customer was charged) and never appears on a store serializer. - Uploaded labels are in scope (2026-09-03). Merchants without a carrier
integration buy postage elsewhere and still need the PDF and the cost on
the consignment.
POST .../labelswith a signed blob id records asource: 'uploaded'label (tracking number, carrier, cost, currency) and mints its delivery throughShippingLabels::Record; the same request without a file purchases through the provider. The serializer'ssourcetells them apart, and refund is refused on an uploaded label (nothing to refund — the merchant deletes it instead, which is the one destroy the resource allows). Sellers get upload but never purchase. - Freight paperwork is not a shipping label (2026-09-03, wholesale
cross-check). A bill of lading, a pallet placard or a packing list is
issued by the forwarder or printed by the merchant; it has no cost to
refund and no carrier lifecycle. It goes to
Spree::OrderDocument(6.1-b2b-order-documents.md) or the client-side prints, never to asource: 'uploaded'label. What freight does share with parcels is the delivery row: the forwarder's PRO or container number is hand-entered as a delivery with a free-textcarrierand a pastedtracking_url, anddeliveredis staff-confirmed throughmark_delivered— which is exactly why that fulfilment-level action stays. - Return labels ship in this plan (2026-09-03). The
Returnowner is what makes the polymorphic shape earn its keep, so it is written in 6.0:Returns::PurchaseLabel(thin, like the fulfillment twin) overShippingLabels::Purchase(owner: return_record), the EasyPost provider buying anis_returnshipment from the customer's address back to the return's stock location, the samelabelscontroller mounted under/orders/:order_id/returns/:return_id/, a customer download on the Store API, and aReturndelivery for the inbound parcel whosedeliveredreport never auto-receives —Returns::Receivestays a staff act because arrival is not inspection. The returns plan's interim "URL inmetadata" advice is withdrawn. - A return label buys the cheapest rate the account offers (2026-09-03).
Unlike an outbound parcel there is no rate the customer selected: return
postage is the merchant's own money and nobody chose a service for it, so
EasyPost::Util.get_lowest_object_ratepicks across every connected carrier. Reusing the outbound carrier was considered and rejected — an outbound parcel whose tracking was hand-entered has no carrier to reuse, and mirroring the outbound service inbound is usually the most expensive answer to a question the merchant never asked. A merchant who wants a specific return service configures it on the integration later; that is additive. - No transition graph, no state machine.
ShippingLabeluseshas_status; every status change is a workflow (ShippingLabels::Purchase,::Refund,::Recordfor uploads).Delivery#statusis the carrier's vocabulary and stays data written byDeliveries::UpdateTracking— apendingvalue replaces today'snilso the creating workflow sets it and the column never carries a database default.
Design Details
Models
Spree::ShippingLabel (spree_shipping_labels, prefix lbl,
Spree::SingleStoreResource, Spree::Metadata, has_status :purchased, :refund_requested, :refunded)
| Column | Notes |
|---|---|
owner_type, owner_id |
polymorphic, null: false, indexed together |
store_id |
null: false |
integration_id |
nullable — the connected carrier account that sold it; nil for uploaded labels |
source |
purchased | uploaded, null: false |
external_id |
provider's shipment/label id |
carrier, service |
strings, carrier key from Spree.tracking_carriers when known |
tracking_number |
the number printed on the label — a frozen purchase fact; the delivery holds the live one |
cost, currency |
decimal(10,2) default 0 + string; what the merchant paid |
format |
pdf | png | zpl |
status |
string, set by the workflow |
refunded_at |
datetime |
metadata |
JSON — provider ids (tracker id, original file URL) |
file |
has_one_attached, Spree.private_storage_service_name, content type limited to PDF/PNG/ZPL, spoofing-protected |
Associations: belongs_to :owner, polymorphic: true, belongs_to :store,
belongs_to :integration, optional: true, has_one :delivery. Scopes:
active (where.not(status: 'refunded')). Fulfillment has_many :shipping_labels, as: :owner, dependent: :destroy; Return the same.
Spree::Delivery (spree_deliveries, prefix dlv,
Spree::SingleStoreResource)
| Column | Notes |
|---|---|
owner_type, owner_id |
polymorphic, null: false |
store_id |
null: false |
shipping_label_id |
nullable, unique index — the label that minted it |
tracking_number |
null: false, indexed (webhook lookup); unique per owner. A parcel's carrier number, or a freight PRO / container number |
tracking_url |
nullable — a pasted link or the provider's tracker page; the resolved URL falls back to the carrier template then format detection, as today |
carrier |
free-text string. Detected from the number when not given (today's detect_tracking_carrier); Spree.tracking_carriers supplies URL templates and display names, never validation — a forwarder's name is a legal value |
service |
string, nullable |
status |
pending | pre_transit | in_transit | out_for_delivery | available_for_pickup | delivered | return_to_sender | failure | unknown — the carrier axis, inclusion-validated, no graph |
estimated_delivery_at, delivered_at |
datetimes |
details |
JSON — the carrier payload worth keeping (scan history, signature, failure reason) |
Associations: belongs_to :owner, polymorphic: true, belongs_to :store,
belongs_to :shipping_label, optional: true. Fulfillment has_many :deliveries, as: :owner, dependent: :destroy (ordered by created_at; the
first is the primary delivery the summary fields read). Return the same.
Fulfillment lifecycle with deliveries
Fulfillments::Fulfill—tracking:(andtracking_carrier:) still accepted as the one-parcel shortcut: it creates a delivery throughDeliveries::Createinside the same transaction as the split. The label step becomesexternal_step :purchase_labelcallingShippingLabels::Purchasewhen the provider generates labels and no active label exists; failure still degrades to "no label yet". The fulfilled email reads tracking from the primary delivery.Fulfillments::PurchaseLabel— thin: validate, refuse on an active label, delegate toShippingLabels::Purchase. Kept as a workflow because its hooks (validate,after_purchase_label) are public since 2026-08-12.Fulfillments::Update—tracking:upserts the primary delivery (creates it, or corrects its number; a corrected number resetsstatustopending).Fulfillments::Cancel—tell_provider_to_stand_downrefunds every active label throughShippingLabels::Refund(notify_provider: falsestill letsOrders::Cancelbatch the carrier I/O), then the 3PLcancel_fulfillment.Fulfillments::MarkDelivered— staff confirmation. Marks every non-delivered deliverydeliveredat the given time (a human saying "it arrived" outranks a carrier that never sent the last scan), then the fulfillment. Unchanged signature. This is the freight path: no webhook ever arrives for a container.Deliveries::UpdateTracking(renamed fromFulfillments::UpdateTracking;fulfillment_update_tracking_workflowstays readable one release and resolves the primary delivery) — writes the carrier axis onto one row withupdate_columns, as today. When the report isdeliveredit stamps the row and, if every sibling delivery is delivered, delegates toFulfillments::MarkDeliveredwith the latestdelivered_at. AReturnowner never auto-transitions anything: goods arriving is not goods inspected, andReturns::Receivestays a staff act. A per-deliverymark_deliveredfrom staff is this workflow withtracking_status: 'delivered'.Deliveries::Create/Deliveries::Destroy— Tier 1 services (no hook earned). Destroy refuses a delivery that has a label — refund the label.
Label workflows
ShippingLabels::Purchase(owner:)—validatehook,ensure_purchasable(providergenerates_labels?, owner not fulfilled/canceled, no active label, order not draft),external_step :purchase(providerpurchase_label(owner)→LabelPurchase), then in one transaction create the label row and its delivery, thenexternal_step :store_file(fetchfile_urlinto the attachment; on failure enqueueShippingLabels::StoreFileJoband leave the URL inmetadata). Publishesshipping_label.purchased. Hookafter_purchase.ShippingLabels::Refund(shipping_label:)—validate,ensure_refundable(statuspurchased, sourcepurchased),external_step :refund(providerrefund_label→refund_requestedorrefunded), write the status, remove the delivery when the owner never shipped. Publishesshipping_label.refunded. A provider whose refund resolves later reports it through its webhook by callingShippingLabels::ConfirmRefund(plain service).ShippingLabels::Record(owner:, file:, tracking_number:, carrier:, cost:, currency:)— an uploaded label: creates asource: 'uploaded'row and its delivery, no provider involved.
Provider contract (Spree::FulfillmentProvider::Base)
def self.generates_labels? = false # unchanged
def purchase_label(owner) # → Spree::LabelPurchase | nil
def refund_label(shipping_label) # → 'refunded' | 'refund_requested' | false
def create_fulfillment(fulfillment) # unchanged — non-label dispatch
def cancel_fulfillment(fulfillment) # unchanged
def documents(owner) # unchanged shape, label excluded
def tracking_url(delivery) # was tracking_url(fulfillment); deprecated twin one release
The EasyPost provider implements purchase_label from today's
buy_quoted/requote_and_buy (returning postage_label.label_url,
rate.rate/currency, label_file_type; is_return: true when the owner
is a Return, shipping from the customer's address to the return's stock
location), refund_label from cancel_fulfillment, drops remember_purchase
and every metadata['easypost_*'] read, and keeps documents for
shipment.forms. Its tracker webhook resolves the delivery by tracking
number scoped to the integration's store. The freight rate provider from the
wholesale plan pairs with the Manual fulfilment provider and generates no
labels; its consignments are hand-entered deliveries.
Admin API (spree/api)
Nested under the order's fulfillment (there is no top-level fulfillments
resource in the Admin API). Both ride the fulfillments permission resource —
their subjects join its list.
GET /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels
POST /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels buy through the provider; with `file` (signed blob id), record an uploaded label
GET /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels/:id
GET /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels/:id/download streamed, read scope
PATCH /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels/:id/refund
DELETE /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/labels/:id uploaded labels only
GET /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries
POST /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries tracking_number, carrier, tracking_url
GET /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries/:id
PATCH /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries/:id correct number / carrier / url
DELETE /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries/:id 422 when it has a label
PATCH /api/v3/admin/orders/:order_id/fulfillments/:fulfillment_id/deliveries/:id/mark_delivered
PATCH .../fulfillments/:id/purchase_label stays one release as a deprecated
alias of POST .../labels returning the fulfillment. mark_delivered on the
fulfillment is unchanged. The same labels controller mounts under
/orders/:order_id/returns/:return_id/ for return labels.
Serializers: Admin::ShippingLabelSerializer (id, owner_id, source,
status, carrier, service, tracking_number, cost, currency,
display_cost, format, download_url, refunded_at, metadata,
timestamps) and Admin::DeliverySerializer extending a store
DeliverySerializer (id, tracking_number, tracking_url, carrier,
carrier_name, status, estimated_delivery_at, delivered_at; admin adds
shipping_label_id, details, timestamps). The fulfillment serializers embed
deliveries always (small, and the customer's question), keep tracking and
tracking_url as the primary delivery's summary, lose tracking_carrier,
tracking_carrier_name, tracking_status, tracking_details and
estimated_delivery_at; the admin one embeds labels; documents and
provider_generates_labels stay. Fulfillment write params keep tracking and
tracking_carrier (forwarded to the primary delivery) and nothing else
tracking-shaped.
Seller branch: sellers fulfill on manual methods only (Decision 13 of the
marketplace plan), so they get deliveries index/create/update/destroy and
labels index/upload/download/destroy under
/seller/orders/:id/fulfillments/:id/ — never purchase or refund, which need
the operator's carrier account.
Store API
fulfillment.deliveries[] on the order serializer beside the permanent
tracking/tracking_url summary. The only label surface is the customer's
return label: GET /store/orders/:order_id/returns/:id/label streams the
active label's file to the order's customer (or order-token holder) — the
label row itself is never serialized to the storefront, since its cost and
provider ids are merchant data.
Dashboard
The fulfillment card lists deliveries (one badge per consignment with its
carrier status; "Add tracking" opens a sheet; a delivery with a label is not
deletable), renders the label row (Buy label → POST labels; Print →
download; Refund with a destructive confirm; Upload label for manual
methods), and shows postage cost. Return page gets the same label block.
Every string through i18next in all locales.
Events
shipping_label.purchased, shipping_label.refunded (new, with an event
serializer). fulfillment.delivered unchanged. No per-scan delivery event —
the after_update_tracking hook is that surface, as today.
Migration Path
- Schema — one migration creating
spree_shipping_labelsandspree_deliveries. The two 20260811 fulfillment migrations are amended in place to stop addingtracking_status,tracking_details,estimated_delivery_atandtracking_carrier(unreleased edge — a dev database that already has them keeps harmless dead columns untilpnpm wt:templaterebuilds it).spree_fulfillments.trackingand its index stay: they are the 5.6 data the task below reads. - Core — models,
LabelPurchase, workflows and services, provider base contract,Fulfill/Update/Cancel/MarkDelivered/PurchaseLabelrewired,Deliveries::UpdateTracking,tracking/tracking_urlreaders delegating to the primary delivery,Spree::Dependencieskeys (shipping_label_purchase_workflow,shipping_label_refund_workflow,shipping_label_record_workflow,delivery_update_tracking_workflow,return_purchase_label_workflow; legacyfulfillment_update_tracking_workflowreadable one release). - Data task —
spree:upgrade:migrate_deliveriesin the 5.6→6.0 manifest aftermigrate_fulfillment_statuses: every fulfillment with atrackinggets onependingdelivery row carrying that number (a pasted link lands intracking_url, the carrier is detected from the number as today); idempotent by(owner, tracking_number)existence. No label backfill: the EasyPostmetadatakeys only ever existed on the unreleased 6.0 edge. - EasyPost —
purchase_labelfor both owners (is_returnfor aReturn),refund_label, webhook matching by delivery,documentsreduced to forms. - API + SDK — fulfillment- and return-nested
labels,deliveries, store return-label download, serializers, typelizer/Zod/OpenAPI, admin-sdk and sdk resources, seller branch. - Dashboard — fulfillment card rework, return page label block, e2e.
- 6.1 — drop
spree_fulfillments.trackingand its index, remove the deprecatedpurchase_labelalias,fulfillment_update_tracking_workflowandtracking_url(fulfillment).
Phases 1–6 are one PR train on one branch; the data task ships with phase 3.
Constraints on Current Work
- Never write
spree_fulfillments.tracking*,estimated_delivery_atortracking_detailsin new code — tracking is aDeliveryrow created throughDeliveries::Create(or thetracking:shortcut onFulfillments::Fulfill/Update, which does the same).delivered_aton the fulfillment is written only byFulfillments::MarkDelivered. - No provider reads or writes
fulfillment.metadatafor label state. Label facts live onSpree::ShippingLabel; a provider that needs to remember its own ids puts them in the label'smetadata. - A label's
costis merchant accounting, never shopper money — it never feedsfulfillment.cost, totals, or a store serializer. - Webhook matching resolves a
Delivery, scoped to the integration's store — neverFulfillment.where(tracking:). - Return labels attach to the
Returnas itsowner— noreturn_label_urlcolumn, no URL inmetadata(the returns plan's interim advice is withdrawn once this ships). Fulfillment#deliveredis a rollup: a new owner or a new carrier integration may never mark a fulfillment delivered directly — it reports a delivery and letsDeliveries::UpdateTrackingroll up.- No new readers of
tracking_status,tracking_carrier,estimated_delivery_atortracking_detailson a fulfillment — the storefront, emails and dashboard readdeliveries; a fulfillment only ever summarizestrackingandtracking_url. Delivery#carrieris free text.Spree.tracking_carrierssupplies URL templates and display names; nothing may validate a carrier against it, or a forwarder's PRO number becomes unenterable.- Freight paperwork is never a
ShippingLabel. A bill of lading, pallet placard or packing list goes toSpree::OrderDocumentor the client-side prints (6.1-b2b-order-documents.md); the label table holds carrier labels only. - A
Returndelivery never transitions the return. Anything that wants "the parcel came back" to do something hangs it onDeliveries::UpdateTracking'safter_update_trackinghook and callsReturns::Receiveitself, staff-style. - Label files are private-storage attachments streamed by the API —
never a public blob URL on any serializer, never
attachment.url. Fulfillment#trackingis a read-through summary, andtracking=is a deprecated shell. New code creates a delivery (Deliveries::Create, or thetracking:keyword onFulfillments::Fulfill/Update); assigningtrackingstill works one release, writing the primary delivery on save with a warning, and is removed in 6.1 with the column.- The label's file format is written as
file_formaton the API.formatis Rails' own request-format parameter, so a controller permitting it receives"json"and the label refuses to save; the model attribute keeps the nameformat.
Open Questions
None blocking. Three items are deliberately deferred:
- Refund outcome from the carrier.
ShippingLabels::Refundrecords what the provider answers synchronously (refundedorrefund_requested). A provider that settles refunds later (EasyPost'srefund.successful/refund.rejectedevents) can complete the story throughShippingLabels::ConfirmRefund, but arefund_rejectedstatus and the webhook wiring wait for a merchant to ask — unblocked by that request. - Several labels for one delivery (a multi-piece shipment under one tracking number). Not modeled: one label mints one delivery. Unblocked by a carrier provider that actually returns multi-piece labels.
- Packaging on the delivery. The wholesale plan names its
palletandcontainerPackageTyperows as "the natural anchor for future label/BOL work"; a nullablepackage_type_id(plus a count) onspree_deliveriesis the additive hook — "3 pallets under PRO 4471923". Unblocked by the wholesale plan landing and a merchant needing the consignment's packaging recorded, not just its number.
References
docs/plans/6.0-fulfillment-and-delivery.md— resolved questions 14 and 15, the "label leads" amendmentdocs/plans/decisions.md— 2026-08-11 (one tracking number per fulfillment), 2026-08-12 (the label leads), 2026-08-22 (polymorphic tax identifier owner — the precedent forownerhere), 2026-09-03 (this plan)docs/plans/6.0-returns-exchanges-claims.md— resolved question 2 (return labels ride with the carrier provider)docs/plans/6.0-delivery-rate-provider.md— EasyPost as the reference providerdocs/plans/6.0-b2b-wholesale-shipping.md— freight tiers, the freight rate provider,PackageType, and the parcel-versus-freight vocabulary that settled the model's namedocs/plans/6.1-b2b-order-documents.md— where bills of lading and packing lists livespree/core/app/workflows/spree/fulfillments/{purchase_label,fulfill,cancel,mark_delivered,update_tracking}.rbspree/providers/easypost/app/models/spree_easypost/{fulfillment_provider,tracker_event}.rbspree/api/app/controllers/spree/api/v3/webhooks/fulfillments_controller.rb