WPRuby Logo WPRuby
Log in Get started
  • Plugins
  • Docs
  • Blog
    • eCommerce
    • Plugins
    • How to
    • Coding
  • Affiliate Area
  • Contact Us
  • About Us
  • Plugins
  • Docs
  • Blog
    • eCommerce
    • Plugins
    • How to
    • Coding
  • Affiliate Area
  • Contact Us
  • About Us

WPRuby Account

4
  • How to upgrade your license
  • How to renew your license
  • How to change your plugin’s license domain
  • How to cancel your subscription.

WooCommerce Australia Post Shipping Method Pro

17
  • Installation
  • How to activate your plugin license
  • How to Upgrade from Free to Pro
  • Australia Post Zone Settings
  • Australia Post Global Settings
  • Australia Post Tracking
  • Pre-Paid Satchels
  • How to Mark a Product to be Shipped individually?
  • TroubleShooting and Common issues
  • Available WordPress Actions and Filters
  • [Labels Pro] How to connect the plugin with your MyPost Business account
  • [Labels Pro] How to connect Labels Pro with your eParcel account
  • [Labels Pro] How to create shipping labels?
  • [Labels Pro] How to print labels and create shipping orders.
  • [Labels Pro] Label Printing & Contracted Prices Credentials
  • [Labels Pro] How to Mark a Product as Containing Hazardous Materials?
  • Step by Step Guide on how to migrate to Shipping Zones

WooCommerce Custom Payment Gateway Pro

11
  • Getting Started
  • Custom Payment Gateway Settings
  • Custom Checkout Field Builder
  • Conditional Display Rules
  • Sending Payment Data to an External API
  • How to Create a Pay by Invoice Payment Method
  • How to Create a Manual Payment Link or Review-Based Payment Method
  • Troubleshooting
  • Frequently Asked Questions
  • Security and Sensitive Payment Data
  • How to Upgrade from Free to Pro

WooCommerce Royal Mail Shipping Calculator Pro

4
  • Installation
  • Settings
  • TroubleShooting and Common issues
  • How to activate your plugin license

Controlled Admin Access Pro

3
  • Available Actions for a Restricted Admin
  • Installation
  • Settings

WooCommerce Simple Table Rates Pro

8
  • Installation
  • Settings
  • Rules and Actions
  • How to Setup Weight Based Shipping
  • How To Setup Shipping By Shipping Class
  • How to Setup Shipping by Cart Total
  • How to Setup Shipping by Product
  • How to Setup Shipping by Product Category

WooCommerce Pack IQ

5
  • Installation
  • How to activate your plugin license
  • How to add a new box
  • How to change the boxes weight and dimensions units
  • How to view the packing results

WooCommerce Restricted Shipping and Payment Pro

4
  • Installation
  • Setting Up Shipping Methods Conditions
  • Available Shipping & Payment Rules
  • Setting Up Payment Gateways Conditions

Affiliate Butler PRO

9
  • Installation and Upgrade
  • Quick Start Guide
  • Settings
  • Keywords Management
  • Installation
  • Frequently Asked Questions
  • Files Structure
  • Links Types
  • Statistics

WooCommerce Adyen Payment Gateway

2
  • Setup the Adyen payment gateway
  • How to configure Adyen Webhook notifications? 

WooCommerce Free Shipping Per Product

2
  • Installation
  • How to setup free shipping for a certain product

WooCommerce UPS Shipping Method Pro

4
  • Installation
  • UPS Zone Settings
  • UPS Global Settings
  • How to get the UPS Access Key?

Delivery Promise for WooCommerce

9
  • Getting Started
  • Understanding Processing Time vs Transit Time
  • Setting the Cutoff Countdown
  • Configuring Default Delivery Estimates
  • Creating Delivery Rules
  • Setting Working Days and Holidays
  • Using Rule Presets
  • Product-Level Lead Times
  • Why the “Order Within” Countdown Is Not Showing
View Categories
  • Home
  • Knowledge Base
  • WooCommerce Custom Payment Gateway Pro
  • Sending Payment Data to an External API

Sending Payment Data to an External API

Waseem
Updated on July 7, 2026

4 min read

The Advanced options section on each gateway settings page lets you send order and checkout data to an external URL after a customer places an order. Use this to connect WooCommerce with invoicing tools, CRMs, internal systems, or custom payment workflows.

Table of Contents

Toggle
  • What API requests are used for
  • Example use cases
  • API settings overview
    • API requests
    • API URL
    • Redirect the Customer to the API URL
    • Request method
    • POST requests data type
  • HTTP Headers
  • WooCommerce API Parameters
  • Extra API Parameters
  • Custom checkout field API parameters
  • Payload Preview
  • Send Test Request
  • API Logs
    • Filtering logs
    • Log details
    • Retry failed requests
  • Configuration examples
    • Send data as form data
    • Send data as JSON
    • Add an Authorization header
    • Add an API key as an extra parameter
  • Important notes

What API requests are used for

After checkout, the plugin can send a request containing:

  • WooCommerce order data (order ID, total, billing details, and more)
  • Static values you define (API keys, environment flags)
  • Values from custom checkout fields (when API parameter is set on each field)

Common uses:

  • Send order data to an invoicing system
  • Create or update a record in a CRM
  • Notify an internal webhook for manual review
  • Trigger an external payment request on your own platform

Example use cases

ScenarioTypical setup
Create invoice in external systemPOST JSON to invoicing API with order ID, total, and billing email
Notify sales teamPOST form data to Zapier/Make webhook with order details
Register pending paymentPOST with order ID and custom field values
Redirect to external payment pageEnable API + redirect option (see below)

