Skip to content

ReturnAction

A ReturnAction is a return of some of an Order's lines (object): which lines and how many (returnedItem, by their orderItemNumber, with a reason), who returns them (agent, pinned like an Order's customer), who takes them (recipient), its status (ActionStatusType: PotentialActionStatus when asked for, CompletedActionStatus when refunded), the return method and fees, the refund (refundType, refundAmount) and its credit note or replacement Order (result). The Order lists its returns in returnActions. returnDelivery, the parcel back with the customer's address, is personal data; see Personal data and erasure. A ReturnAction is a private record: it has no JSON-LD document.

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

Example

Create one with POST /returnactions:

{
  "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"
  },
  "actionStatus": "https://schema.org/PotentialActionStatus",
  "returnedItem": [
    {
      "orderItemNumber": "1",
      "quantity": 1,
      "returnReason": "Too small"
    }
  ],
  "returnMethod": "https://schema.org/ReturnByMail",
  "refundType": "https://schema.org/FullRefund"
}

Fields

Required: object, agent, returnedItem.

Field Type Required Description
at_context https://schema.org JSON-LD @context, always https://schema.org.
at_type ReturnAction 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 Yes The Order the lines are returned from
agent Reference to Person or Organization Yes The customer returning them: the URL of a Person or Organization, stored as ?version=, the version that was newest when the return was written, as an Order's customer.
recipient Reference to Organization or Place or Person Who takes the return: the shop or a store
actionStatus ActionStatusType Where the return stands: Potential (requested), Active (in progress), Completed (refunded or exchanged), Failed (refused)
startTime date-time When the return was asked for
endTime date-time When the return was done
returnedItem list of object Yes The Order's lines returned, by their orderItemNumber. ObjectsGrid's own field.
returnedItem[].orderItemNumber string Yes The orderItemNumber of the Order's line
returnedItem[].quantity number How many of the line are returned; all when not given
returnedItem[].returnReason string Why, as the customer or the shop puts it: not for personal details
returnMethod ReturnMethodEnumeration How the items come back: by mail, in store, at a kiosk
refundType RefundTypeEnumeration Full refund, exchange or store credit
refundAmount MonetaryAmount What was refunded. ObjectsGrid's own field.
returnFees ReturnFeesEnumeration Who pays for the return
returnDelivery list of ParcelDelivery The parcels back, with their tracking and the customer's address. Personal: encrypted with the key of the agent's pinned Person version, as an Order's orderDelivery is, and never in events or search. ObjectsGrid's own field.
result Reference to Invoice or Order What came of it: a credit note (an Invoice), or the replacement Order of an exchange
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 /returnactions
List and search GET /returnactions
Create up to 100 at once POST /returnactions/batch
Retrieve GET /returnactions/{id}
Replace PUT /returnactions/{id}
Update some fields PATCH /returnactions/{id}
Delete DELETE /returnactions/{id}

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

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

GraphQL

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

Operation Field
Query returnAction(id: ID!, version: String): ReturnAction
Query returnActions(where: ReturnActionWhereInput, orderBy: [ReturnActionOrderByInput!], first: Int, after: String): ReturnActionConnection!
Query returnActionsGroupBy(by: [ReturnActionGroupByField!]!, where: ReturnActionWhereInput, having: ReturnActionHavingInput, orderBy: [ReturnActionGroupByOrderByInput!], first: Int, after: String): ReturnActionGroupByConnection!
Mutation createReturnAction(input: CreateReturnActionInput!): ReturnAction!
Mutation updateReturnAction(input: UpdateReturnActionInput!, expectedVersion: String): ReturnAction!
Mutation deleteReturnAction(id: ID!, expectedVersion: String): Boolean!

Webhook events

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

ReturnActionCreated, ReturnActionUpdated, ReturnActionPatched, ReturnActionDeleted.