GraphQL API
Effortlessly integrate and retrieve all your RMA data with our GraphQL API. This API is designed to provide seamless access to your return management system, making it simple for developers to create custom integrations, offer personalized customer experiences, and automate processes with precision. With just a few queries, you can obtain detailed RMA data, including customer returns, statuses, and essential information.
For comprehensive information about GraphQL, refer to the GraphQL developer guide on the Magento DevDocs page.
To download RMA GraphQl collection press this download
RMA GraphQL objects overview
The Query object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
customerRmas | CustomerRmas | List of the signed-in customer's RMAs. Can be filtered by 'status_id' and 'custom_fields' |
guestCustomerRmas | RmaGuestCustomer | List of guest customer RMAs for a given order. Requires an input of type RmaGuestCustomerInput (order_id, customer_email, and optionally customer_name). The order and e-mail must match a guest order, as on the storefront guest form. |
rmaDictionary | RmaDictionary | List of RMA dictionaries |
orderRmas | [OrderRmas] | List of RMAs already created for a given order. Requires an order_id and the customer token of the customer who placed the order. |
CustomerRmas object
Array of RMAs
The CustomerRmas object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
items | CustomerRma | Array of RMAs |
CustomerRma object
RMA mapping fields
The CustomerRma object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
rma_id | Int | RMA internal ID |
id | String | RMA ID |
increment_id | String | (Deprecated: use id.) The RMA number |
status | String | The RMA status |
return_address | String | The RMA return address |
created_at | String | Created at date |
print_slip_url | String | URL to print the RMA Packing Slip |
print_label_url | String | URL to print the RMA Shipping Label |
custom_fields | RmaCustomField | List of custom fields associated with RMA |
orders | RmaOrder | RMA orders list |
messages | RmaMessages | RMA messages information |
RmaGuestCustomer object
The RmaGuestCustomer object is returned by the guestCustomerRmas query.
| Attribute | Data Type | Description |
|---|---|---|
items | CustomerRma | Array of RMAs |
OrderRmas object
The OrderRmas object is returned by the orderRmas query.
| Attribute | Data Type | Description |
|---|---|---|
id | Int | RMA ID |
increment_id | String | (Deprecated.) The RMA number |
created_at | String | Created at date |
RmaFilterInput object
The RmaFilterInput object allows you to filter RMAs based on specific criteria.
| Attribute | Data Type | Description |
|---|---|---|
status_id | Int | Status ID |
custom_fields | RmaCustomFieldInput | Custom fields (code + value) |
RmaDictionary object
RMA Dictionary
The RmaDictionary object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
statuses | RmaStatus | Array of RMA statuses |
conditions | RmaCondition | Array of RMA conditions |
reasons | RmaReason | Array of RMA reasons |
resolutions | RmaResolution | Array of RMA resolutions |
RmaStatus object
RMA Status object
The RmaStatus object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
name | String | Status name |
is_active | Boolean | Is status active |
color | String | Status color |
is_visible | Boolean | Is the status visible in the status bar |
RmaCondition object
RMA Condition object
The RmaCondition object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
name | String | Condition name |
is_active | Boolean | Is condition active |
RmaReason object
RMA Reason object
The RmaReason object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
name | String | Reason name |
is_active | Boolean | Is reason active |
RmaResolution object
RMA Resolution object
The RmaResolution object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
name | String | Resolution name |
is_active | Boolean | Is resolution active |
RmaCustomField object
RMA Custom fields object
The RmaCustomField object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
code | String | Custom field code |
name | String | Custom field name |
type | String | Custom field type |
value | String | Custom field value |
description | String | Custom field description |
is_active | Boolean | Is custom field active |
is_editable | Boolean | Is editable for customers |
is_visible | Boolean | Is visible for customers |
visible_in_status | [String] | Visible for customers in statuses |
is_required | Boolean | Is required for customers |
is_shown_on_shipping | Boolean | Is shown on shipping confirmation |
Mutation object
The Mutation object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
createRma | CreateRmaOutput | Create RMA |
addRmaMessage | AddRmaMessageOutput | Add a message to an existing RMA. Requires the customer token of the customer the RMA belongs to |
CreateRmaInput object
Defines the input to the run createRma mutation
The CreateRmaInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
guest_customer | RmaGuestCustomerInput | Defines guest customer information |
rma_orders | RmaOrderInput! | Defines orders information |
custom_fields | RmaCustomFieldInput | List of custom fields |
agree_box | Boolean | Agree with RMA policy text. Must be true when Ask to agree with RMA policy text is enabled |
reply | String | RMA Customer message |
attachments | RmaMessageAttachmentInput | Files attached to the customer message |
createRma is accepted from a signed-in customer (customer token) or from a guest who sends guest_customer. It applies the same rules as the storefront form:
- a customer can return only their own orders, a guest only the guest order that matches the e-mail, and the order must belong to the current website;
- the order must be in one of the statuses allowed for returns and within the Return Period;
custom_fieldsaccepts only the active fields a customer can fill in on the storefront form;- attachments must be valid base64 and are checked against Allow attachment upload with extensions and Limit of attachments size, Mb. Nothing is saved if one of them is refused.
CreateRmaOutput object
Defines the output for the createRma mutation
The CreateRmaOutput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
rma | Rma! | Rma Object |
RmaGuestCustomerInput object
Defines RMA guest customer information
The RmaGuestCustomerInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
order_id | Int! | Order ID |
customer_email | String! | Customer Email |
customer_name | String | Customer Name |
RmaOrderInput object
Defines RMA order information
The RmaOrderInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
order_id | String! | Order or Receipt # |
store_id | Int! | Storeview ID |
type | String! | Order type. Allowed values: regular, offline |
items | RmaItemInput! | List of RMA order items |
RmaItemInput object
Defines RMA order item information
The RmaItemInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
order_item_id | Int! | Order item ID |
qty_requested | Int! | Qty requested to return |
product_sku | String! | Product Sku |
name | String | Item name, for an offline order. The product SKU is used when it is omitted |
condition_id | Int | Condition ID |
reason_id | Int | Reason ID |
resolution_id | Int | Resolution ID |
AddRmaMessageInput object
Defines the input for the addRmaMessage mutation
The AddRmaMessageInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
rma_id | Int! | RMA internal ID |
message | String! | Message text. It can be empty when the message has attachments |
attachments | RmaMessageAttachmentInput | Files attached to the message |
A message with neither text nor attachments is refused with "Enter a message or attach a file."
RmaMessageAttachmentInput object
Defines a file attached to a message
The RmaMessageAttachmentInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
name | String! | File name |
content | String! | File content, base64-encoded |
type | String | MIME type, for example image/png. application/octet-stream is used when it is omitted |
AddRmaMessageOutput object
Defines the output for the addRmaMessage mutation
| Attribute | Data Type | Description |
|---|---|---|
rma | Rma! | Rma Object |
RmaCustomFieldInput object
Defines RMA custom field information
The RmaCustomFieldInput object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
code | String | Custom field code |
value | String | Custom field value |
Rma object
Defines RMA information
The Rma object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
rma_id | Int | RMA internal ID |
increment_id | String | RMA # |
status_id | Int | Status ID |
date_requested | String | Requested date |
orders | RmaOrder | Defines RMA orders list |
RmaOrder object
Defines RMA orders list
The RmaOrder object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
order_number | String | Order # |
type | String | Order type. Allowed values: regular, offline |
items | RmaItem | Defines RMA order items information |
RmaItem object
Defines RMA order item information
The RmaItem object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
image_url | String | Item image |
item_name | String | Item name |
item_sku | String | Item sku |
qty_requested | Int | Item qty requested |
weight | Float | Item weight, in the units defined by the store |
condition_id | Int | Condition ID |
reason_id | Int | Reason ID |
resolution_id | Int | Resolution ID |
RmaMessages object
Defines RMA messages information. This is the type returned by the messages field of the CustomerRma object above (not by the createRma mutation response, which has no messages field).
The RmaMessages object can contain the following attributes:
| Attribute | Data Type | Description |
|---|---|---|
message_id | String | Message ID |
text | String | Message text |
type | String | Message type |