# Simulates Shipment POST https://api.shipbob.com/2026-01/simulate/shipment Content-Type: application/json Simulation shipments in the ShipBob sandbox environment. Learn more about [sandbox simulations](/sandbox/simulations). This endpoint is **only available** on sandbox. Reference: https://developer.shipbob.com/api/simulations/simulates-shipment ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Simulates Shipment version: endpoint_simulations.simulatesShipment paths: /2026-01/simulate/shipment: post: operationId: simulates-shipment summary: Simulates Shipment description: >- Simulation shipments in the ShipBob sandbox environment. Learn more about [sandbox simulations](/sandbox/simulations). This endpoint is **only available** on sandbox. tags: - - subpackage_simulations parameters: - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token or OAuth2 required: true schema: type: string responses: '200': description: Existing registration content: application/json: schema: $ref: '#/components/schemas/Simulation.simulationResponseModel' requestBody: description: Order Simulation Request Model content: application/json: schema: $ref: '#/components/schemas/Simulation.orderSimulationRequestModel' components: schemas: SimulationSimulationModelAction: type: string enum: - value: ShipOrder - value: DeliverOrder Simulation.simulationModel: type: object properties: action: oneOf: - $ref: '#/components/schemas/SimulationSimulationModelAction' - type: 'null' description: The simulation action to perform. delay: type: - integer - 'null' description: Optional delay before executing this action, in minutes. next: $ref: '#/components/schemas/Simulation.simulationModel' description: The next action in the sequence, if actions are chained. required: - action Simulation.orderSimulationRequestModel: type: object properties: shipment_id: type: - string - 'null' description: The ShipBob shipment id the simulation should target. simulation: $ref: '#/components/schemas/Simulation.simulationModel' description: >- The simulation action definition, optionally chained with subsequent actions. required: - shipment_id - simulation Simulation.simulationResponseModel: type: object properties: message: type: - string - 'null' description: Optional message about the submitted simulation. simulation_id: type: - string - 'null' description: The unique identifier of the simulation run. ``` ## SDK Code Examples ```python Simulations_simulatesShipment_example import requests url = "https://api.shipbob.com/2026-01/simulate/shipment" payload = { "shipment_id": "string", "simulation": { "action": "ShipOrder", "delay": 0, "next": {} } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Simulations_simulatesShipment_example const url = 'https://api.shipbob.com/2026-01/simulate/shipment'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"shipment_id":"string","simulation":{"action":"ShipOrder","delay":0,"next":{}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Simulations_simulatesShipment_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/2026-01/simulate/shipment" payload := strings.NewReader("{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}") req, _ := http.NewRequest("POST", url, payload) 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 Simulations_simulatesShipment_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/2026-01/simulate/shipment") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}" response = http.request(request) puts response.read_body ``` ```java Simulations_simulatesShipment_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/2026-01/simulate/shipment") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}") .asString(); ``` ```php Simulations_simulatesShipment_example request('POST', 'https://api.shipbob.com/2026-01/simulate/shipment', [ 'body' => '{ "shipment_id": "string", "simulation": { "action": "ShipOrder", "delay": 0, "next": {} } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Simulations_simulatesShipment_example using RestSharp; var client = new RestClient("https://api.shipbob.com/2026-01/simulate/shipment"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Simulations_simulatesShipment_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "shipment_id": "string", "simulation": [ "action": "ShipOrder", "delay": 0, "next": [] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/2026-01/simulate/shipment")! 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() ``` ```python Simulations_simulatesShipment_example import requests url = "https://api.shipbob.com/2026-01/simulate/shipment" payload = { "shipment_id": "string", "simulation": { "action": "ShipOrder", "delay": 0, "next": {} } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Simulations_simulatesShipment_example const url = 'https://api.shipbob.com/2026-01/simulate/shipment'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"shipment_id":"string","simulation":{"action":"ShipOrder","delay":0,"next":{}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Simulations_simulatesShipment_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/2026-01/simulate/shipment" payload := strings.NewReader("{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}") req, _ := http.NewRequest("POST", url, payload) 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 Simulations_simulatesShipment_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/2026-01/simulate/shipment") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}" response = http.request(request) puts response.read_body ``` ```java Simulations_simulatesShipment_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/2026-01/simulate/shipment") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}") .asString(); ``` ```php Simulations_simulatesShipment_example request('POST', 'https://api.shipbob.com/2026-01/simulate/shipment', [ 'body' => '{ "shipment_id": "string", "simulation": { "action": "ShipOrder", "delay": 0, "next": {} } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Simulations_simulatesShipment_example using RestSharp; var client = new RestClient("https://api.shipbob.com/2026-01/simulate/shipment"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"shipment_id\": \"string\",\n \"simulation\": {\n \"action\": \"ShipOrder\",\n \"delay\": 0,\n \"next\": {}\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Simulations_simulatesShipment_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "shipment_id": "string", "simulation": [ "action": "ShipOrder", "delay": 0, "next": [] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/2026-01/simulate/shipment")! 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() ```