# ReturnGO

> Read and manage return requests, shipment tracking and return transactions.

App · 10 actions. Web page: https://docs.lodol.com/docs/integrations/returngo

## Actions

### Add a return comment

Add comment to RMA timeline.

**Inputs**

- Rma (`rma_id`, text, required): The ID of the RMA to add the comment for. E.g. for RMA1234, the ID is 1234
- Html text (`html_text`, text, required): The note itself, as HTML code

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "commentType": "merchant",
    "datetime": "example",
    "htmlText": "example",
    "triggeredBy": "example"
  }
}
```

### Create return request

Create a new RMA for the given order items, and the policies to use for each.

**Inputs**

- Returned items (`returned_items`, list, required): The order items to be returned
- Status (`status`, text, required): The desired status for the RMA. Valid values are: Pending, Approved, Received, Validated, Done, Rejected, Canceled Note: if any automation is configured in the policy (auto-approve/auto-done), it will be applied so the resulting status may be more advanced than requested. One of: `Pending`, `Approved`, `Received`, `Validated`, `Done`, `Rejected`, `Canceled`.

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "cancellationFee": 1.0,
    "comments": [],
    "createdAt": "example",
    "exchangeItems": [],
    "exchangeOrders": [],
    "isOutOfPolicy": false,
    "items": [],
    "lastUpdated": "example",
    "orderDetails": {
      "glbe_order_id": "example",
      "orderId": "example",
      "order_name": "example"
    },
    "rmaSummary": {
      "events": [],
      "glbe_order_id": "example",
      "order_name": "example",
      "rmaId": "example",
      "status": "Pending"
    },
    "shipments": [],
    "transactions": []
  }
}
```

### Delete return shipment

Delete Shipment.

**Inputs**

- Shipment ID (`shipment_id`, text, required): The ID of the shipment

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "actualServiceLevel": "example",
    "carrierName": "example",
    "customerAddress": {
      "city": "example",
      "country": "example",
      "email": "example",
      "name": "example",
      "phone": "example",
      "state": "example",
      "street1": "example",
      "street2": "example",
      "zip": "example"
    },
    "isOutbound": false,
    "labelURL": "example",
    "requestedServiceLevel": "example",
    "returnAddress": {
      "city": "example",
      "country": "example",
      "email": "example",
      "name": "example",
      "phone": "example",
      "state": "example",
      "street1": "example",
      "street2": "example",
      "zip": "example"
    },
    "shipmentId": "example",
    "status": "Pending",
    "trackingNumber": "example",
    "trackingURL": "example"
  }
}
```

### Get eligible return policies

Get the eligible policies for the given order items.

**Inputs**

- Return items (`return_items`, list, required): The returned items in the request

**Outputs**

- `data` (list): The response from ReturnGO.

**Example output**

```json
{
  "data": []
}
```

### Get return request

Get RMA details.

**Inputs**

- Rma (`rma_id`, text, required): The ID of the RMA to get the details of. E.g. for RMA1234, the ID is 1234
- Include media (`include_media`, true/false): Include media files in the response. If false or ommitted, media answers are not included

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "cancellationFee": 1.0,
    "comments": [],
    "createdAt": "example",
    "exchangeItems": [],
    "exchangeOrders": [],
    "isOutOfPolicy": false,
    "items": [],
    "lastUpdated": "example",
    "orderDetails": {
      "glbe_order_id": "example",
      "orderId": "example",
      "order_name": "example"
    },
    "rmaSummary": {
      "events": [],
      "glbe_order_id": "example",
      "order_name": "example",
      "rmaId": "example",
      "status": "Pending"
    },
    "shipments": [],
    "transactions": []
  }
}
```

### List return requests

List and search RMAs.

**Inputs**

