Apply Address to Cart
POST /checkout/cart/{cart_id}/shipping_address
Apply the shipping address for the order to the cart. API Reference: Set Shipping Address
Request
the ID of the cart you would like to add this SKU to.
Required Body Parameters Shipping Address:
the first line of the address the order should be billed to.
the city the order should be billed to.
the state of the address the order should be billed to. For US state validation we recommend ANSI two letter state codes, which conform to the ISO 3166-2 format without the US- prefix.
the postal code of the address the order should be billed to.
the two letter country code of the address the order should be billed to. For country validation we use the ISO 3166-2 standard.
curl -X POST https://sandbox-api.violet.io/v1/checkout/cart/{cart_id}/shipping_address \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"city": "Seattle", "state": "WA", "country": "US", "postal_code": "98104", "address_1": "925 4th Ave"}'
Response
{
"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
}
],
"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": "",
"state": "",
"country": "",
"postal_code": "",
"type": "",
"address_1": ""
},
"sub_total": 84999,
"status": "IN_PROGRESS",
"date_created": "2022-05-11T16:17:16+0000",
"date_last_modified": "2022-05-11T16:50:14+0000",
"priced": false,
"currency": "USD",
"errors": [],
"channel": "APP",
"currency_symbol": "$",
"stripe_key": "pk_test_UHg8oLvg4rrDCbvtqfwTE8qd",
"guest": true
}
POST /checkout/cart//billing_address
Apply the billing address of the customer to the cart. API Reference: Set Billing Address
Request
the ID of the cart you would like to add this SKU to.
Required Body Parameters Billing Address:
the first line of the address the order should be billed to.
the city the order should be billed to.
the state of the address the order should be billed to. For US state validation we recommend ANSI two letter state codes, which conform to the ISO 3166-2 format without the US- prefix.
the postal code of the address the order should be billed to.
the two letter country code of the address the order should be billed to. For country validation we use the ISO 3166-2 standard.
curl -X POST https://sandbox-api.violet.io/v1/checkout/cart/{cart_id}/billing_address \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"city": "Seattle", "state": "WA", "country": "US", "postal_code": "98104", "address_1": "925 4th Ave"}'
Response
{
"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
}
],
"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-11T16:50:14+0000",
"priced": false,
"currency": "USD",
"errors": [],
"channel": "APP",
"currency_symbol": "$",
"stripe_key": "pk_test_UHg8oLvg4rrDCbvtqfwTE8qd",
"guest": true
}