Skip to main content
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>'
{
  "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>"
  }
}

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

FieldDescription
paymentIdUnique payment identifier
statuspending, processing, paid, failed, cancelled
customerIdAssociated customer ID
rentalIdAssociated subscription ID
billingGroupIdBilling group ID (for B2B)
amountPayment amount
currencyCurrency code
dueDateWhen payment is due
paidAtWhen payment was collected
failedAtWhen payment failed (if applicable)
failureReasonWhy payment failed
createdAtWhen payment was created
updatedAtLast modification timestamp

Payment Status Details

StatusMeaningCan Transition To
pendingAwaiting collectionprocessing, cancelled
processingCollection in progresspaid, failed
paidSuccessfully collected— (final)
failedCollection failedprocessing (retry), cancelled
cancelledPayment 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
  };
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

paymentId
string
required

The payment ID

Response

Payment details

success
enum<boolean>
required
Available options:
true,
false
payment
object
required