alipay-pay-for-402-service

Parse HTTP 402 responses and retry requests with paymentProof from alipay-bot CLI.

29|2|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/alipay/ai --skill alipay-pay-for-402-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alipay-pay-for-402-service
Source: https://github.com/alipay/ai/tree/main/skills/alipay-pay-for-402-service
Command: npx skills add https://github.com/alipay/ai --skill alipay-pay-for-402-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When HTTP responses indicate a 402 Payment Required, this Skill provides a complete workflow to parse the response, acquire a paymentProof via the alipay-bot CLI, and retry the original request with the necessary credentials, ensuring a smooth buyer-side payment flow.

Core Features & Use Cases

  • Parse 402 Payment Needed responses and extract the required payment instructions.
  • Invoke the alipay-bot CLI to initiate payment, retrieve paymentProof, and retry the original resource request with the proof.
  • Manage the end-to-end flow including verification, retries, and fulfillment signaling after successful payment.

Quick Start

Start by running alipay-bot -- check-wallet to determine wallet readiness before proceeding with the 402 workflow.

Frequently Asked Questions about alipay-pay-for-402-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle an HTTP 402 Payment Required response in my application?

To handle an HTTP 402 Payment Required response, you parse the payment instructions, acquire a paymentProof via the alipay-bot CLI, and retry the original request with attached credentials to fulfill the buyer-side payment flow.

What is the HTTP 402 payment protocol mechanism used for?

The HTTP 402 payment protocol mechanism signals a client must pay to access a requested resource. It initiates a deterministic flow where the buyer parses instructions, pays via a CLI, and resubmits the request with proof.

How do I get a paymentProof and retry an original request after a 402 error?

You get a paymentProof and retry an original request by invoking the alipay-bot CLI to initiate payment, retrieving the generated proof, and resubmitting the failed request with the proof attached as credentials.

Does the alipay-bot CLI workflow support retries and fulfillment signaling?

Yes, the alipay-bot CLI workflow supports retries and fulfillment signaling. It enforces strict input validation, secure URL handling, and end-to-end state management to ensure reliable integration and successful fulfillment after payment.

What should I check before starting the 402 payment workflow?

Before starting the 402 payment workflow, you should run the alipay-bot CLI with the check-wallet command to determine wallet readiness and ensure your environment is prepared for the payment initiation and proof retrieval process.

Why does my 402 payment retry fail even after obtaining a voucher?

A 402 payment retry may fail after obtaining a voucher if strict input validation or secure URL handling fails. The workflow enforces end-to-end state management, so any mismatch in credentials or proof submission will halt the resubmission.