Deposits API
Place, capture, and release authorization holds for rental deposits.
The Deposits API manages security deposit authorization holds via Stripe. Place a hold on the customer's card at booking, then capture (charge) or release (refund) it when the rental is returned.
Deposit Lifecycle
Hold → [Rental Period] → Capture (damage) or Release (no damage)| Status | Description |
|---|---|
pending | Queued or awaiting the customer. Nothing is on the card yet |
held | Authorization hold active on card |
renewing | Hold is being re-authorized on a fresh authorization; the money is still on the card |
captured | Full or partial amount charged |
partial_captured | Part of the hold was captured |
released | Hold released, no charge |
failed | Hold failed (e.g., insufficient funds) |
collected | Cash or other deposit taken and held by the shop (no card hold) |
returned | Cash or other deposit handed back to the customer |
Place Hold
POST /v1/deposits/holdPlaces an authorization hold on the customer's payment method.
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
booking_id | string | ✅ | Associated booking |
customer_id | string | ✅ | Customer the hold is for |
amount | integer | ✅ | Hold amount in cents (any amount of at least 1 cent, see below) |
payment_method_id | string | Stripe payment method ID | |
auto_release_at | string (ISO 8601) | When the hold is released automatically. Defaults to the shop's deposit policy, see below |
The amount is free-form
The API holds exactly the amount you send. It is not checked against the deposit configured on the booking's fleet items, so you may hold more or less than the shop's usual deposit. The only fleet check: if the booking's items now carry a $0 deposit, the hold is refused with 422 booking_not_eligible.
Release date. If you omit auto_release_at, the hold follows the shop's deposit policy: it is released automatically at the booking's return plus the shop's post-return hold window (for example 48 hours). No release date is set when the shop releases deposits by hand, when that time has already passed, or when the request targets an existing hold or takes over a hold the booking already had queued (that hold keeps its own date). While the booking is still confirmed or active, the hold is kept and re-authorized instead of released.
const hold = await renta.deposits.hold({
booking_id: 'bk_def456',
customer_id: 'cus_ghi789',
amount: 15000,
payment_method_id: 'pm_stripe_123',
});
console.log(`Deposit ID: ${hold.deposit_hold_id}`);
console.log(`Amount: $${(hold.amount / 100).toFixed(2)}`);curl -X POST https://api.getrenta.io/v1/deposits/hold \
-H "Authorization: Bearer renta_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"booking_id": "bk_def456",
"customer_id": "cus_ghi789",
"amount": 15000,
"payment_method_id": "pm_stripe_123"
}'Response:
{
"success": true,
"deposit_hold_id": "dep_abc123",
"payment_intent_id": "pi_stripe_hold_123",
"client_secret": "pi_stripe_hold_123_secret_xyz",
"amount": 15000
}Error Responses
| Status | Type | When |
|---|---|---|
402 | payment_failed | The card or bank refused the hold (declined, insufficient funds, 3D Secure needed) or the customer has no usable card |
403 | live_payments_not_approved | The business can't take live card payments yet |
404 | not_found | Booking, customer or the targeted hold not found |
409 | conflict | The booking's deposit state forbids this hold: it already has a hold, a deposit payment link is out, the card already covers the deposit, or the targeted hold has moved on or has a different amount |
422 | booking_not_eligible | The booking takes no card hold (its items' deposit is $0) |
422 | invalid_request | Stripe rejected the request itself (for example no such customer). Sending it again unchanged will not help |
502 | payment_provider_error | Stripe failed; nothing was charged. Retry later |
503 | service_unavailable | The shop's deposit settings could not be read; nothing was placed. Retry later |
Capture Deposit
POST /v1/deposits/captureCapture all or part of a held deposit (e.g., for damage).
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
deposit_hold_id | string | ✅ | Deposit hold ID |
amount | integer | Amount to capture in cents (can be less than hold amount). Omit to capture the full hold |
// Capture $50 of a $150 hold for minor damage
await renta.deposits.capture({
deposit_hold_id: 'dep_abc123',
amount: 5000,
});curl -X POST https://api.getrenta.io/v1/deposits/capture \
-H "Authorization: Bearer renta_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"deposit_hold_id": "dep_abc123",
"amount": 5000
}'Response:
{
"success": true,
"captured_amount": 5000
}You cannot capture more than the held amount. Attempting to capture a deposit that's already been released returns 409 Conflict.
Release Deposit
POST /v1/deposits/releaseRelease a held deposit back to the customer (no damage).
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
deposit_hold_id | string | ✅ | Deposit hold ID |
await renta.deposits.release({
deposit_hold_id: 'dep_abc123',
});curl -X POST https://api.getrenta.io/v1/deposits/release \
-H "Authorization: Bearer renta_sk_live_..." \
-H "Content-Type: application/json" \
-d '{"deposit_hold_id": "dep_abc123"}'Response:
{
"success": true
}Holds are not released automatically when a booking is completed. The scheduled deposits job runs every 15 minutes: it places queued holds and, when a held deposit reaches its scheduled check date, releases it or re-authorizes it on a fresh hold. Capture or release a hold yourself with the calls above.