### Install Mailchimp Marketing Node.js SDK Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Install the official Mailchimp Marketing Node.js SDK using npm. ```bash npm install @mailchimp/mailchimp_marketing ``` -------------------------------- ### Examples Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/MANIFEST.txt Illustrative code examples demonstrating common API usage patterns, including CRUD operations, complex queries, pagination, and batch processing. ```APIDOC ## Examples ### Description This section provides practical code examples showcasing various ways to use the Mailchimp Marketing Node.js API. ### Usage Patterns - **Basic CRUD Operations**: Examples for creating, reading, updating, and deleting resources. - **Complex Queries**: Demonstrations of filtering and searching data. - **Pagination**: How to handle paginated results. - **Batch Operations**: Examples for performing multiple operations in a single request. - **Error Handling**: Illustrative examples of handling API errors. - **OAuth2 Setup**: Step-by-step examples for authentication. - **List Member Management**: Common operations for managing list subscribers. ``` -------------------------------- ### Pagination Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/COMPLETION_SUMMARY.txt Shows how to retrieve paginated results from an API endpoint. This example fetches lists with specified count and offset. ```javascript async function getPaginatedLists() { const response = await mailchimp.lists.getAllLists({ count: 5, // Number of results per page offset: 10, // Starting point for results }); console.log(response); } ``` -------------------------------- ### batches.start Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Starts a new batch request. ```APIDOC ## POST /batches ### Description Starts a new batch request. ### Method POST ### Endpoint /batches ``` -------------------------------- ### Event Handling Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/COMPLETION_SUMMARY.txt Example of how to handle events, such as list member activity. This typically involves setting up webhooks or processing event data. ```javascript // This is a conceptual example, actual implementation depends on webhook setup mailchimp.webhooks.on("list_member.updated", (data) => { console.log("Member updated:", data); }); ``` -------------------------------- ### Batch Operations Request Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Provides an example of a batch request for submitting multiple operations efficiently. ```APIDOC ## Batch Operations Use the Batches API to submit multiple operations in a single request. This is more efficient than individual requests. **Example Batch Request:** ```json { "operations": [ { "method": "POST", "path": "/lists/abc123/members", "body": "{\"email_address\": \"test1@example.com\", \"status\": \"subscribed\"}" }, { "method": "POST", "path": "/lists/abc123/members", "body": "{\"email_address\": \"test2@example.com\", \"status\": \"subscribed\"}" } ] } ``` The batch API processes operations asynchronously. Check status with `GET /batches/{batch_id}`. ``` -------------------------------- ### Pagination Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Demonstrates how to use count and offset parameters for paginating list endpoints. ```APIDOC ## Pagination All list endpoints support pagination using: - `count`: Number of records per page (max 1000, default 10) - `offset`: Number of records to skip **Example:** ``` GET /lists?count=50&offset=100 ``` This gets records 100-150. ``` -------------------------------- ### Batch Operations Request Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Provides an example of a batch request body, which allows submitting multiple operations in a single API call for increased efficiency. Operations include method, path, and body. ```json { "operations": [ { "method": "POST", "path": "/lists/abc123/members", "body": "{\"email_address\": \"test1@example.com\", \"status\": \"subscribed\"}" }, { "method": "POST", "path": "/lists/abc123/members", "body": "{\"email_address\": \"test2@example.com\", \"status\": \"subscribed\"}" } ] } ``` -------------------------------- ### Get all templates Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all available templates. ```APIDOC ## GET /templates ### Description Get all templates. ### Method GET ### Endpoint /templates ``` -------------------------------- ### GET /file-manager/files Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all files from the file manager. No specific setup is required beyond authentication. ```http GET /file-manager/files ``` -------------------------------- ### Get All Promo Rules for a Store Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Retrieves all promo rules associated with a specific store. Use this to get a list of all available promotions. ```javascript ecommerce.listPromoRules(storeId, opts) ``` -------------------------------- ### Get Campaign Advice Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/reports-and-automations.md Access best practice recommendations for a given campaign. Optional parameters are available. ```javascript reports.getCampaignAdvice(campaignId, opts) ``` -------------------------------- ### Verify Script Installation Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Checks if the Mailchimp tracking script is correctly installed on a given site. Requires the site ID. ```javascript connectedSites.verifyScriptInstallation(siteId) ``` -------------------------------- ### automations.startAllEmails Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Starts all emails in an automation workflow. ```APIDOC ## POST /automations/{workflow_id}/actions/start-all-emails ### Description Starts all emails in an automation workflow. ### Method POST ### Endpoint /automations/{workflow_id}/actions/start-all-emails ``` -------------------------------- ### Error Handling Guide Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/MANIFEST.txt Comprehensive guide to understanding and handling API errors, including common HTTP status codes, error response formats, and debugging tips. ```APIDOC ## Error Handling ### Description This guide explains the various error codes and response formats returned by the Mailchimp API, providing strategies for effective error management and debugging. ### Common HTTP Status Codes - **400 Bad Request**: The request was malformed or invalid. - **401 Unauthorized**: Authentication failed. - **403 Forbidden**: The authenticated user does not have permission. - **404 Not Found**: The requested resource does not exist. - **422 Unprocessable Entity**: The request was valid but contained semantic errors (e.g., validation errors). - **500 Internal Server Error**: An error occurred on the Mailchimp server. ### Error Response Format ```json { "type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-codes/", "title": "Resource Not Found", "status": 404, "detail": "The requested resource could not be found.", "instance": "" } ``` ### Debugging Tips - Check API keys and authentication credentials. - Verify request parameters and body against the endpoint documentation. - Review the `detail` and `instance` fields in the error response for specific information. ``` -------------------------------- ### Get all landing pages Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all landing pages. ```APIDOC ## GET /landing-pages ### Description Get all landing pages. ### Method GET ### Endpoint /landing-pages ``` -------------------------------- ### automations.startWorkflowEmail Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Starts a specific email in an automation workflow. ```APIDOC ## POST /automations/{workflow_id}/emails/{workflow_email_id}/actions/start ### Description Starts a specific email in an automation workflow. ### Method POST ### Endpoint /automations/{workflow_id}/emails/{workflow_email_id}/actions/start ``` -------------------------------- ### Base API URL Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/README.md All requests are made to this base URL. Replace `server` with your server prefix (e.g., `us19`, `eu1`). ```text https://server.api.mailchimp.com/3.0 ``` -------------------------------- ### getProductVariants Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Get all variants for a product. ```APIDOC ## getProductVariants ### Description Get all variants for a product. ### Method GET (assumed based on common REST patterns for retrieval) ### Endpoint /ecommerce/stores/{storeId}/products/{productId}/variants ### Parameters #### Path Parameters - **storeId** (string) - Yes - The store ID - **productId** (string) - Yes - The product ID #### Query Parameters - **opts** (Object) - No - Optional parameters (count, offset) ### Response #### Success Response (200) - **variants** (Object) - Product variants array. ``` -------------------------------- ### Start Batch Operation Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Initiate a new batch operation. The body must include an array of operations to be executed. ```javascript batches.start(body) ``` -------------------------------- ### Get All Webhooks Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all webhooks configured for a specific list. ```APIDOC ## GET /lists/{list_id}/webhooks ### Description Get all webhooks. ### Method GET ### Endpoint /lists/{list_id}/webhooks ``` -------------------------------- ### Authentication Setup (OAuth2) Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/COMPLETION_SUMMARY.txt Set up the Mailchimp Marketing API client for OAuth2 authentication. This involves configuring access and bearer tokens. ```javascript const mailchimp = require("@mailchimp/mailchimp-marketing"); mailchimp.setConfig({ accessToken: "YOUR_ACCESS_TOKEN", server: "YOUR_SERVER_PREFIX", // e.g. us19 }); ``` -------------------------------- ### Get all batch operations Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all batch operations initiated. ```APIDOC ## GET /batches ### Description Get all batch operations. ### Method GET ### Endpoint /batches ``` -------------------------------- ### GET /file-manager/folders Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all folders from the file manager. No specific setup is required beyond authentication. ```http GET /file-manager/folders ``` -------------------------------- ### Example Mailchimp Client Configuration Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/configuration.md Demonstrates configuring the Mailchimp client with either Basic Auth or OAuth2, followed by a ping request to test the connection. ```javascript const mailchimp = require('@mailchimp/mailchimp_marketing'); // Configure with Basic Auth mailchimp.setConfig({ apiKey: 'abc123def456', server: 'us19' }); // Or configure with OAuth2 mailchimp.setConfig({ accessToken: 'oauth2_token_xyz789', server: 'us19' }); // Make API calls mailchimp.ping.get() .then(response => console.log('Connected to Mailchimp')) .catch(error => console.error('Connection failed:', error)); ``` -------------------------------- ### Get List Webhooks Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves all configured webhooks for a specific list. ```APIDOC ## getListWebhooks ### Description Get all webhooks for a list. ### Method APICall ### Endpoint /lists/{list_id}/webhooks ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list. #### Query Parameters - **opts** (Object) - Optional - Options for the request. ``` -------------------------------- ### Get List Members with Pagination Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Retrieve members of a specific list with control over the number of results and the starting offset. Useful for handling large lists. ```javascript // Get with pagination const members = await mailchimp.lists.getListMembersInfo('list123', { count: 100, offset: 0 }); ``` -------------------------------- ### Get Single Resource API Response Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Single resource responses return the resource object directly. This example shows how to retrieve a specific campaign by its ID. ```javascript const campaign = await mailchimp.campaigns.get('id123'); // campaign is the campaign object with all properties ``` -------------------------------- ### Get All Files Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve a list of all files in your file manager. Optional parameters allow for pagination and sorting. ```javascript fileManager.files(opts) ``` -------------------------------- ### Get Campaign Feedback Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Get feedback messages for a campaign. ```APIDOC ## GET /campaigns/{campaign_id}/feedback ### Description Get feedback messages. ### Method GET ### Endpoint /campaigns/{campaign_id}/feedback ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The ID of the campaign to get feedback for. ``` -------------------------------- ### Quick Start: Initialize and Ping API Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Initialize the Mailchimp client with your API key and server prefix, then make a ping request to verify the connection. Ensure you replace placeholders with your actual credentials. ```javascript const mailchimp = require('@mailchimp/mailchimp_marketing'); mailchimp.setConfig({ apiKey: 'YOUR_API_KEY', server: 'YOUR_SERVER_PREFIX', }); async function callPing() { const response = await mailchimp.ping.get(); console.log(response); } callPing(); ``` -------------------------------- ### Configuration & Setup Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/MANIFEST.txt Details on how to configure the Mailchimp Marketing Node.js client, including setting API keys, OAuth2, server prefixes, and client properties for different environments. ```APIDOC ## Configuration & Setup ### Description This section covers the essential steps for setting up and configuring the Mailchimp Marketing Node.js client library. ### Methods - **setConfig(apiKey, oauth2)**: Configures the client with API key or OAuth2 credentials. - **setServerPrefix(prefix)**: Sets a custom server prefix for API requests. - **customizeClientProperties(properties)**: Allows customization of client properties. ### Environments - **Browser vs Node.js**: Specific configurations for different JavaScript environments. ``` -------------------------------- ### Get Specific Feedback Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Get a specific feedback message for a campaign. ```APIDOC ## GET /campaigns/{campaign_id}/feedback/{feedback_id} ### Description Get specific feedback. ### Method GET ### Endpoint /campaigns/{campaign_id}/feedback/{feedback_id} ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The ID of the campaign. - **feedback_id** (string) - Required - The ID of the feedback message. ``` -------------------------------- ### Get Campaign Send Checklist Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Get the send checklist for a campaign. ```APIDOC ## GET /campaigns/{campaign_id}/send-checklist ### Description Get the send checklist. ### Method GET ### Endpoint /campaigns/{campaign_id}/send-checklist ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The ID of the campaign to get the send checklist for. ``` -------------------------------- ### Controlling GET Request Caching Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-client-class.md The cache property determines whether GET requests are cached in browsers. When set to false, a timestamp parameter is appended to GET requests to bypass browser caching. ```javascript // Disable caching apiClient.cache = false; ``` -------------------------------- ### Add Store Product Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Creates a new product in the specified store. Requires a product ID, title, and optionally includes URL, description, vendor, image URL, and publish date. ```javascript ecommerce.addStoreProduct(storeId, body) ``` -------------------------------- ### Method Signature Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/README.md Methods are documented with full signatures showing parameter types and return types. Required parameters are direct arguments, while optional parameters are in the `opts` object. Return types are Promises. ```javascript methodName(param1, param2, opts) ``` -------------------------------- ### Start a batch operation Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Initiates a batch operation, allowing multiple API calls to be executed in a single request. ```APIDOC ## POST /batches ### Description Start a batch operation. ### Method POST ### Endpoint /batches ### Request Body - **operations** (array) - Required - An array of operations to be executed in the batch. - **method** (string) - Required - The HTTP method for the operation (e.g., POST). - **path** (string) - Required - The API path for the operation. - **body** (string) - Optional - The request body for the operation, as a JSON string. ``` -------------------------------- ### Basic Mailchimp API Setup and Ping Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Configure the Mailchimp SDK with your API key and server, then make a ping call to verify the connection. Replace 'YOUR_API_KEY' and 'us19' with your actual credentials. ```javascript const mailchimp = require('@mailchimp/mailchimp_marketing'); // Configure with API key mailchimp.setConfig({ apiKey: 'YOUR_API_KEY', server: 'us19' }); // Make API call mailchimp.ping.get() .then(response => console.log('Connected!')) .catch(error => console.error('Connection failed:', error)); ``` -------------------------------- ### Pagination Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Demonstrates how to use 'count' and 'offset' parameters to paginate through list endpoints. 'count' specifies records per page (max 1000, default 10), and 'offset' skips records. ```http GET /lists?count=50&offset=100 ``` -------------------------------- ### Update Campaign Settings Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Modify the settings of an existing campaign. This example shows how to update the campaign's title. ```javascript // Update campaign await mailchimp.campaigns.update('campaign123', { settings: { title: 'New Campaign Title' } }); ``` -------------------------------- ### Start a Batch Operation Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Initiates a batch operation by providing a list of operations to be executed. The body must contain an 'operations' array with 'method', 'path', and 'body' for each operation. ```json { "operations": [ { "method": "POST", "path": "/lists/LIST_ID/members", "body": "{...}" } ] } ``` -------------------------------- ### Create and Configure Custom ApiClient Instance Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-client-class.md Instantiate and configure a custom API client. This allows for separate configurations, including API keys, server details, timeouts, caching, cookies, and default headers. ```javascript const ApiClient = require('@mailchimp/mailchimp_marketing/src/ApiClient'); // Create a new client instance const customClient = new ApiClient(); // Configure it customClient.setConfig({ apiKey: 'custom-key', server: 'us19' }); // Modify settings customClient.timeout = 60000; // 1 minute customClient.cache = false; // Disable caching customClient.enableCookies = true; // Enable cookie persistence // Add custom headers customClient.defaultHeaders = { 'X-App-Name': 'MyApp', 'X-Request-ID': 'unique-id' }; // Use the client's modules const campaigns = customClient.campaigns; campaigns.list().then(response => { console.log(response); }); ``` -------------------------------- ### Error Handling Guide Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/README.md Comprehensive guide to understanding and handling various HTTP status codes and error response formats provided by the Mailchimp API. ```APIDOC ## Error Handling ### Description This guide explains the common HTTP status codes returned by the Mailchimp API, the structure of error responses, and strategies for handling errors effectively in your Node.js application. ### Common HTTP Status Codes and Meanings - **400 Bad Request**: The request could not be understood or was malformed. Check request parameters and body. - **401 Unauthorized**: Authentication credentials (API Key or Access Token) are missing or invalid. - **403 Forbidden**: The authenticated user does not have permission to perform the requested action. - **404 Not Found**: The requested resource does not exist. - **409 Conflict**: The request conflicts with the current state of the resource (e.g., trying to create a resource that already exists). - **422 Unprocessable Entity**: The request was well-formed but contained semantic errors (e.g., invalid data in the request body). - **429 Too Many Requests**: The API rate limit has been exceeded. Implement exponential backoff or reduce request frequency. - **500 Internal Server Error**: An error occurred on the Mailchimp server. Retry the request later. ### Error Response Format When an error occurs (typically for 4xx and 5xx status codes), the API usually returns a JSON object with details about the error. ```json { "type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-codes/", "title": "Invalid Resource", "status": 400, "detail": "Invalid ApiKey", "instance": "", "errors": [ { "field": "apikey", "message": "The provided API key is invalid." } ] } ``` ### Handling Errors Use `try...catch` blocks with `async/await` or `.catch()` with Promises to handle potential errors. ```javascript const MailchimpMarketing = require('@mailchimp/mailchimp-marketing'); async function createList(listName) { try { const response = await MailchimpMarketing.lists.createList({ name: listName, permission_reminder: 'You are receiving this email because you opted in via our website.', use_archive_bar: true, notify_url: '' }); console.log('List created successfully:', response.body); } catch (error) { console.error('Error creating list:', error.response ? error.response.body : error); // Handle specific error codes or messages here if (error.response && error.response.body && error.response.body.status === 400) { console.error('Bad request: Check your input data.'); } } } createList('My New List'); ``` ``` -------------------------------- ### Get All Store Products Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Retrieves a list of all products associated with a specific store. Supports pagination with count and offset options. ```javascript ecommerce.getAllStoreProducts(storeId, opts) ``` -------------------------------- ### Get All Landing Pages Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve a list of all landing pages. Supports optional parameters for filtering, sorting, and pagination. ```javascript landingPages.getAll(opts) ``` -------------------------------- ### Get Landing Page Content Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve the content of a specific landing page. Optional parameters can be included. ```javascript landingPages.getPageContent(pageId, opts) ``` -------------------------------- ### ecommerce.addStoreCustomer Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Adds a new customer to an e-commerce store. ```APIDOC ## POST /ecommerce/stores/{store_id}/customers ### Description Adds a new customer to an e-commerce store. ### Method POST ### Endpoint /ecommerce/stores/{store_id}/customers ``` -------------------------------- ### Client Configuration Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/README.md Documentation for the setConfig() method, covering basic and OAuth2 authentication, and configuration properties like basePath and timeout. ```APIDOC ## setConfig() ### Description Configures the Mailchimp Marketing API client. Supports Basic Authentication (API Key) and OAuth2. ### Method `setConfig(configObject)` ### Parameters #### Configuration Object Properties - **apiKey** (string) - Required for Basic Authentication. Your Mailchimp API key. - **accessToken** (string) - Required for OAuth2 Authentication. Your OAuth2 access token. - **serverPrefix** (string) - Optional. The base URL for API requests. Defaults to `https://.api.mailchimp.com/3.0/`. - **timeout** (number) - Optional. Request timeout in milliseconds. Defaults to 30000. - **cache** (object) - Optional. Configuration for caching responses. ### Example ```javascript const MailchimpMarketing = require('@mailchimp/mailchimp-marketing'); MailchimpMarketing.setConfig({ apiKey: 'YOUR_API_KEY', serverPrefix: 'us19' }); ``` ``` -------------------------------- ### templateFolders.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new template folder. ```APIDOC ## POST /template-folders ### Description Creates a new template folder. ### Method POST ### Endpoint /template-folders ``` -------------------------------- ### getProductVariant Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Get a specific product variant. ```APIDOC ## getProductVariant ### Description Get a specific product variant. ### Method GET (assumed based on common REST patterns for retrieval) ### Endpoint /ecommerce/stores/{storeId}/products/{productId}/variants/{variantId} ### Parameters #### Path Parameters - **storeId** (string) - Yes - The store ID - **productId** (string) - Yes - The product ID - **variantId** (string) - Yes - The variant ID #### Query Parameters - **opts** (Object) - No - Optional parameters (count, offset) ### Response #### Success Response (200) - **variant** (Object) - Product variant object. ``` -------------------------------- ### Authentication Setup (API Key) Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/COMPLETION_SUMMARY.txt Configure the Mailchimp Marketing API client using an API key. Ensure your API key is correctly obtained from your Mailchimp account. ```javascript const mailchimp = require("@mailchimp/mailchimp-marketing"); mailchimp.setConfig({ apiKey: "YOUR_API_KEY", server: "YOUR_SERVER_PREFIX", // e.g. us19 }); ``` -------------------------------- ### Initializing a New ApiClient Instance Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-client-class.md Instantiate a new ApiClient object. This automatically initializes all available API module instances. ```javascript new ApiClient() ``` -------------------------------- ### campaignFolders.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new campaign folder. ```APIDOC ## POST /campaign-folders ### Description Creates a new campaign folder. ### Method POST ### Endpoint /campaign-folders ``` -------------------------------- ### batchWebhooks.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new batch webhook. ```APIDOC ## POST /batch-webhooks ### Description Creates a new batch webhook. ### Method POST ### Endpoint /batch-webhooks ``` -------------------------------- ### Get all automations Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all automations associated with the account. ```APIDOC ## GET /automations ### Description Get all automations. ### Method GET ### Endpoint /automations ``` -------------------------------- ### Custom ApiClient Usage Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-client-class.md Provides an example of how to create and configure a custom instance of the ApiClient, allowing for specific settings like API key, server, timeout, caching, cookies, and default headers. ```APIDOC ## Example: Custom ApiClient Usage While most users interact with the pre-instantiated modules, you can create additional clients: ```javascript const ApiClient = require('@mailchimp/mailchimp_marketing/src/ApiClient'); // Create a new client instance const customClient = new ApiClient(); // Configure it customClient.setConfig({ apiKey: 'custom-key', server: 'us19' }); // Modify settings customClient.timeout = 60000; // 1 minute customClient.cache = false; // Disable caching customClient.enableCookies = true; // Enable cookie persistence // Add custom headers customClient.defaultHeaders = { 'X-App-Name': 'MyApp', 'X-Request-ID': 'unique-id' }; // Use the client's modules const campaigns = customClient.campaigns; campaigns.list().then(response => { console.log(response); }); ``` ``` -------------------------------- ### getCampaignAdvice Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/reports-and-automations.md Fetches best practice advice for a given campaign, helping to optimize future email sends. ```APIDOC ## getCampaignAdvice ### Description Get best practice advice for a campaign. ### Method GET ### Endpoint /reports/campaigns/{campaign_id}/advice ### Parameters #### Path Parameters - **campaign_id** (string) - Required - The campaign ID ``` -------------------------------- ### Get All Segments Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all segments defined for a specific list. ```APIDOC ## GET /lists/{list_id}/segments ### Description Get all segments. ### Method GET ### Endpoint /lists/{list_id}/segments ``` -------------------------------- ### cache Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-client-class.md Controls whether GET requests should be cached in browser environments. ```APIDOC ## cache ### Description Whether to cache GET requests in browsers. ### Type boolean ### Default true ### Writable true ### Notes If `false`, a timestamp parameter is added to GET requests to prevent browser caching. ### Example ```javascript // Disable caching apiClient.cache = false; ``` ``` -------------------------------- ### Response Metadata Example Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Illustrates the structure of pagination metadata included in list responses. It shows the items, total items, and navigation links. ```json { "items": [...], "total_items": 2500, "links": [ { "rel": "self", "href": "https://server.api.mailchimp.com/3.0/lists?count=10&offset=0" }, { "rel": "next", "href": "https://server.api.mailchimp.com/3.0/lists?count=10&offset=10" } ] } ``` -------------------------------- ### campaigns.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new campaign. ```APIDOC ## POST /campaigns ### Description Creates a new campaign. ### Method POST ### Endpoint /campaigns ``` -------------------------------- ### Get Campaign Content Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieve the content of a specific campaign. ```http GET /campaigns/{campaign_id}/content ``` -------------------------------- ### Create New List Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Creates a new mailing list with specified configuration details, including name, contact information, and permissions. ```javascript lists.createList(body) ``` -------------------------------- ### Get List Member Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves information about a specific list member. ```APIDOC ## Get List Member ### Description Get information about a specific list member. ### Method GET (Implied by SDK method) ### Endpoint /lists/{list_id}/members/{subscriber_hash} ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list - **subscriberHash** (string) - Required - MD5 hash of lowercase email, or email address, or contact_id #### Query Parameters - **opts** (Object) - Optional - Optional parameters (fields, excludeFields) ``` -------------------------------- ### reports.getCampaignAdvice Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Retrieves advice for a campaign. ```APIDOC ## GET /reports/{campaign_id}/advice ### Description Retrieves advice for a campaign. ### Method GET ### Endpoint /reports/{campaign_id}/advice ``` -------------------------------- ### Get All Campaigns Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Retrieve a list of all campaigns associated with your Mailchimp account. ```APIDOC ## Get All Campaigns ### Description Retrieve a list of all campaigns associated with your Mailchimp account. ### Method ```javascript const campaigns = await mailchimp.campaigns.list(); ``` ``` -------------------------------- ### landingPages.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new landing page. ```APIDOC ## POST /landing-pages ### Description Creates a new landing page. ### Method POST ### Endpoint /landing-pages ``` -------------------------------- ### Get Campaign Content Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/campaigns.md Retrieves the HTML content for a specific campaign. ```APIDOC ## getContent ### Description Get the HTML content for a campaign. ### Method GET (assumed, based on typical RESTful patterns for retrieval) ### Endpoint `/campaigns/{campaignId}/content` ### Parameters #### Path Parameters - **campaignId** (string) - Required - The unique ID for the campaign. #### Query Parameters - **opts** (Object) - Optional - Optional parameters (fields, excludeFields). ### Response #### Success Response (200) - **Object** - Campaign content object. ### SDK Usage ```javascript campaigns.getContent(campaignId, opts) ``` ``` -------------------------------- ### Configure SDK with API Key Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Use this snippet to configure the SDK for basic authentication using an API key. Obtain your API key from your Mailchimp account settings. ```javascript mailchimp.setConfig({ apiKey: 'YOUR_API_KEY', server: 'us19' }); ``` -------------------------------- ### Get automation emails Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all emails associated with a specific automation workflow. ```APIDOC ## GET /automations/{workflow_id}/emails ### Description Get automation emails. ### Method GET ### Endpoint /automations/{workflow_id}/emails ### Parameters #### Path Parameters - **workflow_id** (string) - Required - The ID of the automation workflow. ``` -------------------------------- ### addStore Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Create a new ecommerce store with the provided configuration. Requires a unique store ID, list ID, name, type, and optionally accepts domain, currency_code, etc. ```APIDOC ## addStore ### Description Create a new ecommerce store. ### Method POST ### Endpoint /ecommerce/stores ### Parameters #### Request Body - **body** (Object) - Required - Store configuration - **id** (string) - Required - Unique store ID - **list_id** (string) - Required - The list ID to associate with the store - **name** (string) - Required - Store name - **type** (string) - Required - Platform type (e.g., 'bigcommerce', 'shopify', 'magento', 'woocommerce', 'custom') - **domain** (string) - Optional - Store URL - **email_address** (string) - Optional - Store contact email - **currency_code** (string) - Optional - Store currency (e.g., 'USD', 'EUR') - **primary_locale** (string) - Optional - Store locale - **timezone** (string) - Optional - Store timezone - **phone** (string) - Optional - Store phone - **address** (Object) - Optional - Store address ### Request Example ```json { "id": "my-store-123", "list_id": "list456", "name": "My Online Store", "type": "shopify", "domain": "mystore.com", "currency_code": "USD" } ``` ### Returns #### Success Response (200) - **store** (Object) - Created store object. ``` -------------------------------- ### Get All Interest Categories Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all interest categories associated with a specific list. ```APIDOC ## GET /lists/{list_id}/interest-categories ### Description Get all interest categories. ### Method GET ### Endpoint /lists/{list_id}/interest-categories ``` -------------------------------- ### Create Campaign Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Create a new campaign. ```APIDOC ## POST /campaigns ### Description Create a new campaign. ### Method POST ### Endpoint /campaigns ### Parameters #### Request Body - **type** (string) - Required - Campaign type - **recipients** (object) - Required - Object with `list_id` - **settings** (object) - Required - Object with `title`, `from_name`, `reply_to` ``` -------------------------------- ### Root Metadata Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Get metadata about the root API including available resources. ```APIDOC ## GET / ### Description Get metadata about the root API including available resources. ### Method GET ### Endpoint / ### Request Example ```http GET / Authorization: Basic base64(user:API_KEY) ``` ``` -------------------------------- ### Get Specific Feedback Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieve a specific feedback message for a campaign. ```http GET /campaigns/{campaign_id}/feedback/{feedback_id} ``` -------------------------------- ### Create List Webhook Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Sets up a webhook to receive notifications for list events. Requires list ID and webhook configuration in the body. ```javascript lists.createListWebhook(listId, body) ``` -------------------------------- ### Get Campaign Feedback Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieve feedback messages for a specific campaign. ```http GET /campaigns/{campaign_id}/feedback ``` -------------------------------- ### Create Campaign Folder Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Create a new campaign folder. Requires a body object containing the folder's name. ```javascript campaignFolders.create(body) ``` -------------------------------- ### Get Send Checklist Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieve the send checklist for a specific campaign. ```http GET /campaigns/{campaign_id}/send-checklist ``` -------------------------------- ### addStoreProduct Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Creates a new product in the specified store. Requires essential product details like ID and title. ```APIDOC ## addStoreProduct ### Description Create a new product. ### Method POST (assumed based on operation) ### Endpoint /stores/{storeId}/products (assumed based on operation) ### Parameters #### Path Parameters - **storeId** (string) - Required - The store ID #### Request Body - **body** (Object) - Required - Product data - **id** (string) - Required - Unique product ID - **title** (string) - Required - Product title - **url** (string) - Optional - Product URL - **description** (string) - Optional - Product description - **vendor** (string) - Optional - Vendor/manufacturer - **image_url** (string) - Optional - Product image URL - **published_at_foreign** (Date) - Optional - Product publish date ### Response #### Success Response (200) - **createdProduct** (Object) - Created product object. ``` -------------------------------- ### Templates API - Get Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieves details for a specific email template by its ID. ```APIDOC ## Templates API - Get ### Description Get a specific template. ### Method GET ### Endpoint /templates/{template_id} ### Parameters #### Path Parameters - **templateId** (string) - Required - The template ID. #### Query Parameters - **fields** (Array[string]) - Optional - Fields to return. - **excludeFields** (Array[string]) - Optional - Fields to exclude. ### Response #### Success Response (200) - **response** (Object) - Template object. ### Request Example ```javascript mailchimp.templates.getTemplate('YOUR_TEMPLATE_ID') .then(template => console.log(template)); ``` ``` -------------------------------- ### batchWebhooks.list Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Lists all batch webhooks. ```APIDOC ## GET /batch-webhooks ### Description Lists all batch webhooks. ### Method GET ### Endpoint /batch-webhooks ``` -------------------------------- ### Get Automation Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/reports-and-automations.md Retrieves the details of a specific automation using its workflow ID. ```APIDOC ## get ### Description Get a specific automation. ### Method `automations.get(workflowId, opts)` ### Parameters #### Path Parameters - **workflowId** (string) - Required - The automation/workflow ID #### Query Parameters - **opts** (Object) - Optional - Optional parameters ### Response #### Success Response (200) - **Promise** - Automation object. ``` -------------------------------- ### templates.list Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Lists all available templates. ```APIDOC ## GET /templates ### Description Lists all available templates. ### Method GET ### Endpoint /templates ``` -------------------------------- ### get Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/campaigns.md Retrieves detailed information about a specific campaign using its unique ID. ```APIDOC ## get ### Description Get information about a specific campaign. ### Method `campaigns.get(campaignId, opts)` ### Parameters #### Path Parameters - **campaignId** (string) - Required - The unique ID for the campaign. #### Query Parameters - **opts** (Object) - Optional - Optional parameters (fields, excludeFields). ### Returns `Promise` - Campaign object with full details. ### Request Example ```javascript mailchimp.campaigns.get('campaign123') .then(campaign => { console.log(`Campaign: ${campaign.settings.title}`); console.log(`Status: ${campaign.status}`); console.log(`Recipients: ${campaign.recipients.list_id}`); }) .catch(error => console.error('Error:', error)); ``` ``` -------------------------------- ### File Manager - Get Folders Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all folders within the file manager. ```APIDOC ## GET /file-manager/folders ### Description Get all folders. ### Method GET ### Endpoint /file-manager/folders ``` -------------------------------- ### Create a landing page Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Creates a new landing page. ```APIDOC ## POST /landing-pages ### Description Create a landing page. ### Method POST ### Endpoint /landing-pages ``` -------------------------------- ### File Manager - Get Files Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves a list of all files within the file manager. ```APIDOC ## GET /file-manager/files ### Description Get all files. ### Method GET ### Endpoint /file-manager/files ``` -------------------------------- ### API Client Class Reference Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/MANIFEST.txt Documentation for the core ApiClient class, including its constructor, configuration options, HTTP methods, utility functions, and authentication/error handling mechanisms. ```APIDOC ## ApiClient Class ### Description The `ApiClient` class is the core component for interacting with the Mailchimp Marketing API. It handles request construction, authentication, and response processing. ### Methods - **constructor(config)**: Initializes the ApiClient with provided configuration. - **callApi(method, path, queryParams, body, headers)**: Makes an HTTP request to the API. - **buildUrl(path, queryParams)**: Constructs the full API endpoint URL. - **setConfig(config)**: Updates the client's configuration. ### Configuration Properties - **apiKey** (string): Your Mailchimp API key. - **server**: The API server URL (e.g., 'us1'). - **timeout** (number): Request timeout in milliseconds. ### Authentication Supports API Key and OAuth2 authentication methods. ``` -------------------------------- ### Get a specific template Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves the details of a specific template using its template ID. ```APIDOC ## GET /templates/{template_id} ### Description Get a specific template. ### Method GET ### Endpoint /templates/{template_id} ### Parameters #### Path Parameters - **template_id** (string) - Required - The ID of the template. ``` -------------------------------- ### automations.list Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Lists all automation workflows for the account. ```APIDOC ## GET /automations ### Description Lists all automation workflows for the account. ### Method GET ### Endpoint /automations ``` -------------------------------- ### Get Interests in Category Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieves all interests within a specific interest category for a list. ```APIDOC ## GET /lists/{list_id}/interest-categories/{interest_category_id}/interests ### Description Get interests in a category. ### Method GET ### Endpoint /lists/{list_id}/interest-categories/{interest_category_id}/interests ``` -------------------------------- ### templates.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new template. ```APIDOC ## POST /templates ### Description Creates a new template. ### Method POST ### Endpoint /templates ``` -------------------------------- ### Get List Growth History Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves the growth history data for a specific list. ```APIDOC ## getListGrowthHistory ### Description Get list growth history. ### Method APICall ### Endpoint /lists/{list_id}/growth-history ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list. #### Query Parameters - **opts** (Object) - Optional - Options for the request. ``` -------------------------------- ### automations.create Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new automation workflow. ```APIDOC ## POST /automations ### Description Creates a new automation workflow. ### Method POST ### Endpoint /automations ``` -------------------------------- ### landingPages.getAll Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Retrieves a list of all landing pages. ```APIDOC ## GET /landing-pages ### Description Retrieves a list of all landing pages. ### Method GET ### Endpoint /landing-pages ``` -------------------------------- ### Get List Locations Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves geographic locations of members within a specific list. ```APIDOC ## getListLocations ### Description Get member locations for a list. ### Method APICall ### Endpoint /lists/{list_id}/locations ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list. #### Query Parameters - **opts** (Object) - Optional - Options for the request. ``` -------------------------------- ### Create Template Folder Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Create a new template folder. The request body must include the folder's name. ```javascript templateFolders.create(body) ``` -------------------------------- ### Get List Abuse Reports Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves abuse reports associated with a specific list. ```APIDOC ## getListAbuseReports ### Description Get abuse reports for a list. ### Method APICall ### Endpoint /lists/{list_id}/reports/abuse ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list. #### Query Parameters - **opts** (Object) - Optional - Options for the request. ``` -------------------------------- ### Get List Member Notes Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/lists.md Retrieves all notes associated with a specific list member. ```APIDOC ## getListMemberNotes ### Description Get all notes for a member. ### Method APICall ### Endpoint /lists/{list_id}/members/{subscriber_hash}/notes ### Parameters #### Path Parameters - **listId** (string) - Required - The unique ID for the list. - **subscriberHash** (string) - Required - MD5 hash of lowercase email or email address. #### Query Parameters - **opts** (Object) - Optional - Options for the request. ### Response #### Success Response (200) - **notes** (Array) - An array of note objects. ``` -------------------------------- ### Create a new template Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Creates a new template. ```APIDOC ## POST /templates ### Description Create a new template. ### Method POST ### Endpoint /templates ``` -------------------------------- ### Get Specific Campaign Endpoint Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/endpoints.md Retrieve details for a single, specific campaign by its ID. ```http GET /campaigns/{campaign_id} ``` -------------------------------- ### createFolder Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Creates a new folder in your file manager. Requires a folder name. ```APIDOC ## createFolder ### Description Create a new folder. ### Method fileManager.createFolder(body) ### Parameters #### Request Body - **body** (Object) - Required - Folder data with 'name' - **body.name** (string) - Required - The name of the new folder. ### Response #### Success Response (200) - **Object** - Created folder object. ``` -------------------------------- ### campaignFolders.list Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Lists all campaign folders. ```APIDOC ## GET /campaign-folders ### Description Lists all campaign folders. ### Method GET ### Endpoint /campaign-folders ``` -------------------------------- ### getStore Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Get a specific store by its ID. Supports optional parameters for fields and excludeFields. ```APIDOC ## getStore ### Description Get a specific store. ### Method GET ### Endpoint /ecommerce/stores/{store_id} ### Parameters #### Path Parameters - **storeId** (string) - Required - The store ID #### Query Parameters - **fields** (Array[string]) - Optional - Fields to return - **excludeFields** (Array[string]) - Optional - Fields to exclude ### Returns #### Success Response (200) - **store** (Object) - Store object. ``` -------------------------------- ### stores Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Get all ecommerce stores. Supports optional parameters for fields, count, and offset. ```APIDOC ## stores ### Description Get all ecommerce stores. ### Method GET ### Endpoint /ecommerce/stores ### Parameters #### Query Parameters - **fields** (Array[string]) - Optional - Fields to return - **count** (Number) - Optional - Records to return (max 1000), defaults to 10 - **offset** (Number) - Optional - Records to skip, defaults to 0 ### Returns #### Success Response (200) - **stores** (Array[Object]) - Stores array with `total_items`. ``` -------------------------------- ### Get All Product Images for a Store Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/ecommerce.md Retrieves all images associated with a specific product in a store. Requires store ID, product ID, and optional parameters. ```javascript ecommerce.getProductImages(storeId, productId, opts) ``` -------------------------------- ### Get Specific Folder Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve details for a specific folder using its unique ID. ```javascript fileManager.getFolder(folderId, opts) ``` -------------------------------- ### lists.createList Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Creates a new list. ```APIDOC ## POST /lists ### Description Creates a new list. ### Method POST ### Endpoint /lists ``` -------------------------------- ### List Template Folders Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve all existing template folders. Optional parameters can be passed to control the response. ```javascript templateFolders.list(opts) ``` -------------------------------- ### Get Specific File Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieve details for a specific file using its unique ID. ```javascript fileManager.getFile(fileId, opts) ``` -------------------------------- ### List Batch Webhooks Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/api-reference/additional-apis.md Retrieves a list of all configured batch webhooks. Use this to view existing webhook configurations. ```javascript batchWebhooks.list(opts) ``` -------------------------------- ### Get Specific Campaign Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/_autodocs/index.md Retrieve details for a specific campaign using its unique ID. ```APIDOC ## Get Specific Campaign ### Description Retrieve details for a specific campaign using its unique ID. ### Method ```javascript const campaign = await mailchimp.campaigns.get('campaign123'); ``` ``` -------------------------------- ### ecommerce.addStore Source: https://github.com/mailchimp/mailchimp-marketing-node/blob/master/README.md Adds a new e-commerce store. ```APIDOC ## POST /ecommerce/stores ### Description Adds a new e-commerce store. ### Method POST ### Endpoint /ecommerce/stores ```