Orders

The orders API will allow you to create orders, list orders you have created, views the details of a single order and cancel an order that was created recently.



HTTP Request

GET https://marketplace.vin65.com/orders

Header Parameters

Parameter Required Description
Authorization TRUE Authorization token
example: Bearer 576gf565f2873g967w8.23478263g945sdfgwe523f.445gf7127cb45twe
version FALSE API Version to access
example: version=1

Query Parameters

Parameter Required Description
order_number TRUE Order Number of Order

Example Request Code

curl -X "POST" "https://marketplace.vin65.com/orders?order_number=12345" \
        -H "Authorization: Bearer your_auth_token_here" \
        -H "Accept: version=1"

require 'httparty'
headers = { 'Authorization' => "Bearer #{auth_token}" }
response = HTTParty.get('https://marketplace.vin65.com/orders?order_number=12345', headers: headers)
JSON.parse(response.body)


Example Response Headers

HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Version: 1
X-Total: 5
X-Per-Page: 5
X-Page: 1
Content-Type: application/json; charset=utf-8
ETag: W/"f53ea28d79400c42435ad03ef00d595b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: a4e911c2-715f-468f-bdf2-72221e347695
X-Runtime: 0.291345
Connection: close
Transfer-Encoding: chunked

Example Response Body

{
  "orders": [{
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2016-02-29",
    "requested_ship_date": "2016-03-05",
    "temp_control": "false",
    "status": "shipped",
    "subtotal": "40.0",
    "shipping_collected": "10.0",
    "sales_tax_collected": "1.88",
    "total": "51.88",
    "gift_message": "Happy Birthday Jake"
    "consumer_benefit": "10.00",
    "shipping_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "shipping_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "billing_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "billing_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "delivery_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "delivery_address": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "order_items": [{
      "product_id": 6,
      "name": "Dancing Wind",
      "sku": "DW123",
      "quantity": 2,
      "price": "15.0",
      "subtotal": "30.0"
    }, {
      "product_id": 1,
      "name": "Stargazer",
      "sku": "SG123",
      "quantity": 1,
      "price": "10.0",
      "subtotal": "10.0"
    }],
    "shipments": [{
      "tracking_number": "12345678",
      "tracking_url": "http://www.fedex.com/Tracking?action=track&tracknumbers=123456789012"
      "carrier_name": "FedEx",
      "service_name": "2 Day Ground",
      "status": "shipped",
      "shipped_on": "2016-02-19T00:00:00.000Z",
      "delivered_on": "2016-04-19T08:00:00.000Z"
    }],
    "winery_orders": [{
      "winery_name": "Dancing Wind",
      "winery_order_number": "2826"
    }]
  }]
}

Response Data

