Home > Blog > How to Integrate Alipay and WeChat Pay QR Code Payments
Traveler scans payment code

How to Integrate Alipay and WeChat Pay QR Code Payments

Learn how to integrate Alipay and WeChat Pay QR code payments. This guide covers API requirements, merchant setup, and secure dynamic code generation.
Updated on April 29, 2026
Table Of Contents

Are you struggling to capture sales from international travelers who prefer mobile wallets over traditional credit cards? Excluding these popular global payment methods can lead to high cart abandonment rates and missed revenue at checkout. This guide explains the technical steps and API requirements to integrate Alipay and WeChat Pay QR codes into your payment workflow for a seamless customer experience.

Technical Foundations of QR Code Payments

Modern payment workflows for Alipay and WeChat Pay typically rely on a merchant-presented mode. In this scenario, your system generates a unique QR code for each transaction, which the customer then scans using their mobile app. This method is highly effective for both physical retail and digital storefronts because it removes the need for expensive card-reading hardware and reduces transaction friction.

When a customer uses a mobile wallet to pay, the transaction data is transmitted through encrypted channels to the payment provider. Using QR codes for payments allows for instant confirmation, as the provider notifies your backend the moment the user authorizes the funds. This real-time feedback loop is essential for businesses that need to trigger immediate order fulfillment or provide instant digital receipts.

Merchant Account Setup and API Requirements

Before you can generate a single payment code, you must register as a merchant with the respective platforms. For Alipay, U.S.-based businesses generally need to provide business registration paperwork, tax identification numbers, and bank account details. WeChat Pay requires similar documentation through the Tencent merchant portal, including proof of compliance with the PCI-DSS compliance guide to ensure the security of the payment environment.

Once your accounts are approved, you will be issued critical API credentials. These typically include:

  • A Unique Merchant ID (MCHID) or App ID.
  • API Keys or Secret Keys for request signing.
  • Webhook URLs for receiving asynchronous payment notifications.
  • Certificate files for secure RSA or SHA-256 communication.

These credentials allow your server to communicate with the payment gateways. For WeChat Pay, you will likely use the Native Payment Order Placement (v3) or Unified Order (v2) APIs. These interfaces require specific fields like `outtradeno` (your unique transaction ID), `totalfee`, and `notifyurl` to successfully initiate a transaction.

Generating Dynamic Payment QR Codes

The most secure way to handle transactions is through dynamic QR codes. Unlike a static code that always points to the same destination, a dynamic code is generated specifically for a single order. When your backend calls the Alipay or WeChat Pay API, the provider returns a `code_url` or an `orderCodeForm`. Your system then uses a QR code generator to turn that URL into a scannable image for the customer.

Dynamic payment flow

Dynamic codes offer significant security advantages. For instance, the `paymentExpiryTime` parameter can be set so the code expires after a few minutes, preventing unauthorized use of old transaction links. Additionally, dynamic QR codes allow you to track scan data in real time, giving you insight into when and where your customers are engaging with your payment touchpoints.

Create Secure Payment Codes Instantly Want to generate trackable and branded QR codes for your checkout process? Use the Dynamic QR Code Generator to build secure payment flows and monitor transaction performance today.

Security, Compliance, and Signature Validation

Security is the most critical component of payment integration. Both Alipay and WeChat Pay require all API requests and responses to be signed. This process involves creating a signature string based on the request method, URI, and body, then encrypting it with your private key. The payment provider uses your public key to verify that the message has not been tampered with during transit.

Beyond encryption, you must be aware of the risks in QR payments, such as malicious code replacement. To mitigate these risks:

  • Always validate the signature of incoming webhooks to ensure they actually originated from the payment provider.
  • Use TLS 1.2 or higher for all server-to-server communication.
  • Implement rate limiting on your payment initiation endpoints to prevent brute-force attacks.
  • Regularly audit your logs for unusual patterns, such as a high volume of initiated orders that never reach the payment confirmation stage.

By following these protocols, you ensure that your integration remains compliant with global financial regulations and protects your customers’ sensitive data.

Integration Scenarios for POS and E-commerce

In a physical retail setting, you can display the generated QR code on a customer-facing screen or print it directly onto a receipt. This allows the customer to scan a QR code in WeChat or Alipay instantly. For older POS systems that lack screens, many merchants use a printed “Payment Station” flyer that features a dynamic display or integrates with a third-party processor like Stripe to bridge the gap between physical and digital payments.

POS and online payments

For online stores, QR codes for e-commerce are typically embedded on the final checkout page. When the user selects Alipay or WeChat Pay as their method, the screen updates to show the transaction code. Once the customer scans and pays on their phone, the website uses a webhook to automatically redirect the user to a “Thank You” or confirmation page. This cross-device interaction has been shown to improve conversion rates, as seen in various e-commerce case studies where mobile wallet adoption simplified the user journey.

