Westpay Agentic Skill

Last updated: 2026-06-10

Westpay provides a curated agentic skill and structured prompts to leverage AI coding assistants such as Cursor, Claude Code, and compatible IDE agents for accelerated Westpay integration development. Use it to generate, review, and refine code for Online API, Access API 2.0, Online API Sandbox, EPAS, PAaS, and SoftPOS integrations using natural language.

The skill and example prompts are available in the Westpay Agentic Skill repository.

bash
git clone https://github.com/westpay/westpay-agentic-skill

The repository contains a skill definition and two key directories:

  • SKILL.md - Agentic skill definition with Westpay integration rules and quick reference guidance.
  • references/ - Condensed reference documents for guided Westpay development across Online API, Access API 2.0, Sandbox, EPAS, PAaS, SoftPOS, and integration guardrails.
  • examples/ - Pre-built prompts for generating, reviewing, and validating Westpay integrations.

Prerequisites

For code generation using the skill and prompts:

  • An AI coding assistant that supports agentic skills, project rules, or reusable context packages, such as Cursor or Claude Code.
  • No Westpay credentials, payment terminal, SDK, or special hardware is required to use the skill and prompts for code generation.

For running the generated code:

  • Online API and Access API 2.0 code requires the relevant Westpay base URL, bearer token, and merchant subscription key.
  • Sandbox validation requires Westpay sandbox access and credentials.
  • EPAS code requires the EPAS client library and a compatible Westpay terminal environment.
  • PAaS and SoftPOS code requires the relevant Android development and terminal or device execution environment.

Note: Always validate generated payment flows in the Westpay demo or sandbox environment before using production credentials or live terminals.

Agentic Skill

An agentic skill is a structured knowledge package that an AI coding assistant can automatically discover and activate during code generation. It contains domain-specific rules, reference documentation, prompt patterns, and guardrails that guide the AI agent to produce accurate, idiomatic code without the developer needing to manually attach reference files in every conversation.

The cloned westpay-agentic-skill/ directory contains a Westpay agentic skill that follows the standard SKILL.md convention supported by AI coding assistants such as Cursor, Claude Code, and others.

About the Skill

This skill targets Westpay integration development across REST APIs, terminal integrations, Android payment apps, and sandbox workflows. When activated, it instructs the AI agent to consult bundled reference documents before generating code, significantly reducing inaccuracies and helping ensure correct Westpay API usage.

The skill helps the agent:

  • select the correct Westpay integration surface for the task;
  • preserve documented endpoint paths, HTTP methods, headers, intent actions, request fields, and status handling;
  • keep Online API, Access API 2.0, EPAS, PAaS, and SoftPOS concepts separate;
  • use placeholders for credentials, merchant identifiers, terminal IDs, and environment-specific values;
  • prefer sandbox-first validation and safe credential handling.

Installing the Skill

Copy the westpay-agentic-skill directory, including its references/ and examples/ subdirectories, into the skills folder recognized by your AI coding assistant. You can install it at the user level, where it is available across projects, or at the workspace level, where it is scoped to a single integration project.

ToolUser-level pathWorkspace-level path
Cursor~/.cursor/skills/westpay-dev/<workspace>/.cursor/skills/westpay-dev/
Claude Code~/.claude/skills/westpay-dev/<workspace>/.claude/skills/westpay-dev/
Other toolsConsult your tool's documentation for the skills directory locationConsult your tool's documentation for the skills directory location

Note: Windows users should prefer a workspace-level installation such as <workspace>\.cursor\skills\westpay-dev\ so the path is explicit and portable. Use mkdir in PowerShell or Command Prompt to create the directory.

powershell
mkdir <workspace>\.cursor\skills\

Step 1: Create the Skills Directory

In the examples below, replace .cursor with your tool's skills directory, such as .claude for Claude Code.

bash
# User-level
mkdir -p ~/.cursor/skills/

# Or workspace-level
mkdir -p <workspace>/.cursor/skills/

Step 2: Copy the Skill

From the cloned Westpay Agentic Skill repository, copy the skill package into your assistant's skills directory and name it westpay-dev.

bash
# User-level
cp -R westpay-agentic-skill ~/.cursor/skills/westpay-dev

# Or workspace-level
cp -R westpay-agentic-skill <workspace>/.cursor/skills/westpay-dev

After copying, the directory structure should look like:

text
<skills-directory>/
`-- westpay-dev/
    |-- SKILL.md
    |-- references/
    |   |-- access-api-2.md
    |   |-- epas.md
    |   |-- guardrails.md
    |   |-- online-api.md
    |   |-- paas.md
    |   |-- sandbox.md
    |   `-- softpos.md
    `-- examples/
        `-- prompts.md