Parameter Type Description Example
order_number STRING Marketplace Vender specified Order Number ABC123
order_type ENUM Type of Order. Possible values are:
daily, club, special
daily
ordered_on DATE Marketplace Vender specified Order Date 2016-02-29
requested_ship_date DATE Marketplace Vender specified Ship Date 2016-02-29
temp_control BOOLEAN Denotes shipment will use temp control route false
status ENUM Status of Order. Possible values are:
processing, shipped, cancelled or refunded
shipped
subtotal NUMBER Calculated field. Sum of order items prices multiplied by quantities. Does not include taxes or shipping 45.67
shipping_collected NUMBER Marketplace Vender specified dollar amount of shipping collected for order 10.00
sales_tax_collected NUMBER Marketplace Vender specified amount of sales tax collected for order including tax on shipping 10.00
total NUMBER Calculated field. Sum of subtotal + sales_tax_collected + shipping_tax_collected + shipping_collected 55.67
gift_message STRING Marketplace Vender specified gift message Happy Birthday Jake
consumer_benefit NUMBER Value of Consumer Benefit given or used in purchase 10.00
shipping_customer OBJECT Object containing shipping custom details
shipping_customer.name STRING Full name of shipping customer Jake Doe
shipping_customer.email STRING Email address of the shipping customer jdoe@example.com
shipping_customer.phone STRING Phone number of the shipping customer 555-555-5555
shipping_customer.dob DATE Date of Birth of the shipping customer 1973-04-09
shipping_address OBJECT Object containing shipping address details
shipping_address.line_1 STRING First line of the shipping address 1190 Airport Road
shipping_address.line_2 STRING Second line of the shipping address Suite 101
shipping_address.city STRING City of the shipping address Napa
shipping_address.state STRING State of the shipping address CA
shipping_address.zip STRING Zipcode of the shipping address 94558
shipping_address.county STRING County of the shipping address Napa County
shipping_address.country STRING Country of the shipping address US
shipping_address.single_line STRING Formatted field of the shipping address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
billing_customer OBJECT Object containing billing custom details
billing_customer.name STRING Full name of billing customer Jake Doe
billing_customer.email STRING Email address of the billing customer jdoe@example.com
billing_customer.phone STRING Phone number of the billing customer 555-555-5555
billing_customer.dob DATE Date of Birth of the billing customer 1973-04-09
billing_address OBJECT Object containing billing address details
billing_address.line_1 STRING First line of the billing address 1190 Airport Road
billing_address.line_2 STRING Second line of the billing address Suite 101
billing_address.city STRING City of the billing address Napa
billing_address.state STRING State of the billing address CA
billing_address.zip STRING Zipcode of the billing address 94558
billing_address.county STRING County of the billing address Napa County
billing_address.country STRING Country of the billing address US
billing_address.single_line STRING Formatted field of the billing address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
delivery_customer OBJECT Object containing delivery custom details
delivery_customer.name STRING Full name of delivery customer Jake Doe
delivery_customer.phone STRING Phone number of the delivery customer 555-555-5555
delivery_address OBJECT Object containing delivery address details
delivery_address.company_name STRING Company Name of the delivery address Walgreens
delivery_address.line_1 STRING First line of the delivery address 1190 Airport Road
delivery_address.line_2 STRING Second line of the delivery address Suite 101
delivery_address.city STRING City of the delivery address Napa
delivery_address.state STRING State of the delivery address CA
delivery_address.zip STRING Zipcode of the delivery address 94558
delivery_address.county STRING County of the delivery address Napa County
delivery_address.country STRING Country of the delivery address US
delivery_address.single_line STRING Formatted field of the delivery address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
delivery_address.hold_at_location_type STRING Indicates the type of delivery address being submitted, supported values are FEDEX_LOCATION and UPS_ACCESSPOINT for HAL addresses FEDEX_LOCATION
delivery_address.hold_at_location_id STRING Unique FedEx location ID ABCD
order_items ARRAY Array of order_item objects
order_items.product_id NUMBER ID of product 1
order_items.name STRING Name of Product Stargazer
order_items.sku STRING SKU of Product SG123
order_items.quantity NUMBER Quantity of Product 2
order_items.price NUMBER Proce of Product 34.56
order_items.subtotal NUMBER Calculated field. (quantity x price) 69.12
shipments ARRAY Array of order_item objects
shipments.tracking_number STRING Tracking number of shipment 123456789012
shipments.tracking_url STRING Tracking url of shipment http://www.fedex.com/Tracking?action=track&tracknumbers=123456789012
shipments.carrier_name STRING Name of Carrier FedEx
shipments.service_name STRING Service Name Ground
shipments.status ENUM Status of Shipment. Possible values are:
processing, shipped
shipped
shipments.shipped_on DATE Date shipment was hipped 2016-02-19
winery_orders ARRAY Array of winery_order objects
winery_orders.winery_name STRING Name of Winery Dancing Wind
winery_orders.winery_order_number STRING Winery Order Number 1234

HTTP Request

GET https://marketplace.vin65.com/orders/{order_id}

Header Parameters

Parameter Required Description
Authorization TRUE Authorization token
example: Bearer 576gf565f2873g967w8.23478263g945sdfgwe523f.445gf7127cb45twe
version FALSE API Version to access
example: version=1

URL Parameters

Parameter Required Description
id TRUE ID of Order

Example Request Code

