> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WooCommerce

> Products, orders, customers, and coupons via REST API.

The WooCommerce connector lets your workflows manage an online store's products, orders, customers, and coupons through the WooCommerce REST API.

<Note>
  For the full API reference, see the [WooCommerce REST API documentation](https://woocommerce.com/document/woocommerce-rest-api/).
</Note>

<Snippet file="connection-note.mdx" />

## Connection setup

<Steps>
  <Step title="Generate REST API keys">
    In your WordPress admin, go to **WooCommerce > Settings > Advanced > REST API**. Click **Add key**, give it a description (e.g., "Spojit Integration"), set permissions to **Read/Write**, and click **Generate API Key**. Copy the **Consumer Key** and **Consumer Secret**.
  </Step>

  <Step title="Add the connection in Spojit">
    Go to **Connections** in Spojit, click **Add Connection**, select **WooCommerce**, and enter:

    * **Store URL**: Your store URL (e.g., `https://mystore.com`)
    * **Consumer Key**: Your REST API consumer key (starts with `ck_`)
    * **Consumer Secret**: Your REST API consumer secret (starts with `cs_`)
  </Step>
</Steps>

<Note>
  Your WooCommerce store must have SSL (HTTPS) enabled for REST API authentication to work. The API uses HTTP Basic Auth over SSL.
</Note>

## Tools

### Products

<AccordionGroup>
  <Accordion title="list-products: List products">
    <ParamField body="page" type="number" default="1">
      Page number for pagination.
    </ParamField>

    <ParamField body="per_page" type="number" default="10">
      Number of results per page (max 100).
    </ParamField>

    <ParamField body="search" type="string">
      Search products by keyword.
    </ParamField>

    <ParamField body="status" type="string">
      Filter by status: `draft`, `pending`, `private`, or `publish`.
    </ParamField>

    <ParamField body="category" type="string">
      Filter by category ID.
    </ParamField>

    <ParamField body="sku" type="string">
      Filter by exact SKU.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "per_page": 2
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "id": 799,
        "name": "Ship Your Idea",
        "slug": "ship-your-idea-22",
        "permalink": "https://example.com/product/ship-your-idea-22/",
        "date_created": "2017-03-23T17:03:12",
        "date_created_gmt": "2017-03-23T20:03:12",
        "date_modified": "2017-03-23T17:03:12",
        "date_modified_gmt": "2017-03-23T20:03:12",
        "type": "variable",
        "status": "publish",
        "featured": false,
        "catalog_visibility": "visible",
        "description": "<p>Pellentesque habitant morbi tristique senectus...</p>",
        "short_description": "<p>Pellentesque habitant morbi...</p>",
        "sku": "",
        "price": "",
        "regular_price": "",
        "sale_price": "",
        "on_sale": false,
        "purchasable": false,
        "total_sales": 0,
        "virtual": false,
        "downloadable": false,
        "tax_status": "taxable",
        "tax_class": "",
        "manage_stock": false,
        "stock_quantity": null,
        "stock_status": "instock",
        "backorders": "no",
        "backorders_allowed": false,
        "backordered": false,
        "weight": "",
        "dimensions": {
          "length": "",
          "width": "",
          "height": ""
        },
        "shipping_required": true,
        "shipping_taxable": true,
        "shipping_class": "",
        "shipping_class_id": 0,
        "reviews_allowed": true,
        "average_rating": "0.00",
        "rating_count": 0,
        "related_ids": [31, 22, 369, 414, 56],
        "upsell_ids": [],
        "cross_sell_ids": [],
        "parent_id": 0,
        "categories": [
          {
            "id": 9,
            "name": "Clothing",
            "slug": "clothing"
          }
        ],
        "tags": [],
        "images": [
          {
            "id": 795,
            "date_created": "2017-03-23T14:03:08",
            "date_created_gmt": "2017-03-23T20:03:08",
            "date_modified": "2017-03-23T14:03:08",
            "date_modified_gmt": "2017-03-23T20:03:08",
            "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
            "name": "",
            "alt": ""
          }
        ],
        "attributes": [
          {
            "id": 6,
            "name": "Color",
            "position": 0,
            "visible": false,
            "variation": true,
            "options": ["Black", "Green"]
          }
        ],
        "default_attributes": [],
        "variations": [],
        "grouped_products": [],
        "menu_order": 0,
        "meta_data": []
      }
    ]
    ```
  </Accordion>

  <Accordion title="get-product: Get a product by ID">
    <ParamField body="id" type="string" required>
      Product ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 794
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 794,
      "name": "Premium Quality",
      "slug": "premium-quality-19",
      "permalink": "https://example.com/product/premium-quality-19/",
      "date_created": "2017-03-23T17:01:14",
      "date_created_gmt": "2017-03-23T20:01:14",
      "date_modified": "2017-03-23T17:01:14",
      "date_modified_gmt": "2017-03-23T20:01:14",
      "type": "simple",
      "status": "publish",
      "featured": false,
      "catalog_visibility": "visible",
      "description": "<p>Pellentesque habitant morbi tristique senectus...</p>",
      "short_description": "<p>Pellentesque habitant morbi...</p>",
      "sku": "",
      "price": "21.99",
      "regular_price": "21.99",
      "sale_price": "",
      "on_sale": false,
      "purchasable": true,
      "total_sales": 0,
      "virtual": false,
      "downloadable": false,
      "tax_status": "taxable",
      "tax_class": "",
      "manage_stock": false,
      "stock_quantity": null,
      "stock_status": "instock",
      "backorders": "no",
      "backorders_allowed": false,
      "backordered": false,
      "weight": "",
      "dimensions": {
        "length": "",
        "width": "",
        "height": ""
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": 0,
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [53, 40, 56, 479, 99],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        {
          "id": 9,
          "name": "Clothing",
          "slug": "clothing"
        }
      ],
      "tags": [],
      "images": [
        {
          "id": 792,
          "date_created": "2017-03-23T14:01:13",
          "date_created_gmt": "2017-03-23T20:01:13",
          "date_modified": "2017-03-23T14:01:13",
          "date_modified_gmt": "2017-03-23T20:01:13",
          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
          "name": "",
          "alt": ""
        }
      ],
      "attributes": [],
      "default_attributes": [],
      "variations": [],
      "grouped_products": [],
      "menu_order": 0,
      "meta_data": []
    }
    ```
  </Accordion>

  <Accordion title="create-product: Create a new product">
    <ParamField body="name" type="string" required>
      Product name.
    </ParamField>

    <ParamField body="type" type="string" default="simple">
      Product type: `simple`, `grouped`, `external`, or `variable`.
    </ParamField>

    <ParamField body="regular_price" type="string">
      Regular price.
    </ParamField>

    <ParamField body="description" type="string">
      Full product description (HTML supported).
    </ParamField>

    <ParamField body="short_description" type="string">
      Short product description (HTML supported).
    </ParamField>

    <ParamField body="sku" type="string">
      Stock-keeping unit.
    </ParamField>

    <ParamField body="categories" type="object[]">
      Categories to assign. Each object should have an `id` field.
    </ParamField>

    <ParamField body="status" type="string" default="publish">
      Product status: `draft`, `pending`, `private`, or `publish`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "name": "Premium Quality",
      "type": "simple",
      "regular_price": "21.99",
      "description": "Pellentesque habitant morbi tristique senectus et netus.",
      "short_description": "Pellentesque habitant morbi tristique senectus.",
      "categories": [
        { "id": 9 },
        { "id": 14 }
      ]
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 794,
      "name": "Premium Quality",
      "slug": "premium-quality-19",
      "permalink": "https://example.com/product/premium-quality-19/",
      "date_created": "2017-03-23T17:01:14",
      "date_created_gmt": "2017-03-23T20:01:14",
      "date_modified": "2017-03-23T17:01:14",
      "date_modified_gmt": "2017-03-23T20:01:14",
      "type": "simple",
      "status": "publish",
      "featured": false,
      "catalog_visibility": "visible",
      "description": "<p>Pellentesque habitant morbi tristique senectus et netus.</p>",
      "short_description": "<p>Pellentesque habitant morbi tristique senectus.</p>",
      "sku": "",
      "price": "21.99",
      "regular_price": "21.99",
      "sale_price": "",
      "on_sale": false,
      "purchasable": true,
      "total_sales": 0,
      "virtual": false,
      "downloadable": false,
      "tax_status": "taxable",
      "tax_class": "",
      "manage_stock": false,
      "stock_quantity": null,
      "stock_status": "instock",
      "backorders": "no",
      "backorders_allowed": false,
      "backordered": false,
      "weight": "",
      "dimensions": {
        "length": "",
        "width": "",
        "height": ""
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": 0,
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [53, 40, 56, 479, 99],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        {
          "id": 9,
          "name": "Clothing",
          "slug": "clothing"
        },
        {
          "id": 14,
          "name": "T-shirts",
          "slug": "t-shirts"
        }
      ],
      "tags": [],
      "images": [],
      "attributes": [],
      "default_attributes": [],
      "variations": [],
      "grouped_products": [],
      "menu_order": 0,
      "meta_data": []
    }
    ```
  </Accordion>

  <Accordion title="update-product: Update an existing product">
    <ParamField body="id" type="string" required>
      Product ID.
    </ParamField>

    <ParamField body="name" type="string">
      New product name.
    </ParamField>

    <ParamField body="regular_price" type="string">
      New regular price.
    </ParamField>

    <ParamField body="description" type="string">
      New description.
    </ParamField>

    <ParamField body="short_description" type="string">
      Short product description (HTML supported).
    </ParamField>

    <ParamField body="sku" type="string">
      New SKU.
    </ParamField>

    <ParamField body="status" type="string">
      New status.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 794,
      "regular_price": "24.54"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 794,
      "name": "Premium Quality",
      "slug": "premium-quality-19",
      "permalink": "https://example.com/product/premium-quality-19/",
      "date_created": "2017-03-23T17:01:14",
      "date_created_gmt": "2017-03-23T20:01:14",
      "date_modified": "2017-03-23T17:01:14",
      "date_modified_gmt": "2017-03-23T20:01:14",
      "type": "simple",
      "status": "publish",
      "featured": false,
      "catalog_visibility": "visible",
      "description": "<p>Pellentesque habitant morbi tristique senectus...</p>",
      "short_description": "<p>Pellentesque habitant morbi...</p>",
      "sku": "",
      "price": "24.54",
      "regular_price": "24.54",
      "sale_price": "",
      "on_sale": false,
      "purchasable": true,
      "total_sales": 0,
      "virtual": false,
      "downloadable": false,
      "tax_status": "taxable",
      "tax_class": "",
      "manage_stock": false,
      "stock_quantity": null,
      "stock_status": "instock",
      "backorders": "no",
      "backorders_allowed": false,
      "backordered": false,
      "weight": "",
      "dimensions": {
        "length": "",
        "width": "",
        "height": ""
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": 0,
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [479, 387, 22, 463, 396],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        {
          "id": 9,
          "name": "Clothing",
          "slug": "clothing"
        }
      ],
      "tags": [],
      "images": [
        {
          "id": 792,
          "date_created": "2017-03-23T14:01:13",
          "date_created_gmt": "2017-03-23T20:01:13",
          "date_modified": "2017-03-23T14:01:13",
          "date_modified_gmt": "2017-03-23T20:01:13",
          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
          "name": "",
          "alt": ""
        }
      ],
      "attributes": [],
      "default_attributes": [],
      "variations": [],
      "grouped_products": [],
      "menu_order": 0,
      "meta_data": []
    }
    ```
  </Accordion>
