Skip to main content

Links between Order Return Request Module and Other Modules

This document showcases the module links defined between the Order Return Request Module and other Commerce Modules.

Summary

The Order Return Request Module has the following links to other modules:
First Data ModelSecond Data ModelTypeDescription
OrderReturnRequestOrderStored - many-to-oneAssociates return requests with the original order
SellerOrderReturnRequestStored - one-to-manyAssociates a seller with their return requests

Order Module

Mercur defines a link between the Order Return Request Module’s OrderReturnRequest data model and the Order Module’s Order data model. This allows return requests to be associated with the original order being returned.

Retrieve with Query

To retrieve the order of a return request with Query, pass order.* in fields:
const { data: returnRequests } = await query.graph({
  entity: "order_return_request",
  fields: [
    "*",
    "order.*",
  ],
})

// returnRequests[0].order
To manage the order association of a return request, use Link:

Seller Module

Mercur defines a link between the Seller Module’s Seller data model and the Order Return Request Module’s OrderReturnRequest data model. This allows tracking which return requests belong to each seller for vendor review and processing.

Retrieve with Query

To retrieve the return requests of a seller with Query, pass order_return_request.* in fields:
const { data: sellers } = await query.graph({
  entity: "seller",
  fields: [
    "*",
    "order_return_request.*",
  ],
})

// sellers[0].order_return_request
To manage the return requests of a seller, use Link: