Create an order
Orders
Create Order
Creates a new subscription order for a customer. The order goes through validation, pricing calculation, and customer lookup/creation. If no customer exists with the provided email, one is automatically created.
POST
Create an order
Overview
Create a new subscription order for a customer. Orders capture the customer’s intent to subscribe to products—they don’t immediately create active subscriptions. After an order is created and confirmed, you’ll use the Create Subscription endpoint to fulfill order items.Orders are the starting point for the subscription lifecycle. Think of them as “checkout transactions” that need to be fulfilled by creating subscriptions and assigning assets.
Order Types
| Type | Description | When to use |
|---|---|---|
standard | New subscription order | Default for new customers or new products |
extension | Extend an existing subscription | Customer wants to keep device longer |
upgrade | Replace with a different product | Customer wants a better/different device |
Common Use Cases
E-commerce Integration
Create orders from your checkout flow when customers complete a subscription purchase
Sales Tool
Build internal tools for sales teams to create orders during customer calls
B2B Portal
Let business customers place bulk orders through a self-service portal
Migration
Import historical orders when migrating from another subscription platform
Minimal Request Example
The simplest order needs customer info, billing address, and at least one item:Complete Request Example
For business customers with full details:Customer Handling
When you create an order:- Existing customer (matching email): Order is linked to existing customer record
- New customer: A new customer record is created automatically
customerId is returned in the order response and can be used for future orders.
Address Fields
BothbillingAddress and shippingAddress support these fields:
| Field | Required | Description |
|---|---|---|
contactName | Yes | Person to contact at this address |
streetAddress | Yes | Street name and number |
city | Yes | City name |
country | Yes | Country name |
company | No | Company name (for business addresses) |
buildingInfo | No | Building, floor, suite details |
locality | No | Neighborhood or district |
adminArea | No | State, province, or region |
postalCode | No | ZIP or postal code |
Custom Fields
UsecustomFields to store additional data specific to your business:
- Purchase order numbers
- CRM/ERP reference IDs
- Cost centers or department codes
- Sales attribution
What Happens Next
After creating an order:- Order created with
pendingstatus - Review the order (manual or automated)
- Confirm the order (updates to
confirmedstatus) - Create subscriptions for each item using Create Subscription
- Order fulfilled when all items have active subscriptions
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
VALIDATION_ERROR | Missing required fields | Check details for specific field errors |
VARIANT_NOT_FOUND | SKU doesn’t exist | Verify SKU against your product catalog |
VARIANT_INACTIVE | SKU exists but is deactivated | Reactivate variant or use different SKU |
INVALID_CONTRACT_LENGTH | Unsupported contract duration | Use a configured contract length (e.g., 12, 24, 36) |
Related Endpoints
- List Orders - View all orders
- Get Order - Get order details
- Create Subscription - Fulfill order items
- List Products - Find valid SKUs
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Body
application/json