fundraisers
Confirms that the fundraiser identified by id has an active enrolment with the supplied channel. Call this before posting a donation so the partner UI can fail fast with a clear error.
HTTP request
Section titled “HTTP request”GET /fundraisersAuthentication
Section titled “Authentication”client_id and client_secret headers. See Authentication.
Parameters
Section titled “Parameters”Header
Section titled “Header”| Parameter | Required | Type | Description |
|---|---|---|---|
X-Correlation-ID | Yes | uuid | Fresh UUID per request. Echoed back as correlationId on the response and in any error envelope. |
| Parameter | Required | Type | Description |
|---|---|---|---|
channel | Yes | SourceChannel | Partner platform making the request. |
id | Yes | string | ASF Member Number |
Returns
Section titled “Returns”SuccessEnvelope with data.items of type FundraiserSummary:
| Field | Type | Description |
|---|---|---|
name | string | Display name of the fundraiser. |
fundraiserId | string | ASF Member Number |
productEnrollmentId | string | Identifier for the product enrolment. |
status | string | Human-readable enrolment status, e.g. Enrollment Validated. |
Sample
Section titled “Sample”import osimport uuidimport requests
BASE_URL = "https://sit.api.asf.org.au/fundraisers/api/v1"
response = requests.get( f"{BASE_URL}/fundraisers", params={ "channel": "XYZ Platform", "id": "ASF123456", }, headers={ "client_id": os.environ["ASF_CLIENT_ID"], "client_secret": os.environ["ASF_CLIENT_SECRET"], "X-Correlation-ID": str(uuid.uuid4()), }, timeout=10,)response.raise_for_status()
print(response.json()["data"]["items"]["status"]) # "Enrollment Validated"import { randomUUID } from 'node:crypto';
const BASE_URL = 'https://sit.api.asf.org.au/fundraisers/api/v1';
const url = new URL(`${BASE_URL}/fundraisers`);url.searchParams.set('channel', 'XYZ Platform');url.searchParams.set('id', 'ASF123456');
const response = await fetch(url, { method: 'GET', headers: { client_id: process.env.ASF_CLIENT_ID!, client_secret: process.env.ASF_CLIENT_SECRET!, 'X-Correlation-ID': randomUUID(), },});if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const body = await response.json();console.log(body.data.items.status); // "Enrollment Validated"<?php$baseUrl = 'https://sit.api.asf.org.au/fundraisers/api/v1';$query = http_build_query([ 'channel' => 'XYZ Platform', 'id' => 'ASF123456',]);$correlationId = bin2hex(random_bytes(16));
$ch = curl_init("$baseUrl/fundraisers?$query");curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'client_id: ' . getenv('ASF_CLIENT_ID'), 'client_secret: ' . getenv('ASF_CLIENT_SECRET'), 'X-Correlation-ID: ' . $correlationId, ],]);
$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);if ($status >= 400) throw new Exception("HTTP $status: $response");
echo json_decode($response, true)['data']['items']['status']; // "Enrollment Validated"Example response
Section titled “Example response”{ "apiVersion": "1.0.0", "correlationId": "210c68180-2ac6-11ee-b000-111", "method": "/fundraisers", "data": { "items": { "name": "Wombat Park Softball Club", "fundraiserId": "ASF123456", "productEnrollmentId": "a0T0T000006MMN2UAO", "status": "Enrollment Validated" } }}Errors
Section titled “Errors”| Status | Code | When it fires |
|---|---|---|
400 | FUNDRAISER:VALIDATION | Fundraiser isn’t enrolled with the channel, or required fields failed validation. |
401 | — | Basic credentials or client_id/client_secret are invalid. |
429 | — | Request quota exhausted. |
500 | FUNDRAISER:UNKNOWN | Unhandled server error. Retry with backoff. |
503 | — | Server temporarily unavailable. |