manage-order-fulfillment

Implement event-sourced order fulfillment workflows covering packing, shipping, tracking, and refunds.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/vesviet/agent-skills --skill manage-order-fulfillment-vesviet
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: manage-order-fulfillment
Source: https://github.com/vesviet/agent-skills/tree/main/core/skills/commerce/manage-order-fulfillment
Command: npx skills add https://github.com/vesviet/agent-skills --skill manage-order-fulfillment-vesviet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building post-purchase order lifecycle logic is error-prone: invalid state transitions, duplicate fulfillments, untracked refunds, and leaked customer PII are common failures. This Skill provides a structured engineering playbook for implementing order status management, shipping label generation, carrier tracking, and return/refund processing with event-sourced state machines and saga orchestration. ## Core Features & Use Cases - Event-Sourced Order State Machine: Model order status as an append-only event log (order_placed, payment_captured, shipped, delivered, returned) with enforced transitions and saga-based compensation branches. - Shipping & Carrier Tracking: Generate labels via carrier APIs (EasyPost, Shippo, DHL, GHTK), validate addresses before billing, and normalize carrier webhook status codes into unified internal milestones. - Refunds & Returns: Process returns with eligibility checks, restock inspection gates, and refunds that always reference the original payment transaction ID. - Use Case: An engineer building a Vietnam-focused e-commerce backend uses this Skill to integrate GHN/GHTK webhook tracking, enforce JWT-scoped agent fulfillment authorization, and prevent automatic restocking before warehouse inspection. ## Quick Start Use the manage-order-fulfillment skill to design the order state machine and shipping integration for my checkout backend.

Frequently Asked Questions about manage-order-fulfillment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement an order fulfillment state machine?▼

Model order status as an append-only event log with events like order_placed, payment_captured, shipped, and delivered, then derive current status by projecting the stream. Enforce transitions in code and reject invalid ones with clear errors rather than mutating a status field directly.

How to process refunds against an original payment transaction?▼

Refunds must always reference the original payment transaction ID and never exceed the captured total. Validate return eligibility first, then issue the refund through the payment gateway integration and emit a refund_issued event for accounting systems.

Should I use webhooks or polling for carrier tracking updates?▼

Prefer webhook callbacks over polling, especially for Vietnamese last-mile carriers like GHN, GHTK, Grab Express, and Viettel Post. Normalize each carrier's status codes into unified internal milestones such as in_transit, out_for_delivery, and delivered.

When should returned inventory be restocked to sellable stock?▼

Returned items must not re-enter sellable stock until a physical warehouse inspection event with Grade A confirmation is logged. Automatic restocking on RMA creation is forbidden because returned items may be damaged or unsellable.

How do I prevent duplicate fulfillment from webhook retries?▼

Require an idempotency key on every fulfillment call and reject duplicate fulfillments. Also enforce the inventory decrement in the same transaction as the fulfillment so retries cannot double-ship or double-decrement.