Skip to content

PayAction

A PayAction records one payment or refund that your payment provider made: what it pays (object, an Order or Invoice), who pays (agent, pinned) whom (recipient), the amount (price, priceCurrency), its status (ActionStatusType), the provider and its id of the payment (providerPaymentId), and how it was paid, for display (PaymentMethod). A refund is a PayAction the other way round, with refundOf. ObjectsGrid takes no payment and holds no card data; see Carts and checkout. The Order and Invoice list their PayActions in payments. A PayAction is a private record: it has no JSON-LD document.

Modeled on schema.org/PayAction · JSON Schema · ABAC object type PayAction

Example

Create one with POST /payactions:

{
  "object": {
    "at_id": "https://apis.objectsgrid.com/orders/3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f"
  },
  "agent": {
    "at_id": "https://apis.objectsgrid.com/persons/8e9f0a1b-2c3d-4e5f-8a6b-7c8d9e0f1a2b"
  },
  "recipient": {
    "at_id": "https://apis.objectsgrid.com/organizations/6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d"
  },
  "price": 49.9,
  "priceCurrency": "EUR",
  "actionStatus": "https://schema.org/CompletedActionStatus",
  "providerPaymentId": "pi_3Q0a1b2c3d4e5f",
  "instrument": {
    "at_type": "PaymentCard",
    "paymentMethodType": "card",
    "name": "Visa ending 4242"
  },
  "startTime": "2026-11-27T10:00:00Z",
  "endTime": "2026-11-27T10:00:02Z"
}

Fields

Required: object, price, priceCurrency.

Field Type Required Description
at_context https://schema.org JSON-LD @context, always https://schema.org.
at_type PayAction 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.
url URL The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid.
object Reference to Order or Invoice Yes What it pays for
agent Reference to Organization or Person Who pays: the customer, or the shop for a refund; stored as ?version=, as an Order's customer
recipient Reference to Organization or Person Who is paid: the shop, or the customer for a refund
price number Yes The amount
priceCurrency string Yes The currency, an ISO 4217 code such as EUR
actionStatus ActionStatusType Potential (created), Active (pending), Completed (paid) or Failed
error string Why it failed, as the provider says
provider Reference to Organization The payment provider, e.g. an Organization for Stripe
providerPaymentId string The provider's id of the payment or refund, e.g. pi_3Q...: look it up to find the PayAction a webhook is about. ObjectsGrid's own field.
instrument PaymentMethod How it was paid, for display
startTime date-time When it started
endTime date-time When it completed or failed
refundOf Reference to PayAction For a refund: the payment it refunds. ObjectsGrid's own field.
description string A note
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.

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 /payactions
List and search GET /payactions
Create up to 100 at once POST /payactions/batch
Retrieve GET /payactions/{id}
Replace PUT /payactions/{id}
Update some fields PATCH /payactions/{id}
Delete DELETE /payactions/{id}

PayAction objects have no JSON-LD document: asked for one (Accept: application/ld+json), GET answers 406.

The OpenAPI contract, with every parameter and response: PayActions (JSON).

GraphQL

Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.

Operation Field
Query payAction(id: ID!, version: String): PayAction
Query payActions(where: PayActionWhereInput, orderBy: [PayActionOrderByInput!], first: Int, after: String): PayActionConnection!
Query payActionsGroupBy(by: [PayActionGroupByField!]!, where: PayActionWhereInput, having: PayActionHavingInput, orderBy: [PayActionGroupByOrderByInput!], first: Int, after: String): PayActionGroupByConnection!
Mutation createPayAction(input: CreatePayActionInput!): PayAction!
Mutation updatePayAction(input: UpdatePayActionInput!, expectedVersion: String): PayAction!
Mutation deletePayAction(id: ID!, expectedVersion: String): Boolean!

Webhook events

Subscribe to these events in your webhook configuration to be called when a PayAction changes:

PayActionCreated, PayActionUpdated, PayActionPatched, PayActionDeleted.