Skip to main content
POST
/
v1
/
orders
Create an order
curl --request POST \
  --url https://api-eu.flexportal.io/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-ID: <tenant-id>' \
  --data '
{
  "customer": {
    "email": "jsmith@example.com",
    "firstName": "<string>",
    "lastName": "<string>",
    "company": "<string>",
    "phone": "<string>",
    "customerType": "individual"
  },
  "billingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  },
  "items": [
    {
      "sku": "<string>",
      "quantity": 2,
      "contractLength": 123
    }
  ],
  "orderType": "standard",
  "extensionDetails": {
    "originalOrderId": "<string>",
    "extensionMonths": 123,
    "previousEndDate": "<string>",
    "newEndDate": "<string>",
    "reason": "<string>"
  },
  "upgradeDetails": {
    "previousDevice": "<string>",
    "previousSerialNumber": "<string>",
    "previousMonthlyAmount": 123,
    "previousRentalId": "<string>",
    "upgradeReason": "<string>"
  },
  "customFields": {},
  "shippingAddress": {
    "contactName": "<string>",
    "streetAddress": "<string>",
    "city": "<string>",
    "country": "<string>",
    "company": "<string>",
    "buildingInfo": "<string>",
    "locality": "<string>",
    "adminArea": "<string>",
    "postalCode": "<string>"
  },
  "notes": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "orderId": "<string>",
  "order": {
    "orderId": "<string>",
    "tenantId": "<string>",
    "status": "pending",
    "orderType": "standard",
    "customer": {
      "customerId": "<string>",
      "email": "jsmith@example.com",
      "firstName": "<string>",
      "lastName": "<string>",
      "company": "<string>",
      "phone": "<string>",
      "customerType": "individual"
    },
    "billingAddress": {
      "contactName": "<string>",
      "streetAddress": "<string>",
      "city": "<string>",
      "country": "<string>",
      "company": "<string>",
      "buildingInfo": "<string>",
      "locality": "<string>",
      "adminArea": "<string>",
      "postalCode": "<string>"
    },
    "shippingAddress": {
      "contactName": "<string>",
      "streetAddress": "<string>",
      "city": "<string>",
      "country": "<string>",
      "company": "<string>",
      "buildingInfo": "<string>",
      "locality": "<string>",
      "adminArea": "<string>",
      "postalCode": "<string>"
    },
    "items": [
      {
        "sku": "<string>",
        "productName": "<string>",
        "quantity": 2,
        "unitPrice": 1,
        "contractLength": 123,
        "rentalIds": [],
        "rentalStatus": "pending"
      }
    ],
    "totals": {
      "subtotal": 1,
      "total": 1,
      "currency": "<string>",
      "totalDevices": 2,
      "taxAmount": 0
    },
    "rentalProgress": {
      "totalDevices": 1,
      "rentedDevices": 1
    },
    "rentalIds": [
      "<string>"
    ],
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "createdBy": "<string>",
    "payment": {
      "status": "pending",
      "method": "stripe",
      "transactionId": "<string>",
      "paidAmount": 1,
      "manuallyMarked": false
    },
    "customFields": {},
    "billingGroupId": "<string>",
    "trackingNumber": "<string>",
    "shippedAt": "<string>",
    "notes": "<string>",
    "extensionDetails": {
      "originalOrderId": "<string>",
      "extensionMonths": 123,
      "previousEndDate": "<string>",
      "newEndDate": "<string>",
      "reason": "<string>"
    },
    "upgradeDetails": {
      "previousDevice": "<string>",
      "previousSerialNumber": "<string>",
      "previousMonthlyAmount": 123,
      "previousRentalId": "<string>",
      "upgradeReason": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Body

application/json
customer
object
required
billingAddress
object
required
items
object[]
required
Minimum array length: 1
orderType
enum<string>
default:standard
Available options:
standard,
extension,
upgrade
extensionDetails
object
upgradeDetails
object
customFields
object
shippingAddress
object
notes
string

Response

Order created successfully

success
enum<boolean>
required
Available options:
true,
false
message
string
required
orderId
string
required
order
object
required