For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://developer-stage.shipbob.dev/2025-07/api/returns/llms.txt. For full documentation content, see https://developer-stage.shipbob.dev/2025-07/api/returns/llms-full.txt.

# Create Return Order


POST https://sandbox-api.shipbob.com/2025-07/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.


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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: api-2025-07
  version: 1.0.0
paths:
  /2025-07/return:
    post:
      operationId: create-return-order
      summary: |
        Create Return Order
      description: >
        Creates a new return order for a previously shipped order. Specify the
        original shipment, inventory items to return, and requested return
        actions.
      tags:
        - subpackage_returns
      parameters:
        - name: Authorization
          in: header
          description: Authentication using Personal Access Token (PAT) token
          required: true
          schema:
            type: string
        - name: shipbob_channel_id
          in: header
          description: |
            Channel Id for operation
          required: true
          schema:
            type: string
            format: int32
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Returns.PublicReturnV1Dto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Returns.ProblemDetails'
        '401':
          description: Authorization missing or invalid
          content:
            application/json:
              schema:
                description: Any type
        '403':
          description: The provided credentials are not authorized to access this resource
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Returns.ApiError'
      requestBody:
        description: >-
          The return order creation request containing return details, items,
          and configuration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Returns.CreateReturnRequest'
servers:
  - url: https://sandbox-api.shipbob.com
