app icon
alipay_subscribe
0.0.1

a collection of subscription and paid tools

alipay/alipay_subscribe723 installs

Alipay AI Subscription Payment Plugin

Author: alipay
Version: 0.0.1
Type: tool

Plugin Description

Overview

AI agent developers can seamlessly integrate subscription payment services through the Alipay AI Subscription Payment Plugin. This plugin enables developers to implement flexible pricing models (per-usage or time-based) within their AI agents. Currently, it provides subscription initialization, subscription status querying, and subscription-based consumption tracking capabilities.

Core Features

This plugin encompasses three essential tools:

  1. Initialize Alipay Subscription Link - Creates an Alipay subscription order and returns a payment URL
  2. Query Alipay Subscription Status - Checks the status of subscription agreements
  3. Alipay Subscription Usage Service - Executes subscription consumption with usage-based billing

Configuration Guide

API Key Authorization Configuration

To configure API Key authorization, the following parameters are required:

Configuration KeyDescriptionRequiredExample Value
Alipay Open Platform App IDAPPID obtained from the Alipay Open PlatformRequired2021xxxxxxxx8009
Application Private KeyPrivate key configured in the Alipay Open PlatformRequiredMIIEvw.....kO71sA==
Alipay Public KeyAlipay server public key from the open platformRequiredMIIBIjA......AQAB
Third-party Service Provider Authorization TokenService provider authorization token (required only for third-party service provider mode)Optional202504BBdd...X49

How to Obtain: For detailed instructions on obtaining Alipay Open Platform App ID, Application Private Key, and Alipay Public Key, please refer to: Integration Prerequisites

Tool Documentation

1. Initialize Alipay Subscription Link

Creates an Alipay subscription order and returns a payment URL. Users can click the link to be redirected to Alipay to complete the subscription payment.

Parameter Specifications:

Parameter NameTypeRequiredDescription
agent_idstringNoAI Agent ID
agent_namestringYesAI Agent Name
plan_idstringYesSubscription Plan ID
uuidstringYesUnique User Identifier

2. Query Alipay Subscription Status

Queries the status of Alipay subscription agreements to verify whether a user's subscription remains valid.

Parameter Specifications:

Parameter NameTypeRequiredDescription
plan_idstringYesSubscription Plan ID
uuidstringYesUnique User Identifier

3. Alipay Subscription Usage Service

Executes Alipay subscription consumption with usage-based billing operations.

Parameter Specifications:

Parameter NameTypeRequiredDescription
out_request_nostringYesExternal request number for unique request identification
plan_idstringYesSubscription Plan ID
use_timesnumberYesNumber of usage deductions
uuidstringYesUnique User Identifier

Usage Examples

Using a simple conversational AI agent as an example, we demonstrate an AI assistant integrated with subscription capabilities. This assistant provides subscription services to users, including subscription creation, status querying, and usage-based billing.

1. API Key Authorization Configuration

2. Adding Alipay Subscription Plugin

Add the Alipay subscription plugin to your AI agent in the Dify platform.

2.1. Query Subscription Status

In a workflow scenario, when users inquire about subscription status, invoke the "Query Alipay Subscription Status" tool:

Response:

2.2. Create Subscription Link

When users request subscription services, invoke the "Initialize Alipay Subscription Link" tool to generate a payment URL. After generating the subscription link, for desktop users, convert the URL to a QR code to guide users through scanning and subscribing. For mobile users, direct clicking will initiate the subscription.

Response:

2.3. Usage-based Billing

When users utilize services, invoke the "Alipay Subscription Usage Service" tool for usage-based billing:

Response:

Frequently Asked Questions

Error CodeError DescriptionRoot CauseSolution
isv.invalid-cloud-app-permissionInvalid open scenario statusPayment MCP Server feature is not enabledLog in to the Open Platform Console, navigate to your application details page, locate Restricted Keys in development settings, click View, and enable Payment MCP Server in the restricted key details page.
isv.missing-signature-keyMissing signature configurationInterface signature method for restricted keys is not configuredLog in to the Open Platform Console, navigate to your application details page, locate Restricted Keys in development settings, click View, and complete the Interface Signature Method configuration in the restricted key details page.
isv.invalid-signatureSignature verification exceptionThe private key configured in the tool does not match the public key configured for interface signature method in the Alipay Open Platform restricted keys1. Use new keys: After generating new keys, log in to the Open Platform Console, navigate to your application details page, locate Restricted Keys in development settings, click View, and reconfigure the Interface Signature Method in the restricted key details page.
2. Use matching keys, refer to Key Matching to find compatible keys.
isv.invalid-open-scene-api-permissionInvalid open scenario API permissionsRequired tools have not been selectedLog in to the Open Platform Console, navigate to your application details page, locate Restricted Keys in development settings, click View, and select the tools you need to invoke in the restricted key details page.

Contact Us

We look forward to exploring the limitless possibilities of AI subscription payments with developers, jointly creating smarter and more convenient subscription payment experiences. If you encounter any issues during usage or have collaboration inquiries, please join the Alipay AI Service Partnership Group by scanning the DingTalk QR code below. We are always ready to listen to your suggestions and requirements.

CATEGORY
Tool
TAGS
BUSINESSFINANCE
VERSION
0.0.1
alipay·10/28/2025 01:18 AM
REQUIREMENTS
Maximum memory
256MB