Skip to content

Brief Description

  • 代收下单接口

Solicited Message

  • Request URL

    javascript
    https://www.xxx.com/gateway/recharge
  • 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 CreateOrderParams {
      merchant_no: string
      order_no: string
      amount: string
      remark: string
      customer: string
      ip: string
      callback_url: string
      return_url: string
      time: string
      sign: string
    }
    
    // Example function: Send order creation request
    async function createOrder(params: CreateOrderParams) {
      try {
        const response = await axios.post('https://api.example.com/gateway/recharge', params)
        console.log('Success:', response.data)
        return response.data
      } catch (error: any) {
        if (error.response) {
          // The error response returned by the server side
          console.error('API Error:', error.response.data)
        } else {
          // Network error or other issues
          console.error('Request Failed:', error.message)
        }
        throw error
      }
    }
    
    // Example call
    createOrder({
      merchant_no: 'M1234567890',
      order_no: 'ORD1234567890',
      amount: '100.00',
      remark: 'Test order',
      customer: 'user123',
      ip: '192.168.1.1',
      callback_url: 'https://yourapp.com/callback',
      return_url: 'https://yourapp.com/return',
      time: Date.now().toString(),
      sign: 'your_generated_signature_here'
    })

  • Request Parameter List

    Parameter NameRequiredTypeexplain
    merchant_nostringmerchant identification number
    order_nostringMerchant Order Number
    amountstringamount
    remarkstringremark
    customerstringuser ID
    ipstringuser IP
    callback_urlstringSuccessful callback address
    return_urlstringSuccessful Jumping Address
    timestringtimestamp
    signstringsign

Response Message

  • Response Example

json
{
  "code": "0",
  "msg": "",
  "data": {
    "hash": "def50200d53b9e1f830a35165aeebae8baa18ef3806e5300cf412ec91c08577df3a1d27f00f46197c55c4c66a5dc6f11d1528c96a8b9a5c4a8281a2e577c47384ae036bee45721dea7595a58d89b482eea66e20043dcb79404",
    "trade_no": "RR241115223531937981",
    "qr_code": "rsn://r/RR241115223531937981",
    "url": "https://xxxxxx/?hash=def50200d53b9e1f830a35165aeebae8baa18ef3806e5300cf412ec91c08577df3a1d27f00f46197c55c4c66a5dc6f11d1528c96a8b9a5c4a8281a2e577c47384ae036bee45721dea7595a58d89b482eea66e20043dcb79404",
    "pay_timeout": 3600
  }
}

  • Response parameter list

    Parameter NameTypeexplain
    hashstringThe encrypted order ID
    trade_nostringorder number
    qr_codestringQR code
    urlstringjump link
    pay_timeoutnumberExpiration time (the number of seconds until the order expires)


remark

  • For more questions regarding 代收下单接口 , please contact the administrator.
  • Date updated: 2024-04-25