Guides & product help, fjellride.se

Back to Integrations & API

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

bash
curl -X GET "https://api.fjellride.se/api/v1/bookings?limit=25" \
  -H "x-api-key: fjr_your_api_key_here"

Query parameters:

ParameterTypeDescription
limitnumberMax results (default: 25)
cursorstringCursor for next page
statusstringFilter by booking status
fromDatestringStart date filter (ISO 8601)
toDatestringEnd date filter (ISO 8601)
searchTermstringSearch by customer name or booking details

Get a single booking

bash
curl -X GET "https://api.fjellride.se/api/v1/bookings/150" \
  -H "x-api-key: fjr_your_api_key_here"

Response:

json
{
  "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

StatusDescription
CONCEPTDraft, not confirmed yet
PENDING_PAYMENTWaiting for payment
RESERVEDPaid and confirmed
PARTIALLY_PICKED_UPSome items collected
PICKED_UPAll items collected
PARTIALLY_RETURNEDSome items returned
RETURNEDAll items returned
CANCELLEDCancelled
ARCHIVEDArchived

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:

bash
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

bash
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

bash
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:

bash
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:

bash
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:

bash
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:

json
{
  "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:

bash
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:

bash
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:

SourceWhere the booking came from
storefrontThe storefront or a booking widget
api_keyThe API, with an API key
manualYour staff, in the dashboard
posThe on-site point of sale

Next steps