This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GraphQL: Add RMA mutations #8258
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b0b3884
GraphQL: Add RMA mutations
keharper 9675955
Merge branch '2.4.2-develop' of github.com:magento/devdocs into kh_rm…
keharper 0ee015a
GraphQL: Add RMA mutations
keharper edcc3fe
update customer object
keharper 482ac39
Merge branch '2.4.2-develop' of github.com:magento/devdocs into kh_rm…
keharper fa032dd
Add RMA mutations
keharper 1598108
schema updates
keharper 36a9549
Fix typos/formatting
keharper ccd3585
Fix typos/formatting
keharper 2972205
fix highlighting
keharper 69d5215
Merge branch '2.4.2-develop' into kh_rma-mutations
keharper 1636e15
Merge branch '2.4.2-develop' of github.com:magento/devdocs into kh_rm…
keharper 611c56f
Update uid descriptions
keharper 5966d2c
Merge branch 'kh_rma-mutations' of github.com:magento/devdocs into kh…
keharper 1175e25
Merge branch '2.4.2-develop' into kh_rma-mutations
keharper bd22fd8
Apply suggestions from code review
keharper e5b7712
minor formatting updates
keharper 3d206f3
Update rel notes
keharper 8c973d7
fix merge conflicts
keharper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
The `Return` object can contain the following attributes: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`available_shipping_carriers` | [ReturnShippingCarrier] | A list of shipping carriers available for returns | ||
`comments`| [ReturnComment] | A list of comments posted for the return request | ||
`created_at` | String! | The date the return was requested | ||
`customer_email` | String! | Email of the person who created the return request | ||
`customer` | [ReturnCustomer](#ReturnCustomer) | The name of the person who requested the return | ||
`items`| [[ReturnItem]](#ReturnItem) | A list of items being returned | ||
`number` | String! | Human-readable return number | ||
`order` | [CustomerOrder]({{page.baseurl}}/graphql/queries/customer.html#orders) | The order associated with the return | ||
`shipping` | [ReturnShipping](#ReturnShipping) | Shipping information for the return | ||
`status` | ReturnStatus | An enum indicating the status of the return request. Possible values are APPROVED, AUTHORIZED, CLOSED, DENIED, PARTIALLY_APPROVED, PARTIALLY_AUTHORIZED, PARTIALLY_RECEIVED, PARTIALLY_REJECTED, PENDING, PROCESSED_AND_CLOSED, RECEIVED, and REJECTED | ||
`uid` | ID! | The unique ID of a `Return` object | ||
|
||
#### ReturnComment attributes {#ReturnComment} | ||
|
||
The ReturnComment object provides details about an individual comment in a refund request. Comments can be added by a customer or the merchant. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`author_name` | String! | The name or author who posted the comment | ||
`created_at` | String! | The date and time the comment was posted | ||
`text` | String! | The contents of the comment | ||
`uid` | ID! | The unique ID of a `ReturnComment` object | ||
|
||
#### ReturnCustomAttribute attributes {#ReturnCustomAttribute} | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`label` | String! | A description of the attribute | ||
`uid` | ID! | The unique ID of a `ReturnCustomAttribute` attribute | ||
`value` | String! | A JSON-encoded value of the attribute | ||
|
||
#### ReturnCustomer attributes {#ReturnCustomer} | ||
|
||
The ReturnCustomer object contains information about the person requesting a return. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`email` | String! | The email address of the refund requester | ||
`firstname` | String | The first name of the refund requester | ||
`lastname` | String | The last name of the refund requester | ||
|
||
#### ReturnItem attributes {#ReturnItem} | ||
|
||
The ReturnItem object provides details about an individual item in a return request. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`custom_attributes` | [[ReturnCustomAttribute]](#ReturnCustomAttribute) | Return item custom attributes that are visible on the storefront | ||
`order_item` | [OrderItemInterface!]({{page.baseurl}}/graphql/interfaces/order-item-interface.html) | Provides access to the product being returned, including information about selected and entered options | ||
`quantity` | Float! | The quantity of the item the merchant authorized to be returned | ||
`request_quantity` | Float! | The quantity of the item requested to be returned | ||
`status`| ReturnItemStatus! | An enum indicating the return status of the item. Possible values are APPROVED, AUTHORIZED, DENIED, PENDING, RECEIVED, and REJECTED | ||
`uid`| ID! | The unique ID of an item of a `Return` object | ||
|
||
#### ReturnShipping attributes {#ReturnShipping} | ||
|
||
The ReturnShipping object can contain the merchant's shipping address and tracking information. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`address`| [ReturnShippingAddress](#ReturnShippingAddress) | The merchant-defined return shipping address | ||
`tracking(uid: ID)` | [[ReturnShippingTracking](#ReturnShippingTracking)] | The unique ID for a `ReturnShippingTracking` object. If a single UID is specified, contains a single tracking record. Otherwise, contains all tracking information | ||
|
||
#### ReturnShippingAddress attributes {#ReturnShippingAddress} | ||
|
||
The ReturnShippingAddress object defines the merchant address for receiving returned items. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`city` | String! | The city for product returns | ||
`contact_name` | String | The merchant's contact person | ||
`country` | Country! | An object that defines the country for product returns | ||
`postcode` | String! | The postal code for product returns | ||
`region` | Region! | An object that defines the state or province for product returns | ||
`street` | [String]! | The street address for product returns | ||
`telephone` | String | The telephone number for product returns | ||
|
||
#### ReturnShippingCarrier attributes {#ReturnShippingCarrier} | ||
|
||
The ReturnShippingCarrier object contains details about the shipping carrier used to return a product. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`label` | String! | A description of the shipping carrier | ||
`uid` | ID! | The unique ID of a `ReturnShippingCarrier` object | ||
|
||
#### ReturnShippingTracking attributes {#ReturnShippingTracking} | ||
|
||
The ReturnShippingTracking object contains tracking information for an approved return. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`carrier` | [ReturnShippingCarrier!](#ReturnShippingCarrier) | Contains details of a shipping carrier | ||
`status` | [ReturnShippingTrackingStatus](#ReturnShippingTrackingStatus) | Contains details about the status of a shipment | ||
`tracking_number` | String! | A tracking number assigned by the carrier | ||
`uid` | ID! | The unique ID assigned of a `ReturnShippingTracking` object | ||
|
||
#### ReturnShippingTrackingStatus attributes {#ReturnShippingTrackingStatus} | ||
|
||
The ReturnShippingTrackingStatus object contains tracking status information for an approved return. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`text` | String! | Text that describes the status | ||
`type` | ReturnShippingTrackingStatusType! | An enum indicating whether the status type is INFORMATIONAL or an ERROR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/guides/v2.4/graphql/mutations/add-return-comment.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
group: graphql | ||
title: addReturnComment mutation | ||
--- | ||
|
||
The `addReturnComment` mutation adds a comment to an existing return request. | ||
|
||
## Syntax | ||
|
||
```graphql | ||
mutation: { | ||
addReturnComment(input: AddReturnCommentInput!): AddReturnCommentOutput | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example adds a comment in response to the merchant. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation{ | ||
addReturnComment(input: { | ||
return_uid: "Mw==" | ||
comment_text: "I'd like a refund"}) | ||
{ | ||
return { | ||
uid | ||
status | ||
comments { | ||
uid | ||
author_name | ||
text | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"addReturnComment": { | ||
"return": { | ||
"uid": "Mw==", | ||
"status": "PENDING", | ||
"comments": [ | ||
{ | ||
"uid": "NQ==", | ||
"author_name": "Customer Service", | ||
"text": "We placed your Return request." | ||
}, | ||
{ | ||
"uid": "Ng==", | ||
"author_name": "Bob Loblaw", | ||
"text": "I want to return the shirt because I don't like the texture of the fabric" | ||
}, | ||
{ | ||
"uid": "Nw==", | ||
"author_name": "Customer Service", | ||
"text": "OK. Would you like a refund or store credit?" | ||
}, | ||
{ | ||
"uid": "OA==", | ||
"author_name": "Bob Loblaw", | ||
"text": "I'd like a refund" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `AddReturnCommentInput` object must contain the following attributes: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`comment_text` | String! | The text added to the return request | ||
`return_uid` | ID! | The unique ID of a `Return` object | ||
|
||
## Output attributes | ||
|
||
The `AddReturnCommentOutput` object contains the `Return` object. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`return` | Return | Contains details about the modified return | ||
|
||
### Return object {#Return} | ||
|
||
{% include graphql/return.md %} | ||
|
||
## Related topics | ||
|
||
* [`requestReturn` mutation]({{page.baseurl}}/graphql/mutations/request-return.html) | ||
* [`addReturnTracking` mutation]({{page.baseurl}}/graphql/mutations/add-return-tracking.html) | ||
* [`removeReturnTracking` mutation]({{page.baseurl}}/graphql/mutations/remove-return-tracking.html) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.