Developer Portal

WooCommerce Redsys Gateway REST API

A REST API for querying transactions, managing tokens, and automating payment workflows from external systems.

Overview

The WooCommerce Redsys Gateway Premium plugin exposes two complementary machine-to-machine surfaces on top of the same signed Redsys pipeline that powers a normal checkout (PSD2/SCA on the shopper side, signed IPN on the bank side). Every automated payment still ends in a real WooCommerce order.

SurfaceWhat it isNamespace
A2A (Agent2Agent)A JSON-RPC 2.0 surface that lets an authenticated AI agent or backend client create, capture, refund, query and tokenize payments.wc-redsys-a2a/v1
UCP (Universal Commerce Protocol)A RESTful commerce surface: catalog discovery, cart and checkout sessions, orders, refunds and webhooks for agentic shopping flows.redsys-ucp/v1

Both surfaces ship off by default and must be enabled by the merchant under WooCommerce → Settings → Redsys Advanced → Agentic Commerce. Until enabled, the endpoints return a service-unavailable error while the public discovery documents (Agent Card, UCP manifest) stay reachable so a client can still discover the surface.

There are also two internal namespaces — redsys-acp/v1 (Agentic Commerce Protocol bridge) and redsys-app/v1 (mobile/app helper routes). They follow the same OAuth model and are not covered endpoint-by-endpoint here.

Base URLs & namespaces

All REST routes are served from your store's WordPress REST root under the plugin namespaces. Discovery documents are additionally published at well-known paths at the site root.

Base URLs
# A2A (JSON-RPC)
https://your-store.com/wp-json/wc-redsys-a2a/v1/

# UCP (REST) — canonical namespace
https://your-store.com/wp-json/redsys-ucp/v1/

# UCP OAuth 2.1 authorization server
https://your-store.com/wp-json/redsys-ucp/oauth/v1/

# Well-known discovery documents
https://your-store.com/.well-known/agent-card.json
https://your-store.com/.well-known/ucp.json
https://your-store.com/.well-known/oauth-authorization-server

For convenience, several UCP capabilities are also registered under capability-scoped aliases (for example redsys-ucp/checkout/v1, redsys-ucp/catalog/v1, redsys-ucp/orders/v1) that mirror the canonical redsys-ucp/v1 routes. Prefer the canonical namespace shown throughout this page.

Authentication

Both surfaces authenticate with OAuth 2.1 + PKCE bearer tokens issued by the UCP authorization server bundled in the same plugin. There are no static API keys. A token is sent on every request in the Authorization: Bearer header.

OAuth endpoints
MethodPathDescription
GET POST/wp-json/redsys-ucp/oauth/v1/authorizeAuthorization endpoint (authorization-code + PKCE flow)
POST/wp-json/redsys-ucp/oauth/v1/tokenExchange an authorization code (or refresh) for an access token
POST/wp-json/redsys-ucp/oauth/v1/registerDynamic client registration (RFC 7591)
POST/wp-json/redsys-ucp/oauth/v1/introspectToken introspection (RFC 7662)
POST/wp-json/redsys-ucp/oauth/v1/revokeToken revocation (RFC 7009)
GET/.well-known/oauth-authorization-serverAuthorization server metadata (RFC 8414)
GET/.well-known/oauth-protected-resourceProtected resource metadata
Registering a client

Register a client dynamically, then run the standard authorization-code + PKCE flow. A2A clients must register with a client_type beginning with a2a_; the server then issues a client_id of the form a2a_… and a one-time client_secret. A2A tokens carry a2a:payments:* scopes; a UCP-flavored token is rejected on the A2A surface and vice-versa — the surfaces are isolated on purpose.

JSON — example registration request
POST /wp-json/redsys-ucp/oauth/v1/register
{
  "client_name": "Concierge Bot",
  "client_type": "a2a_concierge",
  "redirect_uris": ["https://bot.example/oauth/callback"],
  "scopes": ["a2a:payments:read", "a2a:payments:create"]
}
Calling an endpoint
cURL — example
curl https://your-store.com/wp-json/redsys-ucp/v1/discovery \
  -H 'Authorization: Bearer <access_token>' \
  -H 'Accept: application/json'
A2A scopes
ScopeAllows
a2a:payments:readquery_payment_status, list_payments, read-only tasks/get
a2a:payments:createcreate_payment
a2a:payments:capturecapture_payment (post-authorization capture)
a2a:payments:refundrefund_payment
a2a:payments:tokenizetokenize_card, recurrent_charge

