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 flow

Run 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:

InputTypeDescription
API SecretStringAuthentication key (sent as the x-api-key header).
Shop NameStringThis 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 IDStringThe 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 IDStringThe ID of the line item on the order that the customer wants to return.
QuantityNumberThe number of units from this line item to include in the RMA.
Return Reason NameStringThe return reason to use for this item.
Policy NameStringThe 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.
StatusOptional StringThe 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 RestockableOptional BooleanWhether 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 ReturnedOptional BooleanWhether the item was marked as returned during inspection. Must be provided together with Is Restockable, or not at all.
Non-Restockable ReasonOptional StringWhy 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 ReasonOptional StringWhy 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 ModeOptional BooleanIf 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

OutputTypeDescription
Success?BooleanTrue if the RMA was created; False if it wasn't.
RMA IDStringThe ID of the new RMA.
RMA StatusStringThe status of the new RMA. This can be later than the requested Status if the policy has automations set up.
Label Found?BooleanTrue if a return shipping label was generated for the new RMA.
Label URLStringThe URL of the first return label found, if any.
Label URLsListAll return label URLs found across the new RMA's shipments.
RMA DataObjectObject containing the full details of the new RMA.
ErrorStringThe 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


Did this page help you?