Skip to main content

Overview

The Orders & Payments system handles the complete transaction lifecycle from purchase to payment. When clients order gigs, the platform manages order tracking, payment processing, and fund disbursement to ensure secure and reliable transactions for both parties.

Key Capabilities

Order Management

Order Tracking

Monitor order status from placement to completion

Package Selection

Orders are tied to specific gig packages (Basic, Standard, or Premium)

Order History

View complete purchase history with timestamps

Status Updates

Receive notifications when order status changes

Payment Processing

Secure Transactions

Integrated payment gateway for secure processing

Multiple Methods

Support for various payment methods

Transaction Records

Complete payment history with transaction IDs

Payment Status

Track payment state (pending, success, failed)

Order Lifecycle

1

Order Placement

Client selects a gig package and places an order. The order is created with:
  • Selected package details
  • Total amount from package price
  • Initial status: Pending
2

Payment Processing

The payment is processed through the integrated gateway:
  • Payment record is created
  • Status: Pending
  • Transaction ID is recorded once processed
3

Order Confirmation

Once payment succeeds:
  • Payment status: Success
  • Order status: Processing
  • Freelancer is notified to begin work
4

Service Delivery

Freelancer completes the work according to package terms:
  • Delivery within the specified timeframe
  • Revisions handled as per package
  • Order status remains Processing
5

Order Completion

When both parties agree work is complete:
  • Order status: Completed
  • Funds are released to freelancer
  • Client can leave a review

Order Status Flow

User Workflows

For Clients

  1. Browse the gig marketplace
  2. Select a gig that matches your needs
  3. Choose a package (Basic, Standard, or Premium)
  4. Review deliverables, price, and timeline
  5. Proceed to checkout
  6. Complete payment with preferred method
  7. Receive order confirmation

For Freelancers

  1. Receive notification of new order
  2. Review order details and package
  3. Check client requirements
  4. Confirm order acceptance
  5. Begin work according to timeline

Important Fields

Order Model

id
string
Unique order identifier
userId
string
required
Client who placed the order
gigId
string
required
Gig being purchased
packageId
string
required
Specific package selected (Basic, Standard, or Premium)
status
enum
required
Current order status: pending, processing, completed, or cancelled
totalAmount
float
required
Order total (from package price)
createdAt
datetime
When the order was placed
updatedAt
datetime
Last status update timestamp

Payment Model

id
string
Unique payment identifier
orderId
string
required
Associated order (one-to-one relationship)
status
enum
required
Payment status: pending, success, or failed
amount
float
required
Payment amount (matches order total)
paymentMethod
string
required
Method used for payment (credit card, PayPal, etc.)
transactionId
string
Gateway transaction reference ID
createdAt
datetime
Payment initiation timestamp
updatedAt
datetime
Last payment status update

Order Status Definitions

Initial state when order is first created.Characteristics:
  • Payment is being processed
  • Order awaiting confirmation
  • No work has started
Next states: Processing (payment success) or Cancelled (payment failure)
Active state when freelancer is working on the order.Characteristics:
  • Payment succeeded
  • Freelancer is delivering the service
  • Work in progress
  • Revisions may be requested
Next states: Completed (delivered & accepted) or Cancelled (by agreement)
Final success state when order is fulfilled.Characteristics:
  • Work delivered and accepted
  • Funds released to freelancer
  • Client can leave review
  • Order is closed
This is a terminal state.
Final cancelled state when order doesn’t complete.Reasons:
  • Payment failed
  • Mutual agreement to cancel
  • Policy violation
Characteristics:
  • Work stops immediately
  • Refund processed if applicable
  • Order is closed
This is a terminal state.

Payment Integration

The platform uses YouCanPay for payment processing:
  1. Tokenization: Payment details are tokenized for security
  2. Transaction Processing: Payments are processed through the gateway
  3. Status Tracking: Real-time payment status updates
  4. Transaction Records: Complete payment history maintained
The platform supports the Moroccan Dirham (MAD) as the primary currency for transactions.

Notification Preferences

Users can control order-related notifications:
orderUpdatesNotifications
boolean
default:true
Receive notifications for order status changes, messages, and updates
Notifications are sent for:
  • New orders received (freelancers)
  • Order status changes
  • Delivery confirmations
  • Payment confirmations
  • Review requests

Best Practices

For Clients

  • Clearly communicate requirements
  • Respond promptly to freelancer questions
  • Review deliverables within reasonable time
  • Request revisions respectfully
  • Leave honest reviews

For Freelancers

  • Deliver within promised timeframe
  • Communicate progress proactively
  • Honor revision commitments
  • Deliver high-quality work
  • Maintain professionalism

Gig Marketplace

Browse and purchase services

Reviews & Ratings

Rate completed orders

Messaging

Communicate during orders

Freelancer Profiles

View seller information
Always complete transactions through the platform. Off-platform payments are not protected and violate platform terms.

Build docs developers (and LLMs) love