Skip to content

Brief Description

  • 用户直冲接口

Solicited Message

  • Request URL

    javascript
    https://www.xxx.com/h5/deposit
  • Request Specification

    Basic Information

    • Interface Protocol:HTTPS
    • Data Format:application/json
    • Request Method:POST
  • Request Example

    typescript
    
    // typescript + axios Request Example
    import axios from 'axios'
    
    // Define the types of request parameters
    interface CreateRechargeParams {
        merchant_no: string
        member_id: string
        order_no: string
        amount: string
        callback_url: string
        return_url: string
        remark: string
        ip: string
        time: string
        sign: string
    }
    
    // 发起充值请求
    async function createRechargeOrder(params: CreateRechargeParams) {
        try {
            const response = await axios.post('https://api.example.com/h5/deposit', params)
            console.log('Recharge Success:', response.data)
            return response.data
        } catch (error: any) {
            if (error.response) {
              console.error('API Error:', error.response.data)
            } else {
              console.error('Request Failed:', error.message)
            }
            throw error
        }
    }
    
    // Example call
    createRechargeOrder({
        merchant_no: 'M1234567890',
        member_id: 'user_001',
        order_no: 'ORD20250425001',
        amount: '500.00',
        callback_url: 'https://yourapp.com/api/callback',
        return_url: 'https://yourapp.com/success',
        remark: 'Recharge to wallet',
        ip: '192.168.1.88',
        time: Date.now().toString(),
        sign: 'your_generated_signature_here'
    })

  • Request Parameter List

    Parameter NameRequiredTypeexplain
    merchant_nostringmerchant identification number
    member_idstringuser ID
    order_nostringMerchant Order Number
    amountstringrecharge amount
    callback_urlstringloopback address
    return_urlstringJumping to URL
    remarkstringremark
    ipstringuser IP
    timestringtimestamp
    signstringsign

Response Message

  • Response Example

json
{
  "code": "0",
  "msg": "",
  "data": {
    "trade_no":"asdf43fsfsdfasdgdfsfdz",
    "status":"pending",//pending,success
    "deposit_page_url": "http://xxxxxxx.com/xxx?token=xff3f3f3f3f&transaction_id=3r3f3f3f3f"
  }
}

  • Response parameter list

    Parameter NameTypeexplain
    trade_nostringorder number
    statusstringstatus(pending, success)
    deposit_page_urlstringLink to the recharge page


remark

  • For more questions regarding 用户直冲接口 , please contact the administrator.
  • Date updated: 2024-04-24