What are WooCommerce endpoints?

18 minutes
What are WooCommerce endpoints?

Ever wondered how your WooCommerce store knows where to send customers after they log in or check out? Or how your store’s data becomes available to mobile apps and other services? The magic behind these capabilities lies in a powerful but often overlooked feature: WooCommerce endpoints. Whether you’re managing a small boutique shop or developing a sophisticated e-commerce ecosystem, understanding endpoints can transform your approach to WooCommerce development.

In this comprehensive guide, we’ll demystify WooCommerce endpoints, explain their critical role in modern e-commerce applications, and show you how to leverage them for more flexible, powerful online stores. Ready to take your WooCommerce knowledge to the next level?

Understanding WooCommerce endpoints: A comprehensive introduction

Before diving into the technical details, let’s clarify what endpoints actually are. In the context of web development, an endpoint is simply a specific URL that represents a function or resource within your application. Think of endpoints as doorways that allow access to different rooms in your e-commerce house.

For WooCommerce specifically, endpoints serve two primary purposes:

  1. They define customer-facing URLs for account pages, checkout processes, and other user interactions
  2. They provide access points for programmatic data exchange through the REST API

Why should you care about endpoints? Because they’re the foundation of how your WooCommerce store interacts with both users and external systems. Mastering endpoints allows you to:

  • Customize user journeys through your store
  • Build headless commerce solutions
  • Integrate with mobile apps and third-party services
  • Create custom functionality beyond standard WooCommerce features

As e-commerce grows increasingly interconnected, the ability to skillfully work with endpoints becomes not just useful but essential for competitive store development.

What are WooCommerce REST API endpoints?

The WooCommerce REST API is a powerful interface that allows developers to interact with store data programmatically. REST (Representational State Transfer) is an architectural style for building APIs that’s based on standard HTTP methods.

WooCommerce REST API endpoints are specific URLs that follow a consistent pattern:

/wp-json/wc/v3/[resource]

Where [resource] represents the type of data you’re trying to access—products, orders, customers, etc.

These endpoints allow developers to:

  • Retrieve store data (GET requests)
  • Create new resources like products or orders (POST requests)
  • Update existing resources (PUT requests)
  • Delete resources (DELETE requests)

The true power of the REST API becomes apparent in headless commerce scenarios, where the front-end presentation layer is separate from the back-end WooCommerce system. This architectural approach enables the creation of custom shopping experiences across websites, mobile apps, and other digital touchpoints, all powered by the same WooCommerce core.

The WooCommerce REST API doesn’t just allow data access—it opens up entirely new possibilities for how your store can operate and integrate with the broader digital ecosystem.

Core WooCommerce endpoints and their functions

WooCommerce includes a range of built-in endpoints out of the box. These can be divided into two main categories: customer-facing URL endpoints and REST API endpoints.

Endpoint TypeExamplesFunction
Customer Account Endpointsorders, downloads, edit-addressControl URLs for customer account pages
Checkout Process Endpointscheckout, cart, thank-youManage shopping and checkout flow
Product API Endpoints/wp-json/wc/v3/productsManage product data
Order API Endpoints/wp-json/wc/v3/ordersProcess and manage orders
Customer API Endpoints/wp-json/wc/v3/customersCustomer data management

Each of these endpoint categories plays a crucial role in the overall functionality of your WooCommerce store. For instance, the product endpoints allow developers to programmatically create, read, update, and delete products, while order endpoints enable sophisticated order management workflows.

Understanding these core endpoints provides the foundation for both customizing the standard WooCommerce experience and extending it with custom functionality. For store owners looking to scale their WooCommerce development capabilities, mastering these endpoints is a worthwhile investment.

How do WooCommerce account endpoints work?

Account endpoints are the URLs that control what customers see when they navigate to different sections within their account area. By default, WooCommerce registers several account endpoints:

  • Dashboard: The main account page
  • Orders: Customer order history
  • Downloads: Downloadable products
  • Addresses: Shipping and billing addresses
  • Payment methods: Saved payment information
  • Account details: Personal information
  • Logout: End the current session

These endpoints work through WordPress’s rewrite rules system. When a customer visits, for example, /my-account/orders/, WooCommerce intercepts this request and loads the appropriate content for displaying orders.

What makes account endpoints particularly interesting is that they can be customized. You can:

  1. Change the URL structure (e.g., “purchase-history” instead of “orders”)
  2. Add entirely new account sections
  3. Remove default sections you don’t need
  4. Rearrange the order of sections in the account menu

This flexibility allows you to create tailored customer experiences that match your specific business requirements. For instance, a subscription-based business might add a custom “Subscriptions” endpoint, while a B2B store might add a “Company Information” endpoint.