curl -X "POST" "https://marketplace.vin65.com/orders/1" \
        -H "Authorization: Bearer your_auth_token_here" \
        -H "Accept: version=1"

require 'httparty'
headers = { 'Authorization' => "Bearer #{auth_token}" }
response = HTTParty.get('https://marketplace.vin65.com/orders/1', headers: headers)
JSON.parse(response.body)

Example Response Headers

HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Version: 1
Content-Type: application/json; charset=utf-8
ETag: W/"a983148a6684267b9133d47093816999"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0acbbc9e-5a05-48f6-8d94-35d3ace9cc35
X-Runtime: 0.182015
Connection: close
Transfer-Encoding: chunked

Example Response Body

{
  "order": {
    "id": "123",
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2016-02-19",
    "requested_ship_date": "2016-02-22",
    "status": "shipped",
    "subtotal": "100.0",
    "shipping_collected": "15.0",
    "shipping_owed": "15.0",
    "tax_collected": "8.22",
    "total": "123.22",
    "shipping_option_code": "overnight",
    "temp_control": "false",
    "gift_message": "Happy Birthday Jake",
    "consumer_benefit": "10.00",
    "shipping_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "shipping_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "billing_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "billing_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "delivery_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "delivery_address": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "onebox": true,
    "order_items": [{
      "product_id": 291,
      "name": "Dancing Wind Merlot",
      "sku": "12345678",
      "quantity": 1,
      "price": "30.0",
      "subtotal": "30.0",
      "status": "shipped",
      "winery_name": "Dancing Wind",
      "sales_tax_collected": "2.73",
      "sales_tax_owed": "2.73",
      "shipping_collected": "5.0",
      "shipping_owed": "5.0",
      "shipping_tax_collected": "0.45",
      "shipping_tax_owed": "0.45"
    }, {
      "product_id": 291,
      "name": "Dancing Wind Cabernet",
      "sku": "87654321",
      "quantity": 1,
      "price": "30.0",
      "subtotal": "30.0",
      "status": "shipped",
      "winery_name": "Dancing Wind",
      "sales_tax_collected": "2.73",
      "sales_tax_owed": "2.73",
      "shipping_collected": "5.0",
      "shipping_owed": "5.0",
      "shipping_tax_collected": "0.45",
      "shipping_tax_owed": "0.45"
    }],
    "shipments": [{
      "tracking_number": "12345678",
      "tracking_url": "http://www.fedex.com/Tracking?action=track&tracknumbers=123456789012"
      "carrier_name": "FedEx",
      "service_name": "2 Day Ground",
      "shipped_on": "2016-02-19T00:00:00.000Z",
      "delivered_on": "2016-04-19T08:00:00.000Z"
    }],
    "winery_orders": [{
      "winery_name": "Dancing Wind",
      "winery_order_number": "2826"
    }]
  }
}

Response Data

