Documentation Index Fetch the complete documentation index at: https://docs.ollie.shop/llms.txt
Use this file to discover all available pages before exploring further.
Request functions handle incoming HTTP requests from users. Theyβre your main API endpoints that process user interactions, validate data, and execute business logic.
When to Use
User authentication and registration
Form submissions and data processing
API endpoints and webhook handlers
E-commerce transactions and payments
What They Do
Receive HTTP requests (GET, POST, PUT, DELETE)
Validate and process input data
Execute business logic
Return responses to users
How Request Functions Work
User makes HTTP request to your function via hub URL
Hub routes request to your function with authentication
Function processes request data and executes business logic
Response returned to user with any Hub enhancements
Request Function Examples
Product Search
Order Processing
User Authentication
Webhook Handler
Handle product search with filters and pagination: Sample URL: https://hub.ollie.app/https://api.mystore.com/products/search?search=laptop&category=electronics&minPrice=500&maxPrice=2000&page=1
Input Data
Function Implementation
Standard Response
{
"queryStringParameters" : {
"search" : "laptop" ,
"category" : "electronics" ,
"minPrice" : "500" ,
"maxPrice" : "2000" ,
"page" : "1"
}
}
π See Hub Enhancements
{
"products" : [
{
"id" : "prod_123" ,
"name" : "MacBook Pro 14-inch" ,
"price" : 1899.99 ,
"category" : "electronics" ,
"inStock" : true ,
"rating" : 4.8 ,
"imageUrl" : "https://cdn.mystore.com/prod_123.jpg" ,
"slug" : "macbook-pro-14-inch"
},
{
"id" : "prod_456" ,
"name" : "Dell XPS 13" ,
"price" : 1299.99 ,
"category" : "electronics" ,
"inStock" : true ,
"rating" : 4.6 ,
"imageUrl" : "https://cdn.mystore.com/prod_456.jpg" ,
"slug" : "dell-xps-13"
}
],
"pagination" : {
"page" : 1 ,
"totalPages" : 3 ,
"total" : 47 ,
"hasNext" : true ,
"hasPrev" : false
},
"filters" : {
"search" : "laptop" ,
"category" : "electronics" ,
"priceRange" : { "min" : 500 , "max" : 2000 }
}
}
What Ollie Hub adds:
β
Complete pagination with navigation info
β
Enhanced product data (images, slugs, stock status)
β
Applied filters context for better UX
β
Structured, consistent response format
Process customer orders with validation: Sample URL: https://hub.ollie.app/https://api.mystore.com/orders
Request Payload
Order Processing Logic
Standard Response
{
"items" : [
{
"productId" : "prod_123" ,
"quantity" : 1 ,
"price" : 1899.99
},
{
"productId" : "prod_456" ,
"quantity" : 2 ,
"price" : 29.99
}
],
"payment" : {
"method" : "credit_card" ,
"token" : "tok_1234567890" ,
"amount" : 1959.97
},
"shipping" : {
"address" : "123 Main St, City, State 12345" ,
"method" : "standard"
},
"customerId" : "cust_789"
}
π See Hub Enhancements
{
"success" : true ,
"orderId" : "ord_abc123def456" ,
"total" : 1959.97 ,
"estimatedDelivery" : "2024-01-15T10:00:00Z" ,
"status" : "confirmed" ,
"trackingNumber" : "1Z999AA1234567890" ,
"paymentStatus" : "completed" ,
"orderSummary" : {
"subtotal" : 1959.97 ,
"shipping" : 0.00 ,
"tax" : 156.80 ,
"total" : 2116.77
},
"shipping" : {
"method" : "standard" ,
"carrier" : "UPS" ,
"address" : "123 Main St, City, State 12345"
},
"items" : [
{
"productId" : "prod_123" ,
"name" : "MacBook Pro 14-inch" ,
"quantity" : 1 ,
"price" : 1899.99 ,
"status" : "in_stock"
},
{
"productId" : "prod_456" ,
"name" : "Wireless Mouse" ,
"quantity" : 2 ,
"price" : 29.99 ,
"status" : "in_stock"
}
]
}
What Ollie Hub adds:
β
Real-time inventory validation
β
Secure payment processing
β
Automatic tax calculation
β
Delivery estimation with carrier info
β
Complete order summary with line items
β
Generated tracking number
Handle user login with JWT tokens: Sample URL: https://hub.ollie.app/https://auth.myapp.com/login
Login Credentials
Authentication Handler
Standard Response
{
"email" : "john@example.com" ,
"password" : "securePassword123"
}
π See Hub Enhancements
{
"authenticated" : true ,
"userId" : "user_123456789" ,
"user" : {
"id" : "user_123456789" ,
"email" : "john@example.com" ,
"name" : "John Smith" ,
"role" : "customer" ,
"permissions" : [ "read:profile" , "write:orders" ],
"lastLogin" : "2024-01-12T10:30:45.123Z" ,
"profileComplete" : true ,
"preferences" : {
"language" : "en" ,
"currency" : "USD" ,
"notifications" : true
}
},
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"expiresAt" : "2024-01-13T10:30:45.123Z" ,
"refreshToken" : "rt_abc123def456ghi789"
}
What Ollie Hub adds:
β
Complete user profile with permissions
β
Secure JWT token with expiration
β
Refresh token for seamless re-authentication
β
HTTP-only cookies for security
β
User preferences and settings
β
Last login tracking
Process payment webhooks from Stripe: Sample URL: https://hub.ollie.app/https://webhooks.mystore.com/stripe
Stripe Webhook Data
Webhook Processor
Standard Response
{
"id" : "evt_1234567890" ,
"type" : "payment_intent.succeeded" ,
"data" : {
"object" : {
"id" : "pi_1234567890" ,
"amount" : 195997 ,
"currency" : "usd" ,
"status" : "succeeded" ,
"metadata" : {
"orderId" : "ord_abc123def456" ,
"customerId" : "cust_789"
}
}
},
"created" : 1640995200
}
π See Hub Enhancements
Enhanced Webhook Response
{
"received" : true ,
"processed" : true ,
"eventId" : "evt_1234567890" ,
"orderId" : "ord_abc123def456" ,
"actions" : [
{
"type" : "order_status_update" ,
"from" : "pending" ,
"to" : "paid" ,
"timestamp" : "2024-01-12T10:30:45.123Z"
},
{
"type" : "email_sent" ,
"recipient" : "john@example.com" ,
"template" : "order_confirmation" ,
"timestamp" : "2024-01-12T10:30:46.789Z"
},
{
"type" : "analytics_logged" ,
"event" : "payment_succeeded" ,
"amount" : 195997 ,
"timestamp" : "2024-01-12T10:30:47.012Z"
}
]
}
What Ollie Hub adds:
β
Cryptographic signature verification
β
Automatic order status update (pending β paid)
β
Instant confirmation email to customer
β
Event logging for business analytics
β
Detailed processing confirmation
β
Action audit trail
Best Practices
Validate Early Always validate input data first. Return helpful error messages for invalid requests.
Handle Errors Gracefully Use try-catch blocks and return appropriate HTTP status codes and error messages.
Keep Functions Focused Each function should handle one specific endpoint or operation. Donβt try to do everything.
Use Proper Status Codes Return correct HTTP status codes: 200 for success, 400 for bad input, 404 for not found, etc.
Next Steps
Best Practices Essential patterns for building robust functions
Response Functions Learn to customize responses with analytics and enhancements
Task Functions Automate workflows with scheduled functions
Pro Tip: Request functions work great with Response functions to add analytics, security headers, and custom transformations automatically. Check out our Best Practices guide for implementation patterns and security tips.