Class BatchResource
- Namespace
- Crews.PlanningCenter.Api.Giving.V2019_10_18
- Assembly
- Crews.PlanningCenter.Api.dll
A Batch is a collection of Donations. When creating Donation's via the API, you're required to put them in a Batch.
When a Batch is first created, it's in the in_progress or "uncommitted" state. You can freely add/remove/modify Donations in this Batch and they won't show up in a donor's donation history online, they won't appear in any donor statements issued by the Giving admin, and changes to these donations are not flagged in the system log. Think of it as a staging area for donations.
When a Batch is committed (see more in the Actions section), all of the Donations within it are also marked as "committed". At that point, they're visible to donors in their online history, and any further edits made to those Donations are logged and visible to Giving admins.
With all of that in mind, you can use Batches in one of two ways:
1. Create an uncommitted Batch, add Donations to it, then commit the Batch.
2. Create a Batch with a least one donation, commit it, then add more Donations to it.
In both cases, the end result is the same. The main difference is that option #2 does not provide you/other admins the opportunity to fix any mistakes before changes are logged and Donations are made visible to donors. Any Donations added to a committed Batch will automatically be committed as well. Note, batches can't be committed until they have at least one donation.
Whichever route you decide to take, it's helpful to make use of the Batch's description to help differentiate these groupings from each other and from other Batches that the Giving admins might be creating on their own.
public record BatchResource : JsonApiResource<Batch, BatchRelationships>, IEquatable<JsonApiResourceIdentifier>, IEquatable<JsonApiResource>, IEquatable<JsonApiResource<Batch>>, IEquatable<JsonApiResource<Batch, BatchRelationships>>, IEquatable<BatchResource>
- Inheritance
-
JsonApiResourceIdentifierJsonApiResourceJsonApiResource<Batch>BatchResource
- Implements
-
IEquatable<JsonApiResourceIdentifier>IEquatable<JsonApiResource>
- Inherited Members
-
JsonApiResource<Batch, BatchRelationships>.ToString()JsonApiResource<Batch, BatchRelationships>.GetHashCode()JsonApiResource<Batch, BatchRelationships>.Equals(JsonApiResource<Batch>)JsonApiResource<Batch, BatchRelationships>.Equals(JsonApiResource<Batch, BatchRelationships>)JsonApiResource<Batch, BatchRelationships>.<Clone>$()JsonApiResource<Batch, BatchRelationships>.EqualityContractJsonApiResource<Batch, BatchRelationships>.RelationshipsJsonApiResource<Batch>.Equals(JsonApiResource)JsonApiResource<Batch>.Equals(JsonApiResource<Batch>)JsonApiResource<Batch>.AttributesJsonApiResource.Equals(JsonApiResourceIdentifier)JsonApiResource.RelationshipsJsonApiResource.LinksJsonApiResource.MetaJsonApiResourceIdentifier.IdJsonApiResourceIdentifier.LIdJsonApiResourceIdentifier.Type
Constructors
BatchResource()
public BatchResource()
BatchResource(BatchResource)
protected BatchResource(BatchResource original)
Parameters
originalBatchResource
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Methods
Equals(BatchResource?)
public virtual bool Equals(BatchResource? other)
Parameters
otherBatchResource
Returns
Equals(JsonApiResource<Batch, BatchRelationships>?)
public override sealed bool Equals(JsonApiResource<Batch, BatchRelationships>? other)
Parameters
otherJsonApiResource<Batch, BatchRelationships>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(BatchResource?, BatchResource?)
public static bool operator ==(BatchResource? left, BatchResource? right)
Parameters
leftBatchResourcerightBatchResource
Returns
operator !=(BatchResource?, BatchResource?)
public static bool operator !=(BatchResource? left, BatchResource? right)
Parameters
leftBatchResourcerightBatchResource