Step 3: Verify the Installation

Open or restart your AI coding assistant.

Open the agent or chat panel.

Ask a Westpay-related question, for example:

text
Use the Westpay Agentic Skill to create a sandbox-first Online API purchase flow with terminal linking, payment request creation, status polling, and safe credential handling.

The agent should activate the westpay-dev skill, identify the relevant Westpay reference documents, and consult them before generating code.

Updating the Skill

As the Westpay skill evolves, you will want to pick up new reference documents, prompt examples, and rule changes without manually re-copying files. Two approaches are described below.

Option A - Updatable Install (Recommended): Symlink

Instead of copying the skill directory, create a symbolic link from your tool's skills directory to the cloned repository. Future updates are picked up with a simple git pull.

Linux / macOS:

bash
# User-level
ln -s /absolute/path/to/westpay-agentic-skill ~/.cursor/skills/westpay-dev

# Or workspace-level
ln -s /absolute/path/to/westpay-agentic-skill <workspace>/.cursor/skills/westpay-dev

Windows Command Prompt, run as Administrator or with Developer Mode enabled:

bat
REM Junction
mklink /J <workspace>\.cursor\skills\westpay-dev C:\path\to\westpay-agentic-skill

REM Or directory symlink
mklink /D <workspace>\.cursor\skills\westpay-dev C:\path\to\westpay-agentic-skill

Note: On Windows, junctions using mklink /J are usually easier because they do not require Administrator privileges on many systems. Users who cannot create either type of link should use the copy method and re-copy after each update.

To update, pull the latest changes in the cloned repository:

bash
cd /path/to/westpay-agentic-skill
git pull

The symlink ensures your skills directory reflects the latest content.

Option B - Manual Copy (Fallback)

If symlinks are not feasible, use the copy method described above. After pulling new changes from the repository, re-copy the skill directory to pick up updates.

bash
cd /path/to/westpay-agentic-skill
git pull
cp -R . ~/.cursor/skills/westpay-dev

Warning: Re-copying can overwrite local edits you made to skill files. If you customized the skill locally, back up your changes before replacing the directory.

Best Practices for AI-Assisted Development

Choosing a model:

For best results, use the most capable model available from your AI coding assistant. Larger, more advanced models are usually better at following payment integration constraints, preserving endpoint details, and handling multi-step transaction flows.

Tip: If a generated implementation mixes Westpay integration surfaces, invents endpoint fields, or misses sandbox validation steps, switch to a more capable model and ask it to re-check the relevant reference file before editing.

Writing effective prompts:

  • Be specific: include the Westpay product, target language, framework, and expected output.
  • Reference context: mention existing files, API clients, models, or test files the agent should inspect.
  • Break down complex tasks: separate terminal linking, purchase creation, refund handling, and reporting into focused prompts.
  • Include examples: provide expected request and response shapes when your application already has conventions.
  • Specify the environment: state whether the implementation targets sandbox, demo, or production.
  • Specify the integration surface: Online API, Access API 2.0, EPAS, PAaS, or SoftPOS.

Iterating on generated code:

  • Review before accepting: inspect generated code for correct endpoint paths, headers, request fields, and status handling.
  • Test incrementally: validate one transaction or onboarding step before building the entire flow.
  • Use the guardrails reference: ask the agent to consult references/guardrails.md for credential handling and production-readiness checks.
  • Provide error output: paste full API responses, exception traces, terminal logs, or Android intent result payloads into the chat when debugging.
  • Validate in sandbox: run Online API flows through the Westpay sandbox before moving toward production.

Sample Prompts

The examples/prompts.md file in the Westpay Agentic Skill repository contains pre-built prompts for generating and reviewing Westpay integrations. Each prompt provides a complete specification that an AI agent can follow to produce useful code or review output.

The prompts below are ordered from lower complexity to higher complexity. Begin with simpler prompts to familiarize yourself with the workflow before attempting more advanced scenarios.

Prompt 1 - Online API Purchase App (online_api_purchase_app.md), minimal Online API flow with terminal linking, purchase creation, and transaction status polling:

text
Use the Westpay Agentic Skill to build a TypeScript Online API client for terminal linking and purchase requests.

Target the demo environment first. Include configuration for base URL, bearer token, merchant subscription key, and terminal ID.

Implement:
- POST /in-store/api/v1/terminal/link
- POST /in-store/api/v1/purchase
- GET transaction status for the returned onlineAPIRefId

Add typed request and response models, safe error handling, and a README.md with setup instructions.

Save the generated code in online_api_purchase_app.

