### Example Prompts for Virtual Try-On Source: https://woocommerce.com/document/virtual-try-on-for-woocommerce Provides example prompts for different product categories to guide AI generation. These prompts describe how the product should appear in customer photos. ```text Show this product being worn by the person in the photo, maintaining natural lighting and perspective ``` ```text Place this product in the room shown in the photo, ensuring proper scale and perspective with existing furniture ``` ```text Display this product on the person in the photo, positioned naturally and realistically ``` ```text Position this product in the space shown in the photo, matching the room's lighting and style ``` -------------------------------- ### JSONP Support Example Source: https://woocommerce.com/document/bookings-rest-api-reference Demonstrates how to use JSONP for GET requests to retrieve data, wrapping the response in a specified callback function. ```APIDOC ## GET /wp-json/wc-bookings/v1?_jsonp=callback ### Description This endpoint demonstrates how to retrieve data using JSONP by specifying a callback function. ### Method GET ### Endpoint `/wp-json/wc-bookings/v1?_jsonp=callback` ### Parameters #### Query Parameters - **_jsonp** (string) - Required - The name of the JavaScript callback function to wrap the JSON response. ### Request Example ```bash curl https://example.com/wp-json/wc-bookings/v1/products/tags/34?_jsonp=tagDetails \ -u consumer_key:consumer_secret ``` ### Response Example ```javascript /**/tagDetails({"id":34,"name":"Leather Shoes","slug":"leather-shoes","description":"","count":0,"_links":{"self":[{"href":"https://example.com/wp-json/wc-bookings/v1/products/tags/34"}]},"collection":[{"href":"https://example.com/wp-json/wc-bookings/v1/products/tags"}]}) ``` ``` -------------------------------- ### Response Example: Get Generator Source: https://woocommerce.com/document/license-manager-woo Example of a successful response when retrieving a generator's details. ```json { “success”: true, “data”: { “id”: 7, “name”: “Generator created by the API”, “charset”: “LICENSE_GENERATE”, “chunks”: 7, “chunkLength”: 2, “timesActivatedMax”: “2”, “separator”: “-“, “prefix”: “PRE”, “suffix”: “FIX”, “expiresIn”: “10”, “createdAt”: “2022-08-03 07:49:21”, “createdBy”: “1”, “updatedAt”: null, “updatedBy”: null } } ``` -------------------------------- ### Create License Response Example Source: https://woocommerce.com/document/license-manager-woo Example response after successfully creating a license. ```json { “success”: true, “data”: { “id”: 69, “orderId”: null, “productId”: 25, “userId”: 1, “licenseKey”: “TEST-LICENSE”, “expiresAt”: “2022-11-01 00:00:00”, “validFor”: null, “source”: 3, “status”: 3, “timesActivated”: null, “timesActivatedMax”: 3, “createdAt”: “2022-08-01 13:34:42”, “createdBy”: 1, “updatedAt”: null, “updatedBy”: null } } ``` -------------------------------- ### Example HTTP GET Request Source: https://woocommerce.com/document/http-and-response-codes This is an example of an HTTP GET request sent by a browser to a web server to retrieve the homepage of a website. It includes common headers like Host, User-Agent, Accept, and Connection. ```http GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive ``` -------------------------------- ### X (Twitter) App Creation - Initial Setup Source: https://woocommerce.com/document/woocommerce-social-login-create-social-apps Create a free developer account and an X (Twitter) App. This involves applying for a developer account and creating a project. ```N/A Click “Create App”: ``` ```N/A If you have not yet applied for a **Developer** account, you will then be prompted to create an account: ``` ```N/A Click Apply, then on the next screen, select Sign up for a Free Account: ``` ```N/A On the next popup, create a brief description of your use case similar to this one: ``` ```N/A Hopefully, this will almost immediately be approved and send you to your **Developer Portal** , where you will click on “**Create Project** ” to get started: ``` ```N/A Name your project, click **Next** , then enter “**Doing something else** ” for the Use case: ``` ```N/A Add a project description, similar to the original developer use case but shorter, click **Next** , then under **App Setup** , name your App (cannot be same name as your project or any other apps): ``` -------------------------------- ### Example Response for Get Tracking Information Source: https://woocommerce.com/document/order-shipment-tracking This is an example of the JSON response when successfully retrieving tracking information for an order. ```json [ { "tracking_number": "1Z999AA1234567890", "carrier_id": "ups", "carrier_name": "UPS", "tracking_link": "https://www.ups.com/track?tracknum=1Z999AA1234567890", "date_shipped": "2024-11-12", "date_added": "2024-11-12 11:07:35" } ] ``` -------------------------------- ### Activate API Key Query String Source: https://woocommerce.com/document/api-documentation This example demonstrates the query string required to activate an API Key. It includes essential parameters like instance, product_id, and api_key, along with optional ones like object and version. ```URL https://wc/?wc-api=wc-am-api&wc_am_action=activate&instance=p1uOusaNM5ub3&object=dev.toddlahman.com/&product_id=62912&version=1.0&api_key=448567cf667c299bb706df6fe64ed2b44c7d37ba ``` -------------------------------- ### Get All Tickets Response Example Source: https://woocommerce.com/document/ticket-checkin/qr-code-tickets-and-check-in-for-woocommerce-rest-api-documentation Provides a sample JSON response for the 'Get All Tickets' endpoint, detailing ticket information. ```json { "success": true, "data": [ { "id": 1, "ticket_code": "TKT-8X7K9M2P", "order_id": 45, "product_id": 123, "product_name": "Conference Pass", "customer_name": "John Doe", "customer_email": "john@example.com", "status": "Valid", "status_class": "valid", "is_checked_in": false, "is_expired": false, "checkin_type": "single_entry", "checkin_count": 0, "max_checkins": 1, "expires_at": "2025-12-31 23:59:59", "created_at": "2025-01-15 10:30:00", "qr_code_url": "https://api.qrserver.com/..." } ] } ``` -------------------------------- ### Export Tickets Example Request Source: https://woocommerce.com/document/ticket-checkin/qr-code-tickets-and-check-in-for-woocommerce-rest-api-documentation An example GET request to the export endpoint, specifying format, status, and date range. ```http GET /export?format=csv&status=valid&date_from=2025-01-01 ``` -------------------------------- ### Create a Product Bundle Source: https://woocommerce.com/document/bundles-rest-api-reference Use this endpoint to create a new product bundle. Requires product details and a list of bundled items. ```bash curl -X POST https://example.com/wp-json/wc/v1/products \ -u consumer_key:consumer_secret \ -H "Content-Type: application/json" \ -d '{ "name": "Happy Ninja Bundle", "type": "bundle", "regular_price": "53.0", "sale_price": "37.0", "description": "In pretium enim justo, at ornare libero aliquam quis. Nullam imperdiet rutrum volutpat. Suspendisse aliquet ex in ex volutpat vestibulum. Curabitur ultrices convallis condimentum.", "short_description": "In pretium enim justo, at ornare libero aliquam quis.", "categories": [ { "id": 9 } ], "images": [ { "src": "http://somewherewarm.net/pb/wp-content/uploads/2016/09/Ninja_bundle.jpg", "position": 0 }, { "src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/hoodie_4_front.jpg", "position": 1 }, { "src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/hoodie_4_back.jpg", "position": 2 }, { "src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/T_7_front.jpg", "position": 3 }, { "src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/T_7_back.jpg", "position": 4 } ], "bundled_items": [ { "product_id": 53, "quantity_min": 1, "quantity_max": 1, "priced_individually": false, "shipped_individually": false, "optional": false, "override_title": true, "title": "Happy Ninja T-Shirt" }, { "product_id": 37, "quantity_min": 1, "quantity_max": 1, "priced_individually": false, "shipped_individually": false, "optional": false, "override_title": true, "title": "Happy Ninja Hoodie" } ], "bundle_layout": "default" }' ``` -------------------------------- ### Prompt Format Example Source: https://woocommerce.com/document/ai-product-image-generator-for-woocommerce Example of a prompt format for generating product images. Include clear product description, style preferences, background settings, lighting conditions, and composition details. ```text Product photography of wireless headphones, modern design, professional lighting, white background, high quality, commercial style ``` -------------------------------- ### Response Example: Get Specific Campaign Source: https://woocommerce.com/document/donation-for-woocommerce-developer-documentation This is an example of a response when retrieving a specific campaign by its ID. It includes detailed metadata about the campaign. ```json { "ID": 74, "post_author": "1", "post_date": "2022-09-06 13:49:27", "post_date_gmt": "2022-09-06 13:49:27", "post_content": "", "post_title": "A Campaign by API", "post_excerpt": "", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "a-campaign-by-api-2", "to_ping": "", "pinged": "", "post_modified": "2022-09-06 13:49:27", "post_modified_gmt": "2022-09-06 13:49:27", "post_content_filtered": "", "post_parent": 0, "guid": "http://wpexperts.local/wc-donation/a-campaign-by-api-2/", "menu_order": 0, "post_type": "wc-donation", "post_mime_type": "", "comment_count": "0", "filter": "raw", "campaign_meta": { "_thumbnail_id": [ "3341" ], "wc-donation-tablink": [ "tab-1" ], "wc-donation-disp-single-page": [ "yes" ], "wc-donation-disp-shop-page": [ "yes" ], "wc-donation-amount-display-option": [ "free-value" ], "pred-amount": [ [ "10.25", "20.25", "30.25" ] ], "pred-label": [ [ "label1", "label2", "label3" ] ], "free-min-amount": [ "1" ], "free-max-amount": [ "5000" ], "wc-donation-display-donation-type": [ "select" ], "wc-donation-currency-position": [ "after" ], "wc-donation-title": [ "Help for the cause" ], "wc-donation-button-text": [ "Donate Us" ], "wc-donation-button-text-color": [ "00ff00" ], "wc-donation-button-bg-color": [ "2e6057" ], "wc-donation-recurring": [ "enabled" ], "_subscription_period_interval": [ "6" ], "_subscription_period": [ "week" ], "_subscription_length": [ "52" ], "wc-donation-goal-display-option": [ "enabled" ], "wc-donation-goal-display-type": [ "percentage_amount" ], "wc-donation-goal-fixed-amount-field": [ "12000" ], "wc-donation-goal-fixed-initial-amount-field": [ "1250" ], "wc-donation-goal-no-of-donation-field": [ "" ], "wc-donation-goal-no-of-days-field": [ "" ], "wc-donation-goal-total-days": [ "0" ], "wc-donation-goal-progress-bar-color": [ "FF0000" ], "wc-donation-goal-display-donor-count": [ "enabled" ], "wc-donation-goal-close-form": [ "enabled" ], "wc-donation-goal-close-form-text": [ "goal is ended now" ], "wc-donation-progress-on-shop": [ "enabled" ], "wc-donation-progress-on-widget": [ "enabled" ], "wc-donation-cause-display-option": [ "show" ], "donation-cause-names": [ "a:2:{i:0;s:7:\"cause 1\";i:1;s:7:\"cause 2\";}" ], "donation-cause-desc": [ "a:2:{i:0;s:6:\"desc 1\";i:1;s:6:\"desc 2\";}" ], "donation-cause-img": [ "a:2:{i:0;s:92:\"https://woocommerce-224605-1524250.cloudwaysapps.com/wp-content/uploads/2022/02/chai-tea.svg\";i:1;s:91:\"https://woocommerce-224605-1524250.cloudwaysapps.com/wp-content/uploads/2022/02/chicken.svg\";}" ], "tributes": [ "a:3:{i:0;s:31:\"In the Honor of Donation Plugin\";i:1;s:33:\"In the Honor of Restaurant Plugin\";i:2;s:23:\"In the Honor of Objects\";}" ], "wc_donation_product": [ "75" ], "total_donors": [ "" ], "total_donations": [ "" ], "total_donation_amount": [ "" ] } } ``` -------------------------------- ### Customize Target Start Date Source: https://woocommerce.com/document/sales-agent-for-woocommerce-developer-documentation This filter allows you to modify or set the start date for a target. The example sets a custom start date 7 days prior to the current date, ensuring it's not before 2020. ```php add_filter( 'safw_target_start_date', 'customize_target_start_date', 10, 1 ); function customize_target_start_date( $start_date ) { // Example: Set a custom start date for targets, 7 days before the current date. $custom_start_date = strtotime( '-7 days' ); // Ensure the custom start date is within a reasonable range, like not before a certain year. $custom_start_date = max( $custom_start_date, strtotime( '2020-01-01' ) ); return $custom_start_date; } ``` -------------------------------- ### Quick Examples for Ticket Management Source: https://woocommerce.com/document/ticket-checkin/qr-code-tickets-and-check-in-for-woocommerce-rest-api-documentation Demonstrates basic GET and POST requests for validating and checking in tickets. No login is required for validation, but check-in requires authentication. ```bash # Validate a ticket (no login required) GET https://your-site.com/wp-json/wc-tickets/v1/validate/TKT-ABC123 # Check-in a ticket (requires login) POST https://your-site.com/wp-json/wc-tickets/v1/checkin ``` -------------------------------- ### WordPress Site Address Example Source: https://woocommerce.com/document/woocommerce-zapier-integration Example of the correct format for your WordPress Site Address (URL) when authenticating with Zapier. Ensure it starts with https:// and has no trailing slash. ```text https://example.com ``` -------------------------------- ### Response Example: Generate Licenses Source: https://woocommerce.com/document/license-manager-woo Returns an array of generated license keys upon successful generation. ```json { “success”: true, “data”: [ “ve-le-lv-pe-eD-ve-De-re”, “er-vr-lv-le-ep-pe-Dv-De”, “le-ee-eD-oo-re-pD-lo-lp”, “De-ep-or-er-rp-Dv-Dv-ep”, “vD-ee-De-er-ev-ee-er-lv”, “ee-ee-eD-le-rl-vv-pe-le” ] } ``` -------------------------------- ### Authenticated Information Request Example Source: https://woocommerce.com/document/api-documentation Example query string for an authenticated request to retrieve product information. Requires api_key, product_id, plugin_name, instance, and version. ```URL https://wc/?wc-api=wc-am-api&wc_am_action=information&instance=p1uOusaNM5ub3&product_id=62912&version=1.0&api_key=448567cf667c299bb706df6fe64ed2b44c7d37ba&plugin_name=search-engine-ping/search-engine-ping.php ``` -------------------------------- ### Example Product Hero Shortcode Source: https://woocommerce.com/document/storefront-product-hero An example of a fully configured [product_hero] shortcode. This demonstrates how to use various attributes to customize the appearance and behavior of the product hero component. ```html [product_hero layout="center" background_img="https://unsplash.imgix.net/1/irish-hands.jpg?q=75&fm=jpg&s=0b8bb73125fe1ec4828d0048550ae2bd" width="full" full_height="0" background_size="cover" overlay_opacity="0.25" product_id="299" parallax="0" description_text_color="#eeeeee"] ``` -------------------------------- ### Get Statistics with cURL and Authentication Source: https://woocommerce.com/document/ticket-checkin/qr-code-tickets-and-check-in-for-woocommerce-rest-api-documentation Example cURL command to fetch general ticket statistics. ```bash # Get statistics curl -X GET \ -u "admin:your_app_password" \ "http://localhost:10125/wp-json/wc-tickets/v1/stats" ``` -------------------------------- ### Delivery Window Example Source: https://woocommerce.com/document/checkout-delivery-intent Shows how minimum and maximum delivery days set in the plugin determine the selectable delivery date range for customers. This ensures realistic delivery promises. ```text Min: 2 days, Max: 5 days Customer places order Monday: - Earliest delivery: Wednesday (2 days out) - Latest delivery: Saturday (5 days out) - Customer can only select dates in this range ``` -------------------------------- ### Get All Tickets with cURL and Authentication Source: https://woocommerce.com/document/ticket-checkin/qr-code-tickets-and-check-in-for-woocommerce-rest-api-documentation Example cURL command to retrieve all tickets, with pagination support. ```bash # Get all tickets curl -X GET \ -u "admin:your_app_password" \ "http://localhost:10125/wp-json/wc-tickets/v1/tickets?per_page=20" ```