</AccordionGroup>

### Orders

<AccordionGroup>
  <Accordion title="list-orders: List orders">
    <ParamField body="page" type="number" default="1">
      Page number for pagination.
    </ParamField>

    <ParamField body="per_page" type="number" default="10">
      Number of results per page (max 100).
    </ParamField>

    <ParamField body="status" type="string">
      Filter by status: `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded`, `failed`, or `trash`.
    </ParamField>

    <ParamField body="customer" type="string">
      Filter by customer ID.
    </ParamField>

    <ParamField body="after" type="string">
      Filter orders created after this date (ISO 8601).
    </ParamField>

    <ParamField body="before" type="string">
      Filter orders created before this date (ISO 8601).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "per_page": 2,
      "status": "processing"
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "id": 727,
        "parent_id": 0,
        "number": "727",
        "order_key": "wc_order_58d2d042d1d",
        "created_via": "rest-api",
        "version": "3.0.0",
        "status": "processing",
        "currency": "USD",
        "date_created": "2017-03-22T16:28:02",
        "date_created_gmt": "2017-03-22T19:28:02",
        "date_modified": "2017-03-22T16:28:08",
        "date_modified_gmt": "2017-03-22T19:28:08",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "10.00",
        "shipping_tax": "0.00",
        "cart_tax": "1.35",
        "total": "29.35",
        "total_tax": "1.35",
        "prices_include_tax": false,
        "customer_id": 0,
        "customer_ip_address": "",
        "customer_user_agent": "",
        "customer_note": "",
        "billing": {
          "first_name": "John",
          "last_name": "Doe",
          "company": "",
          "address_1": "969 Market",
          "address_2": "",
          "city": "San Francisco",
          "state": "CA",
          "postcode": "94103",
          "country": "US",
          "email": "john.doe@example.com",
          "phone": "(555) 555-5555"
        },
        "shipping": {
          "first_name": "John",
          "last_name": "Doe",
          "company": "",
          "address_1": "969 Market",
          "address_2": "",
          "city": "San Francisco",
          "state": "CA",
          "postcode": "94103",
          "country": "US"
        },
        "payment_method": "bacs",
        "payment_method_title": "Direct Bank Transfer",
        "transaction_id": "",
        "date_paid": "2017-03-22T16:28:08",
        "date_paid_gmt": "2017-03-22T19:28:08",
        "date_completed": null,
        "date_completed_gmt": null,
        "cart_hash": "",
        "meta_data": [],
        "line_items": [
          {
            "id": 315,
            "name": "Woo Single #1",
            "product_id": 93,
            "variation_id": 0,
            "quantity": 2,
            "tax_class": "",
            "subtotal": "6.00",
            "subtotal_tax": "0.45",
            "total": "6.00",
            "total_tax": "0.45",
            "taxes": [
              {
                "id": 75,
                "total": "0.45",
                "subtotal": "0.45"
              }
            ],
            "meta_data": [],
            "sku": "",
            "price": 3
          },
          {
            "id": 316,
            "name": "Ship Your Idea - Color: Black, Size: M",
            "product_id": 22,
            "variation_id": 23,
            "quantity": 1,
            "tax_class": "",
            "subtotal": "12.00",
            "subtotal_tax": "0.90",
            "total": "12.00",
            "total_tax": "0.90",
            "taxes": [
              {
                "id": 75,
                "total": "0.9",
                "subtotal": "0.9"
              }
            ],
            "meta_data": [
              {
                "id": 2095,
                "key": "pa_color",
                "value": "black"
              },
              {
                "id": 2096,
                "key": "size",
                "value": "M"
              }
            ],
            "sku": "Bar3",
            "price": 12
          }
        ],
        "tax_lines": [
          {
            "id": 318,
            "rate_code": "US-CA-STATE TAX",
            "rate_id": 75,
            "label": "State Tax",
            "compound": false,
            "tax_total": "1.35",
            "shipping_tax_total": "0.00",
            "meta_data": []
          }
        ],
        "shipping_lines": [
          {
            "id": 317,
            "method_title": "Flat Rate",
            "method_id": "flat_rate",
            "total": "10.00",
            "total_tax": "0.00",
            "taxes": [],
            "meta_data": []
          }
        ],
        "fee_lines": [],
        "coupon_lines": [],
        "refunds": []
      }
    ]
    ```
  </Accordion>

  <Accordion title="get-order: Get an order by ID">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 727
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 727,
      "parent_id": 0,
      "number": "727",
      "order_key": "wc_order_58d2d042d1d",
      "created_via": "rest-api",
      "version": "3.0.0",
      "status": "processing",
      "currency": "USD",
      "date_created": "2017-03-22T16:28:02",
      "date_created_gmt": "2017-03-22T19:28:02",
      "date_modified": "2017-03-22T16:28:08",
      "date_modified_gmt": "2017-03-22T19:28:08",
      "discount_total": "0.00",
      "discount_tax": "0.00",
      "shipping_total": "10.00",
      "shipping_tax": "0.00",
      "cart_tax": "1.35",
      "total": "29.35",
      "total_tax": "1.35",
      "prices_include_tax": false,
      "customer_id": 0,
      "customer_ip_address": "",
      "customer_user_agent": "",
      "customer_note": "",
      "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      },
      "payment_method": "bacs",
      "payment_method_title": "Direct Bank Transfer",
      "transaction_id": "",
      "date_paid": "2017-03-22T16:28:08",
      "date_paid_gmt": "2017-03-22T19:28:08",
      "date_completed": null,
      "date_completed_gmt": null,
      "cart_hash": "",
      "meta_data": [],
      "line_items": [
        {
          "id": 315,
          "name": "Woo Single #1",
          "product_id": 93,
          "variation_id": 0,
          "quantity": 2,
          "tax_class": "",
          "subtotal": "6.00",
          "subtotal_tax": "0.45",
          "total": "6.00",
          "total_tax": "0.45",
          "taxes": [
            {
              "id": 75,
              "total": "0.45",
              "subtotal": "0.45"
            }
          ],
          "meta_data": [],
          "sku": "",
          "price": 3
        }
      ],
      "tax_lines": [
        {
          "id": 318,
          "rate_code": "US-CA-STATE TAX",
          "rate_id": 75,
          "label": "State Tax",
          "compound": false,
          "tax_total": "1.35",
          "shipping_tax_total": "0.00",
          "meta_data": []
        }
      ],
      "shipping_lines": [
        {
          "id": 317,
          "method_title": "Flat Rate",
          "method_id": "flat_rate",
          "total": "10.00",
          "total_tax": "0.00",
          "taxes": [],
          "meta_data": []
        }
      ],
      "fee_lines": [],
      "coupon_lines": [],
      "refunds": []
    }
    ```
  </Accordion>

  <Accordion title="update-order: Update an order">
    <ParamField body="id" type="string" required>
      Order ID.
    </ParamField>

    <ParamField body="status" type="string">
      New order status.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 727,
      "status": "completed"
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 727,
      "parent_id": 0,
      "number": "727",
      "order_key": "wc_order_58d2d042d1d",
      "created_via": "rest-api",
      "version": "3.0.0",
      "status": "completed",
      "currency": "USD",
      "date_created": "2017-03-22T16:28:02",
      "date_created_gmt": "2017-03-22T19:28:02",
      "date_modified": "2017-03-22T16:30:35",
      "date_modified_gmt": "2017-03-22T19:30:35",
      "discount_total": "0.00",
      "discount_tax": "0.00",
      "shipping_total": "10.00",
      "shipping_tax": "0.00",
      "cart_tax": "1.35",
      "total": "29.35",
      "total_tax": "1.35",
      "prices_include_tax": false,
      "customer_id": 0,
      "customer_ip_address": "",
      "customer_user_agent": "",
      "customer_note": "",
      "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      },
      "payment_method": "bacs",
      "payment_method_title": "Direct Bank Transfer",
      "transaction_id": "",
      "date_paid": "2017-03-22T16:28:08",
      "date_paid_gmt": "2017-03-22T19:28:08",
      "date_completed": "2017-03-22T16:30:35",
      "date_completed_gmt": "2017-03-22T19:30:35",
      "cart_hash": "",
      "meta_data": [],
      "line_items": [
        {
          "id": 315,
          "name": "Woo Single #1",
          "product_id": 93,
          "variation_id": 0,
          "quantity": 2,
          "tax_class": "",
          "subtotal": "6.00",
          "subtotal_tax": "0.45",
          "total": "6.00",
          "total_tax": "0.45",
          "taxes": [
            {
              "id": 75,
              "total": "0.45",
              "subtotal": "0.45"
            }
          ],
          "meta_data": [],
          "sku": "",
          "price": 3
        }
      ],
      "tax_lines": [
        {
          "id": 318,
          "rate_code": "US-CA-STATE TAX",
          "rate_id": 75,
          "label": "State Tax",
          "compound": false,
          "tax_total": "1.35",
          "shipping_tax_total": "0.00",
          "meta_data": []
        }
      ],
      "shipping_lines": [
        {
          "id": 317,
          "method_title": "Flat Rate",
          "method_id": "flat_rate",
          "total": "10.00",
          "total_tax": "0.00",
          "taxes": [],
          "meta_data": []
        }
      ],
      "fee_lines": [],
      "coupon_lines": [],
      "refunds": []
    }
    ```
  </Accordion>
</AccordionGroup>

### Customers

<AccordionGroup>
  <Accordion title="list-customers: List customers">
    <ParamField body="page" type="number" default="1">
      Page number for pagination.
    </ParamField>

    <ParamField body="per_page" type="number" default="10">
      Number of results per page (max 100).
    </ParamField>

    <ParamField body="search" type="string">
      Search by keyword.
    </ParamField>

    <ParamField body="email" type="string">
      Filter by exact email address.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "per_page": 2
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "id": 26,
        "date_created": "2017-03-21T16:11:14",
        "date_created_gmt": "2017-03-21T19:11:14",
        "date_modified": "2017-03-21T16:11:16",
        "date_modified_gmt": "2017-03-21T19:11:16",
        "email": "joao.silva@example.com",
        "first_name": "Joao",
        "last_name": "Silva",
        "role": "customer",
        "username": "joao.silva",
        "billing": {
          "first_name": "Joao",
          "last_name": "Silva",
          "company": "",
          "address_1": "Av. Brasil, 432",
          "address_2": "",
          "city": "Rio de Janeiro",
          "state": "RJ",
          "postcode": "12345-000",
          "country": "BR",
          "email": "joao.silva@example.com",
          "phone": "(55) 5555-5555"
        },
        "shipping": {
          "first_name": "Joao",
          "last_name": "Silva",
          "company": "",
          "address_1": "Av. Brasil, 432",
          "address_2": "",
          "city": "Rio de Janeiro",
          "state": "RJ",
          "postcode": "12345-000",
          "country": "BR"
        },
        "is_paying_customer": false,
        "avatar_url": "https://secure.gravatar.com/avatar/be7b5febff88a2d947c3289e90cdf017?s=96",
        "meta_data": []
      }
    ]
    ```
  </Accordion>

  <Accordion title="get-customer: Get a customer by ID">
    <ParamField body="id" type="string" required>
      Customer ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "id": 25
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 25,
      "date_created": "2017-03-21T16:09:28",
      "date_created_gmt": "2017-03-21T19:09:28",
      "date_modified": "2017-03-21T16:09:30",
      "date_modified_gmt": "2017-03-21T19:09:30",
      "email": "john.doe@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "role": "customer",
      "username": "john.doe",
      "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      },
      "is_paying_customer": false,
      "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
      "meta_data": []
    }
    ```
  </Accordion>

  <Accordion title="create-customer: Create a new customer">
    <ParamField body="email" type="string" required>
      Customer email address.
    </ParamField>

    <ParamField body="first_name" type="string">
      First name.
    </ParamField>

    <ParamField body="last_name" type="string">
      Last name.
    </ParamField>

    <ParamField body="username" type="string">
      Username. Auto-generated from email if not provided.
    </ParamField>

    <ParamField body="billing" type="object">
      Billing address object with fields: `first_name`, `last_name`, `company`, `address_1`, `address_2`, `city`, `state`, `postcode`, `country`, `email`, `phone`.
    </ParamField>

    <ParamField body="shipping" type="object">
      Shipping address object with the same fields as billing (except `email` and `phone`).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "email": "john.doe@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "username": "john.doe",
      "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      }
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "id": 25,
      "date_created": "2017-03-21T16:09:28",
      "date_created_gmt": "2017-03-21T19:09:28",
      "date_modified": "2017-03-21T16:09:30",
      "date_modified_gmt": "2017-03-21T19:09:30",
      "email": "john.doe@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "role": "customer",
      "username": "john.doe",
      "billing": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      },
      "is_paying_customer": false,
      "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
      "meta_data": []
    }
    ```
  </Accordion>
