Order Management

Complete guide to managing orders in the CPS system
View as Markdown

Learn how to create, track, and manage orders through the CPS Order Management API.

Order Lifecycle

1. Order Creation

Orders are created through the ordering platform with customer details and selected photos.

1const createOrder = async (orderData) => {
2 const response = await fetch('https://convention.photos/api/orders/create', {
3 method: 'POST',
4 headers: { 'Content-Type': 'application/json' },
5 body: JSON.stringify(orderData)
6 });
7 return response.json();
8};

2. Status Tracking

Orders progress through statuses: pending → paid → shipped

1const updateOrderStatus = async (orderId, status) => {
2 const response = await fetch(`https://cps-orders.replit.app/api/orders/${orderId}`, {
3 method: 'PUT',
4 headers: { 'Content-Type': 'application/json' },
5 body: JSON.stringify({ status })
6 });
7 return response.json();
8};

3. Shipping Updates

Mark orders as shipped and generate shipping labels.

1const markShipped = async (orderId) => {
2 const response = await fetch(`https://cps-orders.replit.app/api/orders/${orderId}/update-shipping`, {
3 method: 'POST',
4 headers: { 'Content-Type': 'application/json' },
5 body: JSON.stringify({ shipped: true })
6 });
7 return response.json();
8};

4. Feedback Collection

Collect customer satisfaction feedback after fulfillment.

1const submitFeedback = async (orderNumber, feedback) => {
2 const response = await fetch(`https://cps-orders.replit.app/api/orders/${orderNumber}/feedback`, {
3 method: 'POST',
4 headers: { 'Content-Type': 'application/json' },
5 body: JSON.stringify({ feedback })
6 });
7 return response.json();
8};

Admin Dashboard

Order Monitoring

Track all orders by status:

  • Pending: Awaiting payment
  • Paid: Payment received, ready for fulfillment
  • Shipped: Order shipped to customer
  • Cancelled: Order cancelled

Sales Reporting

Access comprehensive sales analytics:

1const getSalesSummary = async () => {
2 const response = await fetch('https://cps-orders.replit.app/api/orders/summary');
3 return response.json();
4};
5
6// Returns:
7// {
8// totalOrders: 150,
9// pendingCount: 12,
10// completedCount: 125,
11// cancelledCount: 13,
12// totalRevenue: 2500.00,
13// averageOrderValue: 20.00
14// }

Envelope Generation

Generate shipping labels for fulfilled orders:

1// Get PNG shipping label
2const getPngLabel = async (orderId) => {
3 const response = await fetch(`https://cps-orders.replit.app/api/envelope/png/${orderId}`);
4 return response.blob();
5};
6
7// Get DOCX shipping label
8const getDocxLabel = async (orderId) => {
9 const response = await fetch(`https://cps-orders.replit.app/api/envelope/docx/${orderId}`);
10 return response.blob();
11};

Google Sheets Integration

All order data is stored in Google Sheets with real-time synchronization:

  • Real-time updates: Changes reflect immediately
  • 30-second cache: Performance optimized with caching
  • Automatic backups: Data safety ensured
  • Column-based status: Easy status management

Sheet Structure

  • Column A: Order ID
  • Column B: Order Number
  • Column C: Customer Name
  • Column D: Email
  • Column E: Phone
  • Column F: Fulfillment Type
  • Column G: Shipping Address
  • Column H: Items
  • Column I: Subtotal
  • Column J: Shipping Fee
  • Column K: Total
  • Column L: Status
  • Column M: Created At
  • Column N: City
  • Column O: State
  • Column P: ZIP Code
  • Column Q: Shipping Status
  • Column R: Feedback

Email Automation

Orders trigger automated email workflows:

  • Receipt emails: Sent upon order creation
  • Status updates: Notifications for status changes
  • Shipping confirmations: When orders ship
  • Feedback requests: Post-fulfillment surveys

Best Practices

  1. Validate addresses before order creation
  2. Monitor order status regularly
  3. Generate labels immediately after payment
  4. Collect feedback within 7 days of shipping
  5. Backup data regularly from Google Sheets

Quick example

Here’s a minimal example showing common customization options in docs.yml:

docs.yml
1title: Your Documentation
2
3colors:
4 accentPrimary:
5 dark: "#81C784"
6 light: "#1B5E20"
7
8logo:
9 dark: docs/assets/logo-dark.svg
10 light: docs/assets/logo-light.svg
11
12favicon: docs/assets/favicon.svg

For complete configuration options, see the site-level settings documentation.