Overview
Login
- Access
Merchants
- Merchant
- Configuration
- Explore
Catalog
- Offers
- SKUs
- Categories
- Collections
- Currencies
Orders & Checkout
- Carts
- Cart Items
- Cart Customer
- Cart Discounts
- Cart Shipping
- Cart Pricing
- Cart Payment
- Cart Completion
- Orders
- Order Refunds
- Order Cancellations
- Transfers
Events
- Webhooks
- Webhook Events
- Wekbhook Headers
Apps
- Merchant/App Installs
- Commission Rates
Operations
- Connection
Relay
- Shipping
Ecom Syncs
- Offers
Create Order
curl --request POST \
--url https://sandbox-api.violet.io/v1/orders \
--header 'Content-Type: application/json' \
--data '{
"payment_method": {
"type": "SINGLE_USE_CARD_TOKEN",
"payment_provider": "STRIPE",
"token": "tok_i1s2h8a9nyg1ukrju12h31kj212kh"
},
"order": {
"app_order_id": "mario-test-1",
"customer": {
"first_name": "Ultra",
"last_name": "Violet",
"email": "super@mar.io"
},
"bags": [
{
"skus": [
{
"sku_id": 80455,
"price": 100000
}
],
"shipping_method": {
"label": "Teleportation",
"price": 10000
},
"tax_total": 10000
}
],
"shipping_address": {
"address_1": "2815 Elliott Ave",
"address_2": "Unit 100",
"city": "Seattle",
"state": "WA",
"country": "US",
"postal_code": "98121"
},
"billing_address": {
"address_1": "200 West Street",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10282"
},
"currency": "USD"
}
}'
{
"id": 54609,
"token": "f9bd116404dc4441838a94f31a942d5f",
"errors": [],
"app_id": 10193,
"developer_id": 10122,
"customer": {
"first_name": "Ultra",
"last_name": "Violet",
"email": "super@mar.io",
"name": "Ultra Violet"
},
"bags": [
{
"id": 64579,
"order_id": 54609,
"merchant_id": 10064,
"captureStatus": "ACCEPTED",
"fulfillment_status": "PROCESSING",
"financial_status": "PAID",
"skus": [
{
"id": 60509,
"merchant_id": 10064,
"app_id": 10193,
"product_id": "815b064726de41d9a21de4bfc029416f",
"sku_id": 80445,
"external_id": "42519630413999",
"name": "Lunar Lemonade - 10 oz.",
"brand": "Space Drinks",
"thumbnail": "https://cdn.shopify.com/s/files/1/0621/1849/4383/files/wealthy_lunar_lemonade_4a9c0731-8758-4847-91e1-d6d37d6ace22.png",
"quantity": 1,
"price": 100000,
"weight": 3,
"available": true,
"captureStatus": "PROCESSING",
"product_type": "PHYSICAL",
"line_price": 100000
}
],
"shipping_method": {
"type": "FLAT_RATE_PRICE",
"carrier": "OTHER",
"label": "Teleportation",
"price": 10000,
"custom": false,
"id": 21839,
"merchant_id": 10064
},
"taxes": [
{
"order_id": 54609,
"merchant_id": 10064,
"state": "WA",
"rate": 10,
"amount": 10000
}
],
"sub_total": 100000,
"shipping_total": 10000,
"tax_total": 10000,
"total": 120000,
"taxes_included": false,
"transactions": [],
"external_checkout": false,
"commission_rate": 0,
"date_created": "2024-06-28T20:31:56+0000",
"date_last_modified": "2024-06-28T20:31:56.000+00:00",
"remorse_period_ends": "2024-07-28T20:31:56+0000",
"currency": "USD",
"external_currency": "USD",
"channel": "MARKETPLACE",
"app_order_id": "ishan-test-1",
"platform": "SHOPIFY",
"fulfillments": [],
"discounts": [],
"wallet_based_checkout": false,
"bag_id": 64579,
"bag_status": "ACCEPTED",
"merchant_name": "Space Drinks"
}
],
"shipping_address": {
"name": "Ultra Violet",
"city": "Seattle",
"state": "WA",
"country": "US",
"postal_code": "98121",
"type": "BILLING",
"address_1": "2815 Elliott Ave",
"address_2": "Unit 100",
"first_name": "Ultra",
"last_name": "Violet"
},
"billing_address": {
"name": "Ultra Violet",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10282",
"type": "BILLING",
"address_1": "200 West Street",
"first_name": "Ultra",
"last_name": "Violet"
},
"payment_transactions": [
{
"id": 31464,
"order_id": 54627,
"payment_provider": "STRIPE",
"payment_provider_transaction_id": "pi_3PXoWvK29KDiBVld1n7ym4B0",
"payment_method_id": 10630,
"payment_provider_payment_method_id": "pm_1PXoWvK29KDiBVldLNqe04Oi",
"payment_intent_client_secret": "pi_3PXoWvK29KDiBVld1n7ym4B0_secret_tB77zb3BoTCKigUe5R38hrCKS",
"amount": 120000,
"metadata": {
"payment_intent_client_secret": "pi_3PXoWvK29KDiBVld1n7ym4B0_secret_tB77zb3BoTCKigUe5R38hrCKS",
"payment_intent_id": "pi_3PXoWvK29KDiBVld1n7ym4B0"
},
"currency": "USD",
"captureStatus": "CAPTURED",
"errors": [],
"date_created": "2024-07-01T18:00:45+0000",
"date_last_modified": "2024-07-01T18:00:48+0000"
}
],
"sub_total": 0,
"shipping_total": 0,
"tax_total": 0,
"total": 0,
"app_order_id": "mario-test-1",
"captureStatus": "COMPLETED",
"is_guest": true,
"date_created": "2024-06-28T20:31:56+0000",
"date_last_modified": "2024-06-28T20:31:56+0000",
"priced": true,
"wallet_based_checkout": false,
"currency": "USD",
"channel": "MARKETPLACE",
"currency_symbol": "$",
"intent_based_checkout": true,
"order_status": "COMPLETED",
"order_id": 54609,
"guest": true
}
Direct order submission allows channels to submit fully composed orders, including their own tax and shipping calculations, in a single request to the merchant through Violet. This feature overrides the platform’s built-in pricing engine, ensuring accuracy in the merchant’s system of record and customer communications.
Learn more about Direct Order Submission in this guide.
The following information is required to be included in the Order payload of this request:
- First Name
- Last Name
- Shipping Address
- Bag(s)
For a multi-merchant Order, multiple bags must be created in the Order payload. Each Bag must contain items from only one merchant and have its own shipping method.
Violet currently only supports accepting Single-use Stripe Tokens as a payment method in this endpoint.
Body
Constructed Order for direct submission to merchant store.
Unique identifier for the order in the apps system.
Bags of items being purchased.
SKUs being purchased in this bag.
ID of the referenced Sku from the Violet catalog, this is the item being purchased.
Price of the SKU being purchased. In the Order currency. In cents.
Quantity of the Sku being purchased. Quantities over 1000 will default to 1000. If a value is not provided will be defaulted to 1.
x < 1000
Shipping method for the bag. Note: this value is not required when all items in the order are digital.
The sum of all the taxes applied to the Bag. In the Order currency. In Cents. Note: this value is not required when the merchant is the tax remitter. Learn more about tax remittance.
The sum of the line item totals for all Sku's in the Bag. In the Order currency. In Cents.
The amount for the shipping method applied to the Bag. In the Order currency. In Cents.
Shipping address for the order. Note: this value is not required when all items in the order are digital.
First line of the address.
City of the address.
The ISO2 (Alpha 2) code for the state or province.
The ISO2 (Alpha 2) code for the country.
Second line of the address.
Postal or Zip code to be applied to the address. This value is required for all countries that have postal codes. For countries that do not have postal codes, this value is optional.
The currency you are writing the order in. This value is used to tell the receiving ecommerce platform what currency the order is in.
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
Billing address for the order. Note: When not provided the provided shipping address will be used.
First line of the address.
City of the address.
The ISO2 (Alpha 2) code for the state or province.
The ISO2 (Alpha 2) code for the country.
Second line of the address.
Postal or Zip code to be applied to the address. This value is required for all countries that have postal codes. For countries that do not have postal codes, this value is optional.
Payment method that will be charged for this Order.
Type of payment method being used.
SINGLE_USE_CARD_TOKEN
, MULTI_USE_CARD_TOKEN
, BANK_TOKEN
, PAYMENT_INTENT
, VIOLET_PAYMENT_METHOD_ID
Payment provider that will process the payment.
Token representing the payment method.
Response
The response is of type any
.
Was this page helpful?
curl --request POST \
--url https://sandbox-api.violet.io/v1/orders \
--header 'Content-Type: application/json' \
--data '{
"payment_method": {
"type": "SINGLE_USE_CARD_TOKEN",
"payment_provider": "STRIPE",
"token": "tok_i1s2h8a9nyg1ukrju12h31kj212kh"
},
"order": {
"app_order_id": "mario-test-1",
"customer": {
"first_name": "Ultra",
"last_name": "Violet",
"email": "super@mar.io"
},
"bags": [
{
"skus": [
{
"sku_id": 80455,
"price": 100000
}
],
"shipping_method": {
"label": "Teleportation",
"price": 10000
},
"tax_total": 10000
}
],
"shipping_address": {
"address_1": "2815 Elliott Ave",
"address_2": "Unit 100",
"city": "Seattle",
"state": "WA",
"country": "US",
"postal_code": "98121"
},
"billing_address": {
"address_1": "200 West Street",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10282"
},
"currency": "USD"
}
}'
{
"id": 54609,
"token": "f9bd116404dc4441838a94f31a942d5f",
"errors": [],
"app_id": 10193,
"developer_id": 10122,
"customer": {
"first_name": "Ultra",
"last_name": "Violet",
"email": "super@mar.io",
"name": "Ultra Violet"
},
"bags": [
{
"id": 64579,
"order_id": 54609,
"merchant_id": 10064,
"captureStatus": "ACCEPTED",
"fulfillment_status": "PROCESSING",
"financial_status": "PAID",
"skus": [
{
"id": 60509,
"merchant_id": 10064,
"app_id": 10193,
"product_id": "815b064726de41d9a21de4bfc029416f",
"sku_id": 80445,
"external_id": "42519630413999",
"name": "Lunar Lemonade - 10 oz.",
"brand": "Space Drinks",
"thumbnail": "https://cdn.shopify.com/s/files/1/0621/1849/4383/files/wealthy_lunar_lemonade_4a9c0731-8758-4847-91e1-d6d37d6ace22.png",
"quantity": 1,
"price": 100000,
"weight": 3,
"available": true,
"captureStatus": "PROCESSING",
"product_type": "PHYSICAL",
"line_price": 100000
}
],
"shipping_method": {
"type": "FLAT_RATE_PRICE",
"carrier": "OTHER",
"label": "Teleportation",
"price": 10000,
"custom": false,
"id": 21839,
"merchant_id": 10064
},
"taxes": [
{
"order_id": 54609,
"merchant_id": 10064,
"state": "WA",
"rate": 10,
"amount": 10000
}
],
"sub_total": 100000,
"shipping_total": 10000,
"tax_total": 10000,
"total": 120000,
"taxes_included": false,
"transactions": [],
"external_checkout": false,
"commission_rate": 0,
"date_created": "2024-06-28T20:31:56+0000",
"date_last_modified": "2024-06-28T20:31:56.000+00:00",
"remorse_period_ends": "2024-07-28T20:31:56+0000",
"currency": "USD",
"external_currency": "USD",
"channel": "MARKETPLACE",
"app_order_id": "ishan-test-1",
"platform": "SHOPIFY",
"fulfillments": [],
"discounts": [],
"wallet_based_checkout": false,
"bag_id": 64579,
"bag_status": "ACCEPTED",
"merchant_name": "Space Drinks"
}
],
"shipping_address": {
"name": "Ultra Violet",
"city": "Seattle",
"state": "WA",
"country": "US",
"postal_code": "98121",
"type": "BILLING",
"address_1": "2815 Elliott Ave",
"address_2": "Unit 100",
"first_name": "Ultra",
"last_name": "Violet"
},
"billing_address": {
"name": "Ultra Violet",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10282",
"type": "BILLING",
"address_1": "200 West Street",
"first_name": "Ultra",
"last_name": "Violet"
},
"payment_transactions": [
{
"id": 31464,
"order_id": 54627,
"payment_provider": "STRIPE",
"payment_provider_transaction_id": "pi_3PXoWvK29KDiBVld1n7ym4B0",
"payment_method_id": 10630,
"payment_provider_payment_method_id": "pm_1PXoWvK29KDiBVldLNqe04Oi",
"payment_intent_client_secret": "pi_3PXoWvK29KDiBVld1n7ym4B0_secret_tB77zb3BoTCKigUe5R38hrCKS",
"amount": 120000,
"metadata": {
"payment_intent_client_secret": "pi_3PXoWvK29KDiBVld1n7ym4B0_secret_tB77zb3BoTCKigUe5R38hrCKS",
"payment_intent_id": "pi_3PXoWvK29KDiBVld1n7ym4B0"
},
"currency": "USD",
"captureStatus": "CAPTURED",
"errors": [],
"date_created": "2024-07-01T18:00:45+0000",
"date_last_modified": "2024-07-01T18:00:48+0000"
}
],
"sub_total": 0,
"shipping_total": 0,
"tax_total": 0,
"total": 0,
"app_order_id": "mario-test-1",
"captureStatus": "COMPLETED",
"is_guest": true,
"date_created": "2024-06-28T20:31:56+0000",
"date_last_modified": "2024-06-28T20:31:56+0000",
"priced": true,
"wallet_based_checkout": false,
"currency": "USD",
"channel": "MARKETPLACE",
"currency_symbol": "$",
"intent_based_checkout": true,
"order_status": "COMPLETED",
"order_id": 54609,
"guest": true
}