# Create a return. POST https://api.shipbob.com/2025-07/return Content-Type: application/json Reference: https://developer.shipbob.com/2025-07/api/returns/create-a-return ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: | Create a return. version: endpoint_returns.createAReturn paths: /2025-07/return: post: operationId: create-a-return summary: | Create a return. 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 - name: creationSourceId in: header description: '' required: false schema: type: integer responses: '201': description: Success content: application/json: schema: $ref: '#/components/schemas/Returns.PublicReturnV1Dto' '400': description: Bad Request content: {} '401': description: Authorization missing or invalid content: {} '403': description: The provided credentials are not authorized to access this resource content: {} '422': description: Client Error content: {} requestBody: description: >- The return order creation request containing return details, items, and configuration. content: application/json: schema: $ref: '#/components/schemas/Returns.CreateReturnRequest' components: schemas: Returns.Facility: type: object properties: id: type: integer name: type: - string - 'null' Returns.ReturnAction: type: string enum: - value: '0' - value: '1' - value: '2' - value: '3' Returns.ReturnInventory: type: object properties: id: type: integer lot_date: type: - string - 'null' format: date-time lot_number: type: - string - 'null' quantity: type: integer requested_action: $ref: '#/components/schemas/Returns.ReturnAction' Returns.CreateReturnRequest: type: object properties: fulfillment_center: $ref: '#/components/schemas/Returns.Facility' inventory: type: - array - 'null' items: $ref: '#/components/schemas/Returns.ReturnInventory' original_shipment_id: type: - integer - 'null' reference_id: type: - string - 'null' tracking_number: type: - string - 'null' Returns.ChannelDto: type: object properties: id: type: integer name: type: - string - 'null' Returns.FulfillmentCenterDto: type: object properties: id: type: integer name: type: - string - 'null' Returns.ActionRequestedDto: type: object properties: action: type: - string - 'null' action_type: type: - string - 'null' instructions: type: - string - 'null' Returns.ActionTakenDto: type: object properties: action: type: - string - 'null' action_reason: type: - string - 'null' image_url: type: - string - 'null' format: uri quantity_processed: type: integer Returns.InventoryItemV1Dto: type: object properties: action_requested: $ref: '#/components/schemas/Returns.ActionRequestedDto' action_taken: type: - array - 'null' items: $ref: '#/components/schemas/Returns.ActionTakenDto' id: type: integer name: type: - string - 'null' quantity: type: integer Returns.TransactionDto: type: object properties: amount: type: number format: double transaction_type: type: - string - 'null' Returns.PublicReturnV1Dto: type: object properties: channel: $ref: '#/components/schemas/Returns.ChannelDto' completed_date: type: - string - 'null' format: date-time customer_name: type: - string - 'null' fulfillment_center: $ref: '#/components/schemas/Returns.FulfillmentCenterDto' id: type: integer insert_date: type: string format: date-time inventory: type: - array - 'null' items: $ref: '#/components/schemas/Returns.InventoryItemV1Dto' invoice_amount: type: - number - 'null' format: double original_shipment_id: type: - integer - 'null' reference_id: type: - string - 'null' return_type: type: - string - 'null' status: type: - string - 'null' store_order_id: type: - string - 'null' tracking_number: type: - string - 'null' transactions: type: - array - 'null' items: $ref: '#/components/schemas/Returns.TransactionDto' ``` ## SDK Code Examples ```python Returns_createAReturn_example import requests url = "https://api.shipbob.com/2025-07/return" payload = { "fulfillment_center": { "id": 0, "name": "string" }, "inventory": [ { "id": 0, "lot_date": "2019-08-24T14:15:22Z", "lot_number": "string", "quantity": 0, "requested_action": 0 } ], "original_shipment_id": 0, "reference_id": "string", "tracking_number": "string" } headers = { "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Returns_createAReturn_example const url = 'https://api.shipbob.com/2025-07/return'; const options = { method: 'POST', headers: { shipbob_channel_id: 'shipbob_channel_id', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"fulfillment_center":{"id":0,"name":"string"},"inventory":[{"id":0,"lot_date":"2019-08-24T14:15:22Z","lot_number":"string","quantity":0,"requested_action":0}],"original_shipment_id":0,"reference_id":"string","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_createAReturn_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://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 \"lot_date\": \"2019-08-24T14:15:22Z\",\n \"lot_number\": \"string\",\n \"quantity\": 0,\n \"requested_action\": 0\n }\n ],\n \"original_shipment_id\": 0,\n \"reference_id\": \"string\",\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 ") 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_createAReturn_example require 'uri' require 'net/http' url = URI("https://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 ' request["Content-Type"] = 'application/json' request.body = "{\n \"fulfillment_center\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lot_date\": \"2019-08-24T14:15:22Z\",\n \"lot_number\": \"string\",\n \"quantity\": 0,\n \"requested_action\": 0\n }\n ],\n \"original_shipment_id\": 0,\n \"reference_id\": \"string\",\n \"tracking_number\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java Returns_createAReturn_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/2025-07/return") .header("shipbob_channel_id", "shipbob_channel_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"fulfillment_center\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lot_date\": \"2019-08-24T14:15:22Z\",\n \"lot_number\": \"string\",\n \"quantity\": 0,\n \"requested_action\": 0\n }\n ],\n \"original_shipment_id\": 0,\n \"reference_id\": \"string\",\n \"tracking_number\": \"string\"\n}") .asString(); ``` ```php Returns_createAReturn_example request('POST', 'https://api.shipbob.com/2025-07/return', [ 'body' => '{ "fulfillment_center": { "id": 0, "name": "string" }, "inventory": [ { "id": 0, "lot_date": "2019-08-24T14:15:22Z", "lot_number": "string", "quantity": 0, "requested_action": 0 } ], "original_shipment_id": 0, "reference_id": "string", "tracking_number": "string" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => 'shipbob_channel_id', ], ]); echo $response->getBody(); ``` ```csharp Returns_createAReturn_example using RestSharp; var client = new RestClient("https://api.shipbob.com/2025-07/return"); var request = new RestRequest(Method.POST); request.AddHeader("shipbob_channel_id", "shipbob_channel_id"); request.AddHeader("Authorization", "Bearer "); 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 \"lot_date\": \"2019-08-24T14:15:22Z\",\n \"lot_number\": \"string\",\n \"quantity\": 0,\n \"requested_action\": 0\n }\n ],\n \"original_shipment_id\": 0,\n \"reference_id\": \"string\",\n \"tracking_number\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Returns_createAReturn_example import Foundation let headers = [ "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "fulfillment_center": [ "id": 0, "name": "string" ], "inventory": [ [ "id": 0, "lot_date": "2019-08-24T14:15:22Z", "lot_number": "string", "quantity": 0, "requested_action": 0 ] ], "original_shipment_id": 0, "reference_id": "string", "tracking_number": "string" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://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() ```