Skip to content

Pay

POST /upay/v2/pay

Pay creates a merchant-initiated payment request. The consumer completes payment through the configured payment method or provider flow.

Request

FieldTypeRequiredDescription
terminal_snstring(32)YesTerminal serial number.
client_snstring(32)YesUnique order number in the client system.
total_amountstring(10)YesAmount in cents.
paywaystringNoProvider override. Omit to infer from the payment credential when supported.
dynamic_idstring(32)YesPayment credential or provider payment token supplied by the consumer/provider flow.
subjectstring(64)YesTransaction subject.
operatorstring(32)YesCashier or operator identifier.
descriptionstring(255)NoDetailed transaction description.
longitude / latitudestringNoMust be supplied together.
device_idstring(32)NoTerminal device identifier.
extendedobjectNoProvider extension fields, maximum 24 keys.
goods_detailsarrayNoGoods list; see Reference.
reflectstring(64)NoValue echoed back for client reconciliation.
notify_urlstring(128)NoCallback URL for payment result.

client_sn is an idempotency boundary for one payment attempt. If the first payment attempt fails and the customer retries a new payment, use a new client_sn.

Example

bash
curl -X POST 'https://vsi-api.shouqianba.com/upay/v2/pay' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: 10298371039 <md5-of-raw-body-plus-terminal-key>' \
  -d '{"terminal_sn":"10298371039","client_sn":"MEX202605220001","total_amount":"1000","dynamic_id":"130818341921441147","subject":"MUWE test order","operator":"cashier01","notify_url":"https://partner.example.mx/muwe/notify"}'

Success

json
{
  "result_code": "200",
  "biz_response": {
    "result_code": "PAY_SUCCESS",
    "data": {
      "sn": "7893259247405832",
      "client_sn": "MEX202605220001",
      "status": "SUCCESS",
      "order_status": "PAID",
      "payway": "3",
      "sub_payway": "1",
      "total_amount": "1000",
      "net_amount": "1000",
      "subject": "MUWE test order",
      "operator": "cashier01",
      "finish_time": "1779436800000"
    }
  }
}

In Progress

json
{
  "result_code": "200",
  "biz_response": {
    "result_code": "PAY_IN_PROGRESS",
    "data": {
      "sn": "789200393929142",
      "client_sn": "MEX202605220001",
      "status": "IN_PROG",
      "order_status": "CREATED",
      "total_amount": "1000"
    }
  }
}

Recovery

  • PAY_SUCCESS: deliver goods.
  • PAY_FAIL: do not deliver goods; use a new client_sn for a new payment attempt.
  • PAY_IN_PROGRESS or network timeout: query by client_sn.
  • If polling cannot prove success before merchant timeout, call cancel.

MUWE OpenAPI documentation for bank and payment partners.