</AccordionGroup>

### Coupons

<AccordionGroup>
  <Accordion title="list-coupons: List coupons">
    <ParamField body="page" type="number" default="1">
      Page number for pagination.
    </ParamField>

    <ParamField body="per_page" type="number" default="10">
      Number of results per page (max 100).
    </ParamField>

    <ParamField body="search" type="string">
      Search by coupon code.
    </ParamField>

    <ParamField body="code" type="string">
      Filter by exact coupon code.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "per_page": 2
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "id": 720,
        "code": "free shipping",
        "amount": "0.00",
        "date_created": "2017-03-21T15:25:02",
        "date_created_gmt": "2017-03-21T18:25:02",
        "date_modified": "2017-03-21T15:25:02",
        "date_modified_gmt": "2017-03-21T18:25:02",
        "discount_type": "fixed_cart",
        "description": "",
        "date_expires": null,
        "date_expires_gmt": null,
        "usage_count": 0,
        "individual_use": true,
        "product_ids": [],
        "excluded_product_ids": [],
        "usage_limit": null,
        "usage_limit_per_user": null,
        "limit_usage_to_x_items": null,
        "free_shipping": true,
        "product_categories": [],
        "excluded_product_categories": [],
        "exclude_sale_items": false,
        "minimum_amount": "0.00",
        "maximum_amount": "0.00",
        "email_restrictions": [],
        "used_by": [],
        "meta_data": []
      },
      {
        "id": 719,
        "code": "10off",
        "amount": "10.00",
        "date_created": "2017-03-21T15:23:00",
        "date_created_gmt": "2017-03-21T18:23:00",
        "date_modified": "2017-03-21T15:23:00",
        "date_modified_gmt": "2017-03-21T18:23:00",
        "discount_type": "percent",
        "description": "",
        "date_expires": null,
        "date_expires_gmt": null,
        "usage_count": 0,
        "individual_use": true,
        "product_ids": [],
        "excluded_product_ids": [],
        "usage_limit": null,
        "usage_limit_per_user": null,
        "limit_usage_to_x_items": null,
        "free_shipping": false,
        "product_categories": [],
        "excluded_product_categories": [],
        "exclude_sale_items": true,
        "minimum_amount": "100.00",
        "maximum_amount": "0.00",
        "email_restrictions": [],
        "used_by": [],
        "meta_data": []
      }
    ]
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-api-request: Make an arbitrary API request">
    Send a request to any WooCommerce REST API endpoint.

    <ParamField body="method" type="string" required>
      HTTP method: `GET`, `POST`, `PUT`, or `DELETE`.
    </ParamField>

    <ParamField body="path" type="string" required>
      API path (e.g., `/wp-json/wc/v3/products`, `/wp-json/wc/v3/orders`).
    </ParamField>

    <ParamField body="body" type="object">
      Request body for `POST` and `PUT` requests.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "method": "GET",
      "path": "/reports/sales"
    }
    ```

    **Example response:**

    ```json theme={null}
    [
      {
        "total_sales": "580.07",
        "net_sales": "457.07",
        "average_sales": "18.68",
        "total_orders": 15,
        "total_items": 22,
        "total_tax": "10.50",
        "total_shipping": "50.00",
        "total_refunds": 0,
        "total_discount": "0.00",
        "totals_grouped_by": "day",
        "totals": {}
      }
    ]
    ```
  </Accordion>
</AccordionGroup>