Parameter Type Description Example
order_number STRING Marketplace Vender specified Order Number ABC123
order_type ENUM Type of Order. Possible values are:
daily, club, special
daily
ordered_on DATE Marketplace Vender specified Order Date 2016-02-29
requested_ship_date DATE Marketplace Vender specified Ship Date 2016-02-29
temp_control BOOLEAN Denotes shipment will use temp control route false
status ENUM Status of Order. Possible values are:
processing, shipped, cancelled or refunded
shipped
subtotal NUMBER Calculated field. Sum of order items prices multiplied by quantities. Does not include taxes or shipping 45.67
shipping_collected NUMBER Marketplace Vender specified dollar amount of shipping collected for order 10.00
sales_tax_collected NUMBER Marketplace Vender specified amount of sales tax collected for order including tax on shipping 10.00
total NUMBER Calculated field. Sum of subtotal + sales_tax_collected + shipping_tax_collected + shipping_collected 55.67
gift_message STRING Marketplace Vender specified gift message Happy Birthday Jake
consumer_benefit NUMBER Value of Consumer Benefit given or used in purchase 10.00
shipping_customer OBJECT Object containing shipping custom details
shipping_customer.name STRING Full name of shipping customer Jake Doe
shipping_customer.email STRING Email address of the shipping customer jdoe@example.com
shipping_customer.phone STRING Phone number of the shipping customer 555-555-5555
shipping_customer.dob DATE Date of Birth of the shipping customer 1973-04-09
shipping_address OBJECT Object containing shipping address details
shipping_address.line_1 STRING First line of the shipping address 1190 Airport Road
shipping_address.line_2 STRING Second line of the shipping address Suite 101
shipping_address.city STRING City of the shipping address Napa
shipping_address.state STRING State of the shipping address CA
shipping_address.zip STRING Zipcode of the shipping address 94558
shipping_address.county STRING County of the shipping address Napa County
shipping_address.country STRING Country of the shipping address US
shipping_address.single_line STRING Formatted field of the shipping address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
billing_customer OBJECT Object containing billing custom details
billing_customer.name STRING Full name of billing customer Jake Doe
billing_customer.email STRING Email address of the billing customer jdoe@example.com
billing_customer.phone STRING Phone number of the billing customer 555-555-5555
billing_customer.dob DATE Date of Birth of the billing customer 1973-04-09
billing_address OBJECT Object containing billing address details
billing_address.line_1 STRING First line of the billing address 1190 Airport Road
billing_address.line_2 STRING Second line of the billing address Suite 101
billing_address.city STRING City of the billing address Napa
billing_address.state STRING State of the billing address CA
billing_address.zip STRING Zipcode of the billing address 94558
billing_address.county STRING County of the billing address Napa County
billing_address.country STRING Country of the billing address US
billing_address.single_line STRING Formatted field of the billing address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
delivery_customer OBJECT Object containing delivery custom details
delivery_customer.name STRING Full name of delivery customer Jake Doe
delivery_customer.phone STRING Phone number of the delivery customer 555-555-5555
delivery_address OBJECT Object containing delivery address details
delivery_address.company_name STRING Company Name of the delivery address Walgreens
delivery_address.line_1 STRING First line of the delivery address 1190 Airport Road
delivery_address.line_2 STRING Second line of the delivery address Suite 101
delivery_address.city STRING City of the delivery address Napa
delivery_address.state STRING State of the delivery address CA
delivery_address.zip STRING Zipcode of the delivery address 94558
delivery_address.county STRING County of the delivery address Napa County
delivery_address.country STRING Country of the delivery address US
delivery_address.single_line STRING Formatted field of the delivery address as a single line 1190 Airport Road, Suite 101, Napa, CA, 94558, US
delivery_address.hold_at_location_type STRING Indicates the type of delivery address being submitted, supported values are FEDEX_LOCATION and UPS_ACCESSPOINT for HAL addresses FEDEX_LOCATION
delivery_address.hold_at_location_id STRING Unique FedEx location ID ABCD
order_items ARRAY Array of order_item objects
order_items.product_id NUMBER ID of product 1
order_items.name STRING Name of Product Stargazer
order_items.sku STRING SKU of Product SG123
order_items.quantity NUMBER Quantity of Product 2
order_items.price NUMBER Proce of Product 34.56
order_items.subtotal NUMBER Calculated field. (quantity x price) 69.12
shipments ARRAY Array of order_item objects
shipments.tracking_number STRING Tracking number of shipment 123456789012
shipments.tracking_url STRING Tracking url of shipment http://www.fedex.com/Tracking?action=track&tracknumbers=123456789012
shipments.carrier_name STRING Name of Carrier FedEx
shipments.service_name STRING Service Name Ground
shipments.status ENUM Status of Shipment. Possible values are:
processing, shipped
shipped
shipments.shipped_on DATE Date shipment was hipped 2016-02-19
winery_orders ARRAY Array of winery_order objects
winery_orders.winery_name STRING Name of Winery Dancing Wind
winery_orders.winery_order_number STRING Winery Order Number 1234

HTTP Request

POST https://marketplace.vin65.com/orders

Header Parameters

