PhonePe Payment Gateway Skills


PhonePe PG Skills are designed to simplify and accelerate integration with PhonePe Payment Gateway APIs. These skills empower tools like GitHub Copilot CLI, Copilot Coding Agent, and Visual Studio Code to guide you through the entire integration process. From setting up secure authentication to implementing seamless payment flows and error handling, PhonePe PG Skills help ensure a reliable and efficient integration experience.

The agent understands your instructions and handles the “heavy lifting” for you:

  • Natural Language: It turns simple requests like “write code to integrate with PhonePe PG APIs to Create a payment link” into real, working code.
  • Smart Security: It automatically manages your login tokens and API security.
  • Live Help: It finds and fixes integration errors directly in your development environment.
  • Instant Setup: It is built to work immediately with common AI tools and CLI platforms.
  • Less Manual Work: You don’t need to memorize every API detail; the AI agent already knows how PhonePe works.
  • Complete Control: You can manage payments, set up subscriptions, check order status, and process refunds using simple commands.

Example 1: Accept Your First Payment Online

Prompt:

Help me integrate PhonePe payment gateway. Create a payment order for ₹100 with order ID “ORDER123” and redirect URL “https://mysite.com/callback”

Copilot will:

  • Fetch authentication token using your credentials
  • Build the correct API payload
  • Generate code to make the API call
  • Parse and return the payment URL

Example 2: Debug Integration Issues

Prompt:

I’m getting “AUTHORIZATION_FAILED” error when calling PhonePe checkout API. Help me debug this.

Copilot will:

  • Check your authentication flow
  • Verify token generation logic
  • Suggest fixes based on error codes

The skill library encapsulates PhonePe’s official API specifications into executable agent actions:

  • Authentication: Automated OAuth2 token generation and lifecycle management.
  • Payment Flows: Support for both Standard Checkout (PhonePe-hosted) and Custom Checkout (Merchant-controlled UI for UPI, Card, Net Banking).
  • Subscriptions: Mandate setup and recurring billing cycles via AutoPay.
  • Order Management: Real-time status querying and full/partial refund processing.

Is this article helpful?