POST

/v1/checkout/cart/{cart_id}/shipping_address

X-Violet-Token
X-Violet-App-Secret
X-Violet-App-Id

Once we have all the available shipping methods for the bags within the cart, you can select and apply them to the cart.

Note: Your bag_id and cart_id will be different from the example you have been following so far. Please update the calls with your information.

  • Params

HEADER PARAMETERS

X-Violet-App-Token
String

Token

X-Violet-App-Secret
String

App Secret from Dashboard

X-Violet-App-Id
String

Your app ID

For more information on this endpoint go to Set Shipping Methods

curl -s --request POST \
   --url 'sandbox-api.violet.io/v1/checkout/cart' \
   --header 'X-Violet-Token: ' \
   --header 'X-Violet-App-Secret: ' \
   --header 'X-Violet-App-Id: ' \
   --header 'Content-type: application/json' \
   --data '{
  "base_currency": "",
  "skus": [
    {
      "sku_id": 10064 ,
      "quantity": 1
    }
  ]
}'
{
    "id": 20956,
    "token": "c8f17e9e6fec4268bc9188f039ec68ad",
    "user_id": 10397,
    "app_id": 10382,
    "developer_id": 10292,
    "customer": {
        "user_id": 10397,
        "first_name": "Paul",
        "last_name": "Sherman",
        "email": "dorythefish@disney.com",
        "name": "Paul Sherman"
    },
    "bags": [
        {
            "id": 20440,
            "order_id": 20956,
            "merchant_id": 10000,
            "app_id": 10382,
            "status": "IN_PROGRESS",
            "fulfillment_status": "PROCESSING",
            "financial_status": "UNPAID",
            "skus": [
                {
                    "id": 24987,
                    "merchant_id": 10000,
                    "app_id": 10382,
                    "product_id": "0ff55c5cda7447118d6ae1c8395f8f11",
                    "sku_id": 10064,
                    "external_id": "13884047425654",
                    "name": "GoPro - Karma Quadcopter with HERO6 Black - White - White",
                    "brand": "GoPro",
                    "thumbnail": "https://cdn.shopify.com/s/files/1/0057/6467/7750/products/6029300_ra.jpg",
                    "quantity": 1,
                    "price": 84999,
                    "weight": 13.45,
                    "available": true,
                    "status": "IN_PROGRESS",
                    "line_price": 84999
                }
            ],
            "shipping_method": {
                "type": "FLAT_RATE_PRICE",
                "carrier": "OTHER",
                "label": "International Shipping",
                "price": 2000,
                "id": 17032,
                "shipping_method_id": "shopify-International%20Shipping-20.00",
                "bag_id": 20440,
                "merchant_id": 10000
            },
            "taxes": [],
            "sub_total": 84999,
            "transactions": [],
            "external_checkout": true,
            "commission_rate": 15.0,
            "date_created": "2022-05-11T16:17:16+0000",
            "remorse_period_ends": "2022-06-10T16:17:16+0000",
            "currency": "USD",
            "external_currency": "USD",
            "channel": "APP",
            "platform": "SHOPIFY",
            "fulfillments": [],
            "merchant_name": "Violet-Besties"
        }
    ],
    "shipping_address": {
        "city": "Sydney",
        "state": "NSW",
        "country": "AU",
        "postal_code": "2000",
        "type": "SHIPPING",
        "address_1": "42 Wallaby Way"
    },
    "billing_address": {
        "city": "Sydney",
        "state": "NSW",
        "country": "AU",
        "postal_code": "2000",
        "type": "BILLING",
        "address_1": "42 Wallaby Way"
    },
    "sub_total": 84999,
    "status": "IN_PROGRESS",
    "date_created": "2022-05-11T16:17:16+0000",
    "date_last_modified": "2022-05-12T16:08:19+0000",
    "priced": false,
    "currency": "USD",
    "errors": [],
    "channel": "APP",
    "currency_symbol": "$",
    "stripe_key": "pk_test_UHg8oLvg4rrDCbvtqfwTE8qd",
    "guest": true
}

Headers

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

Path Parameters

cart_idrequired
integer

Query Parameters

price_cart
Default: false
boolean

Body

application/json
address_1required
string

First line of the Address

address_2
string

Second line of the Address

cityrequired
string

City

countryrequired
string

Country ISO2 Code

email
string

Email Address

first_name
string
last_name
string
name
string

Name on Address

phone
string

Phone Number

postal_coderequired
string

Postal/Zip Code

staterequired
string

State Abbreviation

typerequired
enum<string>

Address Type

Available options:
shipping,
billing

Response

200 - application/json
app_customer_id
string

App Customer ID

app_id
integer

ID of the App creating the order

app_name
string

Name of app that originated the order.

app_order_id
string

App Order ID

bags
object[]

Bags in the Order

billing_address
object

The shipping or billing address of a user placing an order

currency
string

Base currency of cart

currency_symbol
string

Symbol representing the desired currency

customer
object

The Customer Placing the Order

date_created
string

Date of order creation

date_last_modified
string

Date of last order update

developer_id
integer

ID of the Developer who placed

discount_total
integer

Discount Total of the Order

errors
object[]

Errors on the Order

guest
boolean
id
integer
intent_based_checkout
boolean
is_guest
boolean

Order is Guest

order_id
integer
order_status
enum<string>
Available options:
IN_PROGRESS,
PROCESSING,
COMPLETED,
CANCELED,
PARTIALLY_REFUNDED,
REFUNDED,
REQUIRES_ACTION
payment_intent_client_secret
string

Payment intent client secret

payment_method
object

Payment Method belonging to an Order

priced
boolean

Is the cart priced

referral_id
string

Optional value used to represent an identifier in your system.

shipping_address
object

The shipping or billing address of a user placing an order

shipping_total
integer

Shipping Total of the Order

statusrequired
enum<string>

Status of the Order

Available options:
in_progress,
processing,
completed,
canceled,
partially_refunded,
refunded,
requires_action
stripe_key
string

Stripe publishable key. Use for tokenizing payment methods.

sub_total
integer

Subtotal of the Order

tax_total
integer

Tax Total of the Order

token
string
total
integer

Total of the Order

user_id
integer

ID of the User placing the order

wallet_based_checkout
boolean

Is this cart going to be placed through wallet-based checkout