curl --request PATCH \
--url https://api.grainledger.com/api/v1/batches/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.grainledger.com/api/v1/batches/{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/batches/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"externalBatchId": "<string>",
"externalReference": "<string>",
"batchDate": "2023-11-07T05:31:56Z",
"totals": {
"gross": 123,
"fees": 123,
"net": 123,
"paymentCount": 123,
"donationCount": 123
},
"status": "OPEN",
"isCommitted": true,
"committedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>",
"givingIntegration": {
"id": "<string>",
"provider": "<string>",
"name": "<string>"
},
"merchant": {
"id": "<string>",
"name": "<string>",
"campusId": "<string>",
"dimensionValueId": "<string>"
},
"settlement": {
"id": "<string>",
"provider": "<string>",
"externalReference": "<string>",
"status": "<string>",
"totalNet": 123
},
"journalEntry": {
"id": "<string>",
"entryNumber": "<string>",
"referenceNumber": "<string>"
},
"dimensions": [
{
"dimensionId": "<string>",
"dimensionValueId": "<string>",
"dimensionName": "<string>",
"dimensionValueName": "<string>"
}
],
"fundSplits": [
{
"fundId": "<string>",
"fundName": "<string>",
"amount": 123
}
],
"contributionIds": [
"<string>"
],
"isFrozen": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}Update giving batch
Recalculates totals after amount, fee, or membership changes. SETTLED is an accounting-owned state and cannot be set here.
curl --request PATCH \
--url https://api.grainledger.com/api/v1/batches/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.grainledger.com/api/v1/batches/{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/batches/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"externalBatchId": "<string>",
"externalReference": "<string>",
"batchDate": "2023-11-07T05:31:56Z",
"totals": {
"gross": 123,
"fees": 123,
"net": 123,
"paymentCount": 123,
"donationCount": 123
},
"status": "OPEN",
"isCommitted": true,
"committedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>",
"givingIntegration": {
"id": "<string>",
"provider": "<string>",
"name": "<string>"
},
"merchant": {
"id": "<string>",
"name": "<string>",
"campusId": "<string>",
"dimensionValueId": "<string>"
},
"settlement": {
"id": "<string>",
"provider": "<string>",
"externalReference": "<string>",
"status": "<string>",
"totalNet": 123
},
"journalEntry": {
"id": "<string>",
"entryNumber": "<string>",
"referenceNumber": "<string>"
},
"dimensions": [
{
"dimensionId": "<string>",
"dimensionValueId": "<string>",
"dimensionName": "<string>",
"dimensionValueName": "<string>"
}
],
"fundSplits": [
{
"fundId": "<string>",
"fundName": "<string>",
"amount": 123
}
],
"contributionIds": [
"<string>"
],
"isFrozen": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}{
"code": "forbidden",
"message": "You do not have access to this organization.",
"error": "You do not have access to this organization."
}Authorizations
Organization API key created in Grain Settings → API. The key determines the organization and is limited to its assigned resource scopes. Write scopes imply the corresponding read scope.
Headers
Required with OAuth access tokens for resource requests. Omit only for GET /api/v1/organizations. Optional with organization API keys; if supplied with an API key, it must match the key's organization.
Path Parameters
Resource ID
Body
All fields are optional; null clears nullable fields. SETTLED is read-only.
10000OPEN, COMMITTED, FAILED Response
Updated giving batch
Giving batch whose totals and donation count are derived from current contribution membership. Metadata and sync diagnostics are excluded.
Calendar day represented as a UTC-midnight ISO timestamp.
OPEN, COMMITTED, SETTLED, FAILED