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

# Request a charity

> Find a charity in an official register and ask for it to be listed on Donate

If a charity your users want is not on Donate, you can ask for it. A request is checked against
the charity's official register and then reviewed by the Donate team before the charity is listed.
A request never lists a charity by itself, and review has no fixed timeline.

Here "listed" means Donate has the charity and you can name it in a config. The donate.gg site
shows a charity only once the charity has signed up, so a listed charity can have no page there:
its `url` is then `null`.

**1. List the registers**

Find the register the charity is in.

**2. Search the register**

Look the charity up by name or registration number.

**3. Request it**

Ask for an entry whose status is `requestable`. This needs your key.

**4. Read where it stands**

Look again later. Once it is listed you have its charity id.

Every call is on `https://api.donate.gg/api/v2`. Register data identifies an organisation. It does
not confirm that donations are tax-deductible, that the organisation is charitable, or that anyone
endorses it.

## List the registers

[`GET /v2/registers`](https://docs.donate.gg/api-reference/charity-requests/registers/list) returns every register you
can request from, with the registration number format each accepts. Public.

```bash theme={null}
curl "https://api.donate.gg/api/v2/registers"
```

The answer is `{ "items": [...], "nextCursor": null }`. One register, as an example:

```json theme={null}
{
  "id": "united-states",
  "name": "United States",
  "country": "US",
  "publisher": { "name": "Candid", "url": "https://candid.org/" },
  "attribution": {
    "text": "Charity information comes from Candid and public records.",
    "url": null
  },
  "registrationFormat": {
    "label": "Employer Identification Number (EIN)",
    "example": "12-3456789",
    "pattern": "[0-9]{2}-?[0-9]{7}"
  },
  "refresh": "live",
  "coverage": "US organizations with an EIN. Candid findings are reviewed before listing."
}
```

| Register `id` | `country` | Registration number |
| - | - | - |
| `united-states` | `US` | EIN, for example `12-3456789` |
| `england-wales` | `GB` | Main charity number, `1234567` |
| `scotland` | `GB` | SC number, `SC012345` |
| `northern-ireland` | `GB` | NIC number, `NIC100002` |
| `france` | `FR` | SIREN, `775672272` |
| `japan` | `JP` | 13-digit corporate number. Public-interest associations and foundations: by number only |
| `new-zealand` | `NZ` | CC number, `CC21860` |
| `norway` | `NO` | Nine-digit organisation number, `864139442` |
| `netherlands` | `NL` | Nine-digit RSIN, `003014022` (not a KVK number) |
| `canada` | `CA` | Full charity number, `119219814RR0001` |
| `australia` | `AU` | Eleven-digit ABN, `50 169 561 394` |

* `registrationFormat.pattern` is an unanchored regular expression for input the register accepts.
  Use `label` and `example` on your form.
* `refresh` is `live` when the register is read for each search, or `daily` when Donate uses a
  daily copy of the official dataset.
* When you show register data to users, show the register's `attribution` too.
* The list changes rarely. Keep it for minutes, not per request.

## Search a register

[`GET /v2/registers/{registerId}/entries`](https://docs.donate.gg/api-reference/charity-requests/registers/list-entries)
searches one register by charity name or registration number and returns at most 10 entries.
Public. Searching never requests or lists a charity.

```bash theme={null}
curl "https://api.donate.gg/api/v2/registers/united-states/entries?term=make-a-wish%20america"
```

| Parameter | Where | Required | Values |
| - | - | - | - |
| `registerId` | Path | Yes | A register `id` from the list above |
| `term` | Query | Yes | Charity name or registration number, 1 to 120 characters |

The answer is `{ "items": [...], "nextCursor": null }`. One entry, as an example:

```json theme={null}
{
  "registerId": "united-states",
  "registrationNumber": "86-0481941",
  "name": "Make-A-Wish America",
  "imageUrl": "https://docs.candid.org/edoc/11142134",
  "websiteUrl": "https://wish.org/",
  "description": "Together, we create life-changing wishes for children with critical illnesses.",
  "city": "Phoenix",
  "state": "AZ",
  "country": "US",
  "status": "listed",
  "eligibilityIssues": [],
  "charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2"
}
```

`imageUrl`, `websiteUrl`, `description`, `city` and `state` can be `null`.

| `status` | Meaning | What to do |
| - | - | - |
| `listed` | Donate already has it. `charityId` is its id | Name `charityId` in a config. Do not request |
| `requested` | A request already exists | [Read where it stands](#read-where-a-request-stands) |
| `requestable` | Can be requested | [Request it](#request-a-charity) |
| `ineligible` | The entry cannot be requested. `eligibilityIssues` says why, in sentences | Show the reasons |

`charityId` is `null` unless `status` is `listed`. A charity that is disabled or has opted out is
not returned at all.

| Status | `code` | When |
| - | - | - |
| `400` | `VALIDATION_ERROR` | `registerId` is unknown, `term` is missing or too long, or the register cannot be searched with this term. `message` says which |
| `429` | `RATE_LIMIT_EXCEEDED` | The search budget is used up. Wait for `Retry-After` seconds |
| `503` | `PROVIDER_UNAVAILABLE` | The register could not be searched. Try again later |

## Request a charity

[`POST /v2/charity-requests`](https://docs.donate.gg/api-reference/charity-requests/create) checks the registration
against the official register, then saves a request for review. It needs your key.

The call below uses `SC012345`, the register's own example of the format, in place of a real
number. Send the `registrationNumber` of an entry whose status is `requestable`: a number the
register does not have answers `422` with `REGISTRATION_NOT_FOUND`.

```bash theme={null}
curl -i -X POST "https://api.donate.gg/api/v2/charity-requests" \
  -H "donate-api-key: $DONATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"registerId": "scotland", "registrationNumber": "SC012345"}'
```

| Field | Meaning |
| - | - |
| `registerId` | A register `id` |
| `registrationNumber` | The registration number in the format the register accepts, up to 32 characters |

A UK number must be from the register you name: `SC` numbers are Scottish, `NIC` numbers are
Northern Irish, and plain numbers are England and Wales. Northern Ireland numbers may omit the
`NIC` prefix.

The status of the answer says what the request did, and the body is the same object either way:

| Status | Meaning |
| - | - |
| `201` | This request started a review |
| `200` | Nothing new was requested: the registration was already listed, requested or reviewed. `status` in the body says which |

An answer to a request that started a review looks like this, with the format example standing
for the number you sent:

```json theme={null}
{
  "registerId": "scotland",
  "registrationNumber": "SC012345",
  "status": "requested",
  "charityId": null,
  "queue": { "ahead": 4, "typicalSeconds": 172800 }
}
```

| `status` | Meaning |
| - | - |
| `listed` | Donate already has it. Nothing was requested. `charityId` is its id |
| `requested` | Waiting for review. With `201`, this request put it there. With `200`, a request was already waiting and this one was counted as more demand |
| `needs-info` | Reviewers need more information. The request was not reopened |
| `reviewed` | The request was reviewed and the charity was not listed. It was not reopened |

Repeating a request is safe. It counts as more demand and does not undo a review decision.
`registrationNumber` in the answer is the number in its canonical form: use that one from then on.

| Status | `code` | When |
| - | - | - |
| `400` | `VALIDATION_ERROR` | The body is missing a field, has one the operation does not know, or names an unknown register |
| `400` | `INVALID_JSON` | The body is not JSON |
| `400` | `REGISTRATION_INVALID` | The number is not in the format the register accepts |
| `413` | `PAYLOAD_TOO_LARGE` | The body is too large |
| `422` | `REGISTRATION_NOT_FOUND` | The register has no organisation with this number |
| `422` | `REGISTRATION_NOT_ELIGIBLE` | The organisation is in the register and cannot be listed |
| `409` | `CHARITY_UNAVAILABLE` | The charity is not available on Donate |
| `409` | `NEEDS_MANUAL_REVIEW` | A person at Donate has to look at the request before it can continue |
| `429` | `RATE_LIMIT_EXCEEDED` | The request budget is used up. Wait for `Retry-After` seconds |
| `503` | `PROVIDER_UNAVAILABLE` | The register could not be checked. Try again later |

## Read where a request stands

[`GET /v2/charity-requests/{registerId}/{registrationNumber}`](https://docs.donate.gg/api-reference/charity-requests/get)
reports where one registration stands on Donate. Public. It reads Donate only: it does not check
the register and does not request anything.

```bash theme={null}
curl "https://api.donate.gg/api/v2/charity-requests/scotland/SC012345"
```

The answer is the same object the request returns. A registration nobody has requested answers
`200`, not `404`:

```json theme={null}
{
  "registerId": "scotland",
  "registrationNumber": "SC012345",
  "status": "not-requested",
  "charityId": null,
  "queue": null
}
```

`status` is `not-requested`, `requested`, `needs-info`, `reviewed` or `listed`. Only `requested`
changes without a new request, so that is the one to poll. A number that is not in the register's
format answers `400` with `REGISTRATION_INVALID`.

While `status` is `requested`, `queue` estimates where the request stands. Otherwise it is `null`.

| Field | Meaning |
| - | - |
| `ahead` | Requests in the review queue ahead of this one |
| `typicalSeconds` | Typical seconds from request to listing for recent requests, or `null` when it is not known |

Both are estimates. Review order and timing are not guaranteed, and a request can still need more
information or close without a listing.

Once `status` is `listed`, `charityId` is the charity's id. It goes straight into a config, and the
charity appears in [beneficiary search](https://docs.donate.gg/guides/beneficiary-picker.md).

## Rate limits

Register search and requests spend their own budgets on top of the
[normal rate limit](https://docs.donate.gg/api/rate-limits.md):

| Caller | Searches | Requests |
| - | - | - |
| With a key, per project | 120 per minute | 60 per hour |
| Without a key, per IP address | 30 per minute | Not available |

The budget for searches without a key is shared with charity search on donate.gg. A ceiling across
all callers can also apply when the registers are busy. A used-up budget answers `429` with
`RATE_LIMIT_EXCEEDED` and `Retry-After`. Listing registers and reading where a request stands use
only the normal limit.

## Runnable sequence

```bash theme={null}
export DONATE_API_KEY="your key"

# 1. Registers
curl "https://api.donate.gg/api/v2/registers"

# 2. Search one
curl "https://api.donate.gg/api/v2/registers/united-states/entries?term=make-a-wish%20america"

# 3. Request an entry whose status is "requestable": put its register and number here
REGISTER="scotland"
REGISTRATION="SC012345"
curl -i -X POST "https://api.donate.gg/api/v2/charity-requests" \
  -H "donate-api-key: $DONATE_API_KEY" \
  -H "content-type: application/json" \
  -d "{\"registerId\": \"$REGISTER\", \"registrationNumber\": \"$REGISTRATION\"}"

# 4. Where it stands
curl "https://api.donate.gg/api/v2/charity-requests/$REGISTER/$REGISTRATION"
```


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