Related Product
API / Giving
Describe the question
I’m trying to update the labels on Giving donations through the API.
According to the Giving Donation API documentation, PATCH /giving/v2/donations/{id} supports replacing associated labels by passing a labels key in the relationships object.
This works for donations that were manually entered / batch processed in Planning Center Giving. However, it fails with a 403 Forbidden for donations that were submitted directly through a Planning Center donation form / online giving flow.
The online-giving donations can be read successfully, and their labels can be listed successfully, but attempting to update the donation’s labels through the documented donation PATCH endpoint fails.
The error returned is:
{
"errors": [
{
"status": "403",
"title": "Forbidden",
"detail": "You do not have access to this resource",
"meta": {
"description": "User with id _<id>_ cannot update AppGraph::V2019_10_18::Vertices::DonationVertex with id _<id>_."
}
}
]
}
The API credentials being used are account-admin credentials with Giving access. The same credentials can successfully update labels on manually entered / batch donations.
My question: Is there a supported API method to add/remove existing labels from donations that were processed through Planning Center online giving? Or are Planning Center-source donations intentionally not updateable via the donation PATCH endpoint, even for label-only relationship changes?
What have you tried that worked?
GET /giving/v2/donations/{donation_id} works.
GET /giving/v2/donations/{donation_id}/labels works for the affected online-giving donations.
PATCH /giving/v2/donations/{donation_id} with relationships.labels works for donations that were manually entered / batch processed.
- The same API credentials successfully update labels on manually entered / batch donations.
Example successful label read for an affected online-giving donation:
GET /giving/v2/donations/{id}/labels
returns 200 with labels including:
[
{
"type": "Label",
"id": "_<id>_",
"attributes": {
"slug": "acknowledge-needs"
}
},
{
"type": "Label",
"id": "_<id>_",
"attributes": {
"slug": "source-planning-center"
}
}
]
What have you tried that didn't work?
- Updating labels through the documented donation
PATCH endpoint:
PATCH /giving/v2/donations/{id}
Content-Type: application/json
with a payload shaped like:
{
"data": {
"type": "Donation",
"id": "_<id>_",
"relationships": {
"labels": {
"data": [
{ "type": "Label", "id": "_<id>_" },
{ "type": "Label", "id": "_<id>_" },
{ "type": "Label", "id": "_<id>_" },
{ "type": "Label", "id": "_<id>_" },
{ "type": "Label", "id": "_<id>_" }
]
}
}
}
}
This fails only for donations processed through Planning Center online giving, with:
{
"status": "403",
"title": "Forbidden",
"detail": "You do not have access to this resource",
"meta": {
"description": "User with id _<id>_ cannot update AppGraph::V2019_10_18::Vertices::DonationVertex with id _<id>_."
}
}
- Trying a JSON:API-style relationship endpoint:
POST /giving/v2/donations/_<id>_/relationships/labels
This returns:
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "The resource you requested could not be found"
}
]
}
- Trying to POST to the labels association endpoint:
POST /giving/v2/donations/_<id>_/labels
This returns a 403, and appears to be interpreted as an attempt to create a new Label rather than attach an existing Label:
{
"errors": [
{
"status": "403",
"title": "Forbidden",
"detail": "You do not have access to this resource",
"meta": {
"description": "User with id _<id>_ cannot create a Label."
}
}
]
}
Additional context
The goal is to automate acknowledgment workflow labels on donations.
Current workflow:
- Donations with label
acknowledge-needs should have that label removed.
- Label
acknowledge-done should be added.
- The label update works for manually entered / batch donations.
- The label update fails for donations submitted directly through Planning Center online giving.
- The affected online-giving donations include a label like
source-planning-center.
I’m trying to determine whether this is expected behavior, a permissions issue, or whether there is another supported endpoint for assigning existing labels to online-giving donations without updating the full Donation resource.
I have..
Related Product
API / Giving
Describe the question
I’m trying to update the labels on Giving donations through the API.
According to the Giving Donation API documentation,
PATCH /giving/v2/donations/{id}supports replacing associated labels by passing alabelskey in therelationshipsobject.This works for donations that were manually entered / batch processed in Planning Center Giving. However, it fails with a
403 Forbiddenfor donations that were submitted directly through a Planning Center donation form / online giving flow.The online-giving donations can be read successfully, and their labels can be listed successfully, but attempting to update the donation’s labels through the documented donation
PATCHendpoint fails.The error returned is:
{ "errors": [ { "status": "403", "title": "Forbidden", "detail": "You do not have access to this resource", "meta": { "description": "User with id _<id>_ cannot update AppGraph::V2019_10_18::Vertices::DonationVertex with id _<id>_." } } ] }The API credentials being used are account-admin credentials with Giving access. The same credentials can successfully update labels on manually entered / batch donations.
My question: Is there a supported API method to add/remove existing labels from donations that were processed through Planning Center online giving? Or are Planning Center-source donations intentionally not updateable via the donation
PATCHendpoint, even for label-only relationship changes?What have you tried that worked?
GET /giving/v2/donations/{donation_id}works.GET /giving/v2/donations/{donation_id}/labelsworks for the affected online-giving donations.PATCH /giving/v2/donations/{donation_id}withrelationships.labelsworks for donations that were manually entered / batch processed.Example successful label read for an affected online-giving donation:
returns
200with labels including:[ { "type": "Label", "id": "_<id>_", "attributes": { "slug": "acknowledge-needs" } }, { "type": "Label", "id": "_<id>_", "attributes": { "slug": "source-planning-center" } } ]What have you tried that didn't work?
PATCHendpoint:with a payload shaped like:
{ "data": { "type": "Donation", "id": "_<id>_", "relationships": { "labels": { "data": [ { "type": "Label", "id": "_<id>_" }, { "type": "Label", "id": "_<id>_" }, { "type": "Label", "id": "_<id>_" }, { "type": "Label", "id": "_<id>_" }, { "type": "Label", "id": "_<id>_" } ] } } } }This fails only for donations processed through Planning Center online giving, with:
{ "status": "403", "title": "Forbidden", "detail": "You do not have access to this resource", "meta": { "description": "User with id _<id>_ cannot update AppGraph::V2019_10_18::Vertices::DonationVertex with id _<id>_." } }This returns:
{ "errors": [ { "status": "404", "title": "Not Found", "detail": "The resource you requested could not be found" } ] }This returns a
403, and appears to be interpreted as an attempt to create a new Label rather than attach an existing Label:{ "errors": [ { "status": "403", "title": "Forbidden", "detail": "You do not have access to this resource", "meta": { "description": "User with id _<id>_ cannot create a Label." } } ] }Additional context
The goal is to automate acknowledgment workflow labels on donations.
Current workflow:
acknowledge-needsshould have that label removed.acknowledge-doneshould be added.source-planning-center.I’m trying to determine whether this is expected behavior, a permissions issue, or whether there is another supported endpoint for assigning existing labels to online-giving donations without updating the full Donation resource.
I have..