# The return model

Source: https://developers.swell.is/backend-api/returns/the-return-model

## Fields

- `id` (objectId): Unique identifier for the return.
- `order_id` (objectId, required): ID of the order this return was created for.
- `canceled` (boolean): Indicates the return was canceled.
- `carrier` (string): ID of a third-party carrier offering the service, if applicable.
- `carrier_name` (string): Name of a third-party carrier offering the service, if applicable.
- `credit_tax` (currency, auto): Total amount of taxes credited to the order for the returned items.
- `credit_total` (currency, auto): Total amount of additional credit applied to the order.
- `currency` (string): Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
- `date_created` (date, auto): Date and time the return was created.
- `date_estimated` (date): Date the expected return shipment is meant to arrive at a warehouse, if applicable.
- `date_updated` (date, auto): Date and time the return was last updated.
- `destination` (object): The intended return destination.
  - `location` (string): ID of the intended return destination, if applicable. Default: `"default"`.
- `extra_credit` (currency): Arbitrary amount to apply to the order as compensation for their inconvenience.
- `item_quantity_receivable` (int, auto): Total quantity of line items that can still be received in a return shipment.
- `item_quantity_received` (int, auto): Total quantity of line items that have been received in a return shipment.
- `item_quantity_restockable` (int, auto): Total quantity of line items that can still be restocked to product inventory.
- `item_quantity_restocked` (int, auto): Total quantity of line items that have been restocked to product inventory.
- `notes` (string): Internal admin notes, not visible to the customer.
- `notifications` (Notification): Expandable list of notifications sent on behalf of the products returned.
- `number` (string, auto): Unique incremental return number, assigned automatically.
- `order` (Order): Expandable link to the order.
- `origin` (object): The customer's location of origin for the return shipment.
  - `name` (string, required): Origin customer name.
  - `country` (string, required): Two-letter ISO country code in uppercase.
  - `address1` (string, required): Origin address line 1: street address/PO box/company name.
  - `address2` (string): Origin address line 2: apartment/suite/unit/building.
  - `city` (string): Origin city/district/suburb/town/village.
  - `state` (string): Origin state/county/province/region.
  - `zip` (string): Origin zip/postal code.
  - `phone` (string): Origin phone number.
- `reason_code` (string): Code indicating the reason for the return.
- `received` (boolean, auto): Indicates that all items have been received in a return shipment. Default: `false`.
- `restock_fee` (currency): Amount to charge the customer for re-stocking the returned items.
- `service` (string): ID of a shipping service as configured in shipment settings.
- `service_name` (string): Name of the return shipping service.
- `shipment_tax` (currency, auto): Amount to apply to the order as a credit as compensation for the original shipping tax.
- `shipment_total` (currency): Amount to apply to the order as a credit as compensation for the original shipping price.
- `tracking_code` (string): Tracking code used to identify the return shipment, if applicable.

## Example response

```json
{
  "id": "60f199509111e70000000078",
  "items": [
    {
      "id": "5ca537326a0ec32a521139dd",
      "order_item_id": "5a9ea7ba3f95740a914267f2",
      "product_id": "5cad15bc9b14d1990724663b",
      "quantity": 2,
      "quantity_received": 0,
      "quantity_receivable": 2,
      "quantity_restocked": 0,
      "quantity_restockable": 2
    }
  ],
  "order_id": "60f199509111e7000000007a",
  "currency": "USD",
  "date_created": "2021-07-16T14:36:00.399Z",
  "date_updated": "2021-07-16T14:36:00.399Z",
  "origin": {
    "name": "Jon Snow",
    "address1": "1 Main Street",
    "city": "Brooklyn",
    "state": "NY",
    "zip": 11201,
    "country": "US",
    "phone": "(555) 555-5555"
  },
  "received": false,
  "service": "fedex_ground",
  "tracking_code": "T192000000XYZ"
}
```
