For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/close.md.
  • English
  • Close Order

    Close an order whose payment has not completed. The current Allinpay/KPay route rejects PAID orders by default; use the enabled refund flow to return funds for a paid order. Query the final outcome when closing races with payment.

    API Information

    • Endpoint: POST https://api.aimt-horizon.com/mis/close
    • Signature: Uses terminal_sn + terminal_key

    Request Parameters

    ParameterTypeRequiredDescription
    terminal_snString(32)YesTerminal SN
    out_trade_noString(32)YesMerchant order number (from the original tradePush)
    cancel_reasonString(20)YesReason for cancellation (max 20 characters)
    target_device_idString(20)YesTarget payment device ID
    cancel_notify_urlString(128)NoCallback URL for cancellation result notification
    biz_sourceStringNoBusiness source; defaults to "mis"
    client_ipStringNoRequester IP address

    Request Example

    {
      "terminal_sn": "2101107140290972547",
      "out_trade_no": "SG20261022001",
      "cancel_reason": "Customer cancelled",
      "target_device_id": "TUSN12345678",
      "biz_source": "mis"
    }

    Response (Accepted; Query Required)

    {
      "result_code": "200",
      "error_message": null,
      "error_code": null,
      "biz_response": {
        "result_code": "MIS_PUSH_SUCCESS",
        "error_code": null,
        "error_message": null
      }
    }

    Response Example (Failure)

    {
      "result_code": "200",
      "error_message": null,
      "error_code": null,
      "biz_response": {
        "result_code": "MIS_PUSH_FAIL",
        "error_code": "TERMINAL_SN_UN_BIND",
        "error_message": "Terminal SN is unbound, push failed"
      }
    }
    Important
    • Query first; payment can still complete afterward. Query again if closing is rejected because the order is paid. Unpaid orders remain subject to pre-cancel conditions and channel/device support. MIS_PUSH_SUCCESS only acknowledges acceptance and must not mark the local order as canceled.
    • out_trade_no must match the original order pushed via tradePush.
    • ORDER_CLOSE_ABORT_IN_PROGRESS is pending; on PAY_TYPE_CANCEL_NOT_SUPPORTED, follow the device flow and query before choosing another action.
    • Always verify the cancellation result via callback or Query API before confirming to the customer.