# Create Return Order POST https://api.shipbob.com/1.0/return Content-Type: application/json Reference: https://developer.shipbob.com/api/returns/create-return-order ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-1.0 version: 1.0.0 paths: /1.0/return: post: operationId: create-return-order summary: | Create Return Order 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: '' required: true schema: type: string format: int32 - name: creationSourceId in: header description: '' required: false schema: type: integer responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Returns_createReturnOrder_Response_200' '400': description: Bad Request content: application/json: schema: description: Any type '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 requestBody: content: application/json: schema: $ref: '#/components/schemas/Returns.CreateReturnRequest' servers: - url: https://api.shipbob.com - url: https://sandbox-api.shipbob.com components: schemas: Returns.Facility: type: object properties: id: type: integer name: type: - string - 'null' title: Returns.Facility Returns.ReturnAction: type: string enum: - '0' - '1' - '2' - '3' title: Returns.ReturnAction Returns.ReturnInventory: type: object properties: id: type: integer lotDate: type: - string - 'null' format: date-time lotNumber: type: - string - 'null' quantity: type: integer requestedAction: $ref: '#/components/schemas/Returns.ReturnAction' title: Returns.ReturnInventory Returns.CreateReturnRequest: type: object properties: fulfillmentCenter: $ref: '#/components/schemas/Returns.Facility' inventory: type: - array - 'null' items: $ref: '#/components/schemas/Returns.ReturnInventory' originalShipmentId: type: - integer - 'null' referenceId: type: - string - 'null' trackingNumber: type: - string - 'null' title: Returns.CreateReturnRequest Returns_createReturnOrder_Response_200: type: object properties: {} description: Empty response body title: Returns_createReturnOrder_Response_200 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 import requests url = "https://api.shipbob.com/1.0/return" payload = { "fulfillmentCenter": { "id": 0, "name": "string" }, "inventory": [ { "id": 0, "lotDate": "2019-08-24T14:15:22Z", "lotNumber": "string", "quantity": 0, "requestedAction": 0 } ], "originalShipmentId": 0, "referenceId": "string", "trackingNumber": "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 const url = 'https://api.shipbob.com/1.0/return'; const options = { method: 'POST', headers: { shipbob_channel_id: 'shipbob_channel_id', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"fulfillmentCenter":{"id":0,"name":"string"},"inventory":[{"id":0,"lotDate":"2019-08-24T14:15:22Z","lotNumber":"string","quantity":0,"requestedAction":0}],"originalShipmentId":0,"referenceId":"string","trackingNumber":"string"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/1.0/return" payload := strings.NewReader("{\n \"fulfillmentCenter\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lotDate\": \"2019-08-24T14:15:22Z\",\n \"lotNumber\": \"string\",\n \"quantity\": 0,\n \"requestedAction\": 0\n }\n ],\n \"originalShipmentId\": 0,\n \"referenceId\": \"string\",\n \"trackingNumber\": \"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 require 'uri' require 'net/http' url = URI("https://api.shipbob.com/1.0/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 \"fulfillmentCenter\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lotDate\": \"2019-08-24T14:15:22Z\",\n \"lotNumber\": \"string\",\n \"quantity\": 0,\n \"requestedAction\": 0\n }\n ],\n \"originalShipmentId\": 0,\n \"referenceId\": \"string\",\n \"trackingNumber\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/1.0/return") .header("shipbob_channel_id", "shipbob_channel_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"fulfillmentCenter\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lotDate\": \"2019-08-24T14:15:22Z\",\n \"lotNumber\": \"string\",\n \"quantity\": 0,\n \"requestedAction\": 0\n }\n ],\n \"originalShipmentId\": 0,\n \"referenceId\": \"string\",\n \"trackingNumber\": \"string\"\n}") .asString(); ``` ```php request('POST', 'https://api.shipbob.com/1.0/return', [ 'body' => '{ "fulfillmentCenter": { "id": 0, "name": "string" }, "inventory": [ { "id": 0, "lotDate": "2019-08-24T14:15:22Z", "lotNumber": "string", "quantity": 0, "requestedAction": 0 } ], "originalShipmentId": 0, "referenceId": "string", "trackingNumber": "string" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => 'shipbob_channel_id', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.shipbob.com/1.0/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 \"fulfillmentCenter\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"inventory\": [\n {\n \"id\": 0,\n \"lotDate\": \"2019-08-24T14:15:22Z\",\n \"lotNumber\": \"string\",\n \"quantity\": 0,\n \"requestedAction\": 0\n }\n ],\n \"originalShipmentId\": 0,\n \"referenceId\": \"string\",\n \"trackingNumber\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "fulfillmentCenter": [ "id": 0, "name": "string" ], "inventory": [ [ "id": 0, "lotDate": "2019-08-24T14:15:22Z", "lotNumber": "string", "quantity": 0, "requestedAction": 0 ] ], "originalShipmentId": 0, "referenceId": "string", "trackingNumber": "string" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/1.0/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() ```