API reference
Validate campaign discount
Validates an existing campaign discount through the shared database contract; purchase still validates the final price and eligibility.
https://api.sparkglim.net/api/public/discounts/validateAccess model
- Access model
- Public access with validation
- Documented availability
- Implemented in source
Availability is verified from source, not a live production guarantee.
Open the returned checkout URL. SparkGlim Server owns prices, methods, payment verification and fulfillment; browser returns are navigation only.
Request
| Name | Type | Validation |
|---|---|---|
codeRequiredThe existing resource credential or verification code required by this endpoint; never publish a real OTP or ticket secret. | string | Validation: existing campaign discount. |
campaign_idRequiredExisting campaign record within the caller’s account and any narrower campaign credential. | string | Validation: campaign identifier. |
phone_numberOptionalParticipant contact phone; required payment channels and campaign rules may require a valid international number. | string | Validation: customer phone. |
emailOptionalContact email used by the configured campaign or account workflow; never a credential granting access by itself. | string | Validation: email. |
Request
Examples describe the contract and are not executed. Use authorized test records; never paste a real secret into these pages.
POST /api/public/discounts/validate HTTP/1.1
Host: api.sparkglim.net
Content-Type: application/json
{
"code": "<EXISTING_DISCOUNT>",
"campaign_id": "11111111-1111-4111-8111-111111111111"
}Response
{
"success": true,
"discount": {
"id": "11111111-1111-4111-8111-111111111111",
"code": "<EXISTING_DISCOUNT>",
"name": "Example discount",
"discount_percent": 10,
"campaign_id": "11111111-1111-4111-8111-111111111111"
}
}{
"success": false,
"error": "<ERROR_MESSAGE>"
}Validation, permissions, unavailable records and temporary service failures use the handler’s HTTP status and error payload.
Limits & retries
Default Server limit: 100 requests per IP per 60 seconds. Resource-specific controls also apply.
Source compatibility
Authorized operations require account-specific testing.
server/src/api/routes/public.tsapp/api/discounts/validate/route.ts