> This page is for Afterpay Online Developer, version Main (default).
> For other versions, use one of these documentation indexes:
> - Main (default): https://developers.afterpay.com/afterpay-online-developer/main/llms.txt
> - v1: https://developers.afterpay.com/afterpay-online-developer/v-1/llms.txt
> - Chinese: https://developers.afterpay.com/afterpay-online-developer/chinese/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.afterpay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.afterpay.com/_mcp/server.

# Configure Plugin

**How can I add Afterpay as a payment method and display Afterpay Site Messaging?**

---

## Configuration

Complete the steps below to enable and display Afterpay as a Payment Method, and add Afterpay messaging to product pages.

> **Note**
>
> If you have completed the Afterpay Gateway Installation steps, go to Step 3.

1. Go to the *WordPress Admin Dashboard*.

2. Go to *Plugins*\* > *Installed Plugins*.

3. Find the *Afterpay Gateway for WooCommerce* in the plugin list and click the **Settings** button.

   ![woo-config-1.png](/_fern-img/5f6b8221ab6e7deceebef877c7fe28d19b280af85291d36b3b878431a16570c6.webp)

4. Go to the *Core Configuration* section.

   ![woo-config-2.png](/_fern-img/c77b0bd99ed2afee824cef9c50e6f74ed3ef15a86bbb67f436b5ce20343743bd.webp)

5. Enter the Merchant ID provided by Afterpay into the *Merchant ID* field.

   ![woo-config-3.png](/_fern-img/73b175f883361f52c9a798ac4060978fbf3add4cc80463ad58f977fc94f3c794.webp)

6. Enter the Secret Key provided by Afterpay into the *Secret Key* field.

   ![woo-config-4.png](/_fern-img/db0159f898a8139535df5cfc0709acd3cd78225f34a784457b2288292a23d622.webp)

7. Click the **Save changes** button at the bottom of the page.

> **Note**
>
> After a successful save of the Afterpay credentials, the *Merchant Public ID*, *Minimum Payment Amount*, *Maximum Payment Amount* and *Settlement Currency* values are updated.

![woo-config-5.png](/_fern-img/6ad6e12c8bd6b59f4ccbac4693c85016a6285140233ea4236d62c84978354344.webp)

> **Note**
>
> The **Sandbox** API Environment is only applicable for dedicated test websites. Contact your Afterpay Account Manager if you need test credentials.

## Enable Express Checkout

To enable Express Checkout:

1. Go to **WordPress Admin Dashboard**.

2. Go to **Plugins** > **Installed Plugins**.

3. Find the *Afterpay Gateway for WooCommerce* in the plugin list and click the **Settings** button.

4. Find *Express Checkout Configuration* and enable the checkbox.

   ![woo-config-6.png](/_fern-img/06e5b8777079d8d082d7f1e73a1f3ed4b1935a031b869549fa82a7a461ef1ed5.webp)

## Enabling the Afterpay Messaging for WooCommerce

The Afterpay messaging can be enabled on:

* Category Pages

* Product Pages

* Cart Page

To start do the following:

1. Login to the Wordpress Dashboard.

2. Go to *Plugins* > *Installed plugins* > *Afterpay Gateway for Woocommerce* and click *Settings*.

![woo-plugin-1.png](/_fern-img/5f6b8221ab6e7deceebef877c7fe28d19b280af85291d36b3b878431a16570c6.webp)

Under *Settings*, you can see settings for:

* [Express Checkout Configuration](#enable-express-checkout)

* [Payment Info on Category Pages](#payment-info-on-category-pages)

* [Payment Info on Individual Product Pages](#payment-info-on-individual-product-pages)

* [Payment Info Display for Product Variant](#payment-info-display-for-product-variant)

These settings are described below.

### Payment Info on Category Pages

![woo-plugin-4.png](/_fern-img/bb88dd95d81cbab490fc598c4485d8d0e318dc6c9da07a19a251d29f94644d3f.webp)

To enable the messaging on the Category page, do the following:

1. Ensure the *Enable* checkbox is enabled.

2. Enter the correct hook to position the messaging and set the priority to increase or decrease the height of the Messaging position. See the [Hook](#hook) section below.

#### Hook

The positioning of the Messaging for Woocommerce relies on a hook. [This link](https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/) is a guide to understanding hook positioning on Category pages.

> **Warning**
>
> The hooks for Category pages and Product pages are completely different.

For example, use the hook `woocommerce_after_shop_loop_item`to position the messaging under the price:

![woo-plugin-5.png](/_fern-img/ad7cb50fc381d396b554ae869c5187b89abd408322ee80bf32028c0a0e380441.webp)

Below is an example of a category page with Afterpay messaging:

![woo-plugin-6.png](/_fern-img/0c1051a7eeb64b36e54b250097d6225f353eb12f543eeba6cad3e60222785565.webp)

> **Note**
>
> For more information on hooks, see the [Hooks](WC-Hooks.mdx) page.

### Payment Info on Individual Product Pages

To enable the messaging on the individual Product page, do the following:

1. Ensure the Enable checkbox is enabled.

2. Enter the correct hook to position the messaging and set the priority to increase or decrease the height of the Messaging position. See the **Hook** section below.

#### Hook

The positioning of the Messaging for Woocommerce relies on a hook. [This link](https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/) is a guide to understanding hook positioning for Product pages.

> **🚧 Warning**
>
> The hooks for Product Pages and Category Pages are completely different.

For example, use the hook `woocommerce_before_add_to_cart_form` to position the messaging directly under the Product Page price:

![woo-plugin-8.png](/_fern-img/da568a98b0abdfebb35677331caaed5f60b499fd8f8e1dc99b1b7316391ed96f.webp)

Below is an example of a Product Page with Afterpay messaging:

![woo-plugin-9.png](/_fern-img/c925503386049f0e78dd625df050ce4f5afcdb7f325a9e08bebb1f3613651a1a.webp)

> **Note**
>
> For more information on hooks, see the [Hooks](WC-Hooks.mdx) page.

### Payment Info Display for Product Variant

This option enables the Afterpay Messaging for any variant products.

For example a product that has a price range from $50 - $200. The Afterpay Messaging will also display the instalment breakdown according to a price range.

When a customer selects a variant, a specific price appears. This option enables the Afterpay Messaging to display a specific price breakdown.