Creating custom WooCommerce endpoints

One of the most powerful aspects of WooCommerce’s architecture is the ability to create your own custom endpoints. This allows you to extend functionality beyond what’s available out-of-the-box.

Here’s a basic example of how to add a custom account endpoint:

// Register the endpoint
function custom_add_my_account_endpoint() {
    add_rewrite_endpoint( 'my-custom-endpoint', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'custom_add_my_account_endpoint' );

// Add new menu item in account navigation
function custom_add_my_account_menu_item( $items ) {
    $items['my-custom-endpoint'] = 'My Custom Page';
    return $items;
}
add_filter( 'woocommerce_account_menu_items', 'custom_add_my_account_menu_item' );

// Add content to the custom endpoint
function custom_my_account_endpoint_content() {
    echo '<h3>My Custom Content</h3>';
    echo '<p>Here is the content for my custom account section.</p>';
}
add_action( 'woocommerce_account_my-custom-endpoint_endpoint', 'custom_my_account_endpoint_content' );

// Don't forget to flush rewrite rules
function custom_flush_rewrite_rules() {
    flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'custom_flush_rewrite_rules' );

This basic pattern can be adapted to create sophisticated custom functionality within the account area. For more complex requirements, you might want to work with a WooCommerce development specialist who can ensure that your custom endpoints are implemented securely and efficiently.

Creating custom REST API endpoints

Similarly, you can create custom REST API endpoints to expose new functionality programmatically:

add_action( 'rest_api_init', function () {
    register_rest_route( 'my-plugin/v1', '/custom-data', array(
        'methods' => 'GET',
        'callback' => 'my_custom_endpoint_handler',
        'permission_callback' => function() {
            return current_user_can( 'manage_options' );
        }
    ));
});

function my_custom_endpoint_handler( $request ) {
    // Process the request and return data
    $data = array( 'status' => 'success', 'message' => 'Custom data retrieved' );
    return new WP_REST_Response( $data, 200 );
}

This approach allows you to extend WooCommerce’s capabilities in virtually limitless ways, from creating custom reporting systems to building integrations with external services.

Security best practices for WooCommerce endpoint development

When working with WooCommerce endpoints, security should be a top priority. Here are essential practices to follow:

Security ConcernBest PracticeImplementation Approach
AuthenticationAlways verify user identity before allowing access to sensitive dataUse WooCommerce’s built-in authentication methods or implement OAuth for API access
AuthorizationCheck that authenticated users have appropriate permissionsImplement proper capability checks (e.g., current_user_can())
Data ValidationNever trust input data from users or external systemsValidate and sanitize all input using WordPress functions like sanitize_text_field()
Rate LimitingPrevent abuse through excessive API callsImplement request throttling for API endpoints
Error HandlingDon’t expose sensitive information in error messagesUse generic error messages in production environments

For API endpoints specifically, consider implementing an API key system or OAuth authentication to ensure that only authorized applications can access your store’s data. WooCommerce includes built-in support for API keys that can be generated and managed through the admin interface.

Remember that endpoints can expose sensitive customer and order data, so proper security measures are not optional—they’re essential for maintaining customer trust and complying with data protection regulations.

Key takeaways: Mastering WooCommerce endpoints for improved development

As we’ve explored throughout this guide, WooCommerce endpoints are fundamental building blocks for creating flexible, powerful e-commerce experiences. Here’s what you should remember:

  • Endpoints serve both customer-facing navigation and programmatic API access
  • Understanding endpoint architecture allows you to customize the customer experience
  • Custom endpoints enable you to extend WooCommerce beyond its out-of-the-box capabilities
  • Security is paramount when working with endpoints, especially those exposing sensitive data
  • The REST API opens up possibilities for headless commerce and integrated experiences

For those looking to take their WooCommerce stores to the next level, endpoints provide the architectural framework to build truly custom solutions. Whether you’re looking to streamline the customer account area, develop mobile app integrations, or create unique shopping experiences, mastering endpoints gives you the tools you need.

Ready to put this knowledge into practice? Start by reviewing your current WooCommerce setup and identifying opportunities where custom endpoints could improve your customer experience or business operations. For complex implementations, consider partnering with experienced WooCommerce development specialists who can help you implement these powerful features securely and effectively.

Have you worked with WooCommerce endpoints before? What custom functionality have you implemented using them? The possibilities are virtually endless—limited only by your imagination and business requirements.Ever wondered how your WooCommerce store knows where to send customers after they log in or check out? Or how your store’s data becomes available to mobile apps and other services? The answer lies in a feature that is easy to overlook: WooCommerce endpoints. Whether you’re managing a small boutique shop or developing a sophisticated e-commerce ecosystem, understanding endpoints can improve your approach to WooCommerce development.

In this guide, we’ll explain WooCommerce endpoints, their role in modern e-commerce applications, and how to use them for more flexible online stores.

In short: WooCommerce endpoints are URLs that represent a function or resource. There are three kinds: account and checkout endpoints (customer-facing URLs such as /my-account/orders/), REST API endpoints (/wp-json/wc/v3/…, for merchants and integrations, with authentication), and Store API endpoints (/wp-json/wc/store/v1/…, for storefronts and headless frontends).

Understanding WooCommerce endpoints: A comprehensive introduction

Before diving into the technical details, let’s clarify what endpoints actually are. In the context of web development, an endpoint is simply a specific URL that represents a function or resource within your application. Think of endpoints as doorways that allow access to different rooms in your e-commerce house.

For WooCommerce specifically, endpoints serve three main purposes:

  1. They define customer-facing URLs for account pages, checkout processes, and other user interactions
  2. They provide access points for programmatic data exchange through the REST API
  3. They give storefronts and headless frontends access to cart, checkout, and product data through the Store API

Why should you care about endpoints? Because they’re the foundation of how your WooCommerce store interacts with both users and external systems. Mastering endpoints allows you to:

  • Customize user journeys through your store
  • Build headless commerce solutions
  • Integrate with mobile apps and third-party services
  • Create custom functionality beyond standard WooCommerce features

As e-commerce grows increasingly interconnected, the ability to work with endpoints becomes not just useful but important for competitive store development.

What are WooCommerce REST API endpoints?

The WooCommerce REST API is an interface that allows developers to interact with store data programmatically. REST (Representational State Transfer) is an architectural style for building APIs that’s based on standard HTTP methods. The official REST API documentation lists every resource.

WooCommerce REST API endpoints are specific URLs that follow a consistent pattern:

/wp-json/wc/v3/[resource]

Where [resource] represents the type of data you’re trying to access: products, orders, customers, etc. Requests must be authenticated with API keys (a consumer key and secret) created under WooCommerce > Settings > Advanced > REST API and sent over HTTPS.

These endpoints allow developers to:

  • Retrieve store data (GET requests)
  • Create new resources like products or orders (POST requests)
  • Update existing resources (PUT requests)
  • Delete resources (DELETE requests)

The REST API is particularly valuable in headless commerce scenarios, where the front-end presentation layer is separate from the back-end WooCommerce system. This architectural approach enables custom shopping experiences across websites, mobile apps, and other digital touchpoints, all powered by the same WooCommerce core. In such setups the storefront typically uses the Store API for cart and checkout, whilst the REST API handles back-office integrations such as ERP or PIM synchronisation. See whether WooCommerce can run without WordPress for the headless context.

The WooCommerce REST API doesn’t just allow data access, it opens up new possibilities for how your store can operate and integrate with the broader digital ecosystem.

What is the WooCommerce Store API?

The Store API provides endpoints for customer-facing storefronts under /wp-json/wc/store/v1/, such as cart, checkout, and products. It powers the Cart and Checkout blocks and is the right choice for headless frontends that need to show products and let shoppers buy. Unlike the REST API, it does not use API keys. It uses its own nonce or cart token mechanism, so a shopper can only change their own cart. Read the Store API documentation for the current routes.

Core WooCommerce endpoints and their functions

WooCommerce includes a range of built-in endpoints out of the box. These can be divided into three categories: customer-facing URL endpoints, REST API endpoints, and Store API endpoints.

Endpoint TypeExamplesFunction
Customer Account Endpointsorders, view-order, downloads, edit-address, payment-methods, edit-accountControl URLs for customer account pages
Checkout Process Endpointsorder-pay, order-received, add-payment-methodHandle payment and order confirmation steps
Product API Endpoints/wp-json/wc/v3/productsManage product data
Order API Endpoints/wp-json/wc/v3/ordersProcess and manage orders
Customer API Endpoints/wp-json/wc/v3/customersCustomer data management
Store API Endpoints/wp-json/wc/store/v1/cart, /wp-json/wc/store/v1/checkoutStorefront cart and checkout

Each of these endpoint categories plays an important role in the overall functionality of your WooCommerce store. For instance, the product endpoints allow developers to programmatically create, read, update, and delete products, while order endpoints enable advanced order management workflows. The cart and checkout pages themselves are WordPress pages, not endpoints.

Understanding these core endpoints provides the foundation for both customizing the standard WooCommerce experience and extending it with custom functionality. For stores that connect to ERP, CRM, or PIM systems, see our WooCommerce integrations.

How do WooCommerce account endpoints work?

Account endpoints are the URLs that control what customers see when they navigate to different sections within their account area. By default, WooCommerce registers several account endpoints:

  • Dashboard: The main account page
  • Orders (orders): Customer order history
  • Downloads (downloads): Downloadable products
  • Addresses (edit-address): Shipping and billing addresses
  • Payment methods (payment-methods): Saved payment information
  • Account details (edit-account): Personal information
  • Logout (customer-logout): End the current session

These endpoints work through WordPress’s rewrite rules system. When a customer visits, for example, /my-account/orders/, WooCommerce intercepts this request and loads the appropriate content for displaying orders. The official endpoints documentation lists all of them.

What makes account endpoints particularly interesting is that they can be customized. You can:

  1. Change the URL structure (e.g., “purchase-history” instead of “orders”) under WooCommerce > Settings > Advanced, in the account endpoints section
  2. Add entirely new account sections
  3. Remove default sections you don’t need
  4. Rearrange the order of sections in the account menu

This flexibility allows you to create tailored customer experiences that match your specific business requirements. For instance, a subscription-based business might add a custom “Subscriptions” endpoint, while a B2B store might add a “Company Information” endpoint.

Creating custom WooCommerce endpoints

One of the most useful aspects of WooCommerce’s architecture is the ability to create your own custom endpoints. This allows you to extend functionality beyond what’s available out-of-the-box.

Here’s a basic example of how to add a custom account endpoint:

// Register the endpoint
function custom_add_my_account_endpoint() {
    add_rewrite_endpoint( 'my-custom-endpoint', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'custom_add_my_account_endpoint' );

// Add a menu item in the account navigation, before "Log out"
function custom_add_my_account_menu_item( $items ) {
    $logout = $items['customer-logout'] ?? null;
    unset( $items['customer-logout'] );
    $items['my-custom-endpoint'] = 'My Custom Page';
    if ( $logout ) {
        $items['customer-logout'] = $logout;
    }
    return $items;
}
add_filter( 'woocommerce_account_menu_items', 'custom_add_my_account_menu_item' );

// Add content to the custom endpoint
function custom_my_account_endpoint_content() {
    echo '<h3>My Custom Content</h3>';
    echo '<p>Here is the content for my custom account section.</p>';
}
add_action( 'woocommerce_account_my-custom-endpoint_endpoint', 'custom_my_account_endpoint_content' );

// Flush rewrite rules once, on plugin activation
function custom_flush_rewrite_rules() {
    custom_add_my_account_endpoint();
    flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'custom_flush_rewrite_rules' );

After adding the code, refresh the rewrite rules once: activate the plugin, or go to Settings > Permalinks and click Save. Never call flush_rewrite_rules() on every request, because it is expensive. This basic pattern can be adapted to create sophisticated custom functionality within the account area. For more complex requirements, you might want to work with a WooCommerce development specialist who can ensure that your custom endpoints are implemented securely and efficiently.

Creating custom REST API endpoints

Similarly, you can create custom REST API endpoints to expose new functionality programmatically:

add_action( 'rest_api_init', function () {
    // Use your own namespace, never wc/v3
    register_rest_route( 'my-plugin/v1', '/custom-data', array(
        'methods'             => 'GET',
        'callback'            => 'my_custom_endpoint_handler',
        'permission_callback' => function() {
            return current_user_can( 'manage_options' );
        }
    ));
});

function my_custom_endpoint_handler( $request ) {
    // Process the request and return data
    $data = array( 'status' => 'success', 'message' => 'Custom data retrieved' );
    return new WP_REST_Response( $data, 200 );
}

This approach allows you to extend WooCommerce’s capabilities in many ways, from creating custom reporting systems to building integrations with external services. For a broader walkthrough, read how to create an API in WooCommerce.

Security best practices for WooCommerce endpoint development

When working with WooCommerce endpoints, security should be a top priority. Here are essential practices to follow:

Security ConcernBest PracticeImplementation Approach
AuthenticationAlways verify user identity before allowing access to sensitive dataUse WooCommerce API keys over HTTPS, or application passwords for WordPress users
AuthorizationCheck that authenticated users have appropriate permissionsImplement proper capability checks (e.g., current_user_can()) in every permission_callback
Data ValidationNever trust input data from users or external systemsValidate and sanitize all input using WordPress functions like sanitize_text_field(), and escape output with esc_html()
Rate LimitingPrevent abuse through excessive API callsImplement request throttling for API endpoints, for example at the server or firewall level
Error HandlingDon’t expose sensitive information in error messagesUse generic error messages in production environments

For API endpoints specifically, use read-only keys wherever an integration does not need to write data, and revoke keys that are no longer used. WooCommerce includes built-in support for API keys that can be generated and managed through the admin interface.

Remember that endpoints can expose sensitive customer and order data, so proper security measures are essential for maintaining customer trust and complying with data protection regulations. Our WordPress security page explains how we approach hardening.

Key takeaways: Mastering WooCommerce endpoints for improved development

As we’ve explored throughout this guide, WooCommerce endpoints are fundamental building blocks for creating flexible e-commerce experiences. Here’s what you should remember:

  • Endpoints serve customer-facing navigation, programmatic API access, and storefront access through the Store API
  • Understanding endpoint architecture allows you to customize the customer experience
  • Custom endpoints enable you to extend WooCommerce beyond its out-of-the-box capabilities
  • Security is paramount when working with endpoints, especially those exposing sensitive data
  • The REST API and Store API open up possibilities for headless commerce and integrated experiences

For those looking to take their WooCommerce stores to the next level, endpoints provide the architectural framework to build custom solutions. Whether you’re looking to streamline the customer account area, develop mobile app integrations, or create unique shopping experiences, mastering endpoints gives you the tools you need.

Ready to put this knowledge into practice? Start by reviewing your current WooCommerce setup and identifying opportunities where custom endpoints could improve your customer experience or business operations. For complex implementations, consider partnering with experienced WooCommerce development specialists who can help you implement these features securely and effectively.

Frequently asked questions about WooCommerce endpoints

What are WooCommerce endpoints?

WooCommerce endpoints are URLs that represent a function or resource. They include customer-facing account and checkout endpoints such as /my-account/orders/, REST API endpoints under /wp-json/wc/v3/, and Store API endpoints under /wp-json/wc/store/v1/.

What is the base URL of the WooCommerce REST API?

The base URL is /wp-json/wc/v3/ on your domain, followed by a resource such as products, orders or customers. For example, /wp-json/wc/v3/orders returns orders for authenticated requests.

What is the difference between the WooCommerce REST API and the Store API?

The REST API (wc/v3) is for merchants and integrations and requires authentication. The Store API (wc/store/v1) is for customer-facing storefronts, powers the Cart and Checkout blocks, and uses its own nonce or cart token mechanism instead of API keys.

How do I authenticate with the WooCommerce REST API?

Create API keys under WooCommerce > Settings > Advanced > REST API and send the consumer key and secret over HTTPS. Choose read or read/write permissions per key. Application passwords are an alternative for WordPress users.

How do I add a custom endpoint to the My Account page?

Register it with add_rewrite_endpoint(), add a menu item with the woocommerce_account_menu_items filter, output its content on the woocommerce_account_{endpoint}_endpoint action, and flush rewrite rules once.

Why does my custom WooCommerce endpoint return a 404?

Usually the rewrite rules have not been refreshed. Go to Settings > Permalinks and click Save, or flush the rules once on plugin activation. Never flush them on every request.

Pwel Zmyslowski

Paweł Zmysłowski

CEO WLC.team

At White Label Coders responsible for the sales process and sales team, still involved in the analytical and advisory roles in case of more complex projects.

Author page

Is your WordPress “working, but slow”?

MORE ARTICLES

Read also

  • Why do my comparison tables cause layout shift?
    11 minutes

    Why do my comparison tables cause layout shift?

    Comparison tables often cause layout shift because parts of them load without reserved space, so content jumps around as the page renders. This happens when images lack dimensions, dynamic data loads without placeholders, or custom fonts reflow text after the first paint. Layout shift hurts user experience and your Core Web Vitals, which feed into…

    Read

  • How do you implement multiple payment gateways in iGaming platforms?
    11 minutes

    How do you implement multiple payment gateways in iGaming platforms?

    Implementing multiple payment gateways in iGaming platforms involves integrating several payment processors to offer diverse payment options, ensure regulatory compliance, and maximise transaction success rates. This approach requires careful technical planning, strong security measures, and intelligent routing systems. The process typically involves API integrations, database management, and thorough testing to create smooth payment experiences for…

    Read

  • 1 minute

    Development of export activity on new foreign markets

    White Label Coders sp. z o.o. has received EU co-funding for the project “Development of export activity on new foreign markets”. The support, in the form of an export voucher, comes from the project “InterGlobal – internationalisation of SMEs from the Silesian Voivodeship”, implemented by Fundusz Górnośląski S.A. under the European Funds for Silesia 2021–2027…

    Read