> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer-stage.shipbob.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer-stage.shipbob.dev/_mcp/server.

# Create Return Order


POST https://sandbox-api.shipbob.com/Experimental/return
Content-Type: application/json

Creates a new return order for a previously shipped order. Specify the original shipment, inventory items to return, and requested return actions. If purchase_label is true, also purchases a return shipping label using the original_shipment_id.


Reference: https://developer-stage.shipbob.dev/experimental/api/returns/create-return-order

## Authentication

- `Authorization` header (bearer token, required) — Authentication using Personal Access Token (PAT) token
- `Authorization` header (bearer token, required) — OAuth2 authentication using JWT tokens

## Request

### Query parameters

- `api-version` (string, optional) — The requested API version

### Headers

- `shipbob_channel_id` (string, required) — Retrieve your channel ID from the [GET /channel](/api/channels/get-channels) endpoint. Use the channel ID that has write scopes.

### Body (application/json)

- `fulfillment_center` (object, required) — A Facility to process Returns.
  - `id` (integer, optional) — Unique identifier of the facility
  - `name` (string, optional, nullable) — Name of the facility (It is optional because public API integrations do not pass this)
- `inventory` (list of object, required) — Array of inventory items being returned
  - `id` (integer, required) — ID of the inventory item to return.
  - `quantity` (integer, required) — Quantity of the returned inventory item in the return.
  - `requested_action` (enum, required)
    - Allowed values: `Default`, `Restock`, `Quarantine`, `Dispose`, `Donation`
  - `lot_date` (datetime, optional, nullable) — Lot date associated with the inventory item, if applicable.
  - `lot_number` (string, optional, nullable) — Lot number associated with the inventory item, if applicable.
- `reference_id` (string, required) — Client-defined external unique identifier for the return order. If tracking id is not provided, this value must appear on the box label as RMA
- `label_format` (enum, optional, nullable) — Optional label file format. Accepted values: PDF, PNG. If not provided, carrier default format is used. Only used when purchase_label is true
  - Allowed values: `PDF`, `PNG`
- `original_shipment_id` (integer, optional, nullable) — Shipment from which the items in the return originated. Required when purchase_label is true
- `purchase_label` (boolean, optional, nullable, default: false) — If true, purchases a return shipping label after creating the return order. Requires original_shipment_id
- `shipping_service` (string, optional, nullable) — Ship option name (e.g. "ReturnsStandard") for label purchase. Only used when purchase_label is true. Resolved against available return ship options for the merchant. Falls back to cheapest if not matched
- `tracking_number` (string, optional, nullable) — Tracking number for the return shipment

## Response

### 201

Return order created successfully. When purchase_label is true and the label purchase succeeds, both return and label are populated. When purchase_label is false, only return is populated. When purchase_label is true but the label purchase fails, return is populated, label is null, and label_error explains the failure.

- `label` (object, optional, nullable) — Return shipping label details. Populated only when purchase_label is true and the label purchase succeeded. Null when purchase_label is false or the label purchase failed (in which case label_error explains why).
  - `barcode` (list of string, optional, nullable) — Carrier barcode values from label purchase. Currently null in V1
  - `carrier` (string, optional) — Name of the shipping carrier (e.g. USPS, UPS, FedEx)
  - `carrier_service` (string, optional) — Specific carrier service used (e.g. Ground Advantage, Priority Mail)
  - `label_request_id` (long, optional, nullable) — Unique identifier for this label purchase.
  - `label_url` (string, optional) — URL to download the shipping label image. Format follows the label_format request parameter (PDF or PNG) when the carrier supports it; otherwise the carrier's default format is returned.
  - `label_zpl_url` (string, optional, nullable) — URL to download the shipping label in ZPL format for thermal printers
  - `purchase_date` (datetime, optional) — Date and time when the label was purchased
  - `qrcode_url` (string, optional, nullable) — QR code image URL for label-less returns. Currently null in V1
  - `rate` (list of object, optional) — Shipping rate details including amount and currency
    - `amount` (long, optional, nullable) — Shipping rate amount in cents (e.g. 850 = $8.50). Null when the merchant-facing rate is not known for the return.
    - `currency_code` (string, optional, nullable) — ISO 4217 currency code (e.g. USD). Null when the merchant-facing rate is not known for the return.
  - `return_id` (integer, optional) — The ID of the return order this label was purchased for
  - `shipment_rate_id` (long, optional) — Unique identifier for the shipment rate from the labeling service
  - `tracking_number` (string, optional) — Carrier tracking number for the return shipment
  - `tracking_url` (string, optional, nullable) — URL to track the return shipment on the carrier website