Parameter Required Description
Authorization TRUE Authorization token
example: Bearer 576gf565f2873g967w8.23478263g945sdfgwe523f.445gf7127cb45twe
version FALSE API Version to access
example: version=1

Example Request Code

curl -X "POST" "https://marketplace.vin65.com/orders" \
        -H "Authorization: Bearer your_auth_token_here" \
        -H "Accept: version=1" \
        -d '{
  "order": {
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2017-06-01T00:00:00-0000",
    "requested_ship_date": "2017-06-5",
    "shipping_collected": "10.0",
    "shipping_option_code": "overnight",
    "temp_control": "false",
    "packing_slip_code": "abcdefg",
    "tax_collected": "1.88",
    "gift_message": "Happy Birthday Jake",
    "consumer_benefit": "10.00",
    "unfunded_reship_order": "false",
    "shipping_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "shipping_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "delivery_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "delivery_address_attributes": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "billing_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
      "dob": "1970-06-15"
    },
    "billing_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "order_items_attributes": [{
      "product_id": 6,
      "quantity": 2,
      "price": "15.0"
    }, {
      "product_id": 1,
      "quantity": 1,
      "price": "10.0"
    }]
  }
}
'

body = {
  "order": {
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2017-06-01T00:00:00-0000",
    "requested_ship_date": "2017-06-5",
    "shipping_collected": "10.0",
    "shipping_option_code": "overnight",
    "temp_control": "false",
    "packing_slip_code": "abcdefg",
    "tax_collected": "1.88",
    "gift_message": "Happy Birthday Jake",
    "consumer_benefit": "10.00",
    "unfunded_reship_order": "false",
    "shipping_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "shipping_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "delivery_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "delivery_address_attributes": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "billing_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
      "dob": "1970-06-15"
    },
    "billing_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "order_items_attributes": [{
      "product_id": 6,
      "quantity": 2,
      "price": "15.0"
    }, {
      "product_id": 1,
      "quantity": 1,
      "price": "10.0"
    }]
  }
}

require 'httparty'
headers = { 'Authorization' => "Bearer #{auth_token}" }
response = HTTParty.post('https://marketplace.vin65.com/orders', body: body, headers: headers)
JSON.parse(response.body)


Body Parameters

