Invoice¶
An Invoice states the money due for goods or services: the total and minimum payment due, the
payment status (PaymentStatusType) and dates, and the Orders it
bills (referencesOrder; an Order points back with partOfInvoice). Like an Order, customer is pinned to the
version of the Person or Organization that was newest when it was written. An Invoice
is a private record of a customer: it has no JSON-LD document.
Modeled on schema.org/Invoice · JSON Schema · ABAC object type Invoice
Example¶
Create one with POST /invoices:
{
"customer": {
"at_id": "https://apis.objectsgrid.com/organizations/9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
},
"provider": {
"at_id": "https://apis.objectsgrid.com/organizations/1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
},
"paymentStatus": "https://schema.org/PaymentDue",
"totalPaymentDue": {
"value": 158.0,
"currency": "EUR"
},
"paymentDueDate": "2026-12-31T00:00:00Z",
"referencesOrder": [
{
"at_id": "https://apis.objectsgrid.com/orders/3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f"
}
]
}
Fields¶
Required: customer, provider.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
Invoice |
JSON-LD @type, the object's type name. |
|
at_id |
URL | The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid. |
|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
description |
list of LanguageTaggedString | The Invoice description. See schema.org/description. | |
url |
URL | The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid. |
|
accountId |
string | The identifier of the customer's account the invoice is for | |
billingPeriod |
string | The period the invoice covers, as an ISO 8601 duration, e.g. 'P1M' | |
confirmationNumber |
string | A number that confirms the payment has been received | |
minimumPaymentDue |
MonetaryAmount | The minimum payment due | |
paymentDueDate |
date-time | The date that payment is due | |
paymentMethod |
string | The name of the payment method used (e.g. 'Credit Card', 'PayPal') | |
paymentMethodId |
string | An identifier for the method of payment used (e.g. the last 4 digits of the credit card) | |
paymentStatus |
PaymentStatusType | The status of the payment | |
scheduledPaymentDate |
date | The date the invoice is scheduled to be paid | |
totalPaymentDue |
MonetaryAmount | The total amount due | |
customer |
Reference to Person or Organization | Yes | Party paying the invoice: the URL of a Person or Organization, stored as |
provider |
Reference to Organization or Person | Yes | The party issuing the invoice |
broker |
Reference to Organization or Person | An entity that arranges for an exchange between a buyer and a seller | |
referencesOrder |
list of References to Order | The Orders the invoice is for | |
tags |
list of Tag | Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or []. |
|
meta |
ObjectMeta | Read-only metadata: version, type, creation and last update. | |
payments |
computed: list of PayAction | The payments and refunds of it. ObjectsGrid's own field. Computed, read-only: the objects whose PayAction.object points to this object, listed from that type; never stored or written. |
REST API¶
Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.
| Operation | Request |
|---|---|
| Create | POST /invoices |
| List and search | GET /invoices |
| Create up to 100 at once | POST /invoices/batch |
| Retrieve | GET /invoices/{id} |
| Replace | PUT /invoices/{id} |
| Update some fields | PATCH /invoices/{id} |
| Delete | DELETE /invoices/{id} |
Invoice objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.
The OpenAPI contract, with every parameter and response: Invoices (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | invoice(id: ID!, version: String): Invoice |
| Query | invoices(where: InvoiceWhereInput, orderBy: [InvoiceOrderByInput!], first: Int, after: String): InvoiceConnection! |
| Query | invoicesGroupBy(by: [InvoiceGroupByField!]!, where: InvoiceWhereInput, having: InvoiceHavingInput, orderBy: [InvoiceGroupByOrderByInput!], first: Int, after: String): InvoiceGroupByConnection! |
| Mutation | createInvoice(input: CreateInvoiceInput!): Invoice! |
| Mutation | updateInvoice(input: UpdateInvoiceInput!, expectedVersion: String): Invoice! |
| Mutation | deleteInvoice(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when an Invoice changes:
InvoiceCreated, InvoiceUpdated, InvoicePatched, InvoiceDeleted.