Browse the extensions reference

openItemsForAgent

returns [OpenItem!]!

One counterparty's open invoices or bills at a date, oldest first, each with its due date, age and bucket.

Arguments

NameTypeDescription
agentIdString!The counterparty.
kindString!receivables or payables.
asOfDateThe date the items are open at. Omit for today.
entityIdStringThe entity whose books to read. Omit for the group parent.

Returns OpenItem

One open invoice or bill as of a date: what it was for, what has been settled against it by then, and what is left.

FieldTypeDescription
eventIdString!The obligation's event id.
entityIdString!The entity whose books hold it.
agentIdStringThe counterparty.
occurredOnDate!The date it was issued or received.
documentNumberStringThe invoice or bill number, where the source has one.
descriptionStringThe event's description.
originalCentsInt!The obligation's amount.
settledCentsInt!Settled against it on or before the as-of date.
openCentsInt!What is left: original less settled. Negative when overpaid, an unapplied credit.
currencyString!Currency code.
dueDateDate!When it falls due: the stated due date, else the date it was issued (due on receipt).
dueDateBasisString!stated when the obligation carries its own due date; defaulted when it has none and is read as due on receipt.
daysPastDueInt!Days from the due date to the as-of date; zero or negative when not yet due.
bucketString!The aging bucket: current, one_to_thirty, thirty_one_to_sixty, sixty_one_to_ninety, over_ninety, or unapplied_credit when overpaid.

Example

query
{ openItemsForAgent(agentId: "...", kind: "...") { eventId entityId agentId occurredOn } }
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": "{ openItemsForAgent(agentId: \"...\", kind: \"...\") { eventId entityId agentId occurredOn } }"}'