Order¶
An Order records a purchase: the Offers the customer accepted, its lines
(OrderItems: what was ordered, how many, and each line's status), the parcels sent
(ParcelDeliveries), who bought and who sold, the order date and status, discounts and payment
details. Statuses use the Schema.org OrderStatus values, such as
https://schema.org/OrderProcessing. An Order paid with others points to its Invoice in
partOfInvoice.
customer is a Reference to a Person or Organization. The Order
stores it pinned to the version that was newest when it was written, its at_id ending in ?version=<n>, so it
always shows the customer as they were. Send the plain URL as at_id; the customer must exist. billingAddress and
orderDelivery are personal data: they are encrypted with the key of that Person version, never in lists, events or
search, and, once the person is erased, readable to the accounting role only. See
Personal data and erasure.
Modeled on schema.org/Order · JSON Schema · ABAC object type Order
Example¶
Create one with POST /orders:
{
"orderNumber": "2026-000123",
"orderDate": "2026-11-13T09:30:00Z",
"orderStatus": "https://schema.org/OrderProcessing",
"customer": {
"at_id": "https://apis.objectsgrid.com/organizations/9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
},
"seller": {
"at_id": "https://apis.objectsgrid.com/organizations/1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
},
"acceptedOffer": [
{
"at_id": "https://apis.objectsgrid.com/offers/5c2e7a10-9f3b-4d8e-b1a2-6e7f8a9b0c1d"
}
],
"orderItem": [
{
"orderItemNumber": "1",
"orderQuantity": 2,
"orderItemStatus": "https://schema.org/OrderInTransit",
"orderedItem": {
"at_id": "https://apis.objectsgrid.com/products/2b5f8f0e-1d0c-4d61-9a7e-5a1f0c3e9d21"
}
}
],
"orderDelivery": [
{
"trackingNumber": "1Z999AA10123456784",
"trackingUrl": "https://carrier.example/track/1Z999AA10123456784",
"itemShipped": [
"1"
],
"deliveryAddress": {
"streetAddress": "Invalidenstr. 1",
"postalCode": "10115",
"addressLocality": "Berlin",
"addressCountry": "DE"
}
}
]
}
Fields¶
Required: acceptedOffer, customer, orderDate, orderItem, seller.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
Order |
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. |
|
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
image |
URL | image URL | |
name |
list of LanguageTaggedString | The Product Name. See schema.org/name. | |
description |
list of LanguageTaggedString | The Product Description. See schema.org/description. | |
url |
URL | This Product URL | |
acceptedOffer |
list of References to Offer | Yes | A pointer to an Offer that has been accepted as a valid offer for this item. A checkout writes |
billingAddress |
PostalAddress | The billing address. Personal: encrypted with the key of the customer's pinned Person version, so it is kept and erased with it. | |
broker |
Reference to Organization or Person | An entity that arranges for an exchange between a buyer and a seller. | |
confirmationNumber |
string | A number that confirms the given order or payment has been received. | |
customer |
Reference to Person or Organization | Yes | Party placing the order or paying the invoice: the URL of a Person or Organization, stored as |
discount |
number | Any discount applied (to an Order, Invoice, etc.). | |
discountCode |
string | Code used to redeem a discount. | |
discountCurrency |
CurrencyCodeEnumeration | The currency (in 3-letter ISO 4217 format) of the discount. | |
isGift |
boolean | Whether the order is a gift. | |
orderDelivery |
list of ParcelDelivery | The parcels sent for the order, with their tracking and delivery addresses. Personal: encrypted with the key of the customer's pinned Person version, as billingAddress is, so it is kept and erased with it, and never in events or search. | |
orderDate |
date-time | Yes | The date that the order was placed. |
orderNumber |
string | The identifier of the order. | |
orderStatus |
OrderStatus | The current status of the order. | |
orderItem |
list of OrderItem | Yes | The lines of the order: what was ordered, how many, and each line's status. |
partOfInvoice |
Reference to Invoice | The order is being paid as part of the referenced Invoice. | |
returnActions |
computed: list of ReturnAction | The returns of the Order's lines. ObjectsGrid's own field. Computed, read-only: the objects whose ReturnAction.object points to this object, listed from that type; never stored or written. | |
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). | |
paymentUrl |
URL | A URL that can be used to pay for the order. | |
seller |
Reference to Organization or Person | Yes | An entity which offers (sells / leases / licenses etc.) the services / goods. A seller may also be a provider. |
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 []. |
|
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 |
|---|---|
| Check out a Cart into an Order | POST /carts/{id}/checkout |
| Create | POST /orders |
| List and search | GET /orders |
| Create up to 100 at once | POST /orders/batch |
| Retrieve | GET /orders/{id} |
| Replace | PUT /orders/{id} |
| Update some fields | PATCH /orders/{id} |
| Delete | DELETE /orders/{id} |
Order objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.
The OpenAPI contract, with every parameter and response: Carts (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | order(id: ID!, version: String): Order |
| Query | orders(where: OrderWhereInput, orderBy: [OrderOrderByInput!], first: Int, after: String): OrderConnection! |
| Query | ordersGroupBy(by: [OrderGroupByField!]!, where: OrderWhereInput, having: OrderHavingInput, orderBy: [OrderGroupByOrderByInput!], first: Int, after: String): OrderGroupByConnection! |
| Mutation | checkoutCart(id: ID!, input: CheckoutCartInput): Order! |
| Mutation | createOrder(input: CreateOrderInput!): Order! |
| Mutation | updateOrder(input: UpdateOrderInput!, expectedVersion: String): Order! |
| Mutation | deleteOrder(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when an Order changes:
OrderCreated, OrderUpdated, OrderPatched, OrderDeleted.