API Reference

Base URLs

EnvironmentBase URL
Productionhttps://api.pedalheads.com (behind Cloudflare)

All routes are prefixed with /api and return JSON.

Readiness check

A lightweight health endpoint used to confirm a deployment is live:

GET /api/readyness

Authentication

Authentication uses Laravel Sanctum bearer tokens.

  • POST /api/login — obtain a token (IP throttled)
  • POST /api/register — create an account (IP throttled)
  • POST /api/logout
  • POST /api/forgot-password / POST /api/forgot-password/reset
  • GET /api/verify-email / POST /api/verify-email/resend

Authenticated routes are protected by the auth:sanctum middleware. Sensitive public endpoints are additionally protected by IP rate limiting (ip.throttle) and, where appropriate, Cloudflare Turnstile.

Endpoint groups

GroupExample routesPurpose
Catalog/programs, /locations, /cities, /province-state, /neighbourhood, /skill-levelsReference data for building the booking UI.
Camp search/camp-search/{...}, /camp-search-v2/{...}, /camp-map/{...}, /camps/search/{...}Search camps by region, city, program and skill level. A V2 search exists alongside the original.
Registration dates/reg-dates/all, /reg-dates/region/{...}, /reg-dates/upcomingWhen registration opens.
Cart/cart, /cart/bundle, /cart/promocode, /cart/checkoutBuild and check out a cart.
Orders & payments/order/create, /order/checkout-token, /order/status, /order/sezzle/*Create orders and process payments (Converge/Elavon and Sezzle).
Customer account/customer/details, /customer/registrants, /customer/registrations, /customer/orders/{id}, /customer/payment-methods, /customer/credit-card/*, /customer/monthly-payment*Authenticated self-service account management.
Admin/admin/cart/*, /admin/order/*, /admin/registration/*, /admin/customer/*, /admin/allocations/reportBack-office operations.
Marketing / misc/contact/send, /contact/send-chinese, /friendbuy/*Contact forms and referral webhooks.

:::note This is a high-level map, not an exhaustive list. See src/routes/api.php for the authoritative set of routes. :::

Standard response format

Every response follows the same envelope. Controllers use the App\Traits\ApiHttpResponses trait to produce it consistently.

{
  "success": true,
  "message": "This is a response message",
  "data": null,
  "errors": null
}
FieldTypeDescription
successbooleantrue if the request succeeded, false otherwise.
messagestringHuman-readable description of the result.
datamixedPayload (object, array, or null).
errorsmixedError / validation details, or null when there are none.

Using the response helpers

Include the trait at the top of a controller:

use App\Traits\ApiHttpResponses;

class ExampleController extends Controller
{
    use ApiHttpResponses;
}

Then return standardized responses:

return $this->respondSuccess([
    'message' => 'Your response message',
    'data' => ['your', 'data'],
]);

return $this->respondError([ /* ... */ ]);
return $this->respondNotFound([ /* ... */ ]);
return $this->respondUnauthenticated([ /* ... */ ]);
return $this->respondForbidden([ /* ... */ ]);
return $this->respondCreated([ /* ... */ ]);
return $this->respondFailedValidation([ /* ... */ ]);

Standard resource result

Resource responses nest id, attributes, and relationships under data:

{
  "success": true,
  "message": "Example retrieved successfully",
  "data": {
    "id": "1",
    "attributes": {
      "name": "Example Name",
      "description": "Example Description"
    },
    "relationships": {
      "id": "1",
      "name": "Example Name"
    }
  },
  "errors": null
}
  • data.id — unique identifier of the resource.
  • data.attributes — the resource’s properties.
  • data.relationships — related resources.

Client handling guidance

Branch on the success field: when true, read data; when false, surface message to the user or handle errors. Response shapes vary per endpoint, so refer to the specific controller for details.