Before going live, always test your workflow in a sandbox environment. This allows you to simulate successful payments, expired codes, and refund scenarios without moving real currency. Once you are confident in the stability of your API calls, you can switch to the production environment and begin accepting global mobile payments.

Frequently Asked Questions

What is the difference between static and dynamic QR codes for payments?

Static codes contain a fixed link and are often used for simple peer-to-peer transfers, while dynamic codes are generated for each specific transaction. Dynamic codes are more secure because they include unique order IDs and can be set to expire after a certain period.

Do I need a special app to scan these payment codes?

No, customers use the built-in scanners within the Alipay or WeChat apps. Merchants can also verify the status of a transaction using a standard QR code scanner if they need to check the raw data during the testing or debugging phase.

How do I handle currency conversion for international customers?

Alipay and WeChat Pay typically handle the conversion from Chinese Yuan (CNY) to your local currency, such as USD, at the time of the transaction. You should check your merchant agreement for the specific exchange rates and settlement terms provided by your acquirer.

About the author

Siim Kostabi is the Content Lead at Pageloot. He writes about our innovative QR code generator services. With a profound expertise spanning over half a decade on QR codes, Siim is a subject matter expert in the field. He makes significant strides in leveraging QR technology to simplify and augment digital interactions.

Category
Learn more about
✅ The #1 Solution for QR Codes

If you need to create QR Codes online, you can Make a QR Code right here for free!
Pageloot is the #1 Go-To Solution to create and scan QR Codes.

Trusted by over 20 000 brands to get more sales, reviews & followers.

Client logos
Trusted by top brands
Rated 4.8 out of 5

4.86 / 5 stars rating

Hugo Laurent
Hugo Laurent
Restaurant owner
The most easy and reliable QR code Generator ever. PDF files can be uploaded instantly. Our restaurant menus are now digital.
Lucas Jansen
Lucas Jansen
Real estate developer
This is an excellent tool and the QR codes take you to just where you want. We only use the location QR code but there are so many useful features.
Emma Moretti
Emma Moretti
Retail products
Easy to use and quick. It works great and creates a perfect images, so employees can download my vCard.
Hugo Laurent
Hugo Laurent
Restaurant owner
The most easy and reliable QR code Generator ever. PDF files can be uploaded instantly. Our restaurant menus are now digital.
Lucas Jansen
Lucas Jansen
Real estate developer
This is an excellent tool and the QR codes take you to just where you want. We only use the location QR code but there are so many useful features.
Emma Moretti
Emma Moretti
Retail products
Easy to use and quick. It works great and creates a perfect images, so employees can download my vCard.
See More QR Codes
Bank customer scanning QR
QR Codes for Banks & Financial
Turn anything into a digital experience in less than 3 minutes.

Free 14-day trial.

No credit card required.

Get 30% off your first purchase

Use the code:

Share your MP3 files

Sign up to create PDF QR codes

Upload and display everything you need:

  • Audio files
  • Podcasts
  • Music

14-day free trial with sign-up.
QR codes expire after trial.

sign up to create an audio mp3 QR code

Get more scans with frames

Sign up to add more frames to your QR codes

Call-to-action frames help your customers interact with the QR Code easily. Try them out!

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to add more frames to your QR codes

Add more style with shapes

Signup to create more shapes

QR Codes don’t have to be square. Try switching it up to fit your brand’s image.

14-day free trial with sign-up.
QR codes expire after trial.

Signup to create more shapes

Add a logo to your QR Code

Sign up to add your logo to QR codes

Make your QR code stand out by adding your logo and brand to it.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to add your logo to QR codes

Smart App Store redirects

Sign up to create an app store QR code

Add your App links to our smart App Store QR Code. The users are redirected based on their device.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to create an app store QR code

Upload an image to a QR Code

Sign up to create image QR codes

Share your images easily. Change any image dynamically within seconds.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to create image QR codes

Share your PDF files

Sign up to create PDF QR codes

Upload and display everything you need:

  • Menus & price lists
  • Instructions
  • Any documents

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to create PDF QR codes

Edit later without printing

Sign up to edit your QR codes without printing again

Dynamic QR Codes let you change the contents of your QR Code without having to print new ones.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to edit your QR codes without printing again

When? Where? Track your QR Code scans

Sign up to track your QR codes

Discover which of your QR Codes receive the most scans and what excites your clients the most.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to track your QR codes

Print ready files available

Sign up to create vector QR codes like PDF and SVG

.EPS, .PDF, .SVG

Want to download your QR Codes in HD resolution? Get vector or pixel formats that are ready to be printed.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to create vector QR codes like PDF and SVG

Please wait. Your QR Code is loading... loading...

Make it your own

Sign up to save your QR code for later

Get more scans by creating awesome QR Codes with different colors, logos and call-to-action frames.

14-day free trial with sign-up.
QR codes expire after trial.

Sign up to save your QR code for later