VNPay / MoMo / ZaloPay / OnePay Signature Checker

Build signed VNPay, MoMo, ZaloPay and OnePay requests, verify return URLs, IPNs and callbacks, and see the exact signed string to fix “invalid signature”.

Free tool: 20 requests per minute.

Result

Press “Run” to see the result.

action=create builds a ready request: the VNPay payment URL (vnp_ fields sorted, encoded like PHP urlencode, HMAC-SHA512 vnp_SecureHash, API 2.1.0), the MoMo v2 body with its HMAC-SHA256 signature over the fixed rawSignature, the ZaloPay order with mac = HMAC-SHA256(key1, app_id|app_trans_id|app_user|amount|app_time|embed_data|item), or the OnePay URL with the upper-case HMAC-SHA256 vpc_SecureHash (hex-decoded secure secret, sorted vpc_ / user_ fields). action=query signs the MoMo and ZaloPay status queries.

action=verify takes the return URL / IPN query string (query) or the JSON body (fields) and recomputes the signature: valid, the expected and received values, the decoded order id, amount and response code, and signed_data – the exact string that was signed. Send your own signed string in signed_data and the answer points to the first character that differs. ZaloPay callbacks (data + mac, key2) and redirect checksums are supported. action=codes explains vnp_ResponseCode, vnp_TransactionStatus, MoMo resultCode, ZaloPay return_code / sub_return_code and OnePay vpc_TxnResponseCode in Vietnamese and English.

The API never contacts the gateways and never stores or returns the secret (secret, or key1 / key2 for ZaloPay). Use sandbox credentials while developing; keep production secrets on your own server.

Use this in your code

curl -X POST "https://apibox.io.vn/v1/vn-pay-gateway" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider":"vnpay","action":"create","secret":"SANDBOXSECRETKEY0123456789ABCDEF","tmn_code":"DEMOV210","amount":150000,"order_id":"DH001","order_info":"Thanh toan don hang DH001","return_url":"https://shop.example/vnpay_return","create_date":"20261115103000","expire_date":"20261115104500"}'

API documentation → Get a free API key

FAQ

Why does my VNPay signature not match?

Usually the encoding: VNPay signs keys and values encoded like PHP urlencode (space = “+”), sorted by name, without vnp_SecureHash. Compare signed_data with your string – the API shows the first difference.

Is my secret safe?

It is only used in memory to compute the HMAC; it is not logged or returned. For production keys, prefer computing the signature on your own server.

Does the API send the payment to the gateway?

No. It only builds and checks signatures; your server calls the gateway.