Payments API
Create Stripe payment intents for booking payments via Stripe Connect.
The Payments API creates Stripe PaymentIntents for booking payments. Renta uses Stripe Connect to process payments on behalf of each tenant, with automatic application fee collection (Renta's 2.5% fee, capped at 300 a month per tenant).
Monetary values are in cents. An amount of 5500 equals $55.00.
Create Payment Intent
POST /v1/payments/create-intentCreates a Stripe PaymentIntent for a booking. The intent includes the application fee (Renta's transaction fee) actually charged on this payment, after the tenant's monthly cap is applied.
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
booking_id | string | ✅ | Booking to create payment for |
amount | integer | ✅ | Payment amount in cents |
const intent = await renta.payments.createIntent({
booking_id: 'bk_def456',
amount: 10800,
});
console.log(`Payment Intent: ${intent.payment_intent_id}`);
console.log(`Client Secret: ${intent.client_secret}`);
console.log(`Amount: $${(intent.amount / 100).toFixed(2)}`);
console.log(`App Fee: $${(intent.application_fee / 100).toFixed(2)}`);curl -X POST https://api.getrenta.io/v1/payments/create-intent \
-H "Authorization: Bearer renta_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"booking_id": "bk_def456",
"amount": 10800
}'Response:
{
"success": true,
"payment_intent_id": "pi_stripe_abc123",
"client_secret": "pi_stripe_abc123_secret_xyz",
"amount": 10800,
"application_fee": 270
}Application Fees
Renta charges a 2.5% fee per booking, capped at $300 per month for each tenant. Once a tenant's Renta fees reach $300 in a calendar month, payments carry no Renta fee until the next month starts.
- Month — the calendar month in the tenant's own time zone.
- Reaching the cap — the payment that reaches the cap carries only what is left (with $290 used so far, a $20 fee becomes $10). Later payments that month carry no fee.
- Currency — the cap is a round equivalent of US$300 per currency (for example CA$400, €300, £250, A$450, NZ$500, MX$6,000, ¥45,000). An unsupported currency is not capped.
- What counts — fees on every charge for a booking, including fees Renta keeps on cancelled or refunded bookings. Fees returned when a booking fails to go through do not count.
- Flat plan — a tenant still on the legacy Flat plan has no per-booking fee, so
application_feeis0.
The application_fee in the response is the fee actually charged on this PaymentIntent. It can be lower than 2.5% of the amount, or 0, once the tenant reaches its monthly cap. Price previews from the Pricing API return the full 2.5% as an upper bound.
Using the Client Secret
Pass the client_secret to Stripe.js on the frontend to confirm the payment:
import { loadStripe } from '@stripe/stripe-js';
const stripe = await loadStripe('pk_live_...');
const { error } = await stripe.confirmCardPayment(intent.client_secret, {
payment_method: {
card: cardElement,
billing_details: {
name: 'John Doe',
},
},
});
if (error) {
console.error(error.message);
} else {
console.log('Payment successful!');
}The tenant must have Stripe Connect configured. If Stripe credentials are not set up, the endpoint returns 500 Internal Error.
Error Responses
| Status | Type | When |
|---|---|---|
402 | payment_failed | Stripe rejected the payment |
404 | not_found | Booking not found |
500 | internal_error | Stripe not configured or server error |