Concepts: Orders
In the tebio platform, an order is the starting point for many subsequent processes. It acts as a technical and professional trigger for subsequent processes.
Only when an order has been successfully completed are subscriptions created in the background, shop products or hardware transferred to logistics processes and the first billing cycles initiated.
1. Demarcation: Order and Subscription
Section titled “1. Demarcation: Order and Subscription”A common misunderstanding is mixing up orders and subscriptions. The platform strictly separates these two concepts:
- The order is a time-limited, one-time event. It documents the ordering process: Which customer ordered which products, when, under what conditions? Note: If the customer orders via the hosted pages or uses the
CreateNewSubscriptionOrderservice, a new customer can also be created directly during the course of an order if this does not yet exist. - The subscription is the ongoing contractual relationship that results from the order.
Example classification: The order documents the completion. The subscription then reflects the current status. Changes (e.g. a price adjustment or cancellation) affect the current “subscription”, not the historical order.
2. Architecture: Synchronous and asynchronous ordering process
Section titled “2. Architecture: Synchronous and asynchronous ordering process”When a new order is triggered, the tebio platform architecturally divides the process into two phases to ensure stable processing and good response times:
- Synchronous part: Immediately after sending the order, it is validated. If only draft (
DRAFT) or offer (OFFER) is requested as status, the process stops here. No further actions (payment, creating a customer, etc.) will be triggered yet. - Asynchronous part: If the order is placed bindingly (status
ORDERED), the order process takes over in the background. This asynchronous workflow controls the control of subsequent processes without blocking the front end.
Follow-up processes for an order
Section titled “Follow-up processes for an order”Depending on the application, various other processes are triggered from the order process:
- Payment Agreements: A process to establish e.g. B. a SEPA mandate.
- Payment Authorization: The act of reserving or collecting payments.
- Shipping (Logistics): Initiating the shipping of physical goods.
- Fulfillment: The actual provisioning of subscriptions, licenses or SIM cards.
- Returns (returns): If the customer cancels later, the return process will be managed.
3. Order lifecycle
Section titled “3. Order lifecycle”From creation to archiving, an order goes through various, clearly defined states (statuses).
The following state diagram (status model) illustrates the process and possible branches of an order:
stateDiagram-v2
[*] --> DRAFT
[*] --> ORDERED
DRAFT --> OFFER
DRAFT --> CANCELLED
OFFER --> ORDERED
OFFER --> CANCELLED
ORDERED --> WAIT_FOR_PAYM_ARRANGEMENT
ORDERED --> WAIT_FOR_APPROVAL
ORDERED --> WAIT_FOR_SCHED_DATE
ORDERED --> WAIT_FOR_PAYMENT_AUTHORIZE
ORDERED --> FULFILMENT
ORDERED --> CANCELLED
WAIT_FOR_PAYM_ARRANGEMENT --> WAIT_FOR_APPROVAL
WAIT_FOR_PAYM_ARRANGEMENT --> WAIT_FOR_SCHED_DATE
WAIT_FOR_PAYM_ARRANGEMENT --> WAIT_FOR_PAYMENT_AUTHORIZE
WAIT_FOR_PAYM_ARRANGEMENT --> FULFILMENT
WAIT_FOR_PAYM_ARRANGEMENT --> FINISHED_FAILED
WAIT_FOR_APPROVAL --> WAIT_FOR_SCHED_DATE
WAIT_FOR_APPROVAL --> WAIT_FOR_PAYMENT_AUTHORIZE
WAIT_FOR_APPROVAL --> FULFILMENT
WAIT_FOR_APPROVAL --> FINISHED_FAILED
WAIT_FOR_APPROVAL --> CANCELLED
WAIT_FOR_SCHED_DATE --> WAIT_FOR_PAYMENT_AUTHORIZE
WAIT_FOR_SCHED_DATE --> FULFILMENT
WAIT_FOR_SCHED_DATE --> CANCELLED
WAIT_FOR_PAYMENT_AUTHORIZE --> FULFILMENT
WAIT_FOR_PAYMENT_AUTHORIZE --> FINISHED_FAILED
FULFILMENT --> FINISHED_SUCCESS
FULFILMENT --> FINISHED_PARTIAL_SUCCESS
FULFILMENT --> FINISHED_FAILED
note left of FULFILMENT : ERROR state can be both source\nand target of nearly every other state.
Important status values:
Section titled “Important status values:”DRAFT/OFFER: Draft and offer. Preliminary stages without a completed ordering process.ORDERED: The order is placed. The asynchronous workflow now starts.WAIT_FOR_PAYM_ARRANGEMENT: Waiting for setup e.g. B. a direct debit mandate.WAIT_FOR_PAYMENT_AUTHORIZE: The system is waiting for authorization from the payment provider (e.g. PayPal or 3D-Secure).WAIT_FOR_APPROVAL: Waiting for manual commercial approval by a portal user with appropriate authorization.WAIT_FOR_SCHED_DATE: The customer has completed the order, but has chosen a day in the future as the start date (e.g. contract start date is January 1st).FULFILMENT(execution): The moment of provisioning. The system now translates the order items into real subscriptions.FINISHED_SUCCESS(Completed): The execution completed successfully. The order is now historically archived and read-only.CANCELLED/FINISHED_FAILED: The order was canceled or failed due to technical/commercial issues.