List payments
curl --request GET \
--url https://api-eu.flexportal.io/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/payments"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/payments', 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/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/payments")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"payments": [
{
"paymentId": "<string>",
"tenantId": "<string>",
"customerId": "<string>",
"subtotal": 1,
"total": 1,
"currency": "<string>",
"paymentType": "individual",
"billingPeriod": "<string>",
"status": "pending",
"idempotencyKey": "<string>",
"dueDate": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"taxAmount": 0,
"taxRate": 0,
"amount": 1,
"rentalId": "<string>",
"billingGroupId": "<string>",
"provider": "stripe",
"transactionId": "<string>",
"providerResponse": {},
"manuallyMarked": false,
"paymentReference": "<string>",
"markedBy": "<string>",
"captureAttempts": 0,
"lastCaptureError": {
"code": "<string>",
"message": "<string>",
"declineCode": "<string>"
},
"lineItems": [
{
"rentalId": "<string>",
"description": "<string>",
"amount": 1,
"taxAmount": 0
}
],
"lateFeeApplied": false,
"lateFeeAmount": 1,
"originalAmount": 1,
"notes": "<string>",
"paidAt": "<string>",
"lastCaptureAttempt": "<string>",
"nextRetryAt": "<string>"
}
],
"count": 123,
"hasMore": true,
"nextCursor": "<string>"
}Payments
List Payments
Returns a paginated list of payments with optional filtering by status, customer, or rental.
GET
/
v1
/
payments
List payments
curl --request GET \
--url https://api-eu.flexportal.io/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/payments"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/payments', 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/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-eu.flexportal.io/v1/payments")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"payments": [
{
"paymentId": "<string>",
"tenantId": "<string>",
"customerId": "<string>",
"subtotal": 1,
"total": 1,
"currency": "<string>",
"paymentType": "individual",
"billingPeriod": "<string>",
"status": "pending",
"idempotencyKey": "<string>",
"dueDate": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"taxAmount": 0,
"taxRate": 0,
"amount": 1,
"rentalId": "<string>",
"billingGroupId": "<string>",
"provider": "stripe",
"transactionId": "<string>",
"providerResponse": {},
"manuallyMarked": false,
"paymentReference": "<string>",
"markedBy": "<string>",
"captureAttempts": 0,
"lastCaptureError": {
"code": "<string>",
"message": "<string>",
"declineCode": "<string>"
},
"lineItems": [
{
"rentalId": "<string>",
"description": "<string>",
"amount": 1,
"taxAmount": 0
}
],
"lateFeeApplied": false,
"lateFeeAmount": 1,
"originalAmount": 1,
"notes": "<string>",
"paidAt": "<string>",
"lastCaptureAttempt": "<string>",
"nextRetryAt": "<string>"
}
],
"count": 123,
"hasMore": true,
"nextCursor": "<string>"
}Overview
Retrieve a paginated list of payments with optional filtering and sorting. Payments represent scheduled or completed billing transactions for subscriptions—they track when payments are due, their status, and when they were collected.Payment Lifecycle
Scheduled → Pending → Processing → Paid/Failed/Cancelled
| Status | Description |
|---|---|
pending | Payment scheduled, not yet attempted |
processing | Payment attempt in progress |
paid | Payment successfully collected |
failed | Payment attempt failed |
cancelled | Payment was cancelled |
Common Use Cases
Accounts Receivable
Track pending payments and outstanding balances
Collection Dashboard
Monitor failed payments that need attention
Cash Flow Forecasting
Project upcoming revenue from scheduled payments
Customer Billing History
View payment history for specific customers
Filtering Payments
# Get pending payments
GET /v1/payments?status=pending
# Get failed payments that need attention
GET /v1/payments?status=failed
# Get payments for a specific customer
GET /v1/payments?customerId=cust_abc123
# Get payments for a subscription
GET /v1/payments?rentalId=sub_xyz789
# Get payments by due date range
GET /v1/payments?dueDateFrom=2025-01-01&dueDateTo=2025-01-31
# Get payments for a billing group
GET /v1/payments?billingGroupId=bg_abc123
Response Fields
Key fields in each payment object:| Field | Description |
|---|---|
paymentId | Unique payment identifier |
status | Current payment status |
customerId | Customer ID |
rentalId | Associated subscription ID |
billingGroupId | Billing group (if applicable) |
amount | Payment amount |
currency | Currency code (EUR, USD, etc.) |
dueDate | When payment is due |
paidAt | When payment was collected (if paid) |
createdAt | ISO 8601 timestamp |
Example: Get Outstanding Balance
async function getOutstandingBalance(customerId) {
const { payments } = await listPayments({
customerId,
status: 'pending'
});
const total = payments.reduce((sum, p) => sum + p.amount, 0);
return {
customerId,
pendingPayments: payments.length,
totalOutstanding: total,
currency: payments[0]?.currency || 'EUR'
};
}
Example: Upcoming Revenue Forecast
async function getRevenueForecast(daysAhead) {
const today = new Date();
const futureDate = new Date(today.getTime() + daysAhead * 24 * 60 * 60 * 1000);
const { payments } = await listPayments({
status: 'pending',
dueDateFrom: today.toISOString().split('T')[0],
dueDateTo: futureDate.toISOString().split('T')[0]
});
return {
period: `Next ${daysAhead} days`,
expectedPayments: payments.length,
expectedRevenue: payments.reduce((sum, p) => sum + p.amount, 0)
};
}
Related Endpoints
- Get Payment - Get payment details
- Mark Paid - Manually mark as paid
- Cancel Payment - Cancel a payment
- List Subscriptions - View related subscriptions
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Query Parameters
Items per page (default: 50, max: 100)
Cursor for pagination
Filter by status (pending, processing, paid, failed, cancelled)
Filter by customer ID
Filter by rental ID
Filter by billing group ID
Filter by due date from (ISO 8601)
Filter by due date to (ISO 8601)
Was this page helpful?