Open mochacr0 opened 1 week ago
Make sure request & response consistent (estimated fee, delivery date). Perform some tests on get rates
and create shipments
APIs to identify any fields in request that may lead to inconsistencies between these two APIs.
Assume that, these 2 APIs require certain fields to be identical for consistency.
recipient
, shipper
.recipient
, shipper
.DELIVERY_AREA
(charge only domestic delivery).KG
)STANDART_OVERNIGHT
: deliver inside US.INTERNATIONAL_FIRST
: international delivery, which will charge more fees (taxes, duties, etc.), will have some note see deliveryMessages
.
...shipDateStamp
is saturday, will have external fee called SATURDAY_PICKUP
.SATURDAY_DELIVERY
, SATURDAY_PICKUP
.
...USE_SCHEDULED_PICKUP
.YOUR_PACKAGING
(customer-self packaging)SENDER
operationalDetail
.shipDateStamp
.1. Rate & Transit Time: Test service type vs address combination. 2. Create Shipment: After Checking Rate: check if we can create shipment as checking rate request.
Overview
Shipping is crucial to the e-commerce process, beginning when an order is placed and continuing through all steps required to deliver the package to the customer.
The shipping process starts when the user initiates checkout. At this point, they can select their preferred delivery provider, service type, and receive delivery time and fee estimates.
Once the order is confirmed, the shop owner prepares the shipment, including packaging the item, creating a shipping request, and scheduling a pickup time for the carrier. The carrier then manages the fulfillment process to deliver the package.
Throughout this journey, both the buyer and the shop owner can track the package status using a tracking number provided by the carrier.
YAS Delivery Idea
This section outlines the general approach for implementing delivery services into YAS. Since this is still a concept, further discussion is needed to finalize the solution and workflow.
Delivery Providers & Services
We plan to support multiple shipment providers (e.g., FedEx, UPS). Each provider offers a unique list of service types, each with varying rates and delivery times.
During checkout, the system retrieves all available delivery service types from enabled providers that can accommodate the current order details (buyer address, items to ship). Buyers will then select their preferred service type for the order.
Order & Shipment Packages
An order may consist of multiple shipment packages. This is necessary due to our support for multi-warehouse functionality, where products may be located in different warehouses and pickup locations. Since we cannot create a single package for items from various pickup locations, multiple packages will be created, one for each warehouse storing the products.
To illustrate how our system decides on package creation for an order, consider the following stock availability and order scenarios:
When a user wants to place an order containing both Samsung and iPhone with different quantities, the system processes it as follows:
Scenario 1: Samsung x1, iPhone x1
Since both products are available in both warehouses, the system can select either Warehouse A or B based on proximity to the buyer. However, estimating the distance may be complex for now. We can use a simpler method to choose the warehouse by sorting the names in alphabetical order, for example.
Scenario 2: Samsung x6, iPhone x6
In this case, only Warehouse A has enough stock for Samsung, while Warehouse B has sufficient stock for iPhone. Therefore, the shop owner must create two different packages:
Scenario 3: Samsung x11, iPhone x21
Here, the ordered quantities exceed the available stock in each warehouse, but the total is still manageable. Consequently, two packages must be created:
In this scenario, we prioritize allocation from Warehouse A first because its name comes first alphabetically.
This package-splitting logic is also applied when estimating delivery times and fees to provide accurate information to customers.
Arrange a Shipment
Arranging a shipment occurs after the buyer places an order and the shop owner accepts it. At this stage, shop owners must create a shipment package request for the buyer's chosen provider. The following actions can be performed:
Package Status Updating & Tracking
Once the shipment package is arranged and picked up, its status is continuously updated by the delivery providers via webhooks. Each time there is a change in the package's status—such as being picked up, moved to storage, out for delivery, or delivered—providers send update events to our system through pre-configured endpoints. Our system is responsible for receiving these updates and reflecting the accurate status of the package.
Additionally, each package is assigned a unique tracking number, allowing us to retrieve the latest status and details from the provider's website.
Note: Webhooks are only available for deployed and public environments. They are not sent in development environments.
Shipping Provider API Specifications
FedEx
Get Rates (Delivery Times and Fees)
Retrieves available delivery services, estimated delivery times, and associated fees based on shipment details such as addresses, package weight, and pickup type.
Required Information:
"USE_SCHEDULED_PICKUP"
for simplicity.rateRequestType
(type of rate request)."YOUR_PACKAGING"
(indicates that the shop owner is responsible for packaging).Response Includes:
Create Shipment
Initiates a shipment request.
Required Information:
"YOUR_PACKAGING"
.Response Includes:
Cancel Shipment
Cancels an existing shipment request.
Required Information:
Response Includes:
Tracking API
Provides the latest status and history of a shipment
Required Information:
Response Includes:
Get Pickup Rates (Optional)
Retrieves available pickup rates.
Required Information:
SAME_DAY
,FUTURE_DAY
, or both.Response Includes:
Schedule Pickup (Optional)
Schedules a package pickup. This API works in conjunction with the Create Shipment API, as after a shipment is created, shippers can utilize this API to schedule the pickup of their packages, ensuring that their items are picked up at the desired time and location. Note that the pickup request is separate from the create shipment request, as a single pickup may collect multiple shipment packages at one time.
Required Information:
Response Includes:
Cancel Pickup (Optional)
Cancels a previously scheduled pickup.
Required Information:
Response Includes:
Notes
LB
).