Browse the extensions reference

dischargeCandidates

returns DischargeCandidates

The open invoices or bills a payment or bank line may settle.

Its own entity's and counterparty's, open at its date: an exact amount match first, then the oldest due date. A person picks; the commit records the choice with discharge_allocations. Null when there is no such event.

Arguments

NameTypeDescription
eventIdString!The payment or bank line.

Returns DischargeCandidates

The open invoices or bills a payment may settle, best match first.

FieldTypeDescription
eventIdString!The payment or bank line.
kindStringreceivables for money in, payables for money out; null when the line has no amount to say which.
amountCentsInt!The payment's magnitude.
classifiedToControlBoolean!Whether the line is classified to a receivables or payables control account, where a settlement is expected.
candidates[OpenItem!]!Open items of the same entity and counterparty at the line's date: an exact amount match first, then the oldest due date.

Example

query
{ dischargeCandidates(eventId: "...") { eventId kind amountCents classifiedToControl } }
curl
curl -X POST "https://api.robosystems.ai/extensions/$GRAPH_ID/graphql" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ dischargeCandidates(eventId: \"...\") { eventId kind amountCents classifiedToControl } }"}'