components:
  schemas:
    Returns.Facility:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier of the facility
        name:
          type:
            - string
            - 'null'
          description: >-
            Name of the facility (It is optional because public API integrations
            do not pass this)
      required:
        - id
      description: A Facility to process Returns.
      title: Returns.Facility
    Returns.ReturnAction:
      type: string
      enum:
        - Default
        - Restock
        - Quarantine
        - Dispose
      title: Returns.ReturnAction
    Returns.ReturnInventory:
      type: object
      properties:
        id:
          type: integer
          description: ID of the inventory item to return.
        lot_date:
          type:
            - string
            - 'null'
          format: date-time
          description: Lot date associated with the inventory item, if applicable.
        lot_number:
          type:
            - string
            - 'null'
          description: Lot number associated with the inventory item, if applicable.
        quantity:
          type: integer
          description: Quantity of the returned inventory item in the return.
        requested_action:
          $ref: '#/components/schemas/Returns.ReturnAction'
      required:
        - id
        - quantity
        - requested_action
      description: >-
        An inventory being returned, includes the quantity and an override for
        the return action.
      title: Returns.ReturnInventory
    Returns.CreateReturnRequest:
      type: object
      properties:
        fulfillment_center:
          $ref: '#/components/schemas/Returns.Facility'
        inventory:
          type: array
          items:
            $ref: '#/components/schemas/Returns.ReturnInventory'
          description: Array of inventory items being returned
        original_shipment_id:
          type:
            - integer
            - 'null'
          description: >-
            Shipment from which the items in the return originated
            <example>123456</example>
        reference_id:
          type: string
          description: "Client-defined external unique identifier for the return order.\r\n            If tracking id is not provided, this value must appear on the box label as RMA. <example>Example: ShipBob_Return_123</example>"
        tracking_number:
          type:
            - string
            - 'null'
          description: >-
            Tracking number for the return shipment
            <example>1Z9999999999999999</example>
      required:
        - fulfillment_center
        - inventory
        - reference_id
      description: The request payload for creating a Return of inventory.
      title: Returns.CreateReturnRequest
    Returns.ChannelDto:
      type: object
      properties:
        id:
          type: integer
          description: Unique Id of the channel
        name:
          type:
            - string
            - 'null'
          description: Name given to the channel
      description: The details of a Channel
      title: Returns.ChannelDto
    Returns.FulfillmentCenterDto:
      type: object
      properties:
        id:
          type: integer
          description: Unique id of the fulfillment center
        name:
          type:
            - string
            - 'null'
          description: Name give to the fulfillment center
      description: The details of a Fulfillment Center
      title: Returns.FulfillmentCenterDto
    Returns.ActionRequestedDto:
      type: object
      properties:
        action:
          type:
            - string
            - 'null'
          description: The action to take
        action_type:
          type:
            - string
            - 'null'
          description: >-
            The source of the action to take, i.e. Inventory Default or
            Overriden by Merchant at creation
        instructions:
          type:
            - string
            - 'null'
          description: >-
            The instructions for how to take the action given by inventory
            owning Merchant
      description: The details of the action requested for inventory
      title: Returns.ActionRequestedDto
    Returns.ActionTakenDto:
      type: object
      properties:
        action:
          type:
            - string
            - 'null'
          description: The return action taken
        action_reason:
          type:
            - string
            - 'null'
          description: The reason the action was taken
        image_url:
          type:
            - string
            - 'null'
          format: uri
          description: Image of inventory processed with this action.
        quantity_processed:
          type: integer
          description: >-
            The quantity of inventory items processed with this reason and
            action
      description: The details of an action taken for inventory item in the return
      title: Returns.ActionTakenDto
    Returns.InventoryItemV1Dto:
      type: object
      properties:
        action_requested:
          $ref: '#/components/schemas/Returns.ActionRequestedDto'
        action_taken:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Returns.ActionTakenDto'
          description: List of actions taken
        bundle_parent_sku:
          type:
            - string
            - 'null'
          description: >-
            SKU of the parent bundle if this item was expanded from a bundle.
            Null for non-bundle items
        id:
          type: integer
          description: Unique id of the inventory
        name:
          type:
            - string
            - 'null'
          description: Name of the product
        quantity:
          type: integer
          description: Number of inventory that is being returned
      description: The details of the inventory in the return order
      title: Returns.InventoryItemV1Dto
    Returns.TransactionDto:
      type: object
      properties:
        amount:
          type: number
          format: double
          description: The amount charged for this transaction
        transaction_type:
          type:
            - string
            - 'null'
          description: The type of transaction
      description: The details of a transaction charged to the return order
      title: Returns.TransactionDto
    Returns.PublicReturnV1Dto:
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/Returns.ChannelDto'
        completed_date:
          type:
            - string
            - 'null'
          format: date-time
          description: The date and time for when the return order was completely processed
        customer_name:
          type:
            - string
            - 'null'
          description: Name of merchant that return belongs to
        fulfillment_center:
          $ref: '#/components/schemas/Returns.FulfillmentCenterDto'
        id:
          type: integer
          description: Unique id of the return order
        insert_date:
          type: string
          format: date-time
          description: The date and time for when the return order was created
        inventory:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Returns.InventoryItemV1Dto'
          description: List of inventory items in return order
        invoice_amount:
          type:
            - number
            - 'null'
          format: double
          description: Amount merchant was invoiced for processing the return
        original_shipment_id:
          type:
            - integer
            - 'null'
          description: ShipmentId for which return was created
        reference_id:
          type:
            - string
            - 'null'
          description: >-
            Unique reference id of the return order. Created by merchant if a
            regular return.
        return_type:
          type:
            - string
            - 'null'
          description: Type of the return, i.e. Regular, RTS
        status:
          type:
            - string
            - 'null'
          description: >-
            Status of the return order, i.e. `Awaiting Arrival`, `Arrived`,
            `Processing`, `Completed` `Cancelled`
        store_order_id:
          type:
            - string
            - 'null'
          description: Reference to external order id
        tracking_number:
          type:
            - string
            - 'null'
          description: The tracking number of the return shipping label
        transactions:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Returns.TransactionDto'
          description: >-
            List of transactions that make up the billable amount to invoice a
            merchant
      description: >-
        The details of a public return order (V1), including the transactions
        and inventory items
      title: Returns.PublicReturnV1Dto
    Returns.ProblemDetails:
      type: object
      properties:
        detail:
          type:
            - string
            - 'null'
        instance:
          type:
            - string
            - 'null'
        status:
          type:
            - integer
            - 'null'
        title:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
      title: Returns.ProblemDetails
    Returns.ApiError:
      type: object
      properties:
        details:
          oneOf:
            - description: Any type
            - type: 'null'
        errors:
          type:
            - array
            - 'null'
          items:
            type: string
        message:
          type:
            - string
            - 'null'
        stackTrace:
          type:
            - string
            - 'null'
          description: StackTrace of the Exception
      title: Returns.ApiError
  securitySchemes:
    PAT:
      type: http
      scheme: bearer
      description: Authentication using Personal Access Token (PAT) token
    OAuth2:
      type: http
      scheme: bearer
      description: OAuth2 authentication using JWT tokens

