Skip to main contentOrders represent individual transactions within a subscription. Each time a subscription is billed or fulfilled, an order is created.
Orders contain information about the products or services being delivered, pricing, discounts applied, shipping details, and payment status. Orders provide a detailed record of each transaction and are essential for tracking subscription fulfillment and billing history.
Each order tracks:
- Order type: Whether the order is from a checkout (one-time purchase) or recurring (subscription billing)
- Order status: Draft (not yet placed) or placed (completed transaction)
- Pricing: Subtotal, delivery price, taxes, and total price
- Payment method: The payment method used for the order
- Delivery method: Shipping, local delivery, or pickup configuration
- Timestamps: Created date and placed date
- External integration: Links to external e-commerce platform orders
Order Items
Order items (also referred to as order lines) are the individual products or services included in an order. Each order contains one or more items that represent what was purchased.
Each order item contains:
- Product information: Title, subtitle, SKU, product and variant identifiers
- Quantity: Number of units purchased
- Pricing: Unit price and total line price (after discounts)
- Discounts: Item-specific discounts applied to this line
- Tax information: Whether the item is taxable
- Shipping requirements: Whether the item requires shipping
- Subscription item: Link back to the subscription item that generated this order item
- Subscription plan: Reference to the subscription plan that was used
Example: An order might contain three items: “Premium Coffee Beans” (quantity: 2, $15.99 each), “Coffee Filters” (quantity: 1, $4.99), and “Mug Set” (quantity: 1, $12.99).
Order Discounts
Order discounts represent promotional offers or pricing adjustments applied to an order. Discounts are applied during order creation and affect the final order total.
Order discounts can:
- Target shipping: Apply discounts to delivery/shipping costs
- Target items: Apply discounts to specific order items or all items
- Value types: Use fixed amount discounts or percentage discounts
- Source: Reference the subscription discount that generated this order discount
Example: An order might have a “WELCOME10” discount applying 10% off all items, and a “FREESHIP” discount providing free shipping.
Payment status
Orders are linked to billing attempts which track the payment processing status. The payment status indicates the current state of payment processing:
- New: Payment has not been processed yet
- Pending: Payment is being processed or waiting for customer action (e.g., confirmation)
- Completed: Payment was successfully processed
- Failed: Payment processing failed (e.g., insufficient funds, card declined)
Payment statuses are managed through billing attempts, which handle the communication with payment providers and track the payment lifecycle.
Refunds
Refunds represent the reversal of a payment for an order. Refunds can be initiated by operators or automatically processed in certain scenarios (such as chargebacks).
Refund characteristics:
- Status tracking: Refunds have their own status (new, pending, completed, failed)
- Partial or full: Refunds can be for the full order amount or specific items
- Item-level: Refunds can target specific order items, allowing partial refunds
- External integration: Refunds are processed through payment providers and synced with external e-commerce platforms
- Activity logging: All refund actions are logged in the activity log
When a refund is processed:
- The refund is created and tracked through the payment provider
- The order is updated to reflect the refund status
- Activity log entries are created for audit purposes
- Subscriptions may be affected depending on the refund type and timing
Example: If a subscriber receives damaged products, an operator might issue a partial refund for just those items, while the rest of the order remains fulfilled.
Chargebacks
Chargebacks occur when a payment is reversed by the cardholder’s bank or payment provider, typically due to disputes, fraud claims, or unauthorized transactions. Chargebacks are a critical aspect of payment processing that require immediate attention.
When a chargeback occurs:
- Automatic refund: The order is automatically refunded through the payment provider
- Subscription impact: Affected subscriptions are marked as failed
- Payment method revocation: For non-recoverable chargebacks, the payment method may be automatically revoked to prevent further issues
- Recovery options: Depending on chargeback configuration, a new draft order may be created to allow the subscriber to pay again
- Activity logging: Comprehensive activity log entries are created for all chargeback-related actions
- Notifications: Operators and subscribers are notified about the chargeback
Chargeback characteristics:
- Reason codes: Chargebacks include reason codes and messages explaining why the chargeback occurred
- Recoverable vs non-recoverable: Some chargeback types can be recovered (disputed), while others result in permanent payment method revocation
- Order tagging: Orders affected by chargebacks are tagged for easy identification
- Fulfillment status: The system tracks whether orders were fulfilled before the chargeback, affecting refund processing
Example: If a subscriber disputes a charge claiming they didn’t receive their order, a chargeback is initiated. The system automatically refunds the order, marks the subscription as failed, and may revoke the payment method. If the chargeback is recoverable and the operator can prove delivery, they may dispute it through the payment provider.