ReturnGO Create RMA By Policy
Creates a new RMA under a chosen return policy and generates a return label
This action creates a new RMA (return) in ReturnGO for a single order line item under the return policy you choose. ReturnGO generates a return shipping label for the RMA, and the action returns the new RMA ID, its status and the label URL(s).
Recommended flowRun ReturnGO Get Eligible Policies first, using the same order, line item, quantity and return reason. Then pass one of its Eligible Policy Names into Policy Name here. If the item isn't eligible for the policy you pass, ReturnGO rejects the request.
- The action creates one RMA for one line item. Only one order per RMA is allowed.
- The RMA is created as Pending unless you set a different Status. If the policy has automations set up in ReturnGO (e.g. auto-approve or auto-done), the RMA can end up at a later status than the one you asked for. Check RMA Status to see the actual result.
- To create the RMA and record the inspection result in the same step, provide Is Restockable and Is Returned together.
Inputs
In order to use the action in your flow you need to provide it with the following inputs:
| Input | Type | Description |
|---|---|---|
| API Secret | String | Authentication key (sent as the x-api-key header). |
| Shop Name | String | This refers to the x-shop-name header in the API. The shop to operate on, e.g. example.myshopify.com.To find your shop URL, click on the "copy" icon next to your store name at the top of the ReturnGO dashboard. |
| Order ID | String | The platform's internal order ID. This is not the customer-facing order name (e.g. for Shopify, use the order id, not order_name / #1234). |
| Shop Line Item ID | String | The ID of the line item on the order that the customer wants to return. |
| Quantity | Number | The number of units from this line item to include in the RMA. |
| Return Reason Name | String | The return reason to use for this item. |
| Policy Name | String | The internal name of the return policy to create the RMA under. Confirm it with ReturnGO Get Eligible Policies, based on the customer's return reason. |
| Status | Optional String | The status to give the new RMA. Possible values: Pending, Approved, Received, Validated, Done, Rejected, Canceled. Defaults to Pending. Any other value causes an error. |
| Is Restockable | Optional Boolean | Whether the item was found restockable during inspection. Use this when the item is returned and checked in the same step. Must be provided together with Is Returned, or not at all. |
| Is Returned | Optional Boolean | Whether the item was marked as returned during inspection. Must be provided together with Is Restockable, or not at all. |
| Non-Restockable Reason | Optional String | Why the item can't be restocked, when Is Restockable is False. Only sent when Is Restockable and Is Returned are both provided. Otherwise it is ignored. |
| Non-Returned Reason | Optional String | Why the item wasn't returned, when Is Returned is False. Only sent when Is Restockable and Is Returned are both provided. Otherwise it is ignored. |
| Safe Mode | Optional Boolean | If set to True, errors (invalid status, item not eligible for the policy, order not found, items not available for return, auth failures, rate limits, server errors, timeouts) are returned in the Error output and the flow keeps running. If False, an error stops the flow. Defaults to False. |
Outputs
| Output | Type | Description |
|---|---|---|
| Success? | Boolean | True if the RMA was created; False if it wasn't. |
| RMA ID | String | The ID of the new RMA. |
| RMA Status | String | The status of the new RMA. This can be later than the requested Status if the policy has automations set up. |
| Label Found? | Boolean | True if a return shipping label was generated for the new RMA. |
| Label URL | String | The URL of the first return label found, if any. |
| Label URLs | List | All return label URLs found across the new RMA's shipments. |
| RMA Data | Object | Object containing the full details of the new RMA. |
| Error | String | The error message when the call fails and Safe Mode is enabled, including ReturnGO's reason when available. Null on a successful call. Common errors: • 400 – the item is not eligible for the requested policy• 404 – the order was not found• 409 – the item is not available for return on this order (e.g. it has already been returned) |
This action uses the following ReturnGO endpoint:
POST /rma/createByPolicy
https://static.returngo.ai/api-doc/returngo-api-swagger.html
Updated about 1 hour ago
