Dayrate Booking
The hosted dayrate API coordinates availability, booking policy, free or allotment-backed booking, paid checkout, and payment reconciliation. Your application consumes one API contract while Sweet Potato operates the underlying service.
Mental Model
Hosted Integration
- Read availability from the staging application.
- Submit a booking through the authorized customer client.
- For a paid path, redirect to the returned checkout URL.
- Confirm completion from the hosted booking status after webhook reconciliation.
curl --fail-with-body \
-H "X-API-Key: $SPAPS_API_KEY" \
https://api.sweetpotato.dev/api/dayrate/availabilityBooking Paths
| Path | Meaning |
|---|---|
| Free booking | Policy or entitlement permits the authenticated user to book without checkout |
| Allotment booking | The authenticated user’s eligible allowance is consumed instead of charging |
| Paid booking | SPAPS creates a Stripe checkout and reconciles completion through webhook handling |
Free redemption binds to the verified user session. A guest request or a secret key without a user token stays on the paid path; supplying a user ID in the body does not grant free eligibility.
Common Mistakes
Do not mark a paid booking complete from the browser redirect alone. Use Stripe webhook reconciliation so payment state comes from the trusted server-side event path.
- Treating booking policy as frontend-only logic.
- Forgetting to test paid, free, and allotment paths separately.
- Mixing staging and production product, policy, or booking identifiers.