- `label_error` (string, optional, nullable) — Human-readable error message if label purchase was requested but failed. The return is still created in this case — only the label step failed.
- `return` (object, optional) — The created return order details
  - `arrived_date` (datetime, optional, nullable) — The date and time when the return arrived at the fulfillment center
  - `awaiting_arrival_date` (datetime, optional, nullable) — The date and time when the return entered Awaiting Arrival status
  - `cancelled_date` (datetime, optional, nullable) — The date and time when the return was cancelled, if applicable
  - `channel` (object, optional) — The details of a Channel
    - `id` (integer, optional) — Unique Id of the channel
    - `name` (string, optional, nullable) — Name given to the channel
  - `completed_date` (datetime, optional, nullable) — The date and time for when the return order was completely processed
  - `customer_name` (string, optional, nullable) — Name of merchant that return belongs to
  - `fulfillment_center` (object, optional) — The details of a Fulfillment Center
    - `id` (integer, optional) — Unique id of the fulfillment center
    - `name` (string, optional, nullable) — Name give to the fulfillment center
  - `id` (integer, optional) — Unique id of the return order
  - `insert_date` (datetime, optional) — The date and time for when the return order was created
  - `inventory` (list of object, optional, nullable) — List of inventory items in return order
    - `action_requested` (object, optional) — The details of the action requested for inventory
      - `action` (string, optional, nullable) — The action to take
      - `action_type` (string, optional, nullable) — The source of the action to take, i.e. Inventory Default or Overriden by Merchant at creation
      - `instructions` (string, optional, nullable) — The instructions for how to take the action given by inventory owning Merchant
    - `action_taken` (list of object, optional, nullable) — List of actions taken
      - `action` (string, optional, nullable) — The return action taken
      - `action_reason` (string, optional, nullable) — The reason the action was taken
      - `image_url` (string, optional, nullable) — Image of inventory processed with this action.
      - `quantity_processed` (integer, optional) — The quantity of inventory items processed with this reason and action
    - `barcodes` (list of string, optional, nullable) — List of barcodes associated with the inventory item
    - `bundle_parent_sku` (string, optional, nullable) — SKU of the parent bundle if this item was expanded from a bundle. Null for non-bundle items
    - `id` (integer, optional) — Unique id of the inventory
    - `lot_information` (object, optional, nullable) — Lot information associated with a specific inventory item.
      - `expiration` (datetime, optional, nullable) — The expiration date for this lot.
      - `minimumShelfLife` (integer, optional, nullable) — A minimum amount of time in days this product can be safely returned to the shelf without expiring.
      - `number` (string, optional, nullable) — An alphanumeric string uniquely identifying this lot of produced inventory.
    - `name` (string, optional, nullable) — Name of the product
    - `quantity` (integer, optional) — Number of inventory that is being returned
    - `sku` (string, optional, nullable) — Stock keeping unit identifier for the inventory item
  - `invoice` (object, optional, nullable) — The invoice amount and curency
    - `amount` (double, optional, nullable) — Amount being charged
    - `currency_code` (string, optional, nullable) — Currency code of amount
  - `original_shipment_id` (integer, optional, nullable) — ShipmentId for which return was created
  - `processing_date` (datetime, optional, nullable) — The date and time when the return started processing
  - `reference_id` (string, optional, nullable) — Unique reference id of the return order. Created by merchant if a regular return.
  - `return_type` (string, optional, nullable) — Type of the return, i.e. Regular, RTS
  - `shipment_tracking_number` (string, optional, nullable) — The tracking number of the original shipment
  - `status` (string, optional, nullable) — Status of the return order, i.e. `Awaiting Arrival`, `Arrived`, `Processing`, `Completed` `Cancelled`
  - `status_history` (list of object, optional, nullable) — List of status history in return order
    - `status` (string, optional, nullable) — Status to change
    - `timestamp` (datetime, optional) — Date change status
  - `store_order_id` (string, optional, nullable) — Reference to external order id
  - `tracking_number` (string, optional, nullable) — The tracking number of the return shipping label
  - `transactions` (list of object, optional, nullable) — List of transactions that make up the billable amount to invoice a merchant
    - `amount` (double, optional) — The amount charged for this transaction
    - `transaction_type` (string, optional, nullable) — The type of transaction

