### Get Order Details using Bash and JavaScript Source: https://context7.com/context7/developer_vinoshipper/llms.txt Retrieve comprehensive order details from the VinoShipper API, including customer, product, shipping, and status information. This example demonstrates making a GET request to the orders endpoint and processing the JSON response. It requires API credentials and an order number as input. ```bash curl --request GET \ --url https://vinoshipper.com/api/v3/p/orders/VS-12345 \ --header 'Authorization: Basic {base64(apiKey:apiSecret)}' \ --header 'Accept: application/json' ``` ```javascript const getOrderDetails = async (orderNumber) => { const apiKey = process.env.VINOSHIPPER_API_KEY; const apiSecret = process.env.VINOSHIPPER_API_SECRET; const authHeader = 'Basic ' + btoa(`${apiKey}:${apiSecret}`); try { const response = await fetch( `https://vinoshipper.com/api/v3/p/orders/${orderNumber}`, { headers: { 'Authorization': authHeader, 'Accept': 'application/json' } } ); if (!response.ok) { if (response.status === 404) { throw new Error('Order not found'); } throw new Error(`HTTP ${response.status}`); } const order = await response.json(); console.log('=== Order Details ==='); console.log(`Order #: ${order.orderNumber}`); console.log(`Status: ${order.status} / ${order.orderStatus}`); console.log(`Purchased: ${new Date(order.purchasedAt).toLocaleDateString()}`); console.log('\nCustomer:'); console.log(` ${order.customer.fullName} (${order.customer.email})`); console.log(` Customer ID: ${order.customer.id}`); console.log('\nShip To:'); const addr = order.shipToAddress; console.log(` ${addr.firstName} ${addr.lastName}`); console.log(` ${addr.street1}`); if (addr.street2) console.log(` ${addr.street2}`); console.log(` ${addr.city}, ${addr.stateCode} ${addr.postalCode}`); console.log('\nProducts:'); order.products.forEach(p => { console.log(` ${p.quantity}x ${p.productName} - $${p.price.toFixed(2)} ea`); if (p.discount > 0) { console.log(` Discount: -$${p.discount.toFixed(2)}`); } }); console.log('\nShipping:'); console.log(` ${order.shipping.carrier} ${order.shipping.rateDescription}`); console.log(` Cost: $${order.shipping.price.toFixed(2)}`); if (order.shipping.packages && order.shipping.packages.length > 0) { console.log('\nTracking:'); order.shipping.packages.forEach(pkg => { console.log(` ${pkg.carrier}: ${pkg.trackingNumber}`); }); } console.log('\nTotals:'); console.log(` Subtotal: $${(order.total - order.taxesTotal - order.shipping.price).toFixed(2)}`); console.log(` Shipping: $${order.shipping.price.toFixed(2)}`); console.log(` Tax: $${order.taxesTotal.toFixed(2)}`); console.log(` Total: $${order.total.toFixed(2)}`); return order; } catch (error) { console.error('Failed to fetch order:', error); throw error; } }; ``` -------------------------------- ### List Webhooks using Python Source: https://developer.vinoshipper.com/reference/manage-webhooks This Python code snippet demonstrates how to list webhooks using the `requests` library. It sends a GET request to the Vinoshipper API. Make sure to install the `requests` library (`pip install requests`). ```python import requests url = "https://vinoshipper.com/api/v3/p/profile/webhooks" headers = { 'accept': '*/*' } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Initialize Injector V4 JavaScript Source: https://developer.vinoshipper.com/docs/injector-transitioning-from-previous-versions This snippet shows how to load the Injector V4 script and initialize it once the 'vinoshipper:loaded' event is detected. Replace '000' with your Account ID and the value of 'vsWineryId' without quotes. This script should only load once per page. ```html ``` -------------------------------- ### Core Vinoshipper Methods Source: https://developer.vinoshipper.com/docs/injector-methods Methods for initializing and managing the Vinoshipper injector, checking its status, and retrieving server information. ```APIDOC ## Initialization and Status ### `init` Initializes the Vinoshipper Injector for use. Returns a `Promise` allowing for actions after initialization. **Parameters** - `producerID` (number) - Required - The producer's unique identifier. - `options` (VinoshipperConfig) - Optional - Configuration options for Vinoshipper. ### `isLoaded` Returns `true` if Vinoshipper is loaded and ready. ### `isRendered` Returns `true` if Vinoshipper components (like the Cart) have been rendered. ### `isDebug` Returns `true` if Vinoshipper Injector is currently in debug mode. ## Server Information ### `getServer` Returns the Vinoshipper server URL string. Optionally exclude the protocol. **Parameters** - `includeProtocol` (boolean) - Optional, defaults to `true` - If `false`, the protocol (`https://`) is omitted. ``` ```APIDOC ## Product Management ### `onProductAdd` Adds a product to the customer's cart. Allows specifying quantity and update behavior. **Parameters** - `productId` (number) - Required - The ID of the product to add. - `qty` (number) - Optional, defaults to `1` - The quantity of the product to add. - `options` (VSCartOnProductAddOptions) - Optional - Options object, including `update: true` to overwrite the quantity. ```typescript export interface VSCartOnProductAddOptions { update?: boolean } ``` ### `onProductAddFormSubmit` Handles the submission of a product add-to-cart form. **Parameters** - `event` (SubmitEvent) - Required - The submit event object from the form. ``` -------------------------------- ### List Webhooks using PHP Source: https://developer.vinoshipper.com/reference/manage-webhooks A PHP example for fetching webhooks using cURL. This script sends a GET request to the Vinoshipper API endpoint. Ensure your PHP environment has cURL enabled and properly configured. ```php ``` -------------------------------- ### Website Configuration Source: https://developer.vinoshipper.com/reference/uioptions This section details the configurable options for a website within the Vinoshipper platform, including pickup settings, promotional tools, and analytics integration. ```APIDOC ## PUT /websites/{websiteId} ### Description Updates the configuration for a specific website. ### Method PUT ### Endpoint /websites/{websiteId} ### Parameters #### Path Parameters - **websiteId** (string) - Required - The unique identifier of the website. #### Request Body - **wineryPickup** (object) - Optional - Configuration for winery pickup options. - **enabled** (boolean) - Optional - Whether winery pickup is enabled. - **description** (string) - Optional - A description for winery pickup. - **minOrderQty** (integer) - Optional - The minimum order quantity for winery pickup. - **acceptedUpsTerms** (boolean) - Optional - Indicates if UPS terms are accepted. - **approvedByAdmin** (boolean) - Optional - Indicates if the configuration is approved by an admin. - **archived** (boolean) - Optional - Whether the website is archived. - **promotionCode** (string) - Optional - A promotion code to apply. - **packagingChargeCutoff** (integer) - Optional - The cutoff for packaging charges. - **paysShipperPickPackFees** (boolean) - Optional - Whether the shipper pays pick and pack fees. - **googleAnalyticsAccount** (string) - Optional - Google Analytics account ID. - **gtmAccount** (string) - Optional - Google Tag Manager account ID. - **ga4Account** (string) - Optional - Google Analytics 4 account ID. - **facebookPixel** (string) - Optional - Facebook Pixel ID. ### Request Example ```json { "wineryPickup": { "enabled": true, "description": "Pickup at our vineyard.", "minOrderQty": 1 }, "acceptedUpsTerms": true, "googleAnalyticsAccount": "UA-12345678-1" } ``` ### Response #### Success Response (200) Returns the updated website configuration. - **wineryPickup** (object) - Winery pickup settings. - **acceptedUpsTerms** (boolean) - UPS terms acceptance status. - **approvedByAdmin** (boolean) - Admin approval status. - **archived** (boolean) - Archive status. - **promotionCode** (string) - Applied promotion code. - **packagingChargeCutoff** (integer) - Packaging charge cutoff time. - **paysShipperPickPackFees** (boolean) - Shipper pick/pack fee payment status. - **googleAnalyticsAccount** (string) - Google Analytics account ID. - **gtmAccount** (string) - Google Tag Manager account ID. - **ga4Account** (string) - Google Analytics 4 account ID. - **facebookPixel** (string) - Facebook Pixel ID. #### Response Example ```json { "wineryPickup": { "enabled": true, "description": "Pickup at our vineyard.", "minOrderQty": 1 }, "acceptedUpsTerms": true, "approvedByAdmin": true, "archived": false, "promotionCode": null, "packagingChargeCutoff": 1700, "paysShipperPickPackFees": false, "googleAnalyticsAccount": "UA-12345678-1", "gtmAccount": null, "ga4Account": null, "facebookPixel": null } ``` ``` -------------------------------- ### List Webhooks using Node.js Source: https://developer.vinoshipper.com/reference/manage-webhooks Example of listing webhooks via the Vinoshipper API using Node.js. This code makes a GET request to the webhooks endpoint. Replace 'YOUR_API_KEY' with your actual API key for authentication. ```javascript const url = require('url'); const https = require('https'); const options = { method: 'GET', hostname: 'vinoshipper.com', path: '/api/v3/p/profile/webhooks', headers: { 'accept': '*/*' } }; const req = https.request(options, function (res) { const chunks = []; res.on('data', function (chunk) { chunks.push(chunk); }); res.on('end', function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Initialize Vinoshipper Injector with Account ID Source: https://developer.vinoshipper.com/docs/injector-getting-started This code snippet initializes the Vinoshipper Injector script. It requires your Account ID and should be placed in the body of your HTML. The injector will load with default settings and render Vinoshipper components defined in your HTML. ```html ``` -------------------------------- ### Initialize Vinoshipper Injector with Basic Configuration Source: https://context7.com/context7/developer_vinoshipper/llms.txt Initializes the Vinoshipper JavaScript injector with essential configuration parameters. This includes setting up theme colors, cart behavior, default component settings, and analytics integration. It listens for the 'vinoshipper:loaded' event before initialization. ```html Wine Shop
``` -------------------------------- ### GET Request for Product Taxonomies (Shell) Source: https://developer.vinoshipper.com/reference/product-taxonomy This snippet demonstrates how to make a GET request to retrieve product taxonomies using cURL. It includes the target URL and required headers. ```shell curl --request GET \ --url https://vinoshipper.com/api/v3/p/products/taxonomies \ --header 'accept: application/json' ``` -------------------------------- ### GET /shipping/estimate Source: https://developer.vinoshipper.com/reference/estimate_1 Retrieves a detailed shipping estimate based on provided criteria. This endpoint allows users to get comprehensive information about shipping options, including transit times, business days, and guarantee details. ```APIDOC ## GET /shipping/estimate ### Description Retrieves a detailed shipping estimate. This endpoint provides comprehensive information about shipping options, including transit times, business days, and guarantee details. ### Method GET ### Endpoint /shipping/estimate ### Parameters #### Query Parameters - **originCountry** (string) - Required - The country code of the origin. - **destinationCountry** (string) - Required - The country code of the destination. - **packageWeight** (number) - Required - The weight of the package. - **packageDimensions** (object) - Optional - The dimensions of the package. - **length** (number) - The length of the package. - **width** (number) - The width of the package. - **height** (number) - The height of the package. - **unit** (string) - The unit of measurement for dimensions (e.g., "IN", "CM"). ### Response #### Success Response (200) - **rates** (array) - An array of available shipping rates. - **serviceLevel** (string) - The shipping service level. - **estimatedDelivery** (object) - Estimated delivery details. - **date** (string, date) - The estimated delivery date. - **time** (object) - Optional time of delivery. - **hour** (integer, int32) - The hour of the day. - **minute** (integer, int32) - The minute of the hour. - **second** (integer, int32) - The second of the minute. - **nano** (integer, int32) - The nanosecond part of the second. - **pickup** (object) - Pickup details. - **date** (string, date) - The pickup date. - **time** (object) - Optional time of pickup. - **hour** (integer, int32) - The hour of the day. - **minute** (integer, int32) - The minute of the hour. - **second** (integer, int32) - The second of the minute. - **nano** (integer, int32) - The nanosecond part of the second. - **arrival** (object) - Arrival details. - **date** (string, date) - The arrival date. - **time** (object) - Optional time of arrival. - **hour** (integer, int32) - The hour of the day. - **minute** (integer, int32) - The minute of the hour. - **second** (integer, int32) - The second of the minute. - **nano** (integer, int32) - The nanosecond part of the second. - **businessDaysInTransit** (integer, int32) - The number of business days in transit. - **guaranteed** (boolean) - Indicates if the arrival time is guaranteed. #### Response Example ```json { "rates": [ { "serviceLevel": "Express", "estimatedDelivery": { "date": "2023-10-27", "time": { "hour": 14, "minute": 30, "second": 0, "nano": 0 } }, "pickup": { "date": "2023-10-25", "time": { "hour": 17, "minute": 0, "second": 0, "nano": 0 } }, "arrival": { "date": "2023-10-27", "time": { "hour": 10, "minute": 0, "second": 0, "nano": 0 } }, "businessDaysInTransit": 2, "guaranteed": true } ] } ``` #### Error Response (400) - **code** (string) - Error code. - **message** (string) - Error message. - **details** (string) - Additional error details. ``` -------------------------------- ### Product Catalog HTML Component - V4 Source: https://developer.vinoshipper.com/docs/injector-transitioning-from-previous-versions Replaces the old 'vs-winelist' div with the new 'vs-products' class for the Product Catalog component in Injector V4. This allows for multiple catalog instances on a page. ```html
``` -------------------------------- ### HTML Structure and Vinoshipper Initialization Source: https://context7.com/context7/developer_vinoshipper/llms.txt This HTML file sets up the structure for an e-commerce winery website, incorporating various Vinoshipper components. It includes custom styling and a JavaScript snippet to initialize the Vinoshipper library with specific configurations, themes, and event listeners for e-commerce actions. The script depends on the Vinoshipper injector script being loaded. ```html Valley View Winery - Shop

