> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transparencyhubnetwork.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Start a Donation

> Create a donation and get the payment link to send the donor.

Starts a donation against a campaign and returns the **checkout link** for the donor. Send them to that address; they pay on the payment provider's own page (Paystack, Stripe or Flutterwave, whichever the chapter has set up) and the payment is confirmed automatically a moment later.

Card details never pass through this API, and you never handle them.

**Required scope:** `fundraising:write`

### What happens after you call it

1. You get back a `checkout_url` and a `transaction_id`. The donation is recorded as **pending**.
2. The donor opens the link and pays. If you sent a `redirect_url`, they land back there afterwards.
3. The payment provider confirms the payment to Transparency Hub, the donation turns **paid**, and it shows up in the campaign in the app.
4. Check on it any time with `GET /v1/transactions/{transaction_id}`, or list a campaign's giving with **List Campaign Payments** (`GET /v1/fundraising/campaigns/{campaign_id}/payments`).

### Things worth knowing

* `amount` is in normal money units — `150` means 150.00 — and must be at least 1. The currency defaults to the campaign's.
* `cover_fees: true` adds the provider's fee on top, so the campaign receives the full amount.
* The chapter must have finished setting up a payment method; if it has not, you get `409` with a message saying so.
* `payment_gateway_id` is only needed when a chapter has more than one method set up and you want a particular one.

```json Request theme={null}
{
  "amount": 150,
  "donor_name": "Ada Lovelace",
  "donor_email": "ada@example.org",
  "cover_fees": true,
  "redirect_url": "https://alumni.example.org/thank-you"
}
```

```json 201 theme={null}
{
  "status": "success",
  "data": {
    "checkout_url": "https://checkout.paystack.com/abc123",
    "transaction_id": 501,
    "transaction_ref": "THN-2026-0001",
    "amount": 150.0,
    "currency": "NGN",
    "payment_status": "pending",
    "campaign_id": 2
  }
}
```


## OpenAPI

````yaml POST /v1/fundraising/campaigns/{campaign_id}/donations
openapi: 3.0.3
info:
  title: Transparency Hub Public API
  version: 1.7.0
  description: Key-authenticated REST API for association and chapter integrations.
servers:
  - url: https://api.transparencyhubnetwork.ai/api
  - url: https://testapi.transparencyhubnetwork.ai/api
    description: Test
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /v1/fundraising/campaigns/{campaign_id}/donations:
    post:
      summary: Start a donation (hosted checkout)
      description: >-
        Creates a pending donation and returns the payment gateway's hosted
        checkout link. No card details pass through this API - the donor pays on
        the gateway's own page and the existing webhook marks the transaction
        paid. Requires scope `fundraising:write`.
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DonationCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  data:
                    $ref: '#/components/schemas/DonationStarted'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            The chapter has no gateway set up, or it cannot issue hosted
            checkout links
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    DonationCreate:
      type: object
      required:
        - amount
        - donor_name
        - donor_email
      properties:
        chapter_id:
          type: integer
        amount:
          type: number
          minimum: 1
          description: Major currency units, e.g. 150 means 150.00.
        donor_name:
          type: string
        donor_email:
          type: string
        currency:
          type: string
          nullable: true
          description: Defaults to the campaign's currency.
        cover_fees:
          type: boolean
          default: false
          description: Add the gateway fee on top so the campaign receives the full amount.
        is_anonymous:
          type: boolean
          default: false
        redirect_url:
          type: string
          nullable: true
          description: Where the gateway sends the donor after paying.
        payment_gateway_id:
          type: integer
          nullable: true
          description: Use a specific configured gateway; defaults to the chapter's.
    DonationStarted:
      type: object
      properties:
        checkout_url:
          type: string
          description: Send the donor here to pay.
        transaction_id:
          type: integer
        transaction_ref:
          type: string
        amount:
          type: number
        currency:
          type: string
          nullable: true
        payment_status:
          type: string
          description: pending until the gateway confirms.
        campaign_id:
          type: integer
    Error:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          type: string
          enum:
            - error
        code:
          type: string
        message:
          type: string
        details:
          type: object
  responses:
    ValidationError:
      description: validation_error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: insufficient_scope or chapter_forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: not_found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: rate_limited; see Retry-After
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.