Skip to main content
POST
/
v1
/
subscriptions
Create a subscription
curl --request POST \
  --url https://api-eu.flexportal.io/v1/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-ID: <tenant-id>' \
  --data '
{
  "orderId": "<string>",
  "assetSerialNumber": "<string>",
  "customerId": "<string>",
  "billingGroupId": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "contractLength": 60,
  "notes": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "rentalId": "<string>",
  "rental": {
    "rentalId": "<string>",
    "tenantId": "<string>",
    "assetSerialNumber": "<string>",
    "customerId": "<string>",
    "sku": "<string>",
    "productName": "<string>",
    "monthlyAmount": 123,
    "currency": "<string>",
    "status": "active",
    "originalContractLength": 123,
    "contractLength": 123,
    "startDate": "<string>",
    "orderId": "<string>",
    "customerEmail": "<string>",
    "customerName": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "createdBy": "<string>",
    "billingGroupId": "<string>",
    "endDate": "<string>",
    "nextBillingDate": "<string>",
    "lastModifiedDate": "<string>",
    "extensionHistory": [
      {
        "extensionMonths": 60,
        "oldContractLength": 60,
        "newContractLength": 60,
        "oldMonthlyAmount": 1,
        "newMonthlyAmount": 1,
        "extendedBy": {
          "userId": "<string>",
          "email": "<string>",
          "displayName": "<string>",
          "role": "<string>",
          "memberId": "<string>"
        },
        "oldEndDate": "<string>",
        "newEndDate": "<string>",
        "extendedAt": "<string>",
        "reason": "<string>",
        "notes": "<string>"
      }
    ],
    "actualMonthsRented": 123,
    "monthsSaved": 123,
    "deviceRrp": 123,
    "rrpCaptureDate": "<string>",
    "rrpSource": "custom_field",
    "replacementHistory": [
      {
        "oldSerialNumber": "<string>",
        "newSerialNumber": "<string>",
        "reason": "<string>",
        "replacedBy": {
          "userId": "<string>",
          "email": "<string>",
          "displayName": "<string>",
          "role": "<string>",
          "memberId": "<string>"
        },
        "replacedAt": "<string>",
        "damageAssessment": "<string>",
        "insuranceClaim": true,
        "notes": "<string>"
      }
    ],
    "buyoutDetails": {
      "buyoutPrice": 1,
      "calculationMethod": "auto_calculated",
      "reason": "customer_request",
      "processedBy": {
        "userId": "<string>",
        "email": "<string>",
        "displayName": "<string>",
        "role": "<string>",
        "memberId": "<string>"
      },
      "buyoutDate": "<string>",
      "calculationBreakdown": {
        "remainingMonths": 60,
        "remainingMonthsPayment": 1,
        "rrpPercentage": 123,
        "rrpAmount": 1,
        "flatFee": 1
      },
      "notes": "<string>"
    },
    "earlyReturnDetails": {
      "fee": 1,
      "feeWaived": true,
      "calculationMethod": "auto_calculated",
      "returnCondition": "excellent",
      "reason": "<string>",
      "processedBy": {
        "userId": "<string>",
        "email": "<string>",
        "displayName": "<string>",
        "role": "<string>",
        "memberId": "<string>"
      },
      "returnedAt": "<string>",
      "calculationBreakdown": {
        "method": "remaining_months",
        "remainingMonths": 60,
        "gracePeriodApplied": true,
        "daysFromStart": 1825
      },
      "damageAssessment": "<string>",
      "notes": "<string>"
    },
    "upgradeFromRentalId": "<string>",
    "customFields": {},
    "notes": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Body

application/json
orderId
string
required
Minimum string length: 1
assetSerialNumber
string
required
Minimum string length: 1
customerId
string
required
Minimum string length: 1
billingGroupId
string
startDate
string<date-time>
contractLength
integer
Required range: 1 < x <= 120
notes
string

Response

Subscription created

success
enum<boolean>
required
Available options:
true,
false
message
string
required
rentalId
string
required
rental
object
required