Valley View Winery

Award-winning wines from Napa Valley

We Ship To

Our Wines

Join Our Wine Club

Enjoy exclusive member benefits, discounts, and limited releases.

``` -------------------------------- ### GET /websites/developer_vinoshipper/addresses Source: https://developer.vinoshipper.com/reference/winelist Retrieves a list of all customer addresses. ```APIDOC ## GET /websites/developer_vinoshipper/addresses ### Description Retrieves a list of all customer addresses associated with the project. ### Method GET ### Endpoint /websites/developer_vinoshipper/addresses ### Parameters #### Query Parameters - **city** (string) - Optional - Filter addresses by city. - **postalCode** (string) - Optional - Filter addresses by postal code. - **stateCode** (string) - Optional - Filter addresses by state code. - **street1** (string) - Optional - Filter addresses by street. ### Request Example ``` GET /websites/developer_vinoshipper/addresses?city=Anytown&stateCode=CA ``` ### Response #### Success Response (200 OK) - An array of address objects. - Each object will contain the fields defined in the POST request body, plus a unique 'id'. #### Response Example ```json [ { "id": 123, "city": "Anytown", "postalCode": "12345", "stateCode": "CA", "street1": "123 Main St", "firstName": "John", "lastName": "Doe" }, { "id": 456, "city": "Otherville", "postalCode": "67890", "stateCode": "NY", "street1": "456 Oak Ave", "businessName": "Biz Corp" } ] ``` ``` -------------------------------- ### Order Creation Endpoint Source: https://developer.vinoshipper.com/reference/updateorder This section details the parameters required for creating a new order. It includes information about products, shipping rates, taxes, fees, and discounts. ```APIDOC ## POST /websites/developer_vinoshipper ### Description This endpoint allows for the creation of a new order with detailed product, shipping, tax, fee, and discount information. ### Method POST ### Endpoint /websites/developer_vinoshipper ### Parameters #### Request Body - **products** (array) - Required - A list of products that will go on the order. - **productId** (string) - Required - The ID of the product. - **quantity** (object) - Required - The quantity of the product. - **value** (number) - Required - The quantity of the product. - **priceOverride** (number) - Optional - An optional price override that will be used instead of the product's actual price. Note: You cannot override the price of a multi-pack product. Trying to do so will return an error. - **shippingRate** (object) - Required - The shipping rate that will be used to ship the order. - **rateCode** (string) - Required - The shipping rate code. - **carrier** (string) - Optional - The carrier of the shipping rate. Enum: ["UPS", "FEDEX", "GLS", "SELF"] - **price** (number) - Optional - The price of the shipping rate. - **rateDescription** (string) - Optional - A description of the shipping rate. - **taxes** (number) - Optional - Custom tax amount to be collected from the customer. - **fees** (number) - Optional - Additional fees collected, such as CO Retail Delivery fees and CA container deposit fees. - **tipAmount** (number) - Optional - Amount of tip added to the order. - **discount** (object) - Optional - Discount applied to the order. - **productDiscount** (object) - Optional - Details of the product discount. - **type** (string) - Required - The type of product discount. Enum: ["PERCENT", "DOLLAR", "FLAT_RATE", "FREE", "DOLLAR_PER_UNIT"] - **value** (number) - Required - The value of the discount. - **description** (string) - Optional - The display name of the discount. - **appliedValue** (number) - Optional - The actual value applied after discount calculation. ### Request Example ```json { "products": [ { "productId": "example_product_id", "quantity": { "value": 2, "priceOverride": 25.50 } } ], "shippingRate": { "rateCode": "GROUND_SAVER", "carrier": "FEDEX", "price": 10.99, "rateDescription": "Ground Saver" }, "taxes": 5.00, "fees": 1.50, "tipAmount": 3.00, "discount": { "productDiscount": { "type": "PERCENT", "value": 10, "description": "10% off total order" } } } ``` ### Response #### Success Response (200) - **orderId** (string) - The ID of the created order. - **status** (string) - The status of the order. #### Response Example ```json { "orderId": "ord_12345abcde", "status": "pending" } ``` ``` -------------------------------- ### GET /api/v3/p/products/taxonomies Source: https://developer.vinoshipper.com/reference/listtaxcategories Retrieves a list of all product taxonomies. ```APIDOC ## GET /api/v3/p/products/taxonomies ### Description Retrieves a list of all product taxonomies. ### Method GET ### Endpoint /api/v3/p/products/taxonomies ### Parameters #### Query Parameters #### Request Body ### Request Example ### Response #### Success Response (200) - **taxonomies** (array) - A list of product taxonomy objects. - **id** (integer) - The unique identifier for the taxonomy. - **name** (string) - The name of the taxonomy. - **parent_id** (integer) - The identifier of the parent taxonomy, or null if it's a top-level taxonomy. #### Response Example ```json { "taxonomies": [ { "id": 1, "name": "Electronics", "parent_id": null }, { "id": 2, "name": "Computers", "parent_id": 1 } ] } ``` ``` -------------------------------- ### Create Customer with cURL Source: https://context7.com/context7/developer_vinoshipper/llms.txt This snippet shows how to create a new customer using a cURL command. It sends a POST request to the VinoShipper API with customer data in JSON format, including optional address and wholesale flags. Ensure you replace `{base64(apiKey:apiSecret)}` with your actual API credentials. ```bash curl --request POST \ --url https://vinoshipper.com/api/v3/p/customers \ --header 'Authorization: Basic {base64(apiKey:apiSecret)}' \ --header 'Content-Type: application/json' \ --data '{ "email": "newcustomer@example.com", "firstName": "Alice", "lastName": "Johnson", "dateOfBirth": { "year": 1990, "month": 3, "day": 15 }, "address": { "street1": "555 Wine St", "city": "Sonoma", "stateCode": "CA", "postalCode": "95476", "phone": { "number": "7075551234" } }, "wholesale": false }' ``` -------------------------------- ### GET /websites/developer_vinoshipper/addresses/{id} Source: https://developer.vinoshipper.com/reference/winelist Retrieves a specific customer address by its ID. ```APIDOC ## GET /websites/developer_vinoshipper/addresses/{id} ### Description Retrieves a specific customer address using its unique identifier. ### Method GET ### Endpoint /websites/developer_vinoshipper/addresses/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the address to retrieve. ### Request Example ``` GET /websites/developer_vinoshipper/addresses/123 ``` ### Response #### Success Response (200 OK) - An address object containing all details for the specified ID. #### Response Example ```json { "id": 123, "city": "Anytown", "postalCode": "12345", "stateCode": "CA", "street1": "123 Main St", "firstName": "John", "lastName": "Doe", "phone": { "number": "555-123-4567", "country": 1, "extension": "101" }, "description": "Home" } ``` ``` -------------------------------- ### GET /websites/developer_vinoshipper/accessPoint Source: https://developer.vinoshipper.com/reference/updateannouncement Retrieves information about a specific UPS access point. ```APIDOC ## GET /websites/developer_vinoshipper/accessPoint ### Description Retrieves detailed information about a UPS access point, including its location, hours, and contact details. ### Method GET ### Endpoint /websites/developer_vinoshipper/accessPoint ### Parameters #### Query Parameters - **locationId** (string) - Required - The unique identifier for the UPS Location ID. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **id** (integer) - The internal ID of the access point. - **locationId** (string) - UPS Location ID. - **lat** (number) - Latitude coordinate of the access point. - **lng** (number) - Longitude coordinate of the access point. - **imageUrl** (string) - A full URL to an image associated with the Access Point. - **hours** (string) - Text describing the open hours of the access point. - **note** (string) - An optional note from the access point. - **businessName** (string) - The business name of the access point. - **street1** (string) - The first line of the street address. - **street2** (string, nullable) - The second line of the street address, if applicable. - **city** (string) - The city where the access point is located. - **postalCode** (string) - The postal code of the access point. - **stateCode** (string) - The state or province code. - **country** (string) - Two-letter country code. - **phoneNumber** (string, nullable) - The phone number of the access point. #### Response Example ```json { "id": 12345, "locationId": "UPS12345", "lat": 34.0522, "lng": -118.2437, "imageUrl": "http://example.com/image.jpg", "hours": "Mon-Fri 9am-5pm", "note": "Please call upon arrival.", "businessName": "Example Business", "street1": "123 Main St", "street2": null, "city": "Los Angeles", "postalCode": "90012", "stateCode": "CA", "country": "US", "phoneNumber": "555-123-4567" } ``` ``` -------------------------------- ### Initialize Vinoshipper with a Global Theme Source: https://developer.vinoshipper.com/docs/injector-styling-simple-theming Sets a global theme for all Vinoshipper elements on the page. This configuration is applied within the Vinoshipper.init() function after the 'vinoshipper:loaded' event fires. Ensure the Vinoshipper injector is loaded before initialization. ```javascript window.document.addEventListener('vinoshipper:loaded', () => { window.Vinoshipper.init(000, { theme: 'red-dark', }) }, false); ``` -------------------------------- ### GET /websites/developer_vinoshipper Source: https://developer.vinoshipper.com/reference/updateshipping Retrieves details about a specific developer associated with a website. ```APIDOC ## GET /websites/developer_vinoshipper ### Description Retrieves details about a specific developer associated with a website. ### Method GET ### Endpoint `/websites/developer_vinoshipper` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for GET request" } ``` ### Response #### Success Response (200) - **clubName** (string) - The club's name. Please use club.name - **releasesRemaining** (integer) - Club releases remaining before the membership is automatically expired. This is null when the membership does not expire. - **gift** (object) - Gift details for the membership. - **id** (integer) - Membership Gift ID - **salutation** (string) - **firstName** (string) - **lastName** (string) - **phone** (object) - Phone number details. - **number** (string) - **country** (integer) - **extension** (string) - **email** (string) - Gift recipient's email address - **dateOfBirth** (object) - Date of birth details. - **day** (integer) - **address** (object) - The address of the location where the sale is made. - **accessPoint** (object) - UPS access point details. - **id** (string) - **name** (string) - **city** (string) - **postalCode** (string) - **stateCode** (string) - **country** (string) - Two letter country code - **phoneNumber** (string) - Nullable phone number #### Response Example ```json { "clubName": "Example Club", "releasesRemaining": 5, "gift": { "id": 123, "salutation": "Mr.", "firstName": "John", "lastName": "Doe", "phone": { "number": "555-1234", "country": 1, "extension": "101" }, "email": "john.doe@example.com", "dateOfBirth": { "day": 15 } }, "address": { "accessPoint": { "id": "AP12345", "name": "UPS Store", "city": "Anytown", "postalCode": "12345", "stateCode": "CA", "country": "US", "phoneNumber": "555-9876" } } } ``` ``` -------------------------------- ### Order Creation API Source: https://developer.vinoshipper.com/reference/updateorder This section details the structure for creating an order, including customer information, shipping address, and product details. ```APIDOC ## POST /api/orders ### Description Allows the creation of a new order with specified customer and product details. ### Method POST ### Endpoint /api/orders ### Parameters #### Request Body - **customer** (object) - Required - Information about the customer placing the order. - **firstName** (string) - Optional - The first name of the customer. - **lastName** (string) - Optional - The last name of the customer. - **businessName** (string) - Optional - The business name if applicable. - **email** (string) - Required - The email address of the customer. - **phone** (object) - Optional - The phone number of the customer. - **number** (string) - Required - The phone number. - **country** (integer) - Optional - Country code for the phone number. - **extension** (string) - Optional - Phone number extension. - **shipToAddress** (object) - Required - The shipping address for the order. - **street1** (string) - Required - The primary street address. - **street2** (string) - Optional - Secondary street address information. - **city** (string) - Required - The city for the shipping address. - **stateCode** (string) - Required - The state or province code. - **postalCode** (string) - Required - The postal or ZIP code. - **country** (string) - Optional - The two-letter country code (defaults to 'US'). - **salutation** (string) - Optional - A formal greeting or title for the customer. - **firstName** (string) - Optional - The first name for the shipping recipient. - **lastName** (string) - Optional - The last name for the shipping recipient. - **businessName** (string) - Optional - The business name for the shipping recipient. - **phone** (object) - Optional - The phone number for the shipping recipient. - **number** (string) - Required - The phone number. - **country** (integer) - Optional - Country code for the phone number. - **extension** (string) - Optional - Phone number extension. - **upsAccessPointId** (string) - Optional - UPS Access Point ID if applicable. - **productIdType** (string) - Required - The type of product identifier used (e.g., 'SKU', 'VS_ID'). - **products** (array) - Required - A list of products to be included in the order. - **productId** (string) - Required - The identifier of the product. - **quantity** (integer) - Required - The number of units of the product. - **price** (number) - Optional - The price per unit of the product. ### Request Example ```json { "customer": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": { "number": "555-123-4567" } }, "shipToAddress": { "street1": "123 Main St", "city": "Anytown", "stateCode": "CA", "postalCode": "90210", "country": "US" }, "productIdType": "SKU", "products": [ { "productId": "WINE-ABC", "quantity": 2, "price": 25.99 } ] } ``` ### Response #### Success Response (200) - **orderId** (string) - The unique identifier for the created order. - **status** (string) - The current status of the order. #### Response Example ```json { "orderId": "ORD123456789", "status": "Processing" } ``` ``` -------------------------------- ### Get Customer Details Source: https://developer.vinoshipper.com/reference/customerdetails Retrieves comprehensive details for a specific customer. ```APIDOC ## GET /websites/developer_vinoshipper/customers/{customerId} ### Description Retrieves detailed information about a specific customer, including their personal details, club memberships, order history status, and any outstanding alerts or issues. ### Method GET ### Endpoint `/websites/developer_vinoshipper/customers/{customerId}` ### Parameters #### Path Parameters - **customerId** (string) - Required - The unique identifier for the customer. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **details** (object) - Contains detailed customer information. - **notes** (array) - List of notes associated with the customer. - **alerts** (array) - List of data problems to notify producers to fix (deprecated). - **issues** (object) - Data problems to alert producers to fix. - **card** (array) - The list of alerts for card errors. - **order** (array) - The list of alerts for order problem. - **ageVerified** (boolean) - Indicates if the customer's age has been verified. - **clubsOnHold** (boolean) - True if all club memberships are on hold. - **hasOrderHistory** (boolean) - Has this customer ever made an order or have any upcoming club releases? - **fullName** (string) - The customer's full name. - **firstName** (string) - The customer's first name. - **lastName** (string) - The customer's last name. #### Response Example ```json { "details": { "notes": [ { "id": "note_id_123", "author": "John Doe", "timestamp": "2023-10-27T10:00:00Z", "content": "Customer requested faster shipping." } ], "alerts": [], "issues": { "card": [], "order": [] }, "ageVerified": true, "clubsOnHold": false, "hasOrderHistory": true, "fullName": "Jane Smith", "firstName": "Jane", "lastName": "Smith" } } ``` #### Error Response (400) - **error** (object) - Contains error details. - **status** (integer) - The HTTP status code. - **type** (string) - The type of error (e.g., VALIDATION, COMPLIANCE, PAYMENT_FAILURE, SERVER_ERROR, ACCESS_DENIED, CONFLICT). - **errors** (array) - A list of specific errors encountered. - **description** (string) - A description of the error. - **code** (string) - An error code. - **field** (string) - The field related to the error. #### Error Response Example (400) ```json { "error": { "status": 400, "type": "VALIDATION", "errors": [ { "description": "Invalid customer ID format.", "code": "INVALID_ID", "field": "customerId" } ] } } ``` ```