Validation helps ensure customers enter correct information, reducing fulfillment errors and support requests. Fungies supports two validation methods: regex patterns and custom validation URLs.Documentation Index
Fetch the complete documentation index at: https://docs.fungies.io/llms.txt
Use this file to discover all available pages before exploring further.
Regex Validation
Use regular expressions to validate text field input directly in the browser. Invalid input is rejected before the customer can submit.How to Add Regex Validation
- Edit your custom field in the Dashboard
- Enter a regex pattern in the Regex field
- Save your changes
Regex validation happens client-side, providing instant feedback to customers.
Common Patterns
| Use Case | Pattern | Matches |
|---|---|---|
| Numbers only | ^[0-9]+$ | 12345 |
| Letters only | ^[a-zA-Z]+$ | PlayerOne |
| Alphanumeric | ^[a-zA-Z0-9]+$ | Player123 |
| Username (3-20 chars) | ^[a-zA-Z0-9_]{3,20}$ | cool_player_99 |
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ | user@example.com | |
| UUID | ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | 550e8400-e29b-... |
| Date (YYYY-MM-DD) | ^\d{4}-\d{2}-\d{2}$ | 2024-01-15 |
Regex Tips
Custom Validation URL
For complex validation that can’t be expressed as regex—like checking if a player ID exists in your database—use a custom validation endpoint.How It Works
- Customer enters a value
- Fungies sends a POST request to your validation URL
- Your API checks if the value is valid
- Return
200 OKfor valid, any other status for invalid
Request Format
Fungies sends a POST request with the field value:Response
| Status | Meaning |
|---|---|
200 | Valid - customer can proceed |
4xx / 5xx | Invalid - customer sees an error |
Example Endpoint
Securing Your Validation Endpoint
Fungies signs validation requests the same way as webhooks. The signature is in thex-fngs-signature header:
Verify the Signature
Use your validation URL secret (set in the Dashboard) to verify requests:Combining Validation Methods
You can use both regex and URL validation on the same field:- Regex runs first - Catches format errors instantly (client-side)
- URL validation runs second - Checks business logic (server-side)
Next Steps
Custom Fields Setup
Create and configure custom fields
Webhook Setup
Receive custom field data in your application