returns [OpenItem!]!
One counterparty's open invoices or bills at a date, oldest first, each with its due date, age and bucket.
| Name | Type | Description |
|---|---|---|
| agentId | String! | The counterparty. |
| kind | String! | receivables or payables. |
| asOf | Date | The date the items are open at. Omit for today. |
| entityId | String | The entity whose books to read. Omit for the group parent. |
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.
| Field | Type | Description |
|---|---|---|
| eventId | String! | The obligation's event id. |
| entityId | String! | The entity whose books hold it. |
| agentId | String | The counterparty. |
| occurredOn | Date! | The date it was issued or received. |
| documentNumber | String | The invoice or bill number, where the source has one. |
| description | String | The event's description. |
| originalCents | Int! | The obligation's amount. |
| settledCents | Int! | Settled against it on or before the as-of date. |
| openCents | Int! | What is left: original less settled. Negative when overpaid, an unapplied credit. |
| currency | String! | Currency code. |
| dueDate | Date! | When it falls due: the stated due date, else the date it was issued (due on receipt). |
| dueDateBasis | String! | stated when the obligation carries its own due date; defaulted when it has none and is read as due on receipt. |
| daysPastDue | Int! | Days from the due date to the as-of date; zero or negative when not yet due. |
| bucket | String! | The aging bucket: current, one_to_thirty, thirty_one_to_sixty, sixty_one_to_ninety, over_ninety, or unapplied_credit when overpaid. |
{ openItemsForAgent(agentId: "...", kind: "...") { eventId entityId agentId occurredOn } }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 } }"}'