Table of Contents

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
JsonApiResourceIdentifier
JsonApiResource
JsonApiResource<Batch>
JsonApiResource<Batch, BatchRelationships>
BatchResource
Implements
IEquatable<JsonApiResourceIdentifier>
IEquatable<JsonApiResource>
IEquatable<JsonApiResource<Batch>>
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>.EqualityContract
JsonApiResource<Batch, BatchRelationships>.Relationships
JsonApiResource<Batch>.Equals(JsonApiResource)
JsonApiResource<Batch>.Equals(JsonApiResource<Batch>)
JsonApiResource<Batch>.Attributes
JsonApiResource.Equals(JsonApiResourceIdentifier)
JsonApiResource.Relationships
JsonApiResource.Links
JsonApiResource.Meta
JsonApiResourceIdentifier.Id
JsonApiResourceIdentifier.LId
JsonApiResourceIdentifier.Type

Constructors

BatchResource()

public BatchResource()

BatchResource(BatchResource)

protected BatchResource(BatchResource original)

Parameters

original BatchResource

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Methods

Equals(BatchResource?)

public virtual bool Equals(BatchResource? other)

Parameters

other BatchResource

Returns

bool

Equals(JsonApiResource<Batch, BatchRelationships>?)

public override sealed bool Equals(JsonApiResource<Batch, BatchRelationships>? other)

Parameters

other JsonApiResource<Batch, BatchRelationships>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(BatchResource?, BatchResource?)

public static bool operator ==(BatchResource? left, BatchResource? right)

Parameters

left BatchResource
right BatchResource

Returns

bool

operator !=(BatchResource?, BatchResource?)

public static bool operator !=(BatchResource? left, BatchResource? right)

Parameters

left BatchResource
right BatchResource

Returns

bool