Overview
Theorder.created webhook is triggered when a new order is created in your Metrifox account. Orders represent purchases of plans, add-ons, or single purchases by customers.
When It’s Triggered
This event is sent immediately after an order is successfully created, which can happen when:- A customer purchases a plan through checkout
- A subscription is created
- An add-on is purchased
- A single purchase item is bought
- An order is created through the API
Payload Structure
Data Fields
Thedata.order object contains the complete order record, including:
id: Internal order IDcustomer_id: ID of the customer who placed the ordersubtotal_in_base_unit: Subtotal amount in base unitstotal_in_base_unit: Total amount in base unitscurrency_code: Currency code (e.g., “USD”, “NGN”)fulfilled_at: Timestamp when the order was fulfilled (if any)paid_at: Timestamp when the order was paid (if any)expires_at: Order expiration timestamp (if any)created_at: Timestamp when the order was createdupdated_at: Timestamp when the order was last updatedorder_number: Human-readable order numbercustomer_key: Your external customer identifierstatus: Order status (e.g., “draft”, “fulfilled”, “cancelled”)setup_intent_result: Setup intent result (if any)tenant_id: The tenant ID this order belongs tois_manual: Whether the order was created manuallybilling_interval: Billing interval (e.g., “monthly”)billing_interval_value: Billing interval valuetransitioning_subscription_id: Transitioning subscription ID (if any)change_type: Order change type (if any)policy: Policy applied to the order (if any)
Example Use Cases
- Send order confirmation emails
- Sync orders to your order management system
- Trigger fulfillment workflows
- Update inventory systems
- Track sales analytics

