Skip to main content
PATCH
https://api.grainledger.com
/
api
/
v1
/
pledges
/
{id}
Update pledge
curl --request PATCH \
  --url https://api.grainledger.com/api/v1/pledges/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "donorId": "cm456def789ghi",
  "fundId": "cm789ghi012jkl",
  "totalAmount": 12000,
  "startDate": "2026-01-01"
}
'
const options = {
  method: 'PATCH',
  headers: {
    'X-Organization-Id': '<x-organization-id>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    donorId: 'cm456def789ghi',
    fundId: 'cm789ghi012jkl',
    totalAmount: 12000,
    startDate: '2026-01-01'
  })
};

fetch('https://api.grainledger.com/api/v1/pledges/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.grainledger.com/api/v1/pledges/{id}"

payload = {
    "donorId": "cm456def789ghi",
    "fundId": "cm789ghi012jkl",
    "totalAmount": 12000,
    "startDate": "2026-01-01"
}
headers = {
    "X-Organization-Id": "<x-organization-id>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
{
  "id": "<string>",
  "donorId": "<string>",
  "fundId": "<string>",
  "campaignId": "<string>",
  "totalAmount": 123,
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z"
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}
{
  "message": "You do not have access to this organization."
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Organization-Id
string
required

Organization ID for multi-tenant data access

Path Parameters

id
string
required

Resource ID

Body

application/json
donorId
string
required
Example:

"cm456def789ghi"

fundId
string
required
Example:

"cm789ghi012jkl"

totalAmount
number
required
Example:

12000

startDate
string<date>
required
Example:

"2026-01-01"

campaignId
string
endDate
string<date>
Example:

"2026-12-31"

notes
string

Response

Updated pledge

id
string
donorId
string
fundId
string
campaignId
string | null
totalAmount
number
startDate
string<date-time>
endDate
string<date-time> | null
status
enum<string>
Available options:
ACTIVE,
CANCELLED
Last modified on July 8, 2026