---
title: "Update a donation matching"
description: "Update campaign donation matching"
canonical: https://www.charitips.com/docs/api-reference/update-donation-matching
---

# Update a donation matching

`PATCH /v1/campaigns/{campaignId}/donation-matching`

Update campaign donation matching

**Authentication**: Bearer access token.

## Parameters

- `campaignId` (string, required)

## Body

- `rate` (number, minimum 0.5, maximum 5)
- `maximumBudget` (number, integer, minimum 1)
- `maximumDonationBudget` (number, integer, minimum 1)
- `maximumDonorBudget` (number, integer, minimum 1)
- `status` (object) One of `ENABLED`, `DISABLED`.

## Errors

- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.
- 403 `Forbidden`: Your credentials cannot perform this action on this resource. An id from another account never answers 403: it is treated as unknown, with a 404 in the path or a 400 `Bad Request` in the body or the query. See https://www.charitips.com/docs/api-reference/errors.md.
- 404 `Not Found`: No resource with this id on your account and environment. An id that belongs to another account answers 404 too when it is in the path. Ids from the sandbox do not exist in production. See https://www.charitips.com/docs/get-started/sandbox.md.

## Example

```bash
curl -X PATCH https://api.sandbox.charitips.com/v1/campaigns/<campaignId>/donation-matching \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rate": 1,
    "maximumBudget": 2000,
    "status": "ENABLED"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/campaigns/<campaignId>/donation-matching', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "rate": 1,
    "maximumBudget": 2000,
    "status": "ENABLED"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
```

```python
import os, requests

response = requests.patch(
    "https://api.sandbox.charitips.com/v1/campaigns/<campaignId>/donation-matching",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "rate": 1,
      "maximumBudget": 2000,
      "status": "ENABLED"
    },
)
response.raise_for_status()
```

## Response example (200, placeholder values)

```json
{}
```