Prompt 2 - Access API Terminal Management App (access_api_terminal_management_app.md), Access API 2.0 client for terminal ID allocation and terminal package lookup:

text
Use the Westpay Agentic Skill to generate a C# Access API 2.0 client for terminal management.

Use the demo base URL and placeholders for Authorization and Ocp-Apim-Subscription-Key.

Implement:
- POST /getTerminalId
- POST /getTerminalInfo
- GET /terminal/getPackages/{customerId}/{model}
- POST /terminal/createUpdate

Add typed models, safe configuration, error handling, and a README.md with setup instructions.

Save the generated code in access_api_terminal_management_app.

Prompt 3 - EPAS Payment Terminal Integration (epas_sample_ecr_app.md), direct ECR or POS integration with a Westpay payment terminal using EPAS:

text
Use the Westpay Agentic Skill to create a Java EPAS sample ECR transaction flow.

Include:
- connection and login sequence
- callback handling
- purchase transaction
- receipt and event handling
- clear separation between ECR responsibilities and terminal responsibilities

Add a README.md with setup instructions and how to run the sample.

Save the generated code in epas_sample_ecr_app.

Prompt 4 - SoftPOS App2App Integration (softpos_app2app_app.md), Android App2App flow for SoftPOS purchase, refund, reversal, and transaction reporting:

text
Use the Westpay Agentic Skill to implement Android App2App SoftPOS purchase, refund, reversal, transaction history, and last transaction flows.

Use documented intent actions and extras exactly.

Include:
- request construction
- result parsing
- cancellation handling
- denial and error handling
- safe logging rules

Add a README.md with setup instructions and validation steps.

Save the generated code in softpos_app2app_app.

Expected Output

When you paste one of the prompts into the AI agent chat, the agent should:

Skill Activation

Automatically activate the westpay-dev skill, classify the requested Westpay integration surface, and consult the bundled reference documents.

Generating Application

Generate or review code using the relevant Westpay API, SDK, protocol, or Android integration rules.

Generated Code

Save generated code in the directory specified by the prompt and include setup instructions, configuration placeholders, and validation steps.

Each prompt can produce a self-contained project directory with the following structure:

PromptOutput directoryKey generated files
Online API Purchase Apponline_api_purchase_app/API client, request and response models, configuration, tests, README
Access API Terminal Management Appaccess_api_terminal_management_app/Access API client, terminal models, package lookup flow, README
EPAS Payment Terminal Integrationepas_sample_ecr_app/Sample ECR transaction flow, callback handling, receipt handling, README
SoftPOS App2App Integrationsoftpos_app2app_app/Android intent request helpers, result parsing, error handling, README

The generated application is a starting point. Review the generated code in your diff view, accept or reject changes, and ask follow-up questions for refinements.

Running Generated Code

The AI agent can generate Westpay integration code for different runtimes. The exact run process depends on the selected Westpay product and your application stack.

Option A - Local Application Runtime

For REST-based Online API and Access API 2.0 clients, run the generated code in the local runtime selected by the prompt, such as Node.js, .NET, Java, Python, or another supported stack. The agent should generate a README.md with setup and run instructions. A general workflow:

bash
cd <generated_app_directory>/

# Install dependencies using the package manager selected by the generated project
npm install

# Configure environment variables with sandbox or demo values
cp .env.example .env

# Run tests, if generated
npm test

# Run the application
npm run dev

Always replace this generic workflow with the commands generated for your selected stack.

Option B - Westpay Sandbox Validation

For Online API flows, validate the generated code against the Westpay sandbox or demo environment before production. Confirm that credentials are read from environment variables or a secret manager.

Typical validation steps:

  • configure Authorization: Bearer <access-token>;
  • configure Ocp-Apim-Subscription-Key: <merchant-subscription-key>;
  • link the test terminal or virtual terminal;
  • create a payment request;
  • poll or retrieve the transaction status;
  • test success, decline, cancellation, and error paths;
  • confirm that tokens, keys, terminal IDs, and merchant identifiers are not logged.

Option C - Device or Terminal Validation

For EPAS, PAaS, and SoftPOS flows, generated code must be validated in the correct terminal, Android, or device environment.

  • EPAS: verify the client library setup, terminal connection, login sequence, callbacks, transaction flow, and receipt handling.
  • PAaS: validate the Android payment-service integration on the supported Westpay terminal environment.
  • SoftPOS: validate Android App2App intent actions, extras, result payloads, cancellation paths, and reporting flows.

Tip: Ask the AI agent: "Create run instructions and a sandbox validation checklist for this Westpay integration." It can generate project-specific steps based on the code it created.