Overview
The PayLexer WordPress developer API: functions, hooks and a browser script for add-on plugins.
This API lets your WordPress plugin take payments through the merchant's existing PayLexer connection. It is defined by the PayLexer plugin (src/developer-functions.php) and is available once PayLexer is active. Your plugin never holds PayLexer keys.
Register your platform
Declare the plugin you integrate and what it supports.
Create checkouts
Open hosted checkout, check status, refund.
Manage subscriptions
Start, pause, resume and cancel recurring payments.
Listen to webhooks
Settle orders from verified, deduplicated events.
Recommendation: mark orders paid only from the payment_completed webhook, never from the browser callback. See Webhooks.
Conventions
- Availability: Check
function_exists( 'paylexer_api_version' )if your plugin can run without PayLexer. - Errors: Functions return a
WP_Erroron failure. Adapter methods throw anExceptioninstead. See Errors. - Platform required: Functions taking
$platformrefuse unless the platform is registered, declared the feature, and PayLexer is connected. - Your orders only: Order references and subscription IDs work only on objects your platform created.
- Amounts are in major units (
15.00is fifteen dollars). - Versioning:
paylexer_api_version()only gains additive changes within a major version. A breaking change would ship as2.0.
Function index
| Group | Functions |
|---|---|
| Platform | paylexer_api_version, paylexer_register_platform, paylexer_register_adapter, paylexer_is_platform_enabled, paylexer_is_connected, paylexer_settings_url |
| Gateways | paylexer_get_gateways, paylexer_get_currencies, paylexer_payment_icons |
| Orders | paylexer_create_checkout, paylexer_get_payment_status, paylexer_get_orders, paylexer_refund, paylexer_render_order_details |
| Subscriptions | paylexer_create_subscription, paylexer_get_subscription_status, paylexer_cancel_subscription, paylexer_pause_subscription, paylexer_resume_subscription |
| Webhooks | paylexer_init, paylexer_platform_{id}_{event}, WebhookEvent |
| Browser | paylexer_enqueue_checkout, PayLexer.openCheckout |
| Platform adapters | PlatformAdapter, CheckoutRequest, SubscriptionRequest |
New to the API? Start with the Quickstart, then come back here for details.