Renta Docs

Storefront Checkouts

Take a booking and its card payment on your own site — hold the items, collect the payment with Stripe.js, then confirm.

Two endpoints let you build your own checkout on top of Renta, with the same prices, rules and money handling as the booking widget:

  1. POST /v1/storefront/checkouts holds the items for 10 minutes and creates a Stripe PaymentIntent for what is owed now.
  2. You collect the card on your page with Stripe.js, using the client_secret from step 1.
  3. POST /v1/storefront/checkouts/{booking_id}/confirm turns the paid hold into a confirmed booking.

Every amount is in cents of the shop's currency (10800 = $108.00). These endpoints have no test mode: they hold real inventory and take real payments, so they accept live keys only (renta_pk_live_… or renta_sk_live_…). A test key gets 403 live_key_required.

Authentication

Both endpoints need the storefront:read scope, which every publishable key has.

KeyWhere to use itExtra limits
Publishable renta_pk_live_…In the browser, on the shop's own websitePer-IP limits (below); Idempotency-Key, when sent, must be 32+ characters
Secret renta_sk_live_…On the shop's own server onlyYour plan's per-key limit only

A partner key without storefront:read gets 403 forbidden. The shop always comes from the API key; nothing in the body can name another shop.

Calling from a browser (CORS)

A browser may call these two endpoints only from a website the shop owns:

  • one of the shop's verified custom domains (Settings → Custom Domain, status active), over https://; or
  • the shop's Renta storefront host (https://getrenta.io, where /shops/{slug} pages live).

From any other site (another shop's domain, a domain still being verified, plain http://, a non-default port such as https://shop.example:8443, a sandboxed frame) the answer is 403 origin_not_allowed with no CORS headers, and nothing is held, charged or confirmed. Answers to an allowed site echo its exact origin in Access-Control-Allow-Origin with Vary: Origin, and expose Retry-After, X-Request-Id, Idempotent-Replayed and the X-RateLimit-* headers to your script. Credentials (cookies) are never used: the key travels in the Authorization header. Preflight (OPTIONS) allows POST with the Authorization, Content-Type and Idempotency-Key headers, is cached by the browser for 10 minutes, and is limited to 60 per 15 minutes per IP. Over that limit the preflight answers 429 with no CORS headers, so the browser reports a CORS error and does not send the real request; wait and try again.

The API key is checked before the site. So a missing or invalid key (401), a key without the scope (403 forbidden) and the per-key 429 are answered without CORS headers: in a browser they show up as a network (CORS) error, with no readable status, body or Retry-After. Check your key from a server or with cURL if every browser call fails that way. Every other answer, including the per-IP 429s below, is readable by an allowed site.

Server-to-server calls send no Origin header and are not affected.

Create a Checkout

POST /v1/storefront/checkouts

Places a 10-minute pending_payment hold and creates the shop's PaymentIntent on its connected Stripe account. Prices, taxes, required add-ons, coupons, delivery and Renta's fee are all worked out by Renta; you cannot send a price.

Request body (unknown fields are refused with 400 validation_error, never ignored):

FieldTypeRequiredDescription
pickup_datestring✅ISO 8601 date-time
return_datestring✅ISO 8601 date-time
line_itemsarray✅1–100 lines: fleet_item_id (uuid), quantity (default 1), optional characteristics ({"Size": "L"}), package_id, bundle_characteristics, line_range_start / line_range_end (send both or neither)
pickup_location_iduuid | null—Pickup location
half_dayboolean—Half-day pricing (default false)
coupon_codestring | null—Coupon to apply
addonsarray—addon_id (uuid), quantity, optional option_label
checkout_addon_idsstring[]—Checkout add-ons the customer picked (required ones are added anyway)
checkout_responsesarray—Answers to the shop's checkout questions: script_id, kind (questionnaire, signature, checkbox, text), key, value, optional prompt
delivery_selectionsarray—script_id, destination (the delivery address; required, an empty or null address is refused with 400), round_trip. Renta works out the distance itself. A step the shop doesn't offer for this booking, or the same step twice, is refused too
customer_name, customer_email, customer_phonestringone of two waysA new guest. If that email or phone already belongs to a customer, you get 403 customer_verification_required
customer_id + customer_proofstringone of two waysA customer already on file, with the signed proof Renta gave you for them
identity_return_urlurl—Where Stripe Identity sends the customer back to, when the shop requires an ID check

Gift cards and bookings whose only payment is a security deposit are not offered here (422 gift_cards_not_supported, 422 deposit_only_not_supported): use the shop's hosted checkout for those.

curl https://api.getrenta.io/v1/storefront/checkouts \
  -H "Authorization: Bearer renta_pk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0d9c8b7a-6f5e-4d3c-8b2a-190f8e7d6c5b" \
  -d '{
    "pickup_date": "2027-07-01T09:00:00Z",
    "return_date": "2027-07-02T09:00:00Z",
    "line_items": [{ "fleet_item_id": "8f1c2d3e-4b5a-4c6d-9e8f-7a6b5c4d3e2f", "quantity": 1 }],
    "customer_name": "Gina Guest",
    "customer_email": "gina@example.com"
  }'

