Bookings and the customer journey
Create, retrieve, and manage bookings through the API, including the storefront checkout flow.
Working with bookings
The bookings endpoints cover two jobs: managing bookings on your side (listing, creating, updating) and the storefront checkout that a shop of your own uses.
Operator bookings
These endpoints need an API key.
List bookings
curl -X GET "https://api.fjellride.se/api/v1/bookings?limit=25" \
-H "x-api-key: fjr_your_api_key_here"Query parameters:
| Parameter | Type | Description |
|---|---|---|
limit | number | Max results (default: 25) |
cursor | string | Cursor for next page |
status | string | Filter by booking status |
fromDate | string | Start date filter (ISO 8601) |
toDate | string | End date filter (ISO 8601) |
searchTerm | string | Search by customer name or booking details |
Get a single booking
curl -X GET "https://api.fjellride.se/api/v1/bookings/150" \
-H "x-api-key: fjr_your_api_key_here"Response:
{
"id": 150,
"status": "RESERVED",
"isPaid": true,
"amountPaidMinor": 70000,
"totalAmountMinor": 70000,
"startDate": "2026-07-01T08:00:00.000Z",
"endDate": "2026-07-03T18:00:00.000Z",
"fromLocationId": 1,
"toLocationId": 1,
"source": "storefront",
"phoneNumber": "+46701234567",
"products": [
{
"productId": 42,
"quantity": 2,
"name": "Mountain Bike, Adult",
"unitPrice": 35000
}
],
"notes": [],
"tags": ["summer-2026"],
"createdAt": "2026-06-28T14:20:00.000Z",
"updatedAt": "2026-06-28T14:22:00.000Z"
}Booking statuses
| Status | Description |
|---|---|
CONCEPT | Draft, not confirmed yet |
PENDING_PAYMENT | Waiting for payment |
RESERVED | Paid and confirmed |
PARTIALLY_PICKED_UP | Some items collected |
PICKED_UP | All items collected |
PARTIALLY_RETURNED | Some items returned |
RETURNED | All items returned |
CANCELLED | Cancelled |
ARCHIVED | Archived |
Create a manual booking
For bookings your staff take, such as walk-ins and phone orders. Anything other than a draft (CONCEPT) needs the customer's customerOrganizationId:
curl -X POST "https://api.fjellride.se/api/v1/bookings/manual" \
-H "x-api-key: fjr_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2026-07-10",
"endDate": "2026-07-12",
"customerOrganizationId": 17,
"fromLocationId": "1",
"toLocationId": "1",
"status": "RESERVED",
"phoneNumber": "+46709876543",
"products": [
{ "productId": "42", "quantity": 1 }
],
"notes": [
{ "text": "Customer prefers the blue bike" }
]
}'Update booking status
curl -X PUT "https://api.fjellride.se/api/v1/bookings/150/status" \
-H "x-api-key: fjr_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{ "status": "PICKED_UP" }'Update payment status
curl -X PUT "https://api.fjellride.se/api/v1/bookings/150/payment-status" \
-H "x-api-key: fjr_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{ "isPaid": true }'Storefront checkout flow
If you build your own storefront, the storefront endpoints take a renter from cart to payment. Fjellride finds the organization from the request's hostname or the x-organization-slug header.
If your storefront has a server, make these calls from it and send your API key in x-api-key. That is the setup we recommend. Reading products, policies and prices works without a key, but creating a checkout holds gear for the renter, so a checkout without a key has to carry a solved challenge (see step 3).
Step 1: Check the cart
Check the renter's cart before checkout. IDs are sent as strings:
curl -X POST "https://api.fjellride.se/api/v1/storefront/cart" -H "Content-Type: application/json" -H "x-organization-slug: your-org-slug" -d '{
"products": [
{ "productId": "42", "quantity": 2 }
],
"startDate": "2026-07-01",
"endDate": "2026-07-03",
"fromLocationId": "1",
"toLocationId": "1"
}'Step 2: Show the operator's policies
If the operator has published rental terms, a cancellation policy or a privacy policy, the renter has to accept them before paying. Fetch them in the renter's language:
curl -X GET "https://api.fjellride.se/api/v1/storefront/policies?locale=en" -H "x-organization-slug: your-org-slug"Each entry in policies has a kind (rentalTerms, cancellation or privacy), a source (hosted or link) and a version. Show the renter each policy (GET /api/v1/storefront/policies/{slug} returns the text of a hosted one, url points to a linked one), ask them to confirm they've read it, and keep the versions they saw. An empty list means there's nothing to accept.
The URLs take a slug, not the kind: rental-terms for rentalTerms, and cancellation and privacy as they are. /storefront/policies/rentalTerms returns 404.
Step 3: Create the checkout
Create the booking and a Stripe payment session from your server. Send the acceptance as policyAcceptance, with the locale the policies were shown in and the version of each one:
curl -X POST "https://api.fjellride.se/api/v1/storefront/checkout" -H "Content-Type: application/json" -H "x-api-key: fjr_your_api_key_here" -d '{
"products": [
{ "productId": "42", "quantity": 2 }
],
"startDate": "2026-07-01",
"endDate": "2026-07-03",
"fromLocationId": "1",
"toLocationId": "1",
"email": "customer@example.com",
"phone": "+46701234567",
"successUrl": "https://your-storefront.com/booking/success",
"cancelUrl": "https://your-storefront.com/booking/cancel",
"policyAcceptance": {
"locale": "en",
"versions": {
"rentalTerms": "sha256:…",
"cancellation": "https://example.com/cancellation"
}
}
}'phone and the operator's checkout custom fields (customFields) are optional.
A storefront without a server. If the checkout call comes from the browser without a key, fetch a challenge from GET /api/v1/storefront/checkout/challenge, solve it with altcha-lib, and send the result as challengeSolution. Solving takes about a second, so start it while the renter fills in their details. Each solution works for one request, even one that fails, so get a new one for every attempt. One IP address can start 10 checkouts without a key in any 10 minutes. The API reference describes the exact format.
Response:
{
"checkoutUrl": "https://checkout.stripe.com/c/pay/cs_live_...",
"bookingId": 151,
"sessionId": "cs_live_abc123",
"accessToken": "eyJhbGci..."
}Send the renter to checkoutUrl to pay.
If the operator has policies and the request has no policyAcceptance, or the versions are out of date because the operator changed a policy in the meantime, you get 409 with the code POLICIES_CHANGED and the current policies. Nothing is saved. Show the renter the new versions and ask again. Requests made with an API key may leave policyAcceptance out.
Step 4: Read the booking as a guest
After payment, fetch the booking with the guest token:
curl -X GET "https://api.fjellride.se/api/v1/storefront/bookings/151?token=eyJhbGci..."Once the payment has gone through, the booking keeps a frozen copy of each hosted policy the renter accepted. Read one with the same token:
curl -X GET "https://api.fjellride.se/api/v1/storefront/bookings/151/terms/rental-terms?token=eyJhbGci..."It answers 404 for a linked policy, an unknown kind, or a booking with no copy yet.
Booking sources
Each booking records its source:
| Source | Where the booking came from |
|---|---|
storefront | The storefront or a booking widget |
api_key | The API, with an API key |
manual | Your staff, in the dashboard |
pos | The on-site point of sale |
Next steps
- Webhooks, payments, and automation: react to booking events as they happen.
- Full API reference: every endpoint, with a way to try it.