Before importing from Rock
For exact person and fund routing, complete these steps first:- Install the current Grain plugin in Rock and let its scheduled job sync the financial account, campus, and person catalogs.
- In Grain, map every Rock financial account that the workflow can submit. Map campus-specific child accounts as well as the parent fallback account.
- Enable Full directory for the Rock integration and wait for the initial person sync to finish. This lets Grain resolve people who are in Rock but have never given.
- Create a dedicated Digital Cards scan group in Grain if digital and scanned cards should be reviewed separately.
Get valid routing IDs
Call the reference-data endpoint during setup and whenever the Rock account mappings change:scanGroups: Grain scan group IDs and their current campaign and default fund routing.campaigns: Active and draft Grain pledge campaign IDs.funds: Active Grain fund IDs for non-Rock integrations.rockCampuses: Exact RockCampus.Idvalues recognized by Grain.rockAccounts: The complete Rock parent and child account catalog, including each account’s path and mapping state.
rockAccountId whose mappingState is MAPPED and isActive is true. UNMAPPED, INACTIVE_FUND, AMBIGUOUS, and NOT_CATALOGED accounts must be corrected in Grain first.
Recommended Rock workflow payload
SendPOST /api/v1/pledge-card-imports with your access token, organization ID, and a unique Idempotency-Key.
For a Rock digital pledge card workflow, send:
externalId: The Rock workflow ID. Grain displays it during review and returns it in the item result.rockPersonId: The current RockPerson.Id. Grain uses it for exact identity routing instead of fuzzy donor matching.rockAccountId: The RockFinancialAccount.Idselected by the workflow’s campus-to-account mapping.rockCampusId: The RockCampus.Id, when known. This provides campus context but does not select the account.donorAddress2: The second street-address line, when present.scanGroupId: The Grain ID for an existing Digital Cards scan group.defaultRockAccountId: The mapped parent or fallback Rock account for cards that do not includerockAccountId.
When
scanGroupId is supplied, Grain inherits the group’s campaign. Do not
send campaignId. A supplied defaultRockAccountId overrides the group’s
default fund for that batch, and a card-level rockAccountId overrides the
request default for that card.Create a new scan group
OmitscanGroupId and provide name, either defaultRockAccountId or defaultFundId, and your cards. Grain creates a new scan group and its first batch.
defaultFundId and card-level fundId only when the caller already has Grain fund IDs. Do not send defaultFundId with defaultRockAccountId, or fundId with rockAccountId.
Add to an existing scan group
PassscanGroupId to append cards as a new batch inside a group created in Grain or from a prior import.
Use the ID at the end of the scan group review URL, not the display name. For
example, if the URL ends in
/revenue/pledge-card-scan-groups/CMRC90, send
"scanGroupId": "CMRC90".Retry safely
Use a newIdempotency-Key for each logical import. A Rock workflow run ID is a good basis for this value. If a request times out or its result is unclear, retry the exact request body with the same key. Grain returns the existing import instead of creating duplicate review rows.
Reusing a key with a different request body returns 409 Conflict. If the original request is still processing, wait briefly and retry with the same key.
Review import results
The response contains:reviewUrl: Opens the review group in Grain.cardsImported: Rows added to the review workflow.cardsSkipped: Exact duplicates retained as skipped audit rows.cardsWithIssues: Rows with missing, invalid, or unresolved business data that need attention.items: Per-card results mapped back throughexternalIdwhen supplied, including Rock identity and account status.
externalId or card body is retained as a SKIPPED audit row instead of rejecting the entire request. Missing donor names, amounts, or dates do not discard an otherwise valid row. Grain imports the row with an issue so finance staff can correct it during review.
When rockPersonId is present, Grain does not fall back to fuzzy matching. The row reports MATCHED, PENDING, NOT_FOUND, or CONFLICT so staff can resolve the exact Rock identity without creating an accidental duplicate person.
The secured JSON audit artifact is retained by Grain, but it is not presented or synchronized as a scanned pledge card document. The visible externalId is the link back to the originating Rock workflow.