# Estimate Fulfillment Cost For Order POST https://api.shipbob.com/2.0/order/estimate Content-Type: application/json This endpoint will provide, where possible, an estimate of pricing and fulfillment center assignment of a potential standard (direct to consumer) order. Keep in mind that there are ways for the merchant to change FC assignment or product configuration after order creation that could invalidate this estimate. Estimates cannot be returned for items that are unknown, out of stock, or too large for fulfillment using standard box sizes. Additional services such as high-pick fees, shipping insurance, auto-splitting or auto-adding items to orders, and signature required are not included in this estimate. Reference: https://developer.shipbob.com/api/orders/estimate-fulfillment-cost-for-order ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-2.0 version: 1.0.0 paths: /2.0/order/estimate: post: operationId: estimate-fulfillment-cost-for-order summary: Estimate Fulfillment Cost For Order description: >- This endpoint will provide, where possible, an estimate of pricing and fulfillment center assignment of a potential standard (direct to consumer) order. Keep in mind that there are ways for the merchant to change FC assignment or product configuration after order creation that could invalidate this estimate. Estimates cannot be returned for items that are unknown, out of stock, or too large for fulfillment using standard box sizes. Additional services such as high-pick fees, shipping insurance, auto-splitting or auto-adding items to orders, and signature required are not included in this estimate. tags: - subpackage_orders 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: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Orders.EstimateViewModel' '400': description: Bad Request content: application/json: schema: $ref: >- #/components/schemas/Orders.Post.Api.Order.Estimate.Bad.Request.Object '401': description: No access right at this time content: application/json: schema: description: Any type '403': description: No access content: application/json: schema: description: Any type '422': description: Client Error content: application/json: schema: $ref: >- #/components/schemas/Orders.Post.Api.Order.Estimate.Unprocessable.Entity.Object requestBody: content: application/json: schema: $ref: '#/components/schemas/Orders.EstimateFulfillmentRequestModel' servers: - url: https://api.shipbob.com - url: https://sandbox-api.shipbob.com components: schemas: Orders.EstimationAddressViewModel: type: object properties: address1: type: - string - 'null' description: First line of the address address2: type: - string - 'null' description: Second line of the address city: type: - string - 'null' description: The city company_name: type: - string - 'null' description: Name of the company receiving the shipment country: type: string description: The country (Must be ISO Alpha-2 for estimates) state: type: - string - 'null' description: The state or province zip_code: type: - string - 'null' format: postal-code description: The zip code or postal code required: - country title: Orders.EstimationAddressViewModel Orders.EstimateProductInfoModel: type: object properties: id: type: - integer - 'null' description: >- Unique id of the product (Must be provided if reference_id is unknown) quantity: type: integer description: The quantity of this product ordered reference_id: type: - string - 'null' description: >- Unique reference id of the product (Must be provided if ID is unknown) required: - quantity title: Orders.EstimateProductInfoModel Orders.EstimateFulfillmentRequestModel: type: object properties: address: $ref: '#/components/schemas/Orders.EstimationAddressViewModel' products: type: array items: $ref: '#/components/schemas/Orders.EstimateProductInfoModel' description: >- Products to be included in the order. Each product must include one of reference_id or id shipping_methods: type: - array - 'null' items: type: string description: "Array of strings specifying shipping methods for which to fetch estimates.\r\n\r\nIf this field is omitted we will return estimates for all shipping methods defined in ShipBob" required: - address - products title: Orders.EstimateFulfillmentRequestModel Orders.FulfillmentCenterViewModel: type: object properties: id: type: integer description: Id of the fulfillment center name: type: - string - 'null' description: Name of the fulfillment center description: Information about a fulfillment center that a shipment can belong to title: Orders.FulfillmentCenterViewModel Orders.EstimateDetailViewModel: type: object properties: estimated_currency_code: type: - string - 'null' description: Estimated local currency code estimated_price: type: number format: double description: Estimated price in dollars for the provided shipping method fulfillment_center: $ref: '#/components/schemas/Orders.FulfillmentCenterViewModel' shipping_method: type: - string - 'null' description: Provided shipping method. Maps to ship option in ShipBob. total_weight_oz: type: number format: double description: Total weight of items in cart including packaging. title: Orders.EstimateDetailViewModel Orders.EstimateViewModel: type: object properties: estimates: type: - array - 'null' items: $ref: '#/components/schemas/Orders.EstimateDetailViewModel' description: Array of estimates for each shipping method title: Orders.EstimateViewModel Orders.Post.Api.Order.Estimate.Bad.Request.Object: type: object additionalProperties: type: array items: type: string title: Orders.Post.Api.Order.Estimate.Bad.Request.Object Orders.Post.Api.Order.Estimate.Unprocessable.Entity.Object: type: object additionalProperties: type: array items: type: string title: Orders.Post.Api.Order.Estimate.Unprocessable.Entity.Object 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 Orders_estimateFulfillmentCostForOrder_example import requests url = "https://api.shipbob.com/2.0/order/estimate" payload = { "address": { "country": "US", "address1": "100 Nowhere Blvd", "address2": "Suite 100", "city": "Gotham City", "company_name": "Wayne Enterprises", "state": "NJ", "zip_code": "07093" }, "products": [ { "quantity": 1, "id": 0, "reference_id": "TShirtBlueM" } ], "shipping_methods": ["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 Orders_estimateFulfillmentCostForOrder_example const url = 'https://api.shipbob.com/2.0/order/estimate'; const options = { method: 'POST', headers: { shipbob_channel_id: 'shipbob_channel_id', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"address":{"country":"US","address1":"100 Nowhere Blvd","address2":"Suite 100","city":"Gotham City","company_name":"Wayne Enterprises","state":"NJ","zip_code":"07093"},"products":[{"quantity":1,"id":0,"reference_id":"TShirtBlueM"}],"shipping_methods":["string"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Orders_estimateFulfillmentCostForOrder_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/2.0/order/estimate" payload := strings.NewReader("{\n \"address\": {\n \"country\": \"US\",\n \"address1\": \"100 Nowhere Blvd\",\n \"address2\": \"Suite 100\",\n \"city\": \"Gotham City\",\n \"company_name\": \"Wayne Enterprises\",\n \"state\": \"NJ\",\n \"zip_code\": \"07093\"\n },\n \"products\": [\n {\n \"quantity\": 1,\n \"id\": 0,\n \"reference_id\": \"TShirtBlueM\"\n }\n ],\n \"shipping_methods\": [\n \"string\"\n ]\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 Orders_estimateFulfillmentCostForOrder_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/2.0/order/estimate") 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 \"address\": {\n \"country\": \"US\",\n \"address1\": \"100 Nowhere Blvd\",\n \"address2\": \"Suite 100\",\n \"city\": \"Gotham City\",\n \"company_name\": \"Wayne Enterprises\",\n \"state\": \"NJ\",\n \"zip_code\": \"07093\"\n },\n \"products\": [\n {\n \"quantity\": 1,\n \"id\": 0,\n \"reference_id\": \"TShirtBlueM\"\n }\n ],\n \"shipping_methods\": [\n \"string\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Orders_estimateFulfillmentCostForOrder_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/2.0/order/estimate") .header("shipbob_channel_id", "shipbob_channel_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"address\": {\n \"country\": \"US\",\n \"address1\": \"100 Nowhere Blvd\",\n \"address2\": \"Suite 100\",\n \"city\": \"Gotham City\",\n \"company_name\": \"Wayne Enterprises\",\n \"state\": \"NJ\",\n \"zip_code\": \"07093\"\n },\n \"products\": [\n {\n \"quantity\": 1,\n \"id\": 0,\n \"reference_id\": \"TShirtBlueM\"\n }\n ],\n \"shipping_methods\": [\n \"string\"\n ]\n}") .asString(); ``` ```php Orders_estimateFulfillmentCostForOrder_example request('POST', 'https://api.shipbob.com/2.0/order/estimate', [ 'body' => '{ "address": { "country": "US", "address1": "100 Nowhere Blvd", "address2": "Suite 100", "city": "Gotham City", "company_name": "Wayne Enterprises", "state": "NJ", "zip_code": "07093" }, "products": [ { "quantity": 1, "id": 0, "reference_id": "TShirtBlueM" } ], "shipping_methods": [ "string" ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => 'shipbob_channel_id', ], ]); echo $response->getBody(); ``` ```csharp Orders_estimateFulfillmentCostForOrder_example using RestSharp; var client = new RestClient("https://api.shipbob.com/2.0/order/estimate"); 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 \"address\": {\n \"country\": \"US\",\n \"address1\": \"100 Nowhere Blvd\",\n \"address2\": \"Suite 100\",\n \"city\": \"Gotham City\",\n \"company_name\": \"Wayne Enterprises\",\n \"state\": \"NJ\",\n \"zip_code\": \"07093\"\n },\n \"products\": [\n {\n \"quantity\": 1,\n \"id\": 0,\n \"reference_id\": \"TShirtBlueM\"\n }\n ],\n \"shipping_methods\": [\n \"string\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Orders_estimateFulfillmentCostForOrder_example import Foundation let headers = [ "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "address": [ "country": "US", "address1": "100 Nowhere Blvd", "address2": "Suite 100", "city": "Gotham City", "company_name": "Wayne Enterprises", "state": "NJ", "zip_code": "07093" ], "products": [ [ "quantity": 1, "id": 0, "reference_id": "TShirtBlueM" ] ], "shipping_methods": ["string"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/2.0/order/estimate")! 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() ```