Early return a subscription
curl --request POST \
--url https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"rentalId": "<string>",
"reason": "<string>",
"earlyReturnFee": 1,
"damageAssessment": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return"
payload = {
"rentalId": "<string>",
"reason": "<string>",
"earlyReturnFee": 1,
"damageAssessment": "<string>",
"notes": "<string>"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
rentalId: '<string>',
reason: '<string>',
earlyReturnFee: 1,
damageAssessment: '<string>',
notes: '<string>'
})
};
fetch('https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rentalId' => '<string>',
'reason' => '<string>',
'earlyReturnFee' => 1,
'damageAssessment' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return"
payload := strings.NewReader("{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"rentalId": "<string>",
"assetSerialNumber": "<string>",
"earlyReturnFee": 1,
"currency": "<string>",
"actualMonthsRented": 60,
"returnDate": "<string>",
"message": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Subscriptions
Early Return
Customer returns the device before contract end. May incur early return fees.
POST
/
v1
/
subscriptions
/
{subscriptionId}
/
early-return
Early return a subscription
curl --request POST \
--url https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"rentalId": "<string>",
"reason": "<string>",
"earlyReturnFee": 1,
"damageAssessment": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return"
payload = {
"rentalId": "<string>",
"reason": "<string>",
"earlyReturnFee": 1,
"damageAssessment": "<string>",
"notes": "<string>"
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
rentalId: '<string>',
reason: '<string>',
earlyReturnFee: 1,
damageAssessment: '<string>',
notes: '<string>'
})
};
fetch('https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rentalId' => '<string>',
'reason' => '<string>',
'earlyReturnFee' => 1,
'damageAssessment' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-ID: <tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return"
payload := strings.NewReader("{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/subscriptions/{subscriptionId}/early-return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rentalId\": \"<string>\",\n \"reason\": \"<string>\",\n \"earlyReturnFee\": 1,\n \"damageAssessment\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"rentalId": "<string>",
"assetSerialNumber": "<string>",
"earlyReturnFee": 1,
"currency": "<string>",
"actualMonthsRented": 60,
"returnDate": "<string>",
"message": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Process an early return when a customer wants to end their subscription before the contract end date. The customer returns the device and may pay an early termination fee based on your policies.When to Use Early Returns
Early Return vs Buyout
| Aspect | Early Return | Buyout |
|---|---|---|
| Device | Returned to you | Customer keeps |
| Fee | Early termination fee | Buyout price |
| Asset | Back in inventory | Removed from inventory |
| Best for | Customer done with device | Customer wants ownership |
Request Fields
| Field | Required | Description |
|---|---|---|
earlyReturnFee | Yes | The fee to charge |
effectiveDate | No | When subscription ends (default: today) |
reason | No | Reason for early return |
waiveFee | No | Set to true to waive the fee |
Example: Standard Early Return
{
"earlyReturnFee": 258.00,
"reason": "Customer relocating abroad"
}
Example: Waived Fee (Customer Goodwill)
{
"earlyReturnFee": 0,
"waiveFee": true,
"reason": "Customer hardship - fee waived per manager approval"
}
What Happens
When you process an early return:- Subscription status changes to
ended_early_return - Early return details recorded with fee and reason
- Future payments cancelled
- Asset marked for return processing
- Final invoice generated for early return fee (if applicable)
Response Structure
{
"success": true,
"message": "Early return processed",
"subscription": {
"subscriptionId": "sub_abc123",
"status": "ended_early_return",
"earlyReturnDetails": {
"returnDate": "2025-01-20",
"earlyReturnFee": 258.00,
"monthsRemaining": 4,
"feeWaived": false,
"reason": "Customer relocating abroad"
}
}
}
Calculate Before Processing
Always calculate the fee first using Calculate Early Return Fee:async function processEarlyReturn(subscriptionId, reason) {
// 1. Calculate the fee
const calc = await calculateEarlyReturnFee({ subscriptionId });
// 2. Present to customer and get confirmation
const confirmed = await confirmWithCustomer(calc.earlyReturnFee);
if (!confirmed) {
return { cancelled: true };
}
// 3. Process the return
return await earlyReturnSubscription(subscriptionId, {
earlyReturnFee: calc.earlyReturnFee,
reason
});
}
Early Return Fee Policies
Common approaches for calculating early return fees:1. Remaining Contract Value
fee = remainingMonths × monthlyAmount
2. Percentage of Remaining
fee = remainingMonths × monthlyAmount × 0.5 // 50% of remaining
3. Fixed Early Exit Fee
fee = configuredFixedFee // e.g., €200 flat fee
4. Sliding Scale
if (monthsRemaining > 12) {
fee = monthlyAmount * 3; // 3 months penalty
} else if (monthsRemaining > 6) {
fee = monthlyAmount * 2; // 2 months penalty
} else {
fee = monthlyAmount; // 1 month penalty
}
Completing the Early Return
After processing:- Schedule return pickup or provide return instructions
- Receive device from customer
- Inspect device for damage
- Update asset status (available or needs repair)
- Process fee payment if applicable
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
SUBSCRIPTION_NOT_ACTIVE | Subscription is not active | Can only early return active subscriptions |
INVALID_FEE | Fee must be zero or positive | Provide valid fee amount |
Related Endpoints
- Calculate Early Return Fee - Get recommended fee
- Get Subscription - Check subscription details
- Buyout Subscription - Alternative: customer keeps device
- Update Asset - Update returned device status
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The subscription ID
Body
application/json
Was this page helpful?