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 based on the tenant's subscription tier.
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) based on the tenant's subscription tier.
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 collects a transaction fee based on the tenant's subscription tier:
| Tier | Transaction Fee |
|---|---|
| Free | 3% per booking |
| Launch | 2.5% per booking |
| Grow | 2.5% per booking |
| Pro | 0% (no transaction fee) |
The application_fee in the response shows the calculated Renta fee.
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 |