Skip to documentation
SparkGlimSparkGlim Developer
Search all documentation

Try a topic in your language or an exact API path.

    API reference

    Validate campaign discount

    Validates an existing campaign discount through the shared database contract; purchase still validates the final price and eligibility.

    POSThttps://api.sparkglim.net/api/public/discounts/validate

    Access 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

    NameTypeValidation
    codeRequired

    The existing resource credential or verification code required by this endpoint; never publish a real OTP or ticket secret.

    stringValidation: existing campaign discount.
    campaign_idRequired

    Existing campaign record within the caller’s account and any narrower campaign credential.

    stringValidation: campaign identifier.
    phone_numberOptional

    Participant contact phone; required payment channels and campaign rules may require a valid international number.

    stringValidation: customer phone.
    emailOptional

    Contact email used by the configured campaign or account workflow; never a credential granting access by itself.

    stringValidation: 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
    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 response · HTTP 200
    json
    {
      "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"
      }
    }
    Error response · HTTP 400
    json
    {
      "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.ts
    • app/api/discounts/validate/route.ts