Scopes are matched exactly — a2a:payments:create does not imply a2a:payments:read. Every A2A request passes a five-gate chain: authenticate, authorize (scope), IP whitelist, hours window and per-client rate limit (default 60/min, 600/hour, 5000/day). A sandbox bearer credential is available for local testing but only resolves when WP_DEBUG is true and the merchant has explicitly enabled it; it is never honored on a production install.

A2A — Agent2Agent

A2A is a JSON-RPC 2.0 surface. Discovery is via the Agent Card; every operation is a single POST to the /rpc endpoint; long-running tasks report progress over Server-Sent Events.

MethodPathDescription
GET/.well-known/agent-card.jsonPublic Agent Card. No auth. Cacheable (ETag, max-age 300)
GET/wp-json/wc-redsys-a2a/v1/agent-cardExtended Agent Card (auth required) including private skills
POST/wp-json/wc-redsys-a2a/v1/rpcJSON-RPC 2.0 endpoint for all skill invocations
GET/wp-json/wc-redsys-a2a/v1/tasks/{taskId}/streamSSE stream for a task. Resumable with Last-Event-ID
GET/wp-json/wc-redsys-a2a/v1/sca/return/{taskId}Public browser callback after the shopper completes SCA
POST/wp-json/wc-redsys-a2a/v1/rpc

JSON-RPC 2.0 transport. The method selects the RPC verb; for tasks/send and tasks/sendSubscribe the params.skill_id selects the operation. Amounts are always integer cents (1500 = 15,00 EUR); currency codes are uppercase ISO-4217.

RPC methods
MethodPurpose
tasks/sendInvoke a skill. Returns a task.
tasks/sendSubscribeInvoke a skill and return a stream_url to subscribe to.
tasks/getLook up a task by id.
tasks/cancelCancel a non-terminal task.
agent/listSkillsList the skills the bearer is allowed to invoke.
Skills
skill_idRequired scopeDescription
query_payment_statusa2a:payments:readLook up a payment by A2A payment_id or wc_order_id
list_paymentsa2a:payments:readList payments with filters
create_paymenta2a:payments:createProvision a pending order; returns an SCA redirect URL
capture_paymenta2a:payments:captureCapture a previously pre-authorized payment
refund_paymenta2a:payments:refundFull or partial refund
tokenize_carda2a:payments:tokenizeStore a reusable card token
recurrent_chargea2a:payments:tokenizeCharge a stored token
Example request — create_payment
JSON — example
POST /wp-json/wc-redsys-a2a/v1/rpc
Authorization: Bearer <token>

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tasks/send",
  "params": {
    "skill_id": "create_payment",
    "input": {
      "amount": 1250,
      "currency": "EUR",
      "order_reference": "ORDER-2026-001",
      "mode": "redirect"
    },
    "idempotency_key": "5d1c…"
  }
}
Example response (HTTP 200)
JSON — example
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "task_id": "b9b3f9a4-…",
    "state": "input-required",
    "artifacts": {
      "sca_redirect_url": "https://your-store.com/checkout/order-pay/…"
    }
  }
}

A task walks a strict state machine: submitted → working → input-required → completed | failed | canceled. The shopper completes SCA on the redirect URL exactly as a normal customer; the signed Redsys IPN settles the order and the webhook glue mirrors the result onto the task. Successful calls and business errors both use HTTP 200 with a JSON-RPC envelope; transport rejections (missing bearer, rate limit) use HTTP 401/429 and still carry a JSON-RPC error.

UCP — discovery

The UCP manifest advertises the supported capabilities, their spec/schema URIs and the OAuth authorization server. Discovery requires no authentication.

MethodPathDescription
GET/.well-known/ucp.jsonUCP manifest (also served at /.well-known/ucp)
GET/wp-json/redsys-ucp/v1/discoveryUCP capability discovery document
POST/wp-json/redsys-ucp/v1/negotiateNegotiate capability versions and the preferred transport

UCP — catalog & products

Read-only catalog discovery for agentic shopping. Product ids are WooCommerce product ids. A pre-built JSON product feed is available for bulk ingestion.

