Skip to documentation
SparkGlimSparkGlim Developer
Search all documentation

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

    API reference

    Start public donation

    Starts a donation for the selected fundraiser after validating requested amount, campaign rules and browser protection; this is not a completed contribution.

    POSThttps://api.sparkglim.net/api/public/donate

    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
    campaign_idRequired

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

    stringValidation: UUID.
    amountRequired

    Requested contribution or withdrawal amount in the existing campaign/account currency; the server validates financial authority and final terms.

    numberValidation: 1–1000000; increments 0.01 in campaign currency.
    donor_country_codeOptional

    Donor country context, separate from the fundraiser’s selling country and currency.

    stringValidation: uppercase ISO2.
    emailOptional

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

    stringValidation: email.
    phone_numberOptional

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

    stringValidation: valid phone when channel requires.
    donor_nameOptional

    Public display label for the member or contributor; it does not change account ownership.

    stringValidation: trimmed.
    anonymousOptional

    Requests the existing anonymous-contribution behavior; conflicting anonymity fields must not be sent.

    booleanValidation: do not conflict with is_anonymous.
    is_anonymousOptional

    Requests the existing anonymous-contribution behavior; conflicting anonymity fields must not be sent.

    booleanValidation: do not conflict with anonymous.
    custom_dataOptional

    Answers matching the actual campaign-specific fields, required values and supported options.

    objectValidation: configured custom fields.
    payment_channelOptional

    Optional channel preference; only methods enabled for the real selling country, currency and merchant may be used.

    enumValidation: configured method only.
    network_codeOptional

    Configured mobile network selection where the chosen payment channel requires it.

    stringValidation: configured network.
    is_appOptional

    Existing caller context used to select Web or User App configuration; it grants no extra permissions.

    booleanValidation: client context.
    web_abuse_contextRequired

    Existing browser/device protection payload required before public checkout initialization; not a replacement for server authorization.

    objectValidation: strict object; device_details JSON <=12000 characters.
    web_abuse_context.device_idRequired

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    stringValidation: 12–160.
    web_abuse_context.device_fingerprintRequired

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    stringValidation: 12–160.
    web_abuse_context.browser_signatureOptional

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    string|nullValidation: 12–160.
    web_abuse_context.hardware_signatureOptional

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    string|nullValidation: 12–160.
    web_abuse_context.device_detailsOptional

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    objectValidation: JSON object.
    web_abuse_context.client_pattern_detectedOptional

    Existing browser/device protection signal accepted by the current public checkout protection schema.

    booleanValidation: existing device protection.
    client_attempt_idOptional

    Stable client operation identifier used to reuse an existing attempt and reject mismatched retries.

    stringValidation: stable normalized operation identity.
    return_pathOptional

    Relative return destination on the verified current website after centralized checkout.

    stringValidation: same-origin relative path; no // or backslash.

    Request

    Examples describe the contract and are not executed. Use authorized test records; never paste a real secret into these pages.

    POST /api/public/donate
    http
    POST /api/public/donate HTTP/1.1
    Host: api.sparkglim.net
    Content-Type: application/json
    
    {
      "campaign_id": "11111111-1111-4111-8111-111111111111",
      "amount": 10,
      "anonymous": true,
      "web_abuse_context": {
        "device_id": "<EXISTING_DEVICE_ID>",
        "device_fingerprint": "<EXISTING_DEVICE_FINGERPRINT>"
      },
      "client_attempt_id": "example_stable_attempt_0001"
    }

    Response

    Success response · HTTP 200
    json
    {
      "success": true,
      "data": {
        "id": "11111111-1111-4111-8111-111111111111",
        "status": "pending"
      }
    }
    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/router.ts
    • server/src/api/routes/public.ts