- Pagesize (`pagesize`, number): Maximum results to return in one page. From 1 to 500. Default: `50`.
- Cursor (`cursor`, text): The position to start from, as received from a previous call. If not present, start from the beginning
- Sort by (`sort_by`, list): Sort results by these dates, in the chosen order. One or more of: `+rma_created_at` (Created, oldest first), `-rma_created_at` (Created, newest first), `+rma_updated_at` (Updated, oldest first), `-rma_updated_at` (Updated, newest first).
- Created since (`created_since`, date and time): Created since this date and time.
- Updated since (`updated_since`, date and time): Updated since this date and time.
- Status (`status`, list): Return statuses to include. One or more of: `Pending`, `Approved`, `Received`, `Validated`, `Done`, `Rejected`, `Canceled`.
- Order name (`order_name`, text): A comma delimited list of order names e.g order_name=1001,1002 ...
- Glbe order ID (`glbe_order_id`, text): A comma delimited list of Global-e order ids e.g glbe_order_id=GE748856588IL,GE660444968NL ...
- Customer IDs (`customer_ids`, text): A comma delimited list of customer ids e.g customer_ids=6898673516706,6433510031522 ...
- Tracking numbers (`tracking_numbers`, text): A comma delimited list of tracking numbers e.g tracking_numbers=113498651924,390730297459 ...

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "next_cursor": "example",
    "rmas": []
  }
}
```

### List return transactions

List and search all transactions.

**Inputs**

- Pagesize (`pagesize`, number): Maximum results to return in one page. From 1 to 500. Default: `50`.
- Cursor (`cursor`, text): The position to start from, as received from a previous call. If not present, start from the beginning
- Created since (`created_since`, date and time): Created since this date and time.
- Updated since (`updated_since`, date and time): Updated since this date and time.
- Rma IDs (`rma_ids`, text): A comma delimited list of RMA IDs, e.g rma_ids=120,121,...
- Order IDs (`order_ids`, text): A comma delimited list of order IDs, e.g rma_ids=3247583,2547583,... **NOTE:** The Order ID is the e-commerce platform's internal identifier for the order, not the customer facing order number/name
- Statuses (`statuses`, text): A comma delimited list of transaction statuses. One of: `Requested`, `Success`, `Failed`, `Canceled`.
- Types (`types`, text): A comma delimited list of transaction types. One of: `RefundToPaymentMethod`, `RefundToStoreCredit`, `RefundToGiftCard`, `RefundToBankAccount`, `PaymentAuthorization`, `PaymentCapture`, `InvoicePayment`, `InvoiceAdjustmentPositive`, `InvoiceAdjustmentNegative`.
- Processors (`processors`, text): A comma delimited list of transaction processors
- Ids (`ids`, text): A comma delimited list of transaction IDs, e.g ids=9538329,4829042,...

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "next_cursor": "example",
    "transactions": []
  }
}
```

### List webhooks

List of Registered Webhooks.

**Inputs**: None.

**Outputs**

- `data` (list): The response from ReturnGO.

**Example output**

```json
{
  "data": []
}
```

### Set return status

Set RMA status.

**Inputs**

- Rma (`rma_id`, text, required): The ID of the RMA to change status for. E.g. for RMA1234, the ID is 1234
- Status (`status`, text, required): The new status to transition the RMA to. Valid values are: Pending, Approved, Received, Validated, Done, Rejected, Canceled
- Reject reason (`reject_reason`, text): The reason to include in the customer notification when rejecting. If no reason is passed, the default reason is used. Note that an empty string is considered a valid value.
- Cancel reason (`cancel_reason`, text): The reason to include in the customer notification when rejecting. If no reason is passed, the default reason is used. Note that an empty string is considered a valid value.
- New return method for all items (`new_return_method_for_all_items`, text): The internal name of the return method to set for the RMA. Only applicable when setting status to Approved. If the field is omitted and status = approved, the return method is not changed. The return method is applied to all items in the RMA. Note: If there are two return methods with the same internal name, the operation will fail
- Items validation statuses (`items_validation_statuses`, list): The item validation status information. Pass items with returnedItemId which should be validated. Note that this action is possible only when setting the status to "Validated"

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "cancellationFee": 1.0,
    "comments": [],
    "createdAt": "example",
    "exchangeItems": [],
    "exchangeOrders": [],
    "isOutOfPolicy": false,
    "items": [],
    "lastUpdated": "example",
    "orderDetails": {
      "glbe_order_id": "example",
      "orderId": "example",
      "order_name": "example"
    },
    "rmaSummary": {
      "events": [],
      "glbe_order_id": "example",
      "order_name": "example",
      "rmaId": "example",
      "status": "Pending"
    },
    "shipments": [],
    "transactions": []
  }
}
```

### Track shipment

Track Shipment.

**Inputs**

- Shipment ID (`shipment_id`, text, required): The ID (on the platform) of the shipment
- Shipment creation date (`shipment_creation_date`, date and time, required): The date and time when the shipment was created
- Order ID (`order_id`, text, required): The ID of the e-commerce platform's order of the shipment
- Line items (`line_items`, list): The line item ID of the item, as used on the e-commerce platform's order
- Destination zip (`destination_zip`, text, required): Zip code of the destination address
- Tracking number (`tracking_number`, text, required): The tracking number of the shipment.
- Tracking url (`tracking_url`, text): The tracking URL of the shipment.
- Carrier name (`carrier_name`, text): The carrier of the shipment. This is the name of the shipping carrier

**Outputs**

- `data` (object): The response from ReturnGO.

**Example output**

```json
{
  "data": {
    "details": {},
    "reason": "example",
    "success": false
  }
}
```