Parameter Required Description
order.order_number TRUE Order Number of order. This is your way of identifying the order later. it must be unique.
order.order_type FALSE Order Type of order. Valid options are ["daily", "club", "special"]
order.ordered_on TRUE Date the Order was placed. YYYY-MM-DD
order.requested_ship_date FALSE Date the Order will be shipped. NOTE: date must be 1 to 60 days in the future YYYY-MM-DD
order.tax_collected TRUE Dollar Amount of sales tax collected for order including tax on shipping
order.shipping_collected TRUE Dollar Amount of shipping collected for order
order.shipping_option_code TRUE Class of shipping. Choices are ["ground", "two_day", "overnight", "summership"]
order.packing_slip_code FALSE Optional value to instruct fulfillment to use a specific packing slip template instead of the default one
order.gift_message FALSE Gift message that can be printed on package (1000 Characters Maximum)
order.consumer_benefit FALSE Value of Consumer Benefit given or used in purchase
order.unfunded_reship_order FALSE Boolean to determine Reship Logic. Value of Order must be $0.00 if unfunded_reship_order is True.
order.shipping_customer_attributes TRUE Object containing Shipping Customer attributes
order.shipping_customer_attributes.name TRUE Name of Shipping Customer
order.shipping_customer_attributes.email TRUE Email of Shipping Customer
order.shipping_customer_attributes.phone FALSE Phone of Shipping Customer
order.shipping_customer_attributes.dob FALSE Date of Birth of Shipping Customer. YYYY-MM-DD
order.shipping_address_attributes TRUE Object containing Shipping Address attributes
order.shipping_address_attributes.line_1 TRUE First line of Shipping Address
order.shipping_address_attributes.line_2 FALSE First line of Shipping Address
order.shipping_address_attributes.city TRUE City of Shipping Address
order.shipping_address_attributes.state TRUE State Shipping Address
order.shipping_address_attributes.zip TRUE Zip Code Shipping Address
order.shipping_address_attributes.county FALSE County Shipping Address
order.shipping_address_attributes.country TRUE Country Shipping Address
order.billing_customer_attributes TRUE Object containing Billing Customer attributes
order.billing_customer_attributes.name TRUE Name of Billing Customer
order.billing_customer_attributes.email TRUE Email of Billing Customer
order.billing_customer_attributes.phone FALSE Phone of Billing Customer
order.billing_customer_attributes.dob TRUE Date of Birth of Billing Customer. YYYY-MM-DD
order.billing_address_attributes TRUE Object containing Billing Address attributes
order.billing_address_attributes.line_1 TRUE First line of Billing Address
order.billing_address_attributes.line_2 FALSE First line of Billing Address
order.billing_address_attributes.city TRUE City of Billing Address
order.billing_address_attributes.state TRUE State Billing Address
order.billing_address_attributes.zip TRUE Zip Code Billing Address
order.billing_address_attributes.county FALSE County Billing Address
order.billing_address_attributes.country TRUE Country Billing Address
order.delivery_customer_attributes FALSE Object containing Delivery Customer attributes
order.delivery_customer_attributes.name TRUE Name of Delivery Customer. Should match the name of the shipping customer.
order.delivery_customer_attributes.phone TRUE Phone of Delivery Customer. important for notification of the recipient that the package is available.
order.delivery_address_attributes FALSE Object containing Delivery Address attributes
order.delivery_address_attributes.company_name TRUE Company Name of Delivery Address
order.delivery_address_attributes.line_1 TRUE First line of Delivery Address
order.delivery_address_attributes.line_2 FALSE First line of Delivery Address
order.delivery_address_attributes.city TRUE City of Delivery Address
order.delivery_address_attributes.state TRUE State Delivery Address. Must equal state in Shipping Address
order.delivery_address_attributes.zip TRUE Zip Code Delivery Address
order.delivery_address_attributes.county FALSE County Delivery Address
order.delivery_address_attributes.country TRUE Country Delivery Address
order.delivery_address_attributes.hold_at_location_type TRUE Indicates the type of delivery address being submitted, supported values are FEDEX_LOCATION and UPS_ACCESSPOINT for HAL addresses
order.delivery_address_attributes.hold_at_location_id TRUE Indicates the id of delivery address being submitted
order.order_items_attributes TRUE Array containing order items
order.order_items_attributes.product_id TRUE Market Serivces Product ID
order.order_items_attributes.quantity TRUE Number of this product included in this order
order.order_items_attributes.price TRUE Price of product

Example Request Body

{
  "order": {
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2017-06-01T00:00:00-0000",
    "requested_ship_date": "2017-06-5",
    "shipping_collected": "10.0",
    "shipping_option_code": "overnight",
    "temp_control": "false",
    "packing_slip_code": "abcdefg",
    "tax_collected": "1.88",
    "gift_message": "Happy Birthday Jake",
    "consumer_benefit": "10.00",
    "unfunded_reship_order": "false",
    "shipping_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "shipping_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "delivery_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
    },
    "delivery_address_attributes": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "billing_customer_attributes": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555"
      "dob": "1970-06-15"
    },
    "billing_address_attributes": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US"
    },
    "order_items_attributes": [{
      "product_id": 6,
      "quantity": 2,
      "price": "15.0"
    }, {
      "product_id": 1,
      "quantity": 1,
      "price": "10.0"
    }]
  }
}

Example Response Headers

HTTP/1.1 201 Created
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Version: 1
Content-Type: application/json; charset=utf-8
ETag: W/"a983148a6684267b9133d47093816999"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0acbbc9e-5a05-48f6-8d94-35d3ace9cc35
X-Runtime: 0.182015
Connection: close
Transfer-Encoding: chunked

Example Response Body

