This guide uses Laravel’s built-in HTTP client to call the OurPay REST API. No unofficial framework adapter is required. Use the sandbox environment while developing so test data stays separate from live customers and payments.

Configure Laravel

Create an organization access token and a webhook endpoint secret, then add them to .env:
Terminal
Switch OURPAY_API_URL to https://api.ourpay.dev only when you are ready to use live data. Expose the values through config/services.php so cached Laravel configuration works correctly:
Every API example pins the 2026-10 API version with the OurPay-Version header.

List products

Register a route:
Create the controller:
Render a normal link for each product:

Create a hosted checkout

Register the checkout and confirmation routes:
Create a checkout on your server, then redirect the browser to the returned hosted URL:
The confirmation page may retrieve the checkout for display:
Do not grant access from the browser redirect alone. Treat a verified order.paid or applicable subscription webhook as the fulfillment signal.

Verify webhooks

Create an endpoint in the dashboard under Settings → Webhooks, select the events your app needs, and point it at https://your-app.example/api/webhook/ourpay. Register the route:
Verify the signature against the exact raw request body before decoding JSON. OurPay uses HMAC SHA-256 over {webhook-id}.{webhook-timestamp}.{raw-body} and can send more than one versioned signature in the header.
Webhook deliveries can be retried. Store webhook-id with a unique constraint before performing side effects, and dispatch slow fulfillment work to a queue only after verification succeeds. For local testing, expose Laravel with a tunnel such as ngrok http 8000, then use the HTTPS URL as the webhook endpoint. Keep the same raw-body and signature checks enabled in every environment.