Estimate Order

Using the Estimate Order endpoint you can discover the estimated totals and available shipping methods for any combination of Sku’s and a shipping address. This feature can be useful for estimating an order before creating an order with Direct Order Submission.

When using Estimate Order you do not need to manage the lifecycle of a cart. Violet will handle the creation, modification, and deletion of any external carts that may need to be created while estimating an order.

When the Estimate Order process fails in the external commerce platform, Violet will attempt to parse and surface all error messages from the external system so that you are able to fully understand why the estimation failed. The most common reasons for failure will be Sku unavailability and incorrectly formatted shipping addresses.

Estimate Order

post
Header parameters
X-Violet-TokenstringRequired
X-Violet-App-SecretstringRequired
X-Violet-App-Idinteger · int32Required
Body

Calculate Cart Request

base_currencystring · enum · min: 3 · max: 3Optional

The base currency the cart should be calculated in.

Default: USDPossible values:
Responses
200
success
application/json
post
POST /v1/orders/estimate HTTP/1.1
Host: sandbox-api.violet.io
X-Violet-Token: text
X-Violet-App-Secret: text
X-Violet-App-Id: 1
Content-Type: application/json
Accept: */*
Content-Length: 193

{
  "base_currency": "USD",
  "skus": [
    {
      "quantity": 1,
      "sku_id": 1,
      "price": 1
    }
  ],
  "shipping_address": {
    "city": "Seattle",
    "state": "WA",
    "postal_code": "text",
    "country": "US",
    "address_1": "text",
    "address_2": "text"
  }
}
{
  "estimated_carts": [
    {
      "merchant_id": 10000,
      "platform": "SHOPIFY",
      "base_currency": "USD",
      "sub_total": 19998,
      "shipping_total": 0,
      "tax_total": 2119,
      "total": 22117,
      "skus": [
        {
          "quantity": 2,
          "sku_id": 10000,
          "name": "Nintendo Entertainment System",
          "price": 9999,
          "merchant_id": 11111,
          "external_id": "31516807528534",
          "available": true,
          "requires_shipping": true,
          "product_type": "PHYSICAL",
          "line_price": 19998
        }
      ],
      "available_shipping_methods": [
        {
          "label": "Free Shipping",
          "carrier": "OTHER",
          "price": 0,
          "shipping_method_id": "18ff5c0a16d83cb8ba46848e48e06532"
        },
        {
          "label": "Ground Advantage",
          "carrier": "USPS",
          "price": 712,
          "shipping_method_id": "468c823c817c753e850ff6658ef1480f"
        },
        {
          "label": "Priority Mail",
          "carrier": "USPS",
          "price": 934,
          "shipping_method_id": "02ef65ebff687faa10c71830d41144b2"
        },
        {
          "label": "Standard",
          "carrier": "OTHER",
          "price": 1990,
          "shipping_method_id": "7a4763e6b861a281511834b449e0c574"
        }
      ],
      "has_shipping_methods": true
    }
  ]
}

Last updated

Was this helpful?