Leases
Credits

Create a payment intent for a lease

Creates a payment intent for a lease (signing fees, etc.).

Supported methods:

  • stripe: creates a Stripe PaymentIntent; the response contains client_secret for Stripe Elements (web).
  • credit: debits the user's credit balance; the response may contain balance_after.

Prerequisites:

  • The lease must exist (otherwise 404).
  • leases:write permission required.
  • For credits: sufficient balance (otherwise 422 business error).
post/leases/{lease_id}/payment/create-intent

Request

  • Base URL: https://api.faireplace.com/api
  • URL: https://api.faireplace.com/api/leases/{lease_id}/payment/create-intent
  • Auth: HTTP bearer

Path parameters

lease_idstring uuid required

Lease ID

Request body

amountinteger required

Amount in cents (e.g. 2990 = 29.90 EUR).

currencystring required

Currency code (e.g. "eur", "EUR").

payment_method'stripe' | 'credit' required

Payment method for a lease.

  • stripe: card payment via Stripe (PaymentIntent)
  • credit: debit from the user's credit balance
metadataobject nullable

Optional metadata propagated to the payment port. The backend automatically adds lease_id and reason (e.g. "lease_payment").

Example request

{
  "amount": 2990,
  "currency": "eur",
  "payment_method": "stripe"
}

Response

Payment intent created successfully

payment_intent_idstring required

Stripe PaymentIntent ID (e.g. "pi_xxx") or credit transaction ID.

client_secretstring nullable

Client secret for Stripe Elements (web). Absent for credit payments.

status'pending' | 'succeeded' | 'failed' | 'canceled' required

Payment status.

amountinteger required

Amount in cents.

currencystring required
payment_method'stripe' | 'credit' required

Payment method for a lease.

  • stripe: card payment via Stripe (PaymentIntent)
  • credit: debit from the user's credit balance
balance_afterinteger nullable

Credit balance after consumption (only if payment_method = credit).

Example response

{
  "payment_intent_id": "pi_3ABC123xyz",
  "client_secret": "pi_3ABC123xyz_secret_xxx",
  "status": "succeeded",
  "amount": 2990,
  "currency": "eur",
  "payment_method": "stripe",
  "balance_after": 4710
}

Changes

No recorded changes to this operation across all 1 revision of this API.