Response 201 (Cache-Control: no-store; it carries secrets):

{
  "booking_id": "3b2a1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
  "confirmation_number": "RNT-7K2Q",
  "status": "pending_payment",
  "reservation_token": "eyJ...",
  "reservation_expires_at": "2027-06-20T18:10:00.000Z",
  "hold_minutes": 10,
  "customer_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
  "customer_proof": "eyJ...",
  "total": 10800,
  "renta_fee_amount": 324,
  "charge_total": 11124,
  "payment_required": true,
  "client_secret": "pi_3Q..._secret_...",
  "payment_intent_id": "pi_3Q...",
  "stripe_publishable_key": "pk_live_...",
  "stripe_account_id": "acct_1N..."
}
FieldDescription
booking_id, confirmation_numberThe hold. Use booking_id in the confirm URL
reservation_tokenProof that this caller made the hold. Required by confirm; keep it secret
reservation_expires_at, hold_minutesThe hold ends 10 minutes after it was made
customer_id, customer_proofcustomer_proof is returned only when this request created a new guest. Keep it to reuse the same customer on a retry
totalWhat the booking costs (owed to the shop)
renta_fee_amount, charge_totalRenta's fee and the amount the customer is charged now
payment_requiredfalse when nothing has to be paid by card: there is then no PaymentIntent, and you go straight to confirm without payment_intent_id
client_secret, payment_intent_idThe PaymentIntent to confirm with Stripe.js
stripe_publishable_key, stripe_account_idInitialise Stripe.js with these (stripeAccount is the shop's connected account)
down_paymentPresent when the shop takes a deposit-style down payment: amount_due_now, charge_total_now, balance_due_later, balance_due_later_charged

A refusal after the customer step (for example the items just sold out) carries customer_id and customer_proof in error.details when this request created the guest, so a retry reuses that customer.

You never cancel a hold: an unpaid hold expires by itself after 10 minutes and the items are released.

Confirm a Checkout

POST /v1/storefront/checkouts/{booking_id}/confirm

Call this after Stripe.js reports the payment succeeded. It credits the payment to the booking exactly once and confirms it. Repeating the call is always safe: it returns the same booking and credits nothing again.

Request body:

FieldTypeRequiredDescription
reservation_tokenstring✅From the checkout response
payment_intent_idstringwhen payment_required was trueThe PaymentIntent the customer paid

Response 200:

{
  "booking_id": "3b2a1c0d-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
  "status": "confirmed",
  "amount_paid": 10800,
  "amount_owed": 0,
  "confirmation_number": "RNT-7K2Q"
}

A 200 always shows the payment already counted.

409 payment_processing: wait and repeat, never charge again

The customer has paid, but the money is not on the booking yet: Stripe's own notice is applying the same payment at that moment, or Stripe still reports the card payment as processing (rare, and short). Checkouts offer instant payment methods only (cards, including Apple Pay and Google Pay); no bank debit that takes days to clear is offered, because the hold lasts 10 minutes. A hold made through this API can only be paid with the PaymentIntent this API created for it: the website's own payment step refuses it. The answer has a Retry-After header (seconds) and error.details.retry_after_seconds:

{
  "error": {
    "code": "payment_processing",
    "message": "The payment was received and is being applied to the booking. Do not charge the customer again. Repeat this request in a few seconds to read the final amounts.",
    "details": { "booking_id": "3b2a1c0d-...", "retry_after_seconds": 2 }
  }
}

Wait Retry-After seconds and repeat the same confirm call. Do not take a second payment. A 409 is never stored for idempotent replay, so the repeat reads the final figures. Repeats that carry this booking's own reservation_token do not use up the visitor's general limit (see Rate limits). If a repeat made more than 2 minutes after the payment was received still finds it unapplied, the shop's staff are told automatically (nobody is told if you stop repeating, so keep repeating while the hold lasts). Either way the customer's money is never lost: while the hold is alive Stripe's notice confirms the booking on its own, and once the hold has ended the payment is refunded in full.

Late and duplicate payments are refunded

  • The hold ended first. If the payment arrives after the 10-minute hold expired, or after the hold was cancelled before it was confirmed, the payment is refunded in full (an uncaptured authorisation is cancelled) and confirm answers 410 reservation_expired. Start a new checkout. The same refund happens if nobody calls confirm: Renta's Stripe webhook refunds a payment that lands on a dead hold.
  • A second payment for an already paid booking. It is refunded in full only when Renta's money records prove it was not credited anywhere; the booking's own payment is never refunded. When that cannot be proven, nothing is refunded and the shop's staff are told.
  • An underpayment (less than the hold's amount) is refunded in full and answers 409 amount_mismatch with details.reserved and details.charged in cents.
  • A payment in a different currency from the booking is not applied (409 payment_currency_mismatch); contact the shop.

Idempotency

Send an Idempotency-Key header to make a retry safe. A repeat with the same key and the same body returns the stored answer (Idempotent-Replayed: true, Cache-Control: no-store) and does nothing again.

  • With a publishable key the key must be at least 32 characters and random — use a UUID v4 (crypto.randomUUID()), new for every request. A shorter key is refused with 400 invalid_idempotency_key. (A publishable key is public, so a short key could be guessed.) Secret keys may use any length up to the maximum.
  • Keys are scoped to the route: the same key sent to the checkout and to confirm are two separate records.
  • Only successful (2xx) answers are stored, for 24 hours. Errors, including 409 payment_processing, are not.
  • A checkout is replayed only until its reservation_expires_at. This is a clock check: before that time the stored answer is replayed even if the hold was meanwhile paid or cancelled (confirm is what tells you the booking's real state). After it, a repeat answers 409 checkout_expired and the payment secret is not sent again: start a new checkout with a new key.
  • The same key with a different body answers 422 idempotency_key_in_use.

Rate Limits

On top of your plan's per-key limit (Authentication), publishable keys have per-IP limits:

EndpointLimit
Create a checkout10 per 15 minutes per IP
Confirm, with this booking's own reservation_token120 per 15 minutes per booking, and 300 per 15 minutes per IP across bookings
Confirm, anything else (no token, or one that does not match)10 per 15 minutes per IP

Over a per-IP limit the answer is 429 rate_limited with Retry-After, readable by your page. The per-key limit is checked before the site, so in a browser its 429 shows up as a CORS error (see above). Secret keys (a shop server, one IP for every customer) have the per-key limit only.

Errors

Errors have the shape { "error": { "code", "message", "details"? } }. Every checkout answer is Cache-Control: no-store.

Both endpoints

StatusCodeMeaning
400validation_errorThe body does not match the schema (unknown fields included); details.errors lists the fields
400invalid_requestThe body is not a JSON object
400invalid_idempotency_keyIdempotency-Key is empty, too long, or (publishable key) shorter than 32 characters
401unauthorizedMissing or invalid API key
403forbiddenThe key lacks storefront:read
403live_key_requiredA test-mode key; there is no test mode
403origin_not_allowedBrowser call from a site the shop does not own (see CORS)
422idempotency_key_in_useSame Idempotency-Key, different body
429rate_limitedOver a limit; see Retry-After

Create a checkout

StatusCodeMeaning
403customer_verification_requiredThe email or phone belongs to an existing customer: send customer_id + customer_proof
403shop_frozen, shop_not_liveThe shop is not taking online bookings
409availability_conflictThe items are not available for those dates
409booking_already_existsThis customer already has a booking (not a pending hold) for this exact cart; details names it. Nothing new was held or charged
409checkout_in_progressA checkout for this cart already has a payment applied
409checkout_expiredIdempotent replay of a checkout whose hold has ended
422gift_cards_not_supported, deposit_only_not_supportedUse the shop's hosted checkout
400package_requiredThe item is priced by package: send package_id
400addon_not_foundAn addons id or a checkout_addon_ids step this shop doesn't have (removed, or another shop's). Nothing was held: reload the shop's add-ons and checkout, drop it, and try again
429demo_limit_reachedThe shop has reached its monthly booking limit
500internal_error, payment_intent_failedNothing was charged; try again
503service_unavailableTry again

Other refusals from the shop's checkout rules (opening hours, minimum rental, coupon rules, …) keep the code and customer-facing message the website shows, in lower case.

Confirm

StatusCodeMeaning
400reservation_token_requiredreservation_token is missing
402payment_not_acceptedThe PaymentIntent has not succeeded
403reservation_token_invalidThe token is forged, expired, or for another booking
404booking_not_foundNo such booking for this shop
409payment_processingPaid, being applied: wait Retry-After and repeat; never charge again
409amount_mismatchUnderpaid; the payment was refunded
409payment_currency_mismatchWrong currency; not applied
410reservation_expiredThe hold ended before the payment; the payment is refunded
500confirm_failedNot confirmed and nothing refunded by this request; repeat it
500confirm_summary_unavailableConfirmed, but the figures could not be read; repeat to read them

End-to-end Example

A browser checkout on the shop's own site, with Stripe.js and the Payment Element.

<script src="https://js.stripe.com/v3/"></script>
<form id="pay"><div id="payment-element"></div><button>Pay</button></form>
const RENTA = 'https://api.getrenta.io/v1';
const KEY = 'renta_pk_live_...';

// Throws on a network error (or an answer the browser hides, see CORS above).
async function renta(path, body, idempotencyKey) {
  const res = await fetch(`${RENTA}${path}`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${KEY}`,
      'Content-Type': 'application/json',
      'Idempotency-Key': idempotencyKey,
    },
    body: JSON.stringify(body),
  });
  return { res, json: await res.json().catch(() => null) };
}

// 1. Hold the items and get the PaymentIntent.
const { res, json: checkout } = await renta('/storefront/checkouts', {
  pickup_date: '2027-07-01T09:00:00Z',
  return_date: '2027-07-02T09:00:00Z',
  line_items: [{ fleet_item_id: '8f1c2d3e-4b5a-4c6d-9e8f-7a6b5c4d3e2f', quantity: 1 }],
  customer_name: 'Gina Guest',
  customer_email: 'gina@example.com',
}, crypto.randomUUID());
if (res.status !== 201) throw new Error(checkout.error.message);

// 2. Collect the card on the shop's connected account.
const confirmKey = crypto.randomUUID(); // reuse for every repeat of step 3
const holdEndsAt = Date.parse(checkout.reservation_expires_at);
const RETRY = new Set(['payment_processing', 'rate_limited', 'confirm_failed', 'confirm_summary_unavailable']);
const wait = (seconds) => new Promise((r) => setTimeout(r, seconds * 1000));

async function confirmBooking() {
  // Keep repeating (same body, same Idempotency-Key) while the hold lasts: a repeat is always
  // safe, it never charges or credits twice. do/while: the first call is always made, even if
  // this device's clock runs fast.
  do {
    let res, json;
    try {
      ({ res, json } = await renta(
        `/storefront/checkouts/${checkout.booking_id}/confirm`,
        {
          reservation_token: checkout.reservation_token,
          ...(checkout.payment_required ? { payment_intent_id: checkout.payment_intent_id } : {}),
        },
        confirmKey,
      ));
    } catch {
      await wait(2); // network error or a CORS-hidden answer: try again
      continue;
    }
    const error = json?.error ?? {};
    if (res.status === 200 && json) return { outcome: 'confirmed', booking: json };
    // No readable body (a proxy page, a cut-off answer), a 5xx, or a code that means "repeat".
    if (!json || res.status >= 500 || RETRY.has(error.code)) {
      await wait(Number(res.headers.get('Retry-After')) || 2);
      continue;
    }
    return { outcome: 'refused', error }; // e.g. 410 reservation_expired: refunded
  } while (Date.now() < holdEndsAt + 60_000);
  // We could not read a final answer. The payment is safe: Stripe's notice confirms the
  // booking, or refunds the payment if the hold ended. Never take a second payment.
  return { outcome: 'pending' };
}

function showResult(result, paid) {
  if (result.outcome === 'confirmed') return showConfirmation(result.booking.confirmation_number);
  if (result.outcome === 'refused') return showError(result.error.message ?? 'The booking could not be completed.');
  // Never tell a customer whose payment went through that they were not charged.
  return paid
    ? showMessage('Payment received. Your confirmation is on its way by email. If the booking cannot be completed, the payment is refunded automatically.')
    : showMessage('We could not finish your booking. Please try again in a moment.');
}

if (!checkout.payment_required) {
  // 3a. Nothing to pay by card: confirm straight away.
  showResult(await confirmBooking(), false);
} else {
  const stripe = Stripe(checkout.stripe_publishable_key, { stripeAccount: checkout.stripe_account_id });
  const elements = stripe.elements({ clientSecret: checkout.client_secret });
  elements.create('payment').mount('#payment-element');

  document.getElementById('pay').addEventListener('submit', async (e) => {
    e.preventDefault();
    const { error, paymentIntent } = await stripe.confirmPayment({
      elements,
      redirect: 'if_required',
      confirmParams: { return_url: `${location.origin}/booking/done` },
    });
    if (error) return showError(error.message); // not charged; the hold stays until it expires
    if (paymentIntent.status === 'succeeded' || paymentIntent.status === 'processing') {
      // 3. Confirm the booking.
      showResult(await confirmBooking(), true);
    }
  });
}

Apple Pay on the shop's own domain. The Payment Element shows Apple Pay only on a domain registered for the shop's connected Stripe account (Stripe's payment method domains). Until the shop's checkout domain is registered there, the card form still works but the Apple Pay button does not appear.

If Stripe redirects the customer (some payment methods do), call confirm from your return_url page with the booking_id, reservation_token and payment_intent_id you kept.

Confirm within the 10-minute hold. A payment that completes after the hold ended is refunded, and the customer has to start again.

Storefront Checkouts | Renta Docs