Skip to content

Restore and Extend EasyPost functionality #111

@fthobe

Description

@fthobe

Breaking Bugs / lack of maintenance:

Outdated API: #108 #104 (draft PR #112)
Missing Features: #47 (Draft PR #75)

Required for first PR

Required for second PR

Features

shippingTypes of shippingMethods

Fields required

Shipping Method needs shippingtype

A picklist named shippingType containing the following options

  1. Normal
  2. Roundtrip (Returns are not integrated with EasyPost out of the box #83)
  3. Inbound
  4. InboundRountrip

Product needs Default Inbound Stock Location

Add default inbound stock location to products to overwrite the stock the item is returning to. The stock location can be chosen from existing stocks.

Implementation

  1. Normal creates a regular shipping label
  2. Roundtrip creates a Return Label in addition the outbound label to the default stock location from which the item was removed or, if present, from item inbound stock.
  3. Inbound creates an Inbound label using the customer shipping address as from_address and the product default inbound stock location as to_address
  4. InboundRountrip creates in addition to the inbound label a Return Label to the customer to the customer shipping address from the inbound stock location as from_address

Additional Information

Easypost offers return label generation endpoints.

Add insurance

The Shipping Method should contain an insurance flag to allow using easypost insurance for either all items or by item value.

Fields required on shipping method

A picklist named Insurance containing the following options

  1. True
  2. False
  3. Treshold

If Treshold is chosen, a minimum amount has to be set. Therefor following fields need to created as well:

  1. insuranceMin for the order value of the products contained in the shipment

Implementation

Add Insurance (link to Easypost API) by following logic:

  1. If Insurance True insure for total amount of product value contained in the shipment by providing the lineitemsvalue of items contained in the shipment
  2. If insurance False do not insure
  3. If Insurance Treshold is applied, the shipment should be insured if the value of lineitems contained in the shipment are exceeding insuranceMin

Notes

Easypost expects the insured amount to be provided in USD, this is not always possible right now as no exchange rate tracking is available. Currently we will just convert 1 to 1 for now. A better solution would be the import of the free ECB feed https://github.com/matthutchinson/ecb_exchange/blob/main/lib/ecb/exchange.rb

Overhaul Shipment Tracking

Add Inbound tracking code on shipment resource

The inbound tracking code should live a separate life not touching current states.

States

Current shipping states are

  • Pending
  • Ready
  • Shipped

Additional states are need to reflect inbound shipment states:

  • InboundPending (Inbound label created)
  • InboundReady (Inbound label created)
  • InboundShipped (Inbound label has been shipped)
  • InboundDelivered (Inbound shipment has been received)
  • Delivered (Shipment has been delivered)

Currently updates to the order states rely on solidus webhooks.

States Normal Roundtrip Inbound InboundRountrip
InboundPending N/A N/A (RMA) Inbound Label not created Inbound Label not created
InboundReady N/A N/A (RMA) Inbound Label created Inbound Label created
InboundShipped N/A N/A (RMA) Inbound Label Shipped Inbound Label Shipped
InboundDelivered N/A N/A (RMA) Inbound Label Received Inbound Label Ready (Updated via Backend or API)
Pending As before As before N/A Outbound Label Ready (Updated via Backend or API)
Ready As before As before N/A Outbound Label Ready (Updated via Backend or API)
Shipped As before As before N/A Outbound Label Shipped (Updated via Backend or API)
Delivered Updated via Backend or API Updated via Backend or API N/A Updated via Backend or API

Implement Customer Returns

The ability to integrate an existing ticket with a customer return needs to be implemented fetching the tracking code from the Outbound Shipment if available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions