askill
binance-pay

binance-paySafety 90Repository

Binance Pay integration for crypto payments. Send, receive, and accept cryptocurrency payments with the world's largest exchange.

0 stars
1.2k downloads
Updated 2/7/2026

Package Files

Loading files...
SKILL.md

Binance Pay 🟑

Crypto payment solution powered by Binance, the world's largest cryptocurrency exchange.

Environment Variables

VariableDescriptionRequired
BINANCE_PAY_API_KEYMerchant API KeyYes
BINANCE_PAY_SECRETAPI Secret KeyYes
BINANCE_PAY_MERCHANT_IDMerchant IDYes

Features

  • πŸ’Έ C2C Transfers - Send crypto to Binance users (0 fee)
  • πŸ›’ Merchant Payments - Accept crypto payments
  • πŸ”„ Refunds - Process payment refunds
  • πŸ“Š Order Management - Track payment status
  • 🌍 200M+ Users - Access to Binance ecosystem

API Base URL

https://bpay.binanceapi.com

Authentication

API_KEY="${BINANCE_PAY_API_KEY}"
SECRET="${BINANCE_PAY_SECRET}"
TIMESTAMP=$(date +%s%3N)
NONCE=$(openssl rand -hex 16)

# Generate signature
generate_signature() {
  local payload="$1"
  local sign_string="${TIMESTAMP}\n${NONCE}\n${payload}\n"
  echo -n "$sign_string" | openssl dgst -sha512 -hmac "$SECRET" | cut -d' ' -f2 | tr '[:lower:]' '[:upper:]'
}

Create Payment Order

PAYLOAD='{
  "env": {
    "terminalType": "WEB"
  },
  "merchantTradeNo": "'"$(date +%s)"'",
  "orderAmount": "10.00",
  "currency": "USDT",
  "goods": {
    "goodsType": "01",
    "goodsCategory": "D000",
    "referenceGoodsId": "product-001",
    "goodsName": "Product Name"
  }
}'

SIGNATURE=$(generate_signature "$PAYLOAD")

curl -s -X POST "https://bpay.binanceapi.com/binancepay/openapi/v2/order" \
  -H "Content-Type: application/json" \
  -H "BinancePay-Timestamp: ${TIMESTAMP}" \
  -H "BinancePay-Nonce: ${NONCE}" \
  -H "BinancePay-Certificate-SN: ${API_KEY}" \
  -H "BinancePay-Signature: ${SIGNATURE}" \
  -d "$PAYLOAD" | jq '.'

Query Order Status

PAYLOAD='{
  "merchantTradeNo": "<ORDER_ID>"
}'

SIGNATURE=$(generate_signature "$PAYLOAD")

curl -s -X POST "https://bpay.binanceapi.com/binancepay/openapi/v2/order/query" \
  -H "Content-Type: application/json" \
  -H "BinancePay-Timestamp: ${TIMESTAMP}" \
  -H "BinancePay-Nonce: ${NONCE}" \
  -H "BinancePay-Certificate-SN: ${API_KEY}" \
  -H "BinancePay-Signature: ${SIGNATURE}" \
  -d "$PAYLOAD" | jq '.'

Close Order

PAYLOAD='{
  "merchantTradeNo": "<ORDER_ID>"
}'

SIGNATURE=$(generate_signature "$PAYLOAD")

curl -s -X POST "https://bpay.binanceapi.com/binancepay/openapi/v2/order/close" \
  -H "Content-Type: application/json" \
  -H "BinancePay-Timestamp: ${TIMESTAMP}" \
  -H "BinancePay-Nonce: ${NONCE}" \
  -H "BinancePay-Certificate-SN: ${API_KEY}" \
  -H "BinancePay-Signature: ${SIGNATURE}" \
  -d "$PAYLOAD" | jq '.'

Process Refund

PAYLOAD='{
  "refundRequestId": "'"$(date +%s)"'",
  "prepayId": "<PREPAY_ID>",
  "refundAmount": "5.00"
}'

SIGNATURE=$(generate_signature "$PAYLOAD")

curl -s -X POST "https://bpay.binanceapi.com/binancepay/openapi/v2/order/refund" \
  -H "Content-Type: application/json" \
  -H "BinancePay-Timestamp: ${TIMESTAMP}" \
  -H "BinancePay-Nonce: ${NONCE}" \
  -H "BinancePay-Certificate-SN: ${API_KEY}" \
  -H "BinancePay-Signature: ${SIGNATURE}" \
  -d "$PAYLOAD" | jq '.'

Supported Currencies

CurrencyTypeMin Amount
USDTStablecoin0.01
BUSDStablecoin0.01
USDCStablecoin0.01
BTCCrypto0.00001
ETHCrypto0.0001
BNBCrypto0.001

Webhook Events

EventDescription
PAYPayment completed
REFUNDRefund processed
CANCELOrder cancelled

Webhook Verification

# Verify webhook signature
verify_webhook() {
  local payload="$1"
  local received_sig="$2"
  local timestamp="$3"
  local nonce="$4"
  
  local sign_string="${timestamp}\n${nonce}\n${payload}\n"
  local expected_sig=$(echo -n "$sign_string" | openssl dgst -sha512 -hmac "$SECRET" | cut -d' ' -f2 | tr '[:lower:]' '[:upper:]')
  
  [[ "$received_sig" == "$expected_sig" ]]
}

Order Status Codes

StatusDescription
INITIALOrder created
PENDINGAwaiting payment
PAIDPayment successful
CANCELEDOrder cancelled
REFUNDINGRefund in progress
REFUNDEDRefund completed
EXPIREDOrder expired

Safety Rules

  1. ALWAYS verify webhook signatures
  2. NEVER expose API secrets
  3. ALWAYS use idempotent merchantTradeNo
  4. CHECK order status before fulfilling

Links

Install

Download ZIP
Requires askill CLI v1.0+β–Ά

AI Quality Score

95/100Analyzed 2/12/2026

Excellent, production-ready skill for Binance Pay integration. It provides complete bash implementations for authentication, order management, and webhook verification, supported by clear reference tables and safety guidelines.

90
95
90
95
95

Metadata

Licenseunknown
Version-
Updated2/7/2026
PublisherYPYT1

Tags

apisecurity