Get a payment
curl --request GET \
--url https://api-eu.flexportal.io/v1/payments/{paymentId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/payments/{paymentId}"
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/{paymentId}', 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/{paymentId}",
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/{paymentId}"
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/{paymentId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/payments/{paymentId}")
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,
"payment": {
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Payments
Get Payment
Retrieves a specific payment by ID.
GET
/
v1
/
payments
/
{paymentId}
Get a payment
curl --request GET \
--url https://api-eu.flexportal.io/v1/payments/{paymentId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/payments/{paymentId}"
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/{paymentId}', 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/{paymentId}",
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/{paymentId}"
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/{paymentId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/payments/{paymentId}")
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,
"payment": {
"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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Retrieve details for a single payment by its ID. Use this endpoint to check payment status, view payment history, or get details for customer support inquiries.Response Fields
| Field | Description |
|---|---|
paymentId | Unique payment identifier |
status | pending, processing, paid, failed, cancelled |
customerId | Associated customer ID |
rentalId | Associated subscription ID |
billingGroupId | Billing group ID (for B2B) |
amount | Payment amount |
currency | Currency code |
dueDate | When payment is due |
paidAt | When payment was collected |
failedAt | When payment failed (if applicable) |
failureReason | Why payment failed |
createdAt | When payment was created |
updatedAt | Last modification timestamp |
Payment Status Details
| Status | Meaning | Can Transition To |
|---|---|---|
pending | Awaiting collection | processing, cancelled |
processing | Collection in progress | paid, failed |
paid | Successfully collected | — (final) |
failed | Collection failed | processing (retry), cancelled |
cancelled | Payment cancelled | — (final) |
Common Use Cases
- Customer Support: Look up payment details for billing inquiries
- Reconciliation: Match payments with bank transactions
- Debugging: Investigate failed payment reasons
Example: Check Payment Status
async function getPaymentSummary(paymentId) {
const payment = await getPayment(paymentId);
return {
paymentId: payment.paymentId,
amount: `${payment.currency} ${payment.amount}`,
status: payment.status,
dueDate: payment.dueDate,
isPaid: payment.status === 'paid',
paidDate: payment.paidAt || null,
failureReason: payment.failureReason || null
};
}
Related Endpoints
- List Payments - Browse all payments
- Mark Paid - Manually mark as paid
- Cancel Payment - Cancel payment
- Get Subscription - View related subscription
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The payment ID
Was this page helpful?