```

## SDK Code Examples

```python Returns_createReturnOrder_example
import requests

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

payload = {
    "fulfillment_center": {
        "id": 0,
        "name": "string"
    },
    "inventory": [
        {
            "id": 0,
            "quantity": 0,
            "requested_action": "Default",
            "lot_date": "2019-08-24T14:15:22Z",
            "lot_number": "string"
        }
    ],
    "reference_id": "string",
    "original_shipment_id": 0,
    "tracking_number": "string"
}
headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Returns_createReturnOrder_example
const url = 'https://sandbox-api.shipbob.com/2025-07/return';
const options = {
  method: 'POST',
  headers: {
    shipbob_channel_id: 'shipbob_channel_id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"fulfillment_center":{"id":0,"name":"string"},"inventory":[{"id":0,"quantity":0,"requested_action":"Default","lot_date":"2019-08-24T14:15:22Z","lot_number":"string"}],"reference_id":"string","original_shipment_id":0,"tracking_number":"string"}'
};

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

```go Returns_createReturnOrder_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"fulfillment_center\": {\n    \"id\": 0,\n    \"name\": \"string\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 0,\n      \"quantity\": 0,\n      \"requested_action\": \"Default\",\n      \"lot_date\": \"2019-08-24T14:15:22Z\",\n      \"lot_number\": \"string\"\n    }\n  ],\n  \"reference_id\": \"string\",\n  \"original_shipment_id\": 0,\n  \"tracking_number\": \"string\"\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 Returns_createReturnOrder_example
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.shipbob.com/2025-07/return")

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\": 0,\n    \"name\": \"string\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 0,\n      \"quantity\": 0,\n      \"requested_action\": \"Default\",\n      \"lot_date\": \"2019-08-24T14:15:22Z\",\n      \"lot_number\": \"string\"\n    }\n  ],\n  \"reference_id\": \"string\",\n  \"original_shipment_id\": 0,\n  \"tracking_number\": \"string\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://sandbox-api.shipbob.com/2025-07/return")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fulfillment_center\": {\n    \"id\": 0,\n    \"name\": \"string\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 0,\n      \"quantity\": 0,\n      \"requested_action\": \"Default\",\n      \"lot_date\": \"2019-08-24T14:15:22Z\",\n      \"lot_number\": \"string\"\n    }\n  ],\n  \"reference_id\": \"string\",\n  \"original_shipment_id\": 0,\n  \"tracking_number\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.shipbob.com/2025-07/return', [
  'body' => '{
  "fulfillment_center": {
    "id": 0,
    "name": "string"
  },
  "inventory": [
    {
      "id": 0,
      "quantity": 0,
      "requested_action": "Default",
      "lot_date": "2019-08-24T14:15:22Z",
      "lot_number": "string"
    }
  ],
  "reference_id": "string",
  "original_shipment_id": 0,
  "tracking_number": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

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

```csharp Returns_createReturnOrder_example
using RestSharp;

var client = new RestClient("https://sandbox-api.shipbob.com/2025-07/return");
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\": 0,\n    \"name\": \"string\"\n  },\n  \"inventory\": [\n    {\n      \"id\": 0,\n      \"quantity\": 0,\n      \"requested_action\": \"Default\",\n      \"lot_date\": \"2019-08-24T14:15:22Z\",\n      \"lot_number\": \"string\"\n    }\n  ],\n  \"reference_id\": \"string\",\n  \"original_shipment_id\": 0,\n  \"tracking_number\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Returns_createReturnOrder_example
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "fulfillment_center": [
    "id": 0,
    "name": "string"
  ],
  "inventory": [
    [
      "id": 0,
      "quantity": 0,
      "requested_action": "Default",
      "lot_date": "2019-08-24T14:15:22Z",
      "lot_number": "string"
    ]
  ],
  "reference_id": "string",
  "original_shipment_id": 0,
  "tracking_number": "string"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2025-07/return")! 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()
```