1. VM Card operation V1 (only for accounts with a merchant public key configured before 2026-10-30)
VM_API
English
  • 简体中文
  • English
  • Integration Guide
  • Environment Configuration
  • Global Error Codes
  • Transaction Type Description
  • Card Status Description
  • VM Card operation V1 (only for accounts with a merchant public key configured before 2026-10-30)
    • Webhook Signature Verification
    • Get Account Balance
      POST
    • Get Card Product Code
      POST
    • Apply for Card
      POST
    • Card Details
      POST
    • Modify Card Limit(For credit line cards only)
      POST
    • Freeze/Unfreeze Card
      POST
    • Card Top-up(For prepaid cards only)
      POST
    • Card Refund(For prepaid cards only)
      POST
    • Transaction Records
      POST
    • Delete Card
      POST
    • Card List
      POST
    • Card Flow
      POST
  • VM Card operation V2 (available to all accounts, recommended)
    • Get Account Balance
      POST
    • Get Card Product Code
      POST
    • Apply for Card
      POST
    • Card Details
      POST
    • Modify Card Limit(For credit line cards only)
      POST
    • Freeze/Unfreeze Card
      POST
    • Card Top-up(For prepaid cards only)
      POST
    • Card Refund(For prepaid cards only)
      POST
    • Transaction Records
      POST
    • Delete Card
      POST
    • Card List
      POST
    • Card Flow
      POST
  • Notification
    • WebHook
    • Card 3DS Notification
  • Change Log
    • Change Log
  • FAQ
    • FAQ
  • Get accessToken
    GET
  • 数据模型
    • 示例数据模型
      • Pet
      • Category
      • Tag
  1. VM Card operation V1 (only for accounts with a merchant public key configured before 2026-10-30)

Webhook Signature Verification

1. Overview#

When VM sends a Webhook to a merchant callback URL, VM uses its private key to generate an RSA-SHA256 signature for the original HTTP request body.
After receiving the Webhook, the merchant should use the public key provided by VM to verify the signature and confirm that:
The message was signed by VM.
The request body was not modified during transmission.

2. Signature Rules#

ItemDescription
Signature algorithmRSA-SHA256
Digest algorithmSHA-256
RSA paddingPKCS#1 v1.5
RSA key length2048 bits
Signed contentThe exact original HTTP request body
Signature encodingBase64
Signature headerX-VM-SIGN
Character encodingUTF-8
Signature calculation:
signature = Base64(
    RSA_PKCS1_V1_5_SIGN(
        SHA256(raw_http_body),
        VM_private_key
    )
)

3. Webhook Request Example#

HTTP header names are case-insensitive. The following names are equivalent:
X-VM-SIGN
X-Vm-Sign
x-vm-sign
HTTP/2 and some web frameworks may automatically convert header names to lowercase. This is expected behavior.

4. Signature Verification Process#

1.
Read the original HTTP request body.
2.
Read the X-VM-SIGN request header.
3.
Base64-decode the signature.
4.
Use the VM Webhook verification public key to perform RSA-SHA256 signature verification.
5.
Parse and process the JSON only after signature verification succeeds.
6.
Reject the message if signature verification fails.
The original HTTP request body must be used for verification. Do not parse the JSON and serialize it again before verification. Any changes to whitespace, line breaks, field order, or escaping may cause signature verification to fail.

5. PHP Verification Example#

6. Public Key#

The merchant must use the VM Webhook verification public key.
How to obtain: Log in to the VM Console and go to Personal Center -> Developer. Get the Sandbox public key from the Sandbox console (https://sandbox.vmcardio.com/) and the Production public key from the production console (https://vmcardio.com/).
The public key format is as follows:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA*************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
****************************************************************
*****************************************************IDAQAB
-----END PUBLIC KEY-----
The above is a format example only (the middle content is replaced with *); do not use it directly. Copy the actual public key from the Developer page, keeping the first and last lines and every line break in between.
Notes:
Do not use the merchant's own public key for verification.
Do not use the API public key configured for the merchant's requests to VM.
VM's private key will not be provided to the merchant.
Sandbox and Production public keys are different; obtain them separately and do not use one for the other.
Only obtain the public key from the console Developer page; do not use a public key forwarded by others.
修改于 2026-11-05 05:40:07
上一页
Card Status Description
下一页
Get Account Balance
Built with