## Examples

**Request**

```json
{
  "fulfillment_center": {
    "id": 10,
    "name": "Cicero (CHI3)"
  },
  "inventory": [
    {
      "id": 1279396,
      "quantity": 2,
      "requested_action": "Restock",
      "lot_date": null,
      "lot_number": null
    }
  ],
  "reference_id": "RMA-2026-00123",
  "original_shipment_id": 98765,
  "purchase_label": true,
  "shipping_service": "ReturnsStandard",
  "tracking_number": "1Z999AA10123456784"
}
```

**Response**

```json
{
  "label": {
    "barcode": null,
    "carrier": "UPS",
    "carrier_service": "Ground",
    "label_request_id": 999,
    "label_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/label.png",
    "label_zpl_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/label.zpl",
    "purchase_date": "2026-04-13T12:00:00+00:00",
    "qrcode_url": null,
    "rate": [
      {
        "amount": 1025,
        "currency_code": "USD"
      }
    ],
    "return_id": 12345,
    "shipment_rate_id": 999,
    "tracking_number": "1Z999AA10123456784",
    "tracking_url": "https://www.ups.com/track?tracknum=1Z999AA10123456784"
  },
  "label_error": null,
  "return": {
    "arrived_date": null,
    "awaiting_arrival_date": "2026-04-13T12:00:00+00:00",
    "cancelled_date": null,
    "channel": {
      "id": 1,
      "name": "ShipBob Default"
    },
    "completed_date": null,
    "customer_name": "Jane Doe",
    "fulfillment_center": {
      "id": 8,
      "name": "Cicero (IL)"
    },
    "id": 12345,
    "insert_date": "2026-04-13T12:00:00+00:00",
    "inventory": [
      {
        "action_requested": {
          "action": "Restock",
          "action_type": "InventoryDefault",
          "instructions": ""
        },
        "action_taken": [],
        "barcodes": [
          "BC-100"
        ],
        "id": 100,
        "lot_information": null,
        "name": "Test Product",
        "quantity": 1,
        "sku": "SKU-100"
      }
    ],
    "invoice": null,
    "original_shipment_id": 98765,
    "processing_date": null,
    "reference_id": "REF-12345",
    "return_type": "Customer Generated",
    "shipment_tracking_number": null,
    "status": "Awaiting Arrival",
    "status_history": [
      {
        "status": "Awaiting Arrival",
        "timestamp": "2026-04-13T12:00:00+00:00"
      }
    ],
    "store_order_id": "SO-12345",
    "tracking_number": null,
    "transactions": []
  }
}
```

**SDK Code**

