POST
/
carts
/
estimate

Using the Estimate Cart 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 debugging failed carts where one or more Sku’s may have been unavailable in a certain region or no shipping methods were returned for an address.

Cart estimation is not a part of the checkout process and is instead best used as a method for anticipating the behavior of a cart or debugging a failed cart.

When using Estimate Cart 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 a cart.

When the Estimate Cart 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

skus
object[]
required

A list of one or more Violet Sku's. Sku's from the same merchant will be grouped and calculated together.

shipping_address
object
required

The address the items in the cart should be shipped to.

base_currency
enum<string>
default: USD

The base currency the cart should be calculated in.

Available options:
USD,
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BWP,
BZD,
CAD,
CDF,
CHF,
CLP,
CNY,
COP,
CRC,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
ISK,
JMD,
JPY,
KES,
KGS,
KHR,
KMF,
KRW,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
STD,
SVC,
SZL,
THB,
TJS,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VND,
VUV,
WST,
XAF,
XCD,
XOF,
XPF,
YER,
ZAR,
ZMW,
BTN

Response

200 - application/json

Order Refund

order_id
integer
required

ID of the Order being refunded

merchant_id
integer
required

ID of the merchant making the refund

app_id
integer
required

ID of the App that created the Order

transaction_id
integer
required

ID of the Transaction being refunded

gateway_transaction_id
string
required

ID of the Transaction in the Payment Gateway

amount
integer
required

Amount being refunded. In Cents

id
integer
bag_id
integer

ID of the Bag being refunded

merchant_transfer_reversal_amount_usd
integer

Amount being taken back from the associated transfer to the merchant. In Cents

developer_transfer_reversal_amount_usd
integer

Amount being taken back from the associated transfer to the developer. In Cents

reason
string

Reason for refund

reason_code
enum<string>

Reason code for refund

Available options:
OTHER,
CUSTOMER,
INVENTORY,
FRAUD,
DECLINED
refund_currency
string

Currency set for this refund by the external ecom platform

status
enum<string>

Status of the Refund

Available options:
PROCESSING,
COMPLETED,
CANCELED,
PARTIALLY_COMPLETED,
FAILED,
EXTERNAL
skus
object[]

SKUs the refund applies to

date_created
string

Date of creation

date_last_modified
string

Date of last update

external_id
string

ID of the refund on the external commerce platform. This value will only be populated if the external commerce platform supports refund ID's.

errors
object[]

List of errors associated to this refund during processing. This value will only be populated if there are errors during processing

shipping
object | null

Details of any refunded shipping amounts.

tax_amount
integer | null

Tax amount being refunded. In Cents.

Required range: x > 0