API settings overview

All API settings are under Advanced options on the gateway settings page.

API requests

Checkbox: Enable the gateway to request an API URL after the checkout process.

Turn this on to activate API functionality for this gateway. When off, no API requests are sent.

API URL

The URL that receives the request after the order is placed.

Example:

https://api.yourservice.com/orders/create

Redirect the Customer to the API URL

When checked, the customer is redirected to the API URL instead of the normal thank-you page flow.

Request methodRedirect behavior
GETCustomer is redirected to the API URL with data appended as query parameters
POSTCustomer is sent to an intermediate payment receipt page that auto-submits a form to the API URL

JSON POST body mode does not apply when redirect is enabled. Use form-style POST for redirects.

Request method

OptionDescription
POSTSends data in the request body (default)
GETSends data as URL query parameters

POST requests data type

Applies when POST is selected and Redirect the Customer to the API URL is not checked.

OptionDescription
FORM DATASends application/x-www-form-urlencoded data (default)
JSONSends application/json body

HTTP Headers

Add custom HTTP headers for authentication or content type.

KeyValue example
AuthorizationBearer your-token-here
Content-Typeapplication/json
X-API-Keyyour-api-key

Click Add Row to add more headers. Use the trash icon to remove a row.


WooCommerce API Parameters

Map WooCommerce order values to custom key names in the API payload.

Key (you define)Value (WooCommerce data)
order_idOrder ID
order_totalOrder Total
customer_idCustomer ID
billing_first_nameCustomer First Name
billing_last_nameCustomer Last Name
billing_postcodeCustomer Postcode
billing_address_1Customer Address line 1
billing_address_2Customer Address line 2
billing_cityCustomer City
billing_stateCustomer State
billing_countryCustomer Country
billing_emailCustomer Email
billing_phoneCustomer Phone
billing_ip_addressCustomer IP Address
return_urlOrder Return URL

Example mapping:

KeyValue
invoice_order_idOrder ID
amountOrder Total
customer_emailCustomer Email

Extra API Parameters

Add static key/value pairs sent with every request.

You can use {order_id} in values — it is replaced with the real order ID when the order is placed.

Example:

KeyValue
api_keyyour-secret-key
sourcewoocommerce
referenceorder-{order_id}

Custom checkout field API parameters

For each checkout field in the Custom Form builder, set API parameter to the key name you want in the API payload.

Example:

Checkout fieldAPI parameter
Company namecompany_name
Purchase order numberpo_number
Billing contact emailbilling_contact

Field values are included automatically when the customer submits the form.


Payload Preview

The Payload Preview shows the structure of the data that will be sent.

  • Placeholder values like [dynamic:order_id] appear in the preview.
  • Dynamic order values are filled with real data when a customer places an order.

Use the preview to confirm key names and structure before going live.


Send Test Request

The API Request Tools section includes Send Test Request.

Use it to verify:

  • The API URL is reachable
  • Headers are correct
  • The request method works
  • The payload structure matches what your endpoint expects

Test requests use sample data — not a real order. Check the result message shown after sending.


API Logs

The API Logs table records requests sent by the plugin.

ColumnDescription
StatusSuccess, Failed, Pending, or Retried
GatewayGateway that sent the request
OrderRelated order ID
MethodGET or POST
URLRequest URL
ResponseResponse summary
AttemptsNumber of attempts
Created / Last AttemptTimestamps

Filtering logs

Filter by status, order ID, or date range using the controls above the table.

Log details

Open a log entry to view:

  • Error message (if failed)
  • Request headers
  • Request payload
  • Response body
  • Attempt history

Retry failed requests

Failed requests can be retried from the log actions. Retries use the current gateway API settings and the current order data.

Retries use the current gateway API settings and the current order data.


Configuration examples

Send data as form data

  1. Enable API requests.
  2. Set API URL.
  3. Request method: POST
  4. POST requests data type: FORM DATA
  5. Add WooCommerce API Parameters and Extra API Parameters.
  6. Click Send Test Request to verify.

Send data as JSON

  1. Enable API requests.
  2. Set API URL.
  3. Request method: POST
  4. POST requests data type: JSON
  5. Leave Redirect the Customer to the API URL unchecked.
  6. Add headers if needed.
  7. Save and send a test request.

Add an Authorization header

In HTTP Headers:

KeyValue
AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Add an API key as an extra parameter

In Extra API Parameters:

KeyValue
api_keysk_live_your_key_here

Important notes

  • Dynamic values: Order totals, billing fields, and custom field values are populated when a real order is placed. The payload preview shows placeholders until then.
  • Test requests: Use test requests to validate URL, headers, method, and payload — not to create real orders in external systems unless your endpoint is designed for test data.
  • API logs: Check logs when requests fail. Empty logs usually mean API requests are disabled or no orders have used the gateway yet.
  • Sensitive data: Card numbers, CVV codes, and similar values are blocked from storage and API payloads. Do not configure fields to collect them. See Security and Sensitive Payment Data.
  • Storage option: If you disable Store Payment Information in the Database in global settings, field data may only exist in the API request and not in order meta.
Conditional Display RulesHow to Create a Pay by Invoice Payment Method
WPRuby Logo WPRuby

In 2015, WPRuby was established as an independent agency where we focus on producing and supporting many WordPress plugins. Each product we develop is simple to use and easy to customize and backed by awesome support and regular updates.

Resources

  • Knowledge Base
  • Affiliate Area
  • About Us
  • WPTools
  • Nomad Jar

Legal

  • Privacy Policy
  • Terms of Use

Follow us

  • Github
  • X.com
  • LinkedIn
  • Facebook

© 2026 - WPRuby