```python default
import requests

url = "https://sandbox-api.shipbob.com/Experimental/return"

querystring = {"api-version":"1"}

payload = {
    "fulfillment_center": {
        "id": 10,
        "name": "Cicero (CHI3)"
    },
    "inventory": [
        {
            "id": 1279396,
            "quantity": 2,
            "requested_action": "Restock",
            "lot_date": None,
            "lot_number": None
        }
    ],
    "reference_id": "RMA-2026-00123",
    "original_shipment_id": 98765,
    "purchase_label": True,
    "shipping_service": "ReturnsStandard",
    "tracking_number": "1Z999AA10123456784"
}
headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript default
const url = 'https://sandbox-api.shipbob.com/Experimental/return?api-version=1';
const options = {
  method: 'POST',
  headers: {
    shipbob_channel_id: 'shipbob_channel_id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"fulfillment_center":{"id":10,"name":"Cicero (CHI3)"},"inventory":[{"id":1279396,"quantity":2,"requested_action":"Restock","lot_date":null,"lot_number":null}],"reference_id":"RMA-2026-00123","original_shipment_id":98765,"purchase_label":true,"shipping_service":"ReturnsStandard","tracking_number":"1Z999AA10123456784"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go default
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.shipbob.com/Experimental/return?api-version=1"

	payload := strings.NewReader("{\n  \"fulfillment_center\": {\n    \"id\": 10,\n    \"name\": \"Cicero (CHI3)\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 1279396,\n      \"quantity\": 2,\n      \"requested_action\": \"Restock\",\n      \"lot_date\": null,\n      \"lot_number\": null\n    }\n  ],\n  \"reference_id\": \"RMA-2026-00123\",\n  \"original_shipment_id\": 98765,\n  \"purchase_label\": true,\n  \"shipping_service\": \"ReturnsStandard\",\n  \"tracking_number\": \"1Z999AA10123456784\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("shipbob_channel_id", "shipbob_channel_id")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby default
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.shipbob.com/Experimental/return?api-version=1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["shipbob_channel_id"] = 'shipbob_channel_id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fulfillment_center\": {\n    \"id\": 10,\n    \"name\": \"Cicero (CHI3)\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 1279396,\n      \"quantity\": 2,\n      \"requested_action\": \"Restock\",\n      \"lot_date\": null,\n      \"lot_number\": null\n    }\n  ],\n  \"reference_id\": \"RMA-2026-00123\",\n  \"original_shipment_id\": 98765,\n  \"purchase_label\": true,\n  \"shipping_service\": \"ReturnsStandard\",\n  \"tracking_number\": \"1Z999AA10123456784\"\n}"

response = http.request(request)
puts response.read_body
```

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.shipbob.com/Experimental/return?api-version=1")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fulfillment_center\": {\n    \"id\": 10,\n    \"name\": \"Cicero (CHI3)\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 1279396,\n      \"quantity\": 2,\n      \"requested_action\": \"Restock\",\n      \"lot_date\": null,\n      \"lot_number\": null\n    }\n  ],\n  \"reference_id\": \"RMA-2026-00123\",\n  \"original_shipment_id\": 98765,\n  \"purchase_label\": true,\n  \"shipping_service\": \"ReturnsStandard\",\n  \"tracking_number\": \"1Z999AA10123456784\"\n}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.shipbob.com/Experimental/return?api-version=1', [
  'body' => '{
  "fulfillment_center": {
    "id": 10,
    "name": "Cicero (CHI3)"
  },
  "inventory": [
    {
      "id": 1279396,
      "quantity": 2,
      "requested_action": "Restock",
      "lot_date": null,
      "lot_number": null
    }
  ],
  "reference_id": "RMA-2026-00123",
  "original_shipment_id": 98765,
  "purchase_label": true,
  "shipping_service": "ReturnsStandard",
  "tracking_number": "1Z999AA10123456784"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

echo $response->getBody();
```

```csharp default
using RestSharp;

var client = new RestClient("https://sandbox-api.shipbob.com/Experimental/return?api-version=1");
var request = new RestRequest(Method.POST);
request.AddHeader("shipbob_channel_id", "shipbob_channel_id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"fulfillment_center\": {\n    \"id\": 10,\n    \"name\": \"Cicero (CHI3)\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 1279396,\n      \"quantity\": 2,\n      \"requested_action\": \"Restock\",\n      \"lot_date\": null,\n      \"lot_number\": null\n    }\n  ],\n  \"reference_id\": \"RMA-2026-00123\",\n  \"original_shipment_id\": 98765,\n  \"purchase_label\": true,\n  \"shipping_service\": \"ReturnsStandard\",\n  \"tracking_number\": \"1Z999AA10123456784\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "fulfillment_center": [
    "id": 10,
    "name": "Cicero (CHI3)"
  ],
  "inventory": [
    [
      "id": 1279396,
      "quantity": 2,
      "requested_action": "Restock",
      "lot_date": ,
      "lot_number": 
    ]
  ],
  "reference_id": "RMA-2026-00123",
  "original_shipment_id": 98765,
  "purchase_label": true,
  "shipping_service": "ReturnsStandard",
  "tracking_number": "1Z999AA10123456784"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/Experimental/return?api-version=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```