MethodPathDescription
GET/wp-json/redsys-ucp/v1/catalog/searchSearch the catalog
GET/wp-json/redsys-ucp/v1/catalog/{id}Look up a single catalog item
GET/wp-json/redsys-ucp/v1/productsList products
GET/wp-json/redsys-ucp/v1/products/{id}Retrieve a single product
GET/wp-json/redsys-ucp/v1/products/feed.jsonFull product feed (JSON)
GET/wp-json/redsys-ucp/v1/products/feed/manifestFeed manifest (chunking / freshness metadata)
GET/wp-json/redsys-ucp/v1/catalog/search

Search products for an agent. Parameters below are typical; the exact accepted set follows the UCP catalog search schema advertised in the discovery document.

Parameters
NameTypeDescription
qstringFree-text query (example)
limitintMaximum results to return (example)

UCP — cart sessions

A cart session holds line items before checkout. Create one, then read or update it by id.

MethodPathDescription
POST/wp-json/redsys-ucp/v1/cart-sessionsCreate a cart session
GET/wp-json/redsys-ucp/v1/cart-sessions/{id}Retrieve a cart session
PUT/wp-json/redsys-ucp/v1/cart-sessions/{id}Update line items / quantities

UCP — checkout sessions

A checkout session turns a cart into a payable order. Complete it to trigger the signed Redsys payment, or cancel it. The same routes are also exposed under the generic /sessions alias.

MethodPathDescription
POST/wp-json/redsys-ucp/v1/checkout-sessionsCreate a checkout session
GET/wp-json/redsys-ucp/v1/checkout-sessions/{id}Retrieve a checkout session
PUT/wp-json/redsys-ucp/v1/checkout-sessions/{id}Update buyer / shipping / payment details
POST/wp-json/redsys-ucp/v1/checkout-sessions/{id}/completeComplete the session and start payment
POST/wp-json/redsys-ucp/v1/checkout-sessions/{id}/cancelCancel the session

Alias routes: POST /sessions, GET /sessions/{id}, PATCH /sessions/{id}, POST /sessions/{id}/complete, POST /sessions/{id}/cancel.

UCP — orders

Read orders created through the commerce surface and act on them. Order ids are WooCommerce order ids.

MethodPathDescription
GET/wp-json/redsys-ucp/v1/ordersList orders
GET/wp-json/redsys-ucp/v1/orders/{id}Retrieve a single order
POST/wp-json/redsys-ucp/v1/orders/{id}/cancelCancel an order
POST/wp-json/redsys-ucp/v1/orders/{id}/refundCreate a full or partial refund (synced with Redsys)
POST/wp-json/redsys-ucp/v1/orders/{id}/refund

Refund all or part of a paid order. The refund is executed against Redsys and recorded on the WooCommerce order.

Parameters
NameTypeDescription
idintWooCommerce order id (path parameter)
amountintAmount in cents to refund (omit for a full refund) (example)
reasonstringOptional refund reason (example)
Example response (HTTP 200)
JSON — example
{
  "order_id": 10432,
  "status": "refunded",
  "refunded_amount": 1250,
  "currency": "EUR"
}

UCP — webhooks

Register HTTPS endpoints to receive signed event notifications (for example when an order is paid or refunded) instead of polling.

MethodPathDescription
POST/wp-json/redsys-ucp/v1/webhooksRegister a webhook subscription
GET/wp-json/redsys-ucp/v1/webhooksList webhook subscriptions
DELETE/wp-json/redsys-ucp/v1/webhooks/{id}Delete a webhook subscription

Error handling

UCP REST endpoints return standard HTTP status codes with a WordPress-style JSON error body (code, message, data.status). A2A endpoints return JSON-RPC error envelopes; transport-level failures additionally carry the matching HTTP status.

StatusMeaningWhen
400Bad requestInvalid or missing parameters / schema validation failure
401UnauthorizedMissing, invalid, expired or revoked bearer token
403ForbiddenToken lacks the required scope, IP not whitelisted, or outside the allowed hours window
404Not foundNo resource (task, session, order) matches the id
429Too many requestsPer-client rate limit exceeded (minute / hour / day window)
503Service unavailableThe A2A or UCP surface is not enabled by the merchant
500Server errorUnexpected gateway or Redsys error (see the Redsys logs)

Representative A2A JSON-RPC error codes: -32002 scope_denied (with data.required_scope), -32003 rate_limited (with data.window and data.limit), and a2a_client_revoked when a real token maps to a revoked client.

Get full API access

The REST API ships with the WooCommerce Redsys Gateway Premium plugin.