POST
/
orders
/
estimate
curl --request POST \
  --url https://sandbox-api.violet.io/v1/orders/estimate \
  --header 'Content-Type: application/json' \
  --data '{
  "base_currency": "USD",
  "skus": [
    {
      "quantity": 1,
      "sku_id": 123,
      "price": 123
    }
  ],
  "shipping_address": {
    "city": "Seattle",
    "state": "WA",
    "postal_code": "<string>",
    "country": "US",
    "address_1": "<string>",
    "address_2": "<string>"
  }
}'
{
  "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
    }
  ]
}

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.

Headers

X-Violet-Token
string
X-Violet-App-Secret
string
X-Violet-App-Id
integer

Body

application/json

Calculate Cart Request

Response

200
application/json
success

Order Refund