{
  "order": {
    "id": "123",
    "order_number": "1234561234",
    "order_type": "daily",
    "ordered_on": "2016-02-19",
    "requested_ship_date": "2016-02-22",
    "status": "shipped",
    "subtotal": "100.0",
    "shipping_collected": "15.0",
    "shipping_owed": "15.0",
    "tax_collected": "8.22",
    "total": "123.22",
    "shipping_option_code": "overnight",
    "temp_control": "false",
    "gift_message": "Happy Birthday Jake",
    "consumer_benefit": "10.00",
    "shipping_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "shipping_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "billing_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "billing_address": {
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US"
    },
    "delivery_customer": {
      "name": "John Doe",
      "email": "jdoe@example.com",
      "phone": "555-555-5555",
      "dob": "1973-04-09"
    },
    "delivery_address": {
      "company_name": "Walgreens",
      "line_1": "1190 Airport Road",
      "line_2": "Suite 101",
      "city": "Napa",
      "state": "CA",
      "zip": "94558",
      "county": "Napa County",
      "country": "US",
      "single_line": "1190 Airport Road, Suite 101, Napa, CA, 94558, US",
      "hold_at_location_type": "FEDEX_LOCATION",
      "hold_at_location_id": "ABCD"
    },
    "onebox": true,
    "order_items": [{
      "product_id": 291,
      "name": "Dancing Wind Merlot",
      "sku": "12345678",
      "quantity": 1,
      "price": "30.0",
      "subtotal": "30.0",
      "status": "shipped",
      "winery_name": "Dancing Wind",
      "sales_tax_collected": "2.73",
      "sales_tax_owed": "2.73",
      "shipping_collected": "5.0",
      "shipping_owed": "5.0",
      "shipping_tax_collected": "0.45",
      "shipping_tax_owed": "0.45"
    }, {
      "product_id": 291,
      "name": "Dancing Wind Cabernet",
      "sku": "87654321",
      "quantity": 1,
      "price": "30.0",
      "subtotal": "30.0",
      "status": "shipped",
      "winery_name": "Dancing Wind",
      "sales_tax_collected": "2.73",
      "sales_tax_owed": "2.73",
      "shipping_collected": "5.0",
      "shipping_owed": "5.0",
      "shipping_tax_collected": "0.45",
      "shipping_tax_owed": "0.45"
    }],
    "shipments": [{
      "tracking_number": "12345678",
      "tracking_url": "http://www.fedex.com/Tracking?action=track&tracknumbers=123456789012"
      "carrier_name": "FedEx",
      "service_name": "2 Day Ground",
      "shipped_on": "2016-02-19T00:00:00.000Z",
      "delivered_on": "2016-04-19T08:00:00.000Z"
    }],
    "winery_orders": [{
      "winery_name": "Dancing Wind",
      "winery_order_number": "2826"
    }]
  }
}

HTTP Request

PUT https://marketplace.vin65.com/orders/{order_id}

Header Parameters

Parameter Required Description
Authorization TRUE Authorization token
example: Bearer 576gf565f2873g967w8.23478263g945sdfgwe523f.445gf7127cb45twe
version FALSE API Version to access
example: version=1

Example Request Code

curl -X "PUT" "https://marketplace.vin65.com/orders/1" \
        -H "Authorization: Bearer your_auth_token_here" \
        -H "Accept: version=1" \
        -d '{
  "order": {
    "cancel_order": "true"
  }
}
'

body = {
  "order": {
    "cancel_order": "true"
  }
}

require 'httparty'
headers = { 'Authorization' => "Bearer #{auth_token}" }
response = HTTParty.post('https://marketplace.vin65.com/orders/1', body: body, headers: headers)
JSON.parse(response.body)


Body Parameters

Parameter Required Description
order.cancel_order TRUE Boolean to cancel an order

Example Request Body

{
  "order": {
    "cancel_order": "true"
  }
}

Example Response Headers

HTTP/1.1 204 No Content
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Version: 1
Content-Type: application/json; charset=utf-8
ETag: W/"a983148a6684267b9133d47093816999"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0acbbc9e-5a05-48f6-8d94-35d3ace9cc35
X-Runtime: 0.182015
Connection: close
Transfer-Encoding: chunked