取消 Order 对象

你可以对待支付状态的 order 对象进行取消动作,订单被取消后不能再次发起支付。订单在到达过期时间时仍未完成付款,Ping++ 会自动改变订单状态为已取消。订单如果使用优惠券,在取消后,会自动退回优惠券。

请求参数描述
ORDER_ID required stringPing++ 返回的 order 对象的 id,用于商品订单查询、退款,该参数仅需要填写在请求地址内。
status required string值填 canceled,表示更新 order 对象的状态。
user optional stringuser 对象的 id,传入该参数以检查是否和订单的 user 值一致,默认不检查。

返回

返回一个 order 对象,或者返回一个错误,详见 错误

定义

PUT https://api.pingxx.com/v1/orders/{ORDER_ID}
待补充
待补充
待补充
待补充
待补充
待补充
待补充

请求示例

curl https://api.pingxx.com/v1/orders/2001608270000004428 \
-H "Pingplusplus-Request-Timestamp: 1475029155" \
-H "Pingplusplus-Signature: SIGNATURE" \
-u sk_test_ibbTe5jLGCi5rzfH4OqPW9KC:
-d '
	{
	"status": "canceled",
  	"user": "user_007"
  	}'
待补充
待补充
待补充
待补充
待补充
待补充
待补充

返回示例

{
    "id": "2001708140000017551",
    "object": "order",
    "created": 1502695388,
    "livemode": false,
    "paid": false,
    "refunded": false,
    "status": "canceled",
    "app": "app_1Gqj58ynP0mHeX1q",
    "uid": "user_007",
    "available_balance": 0,
    "merchant_order_no": "2017081400000006",
    "amount": 1000,
    "actual_amount": 800,
    "amount_refunded": 0,
    "amount_paid": 0,
    "coupon_amount": 200,
    "currency": "cny",
    "subject": "Your Subject",
    "body": "Your Body",
    "client_ip": "127.0.0.1",
    "time_paid": null,
    "time_expire": 1502781019,
    "coupon": "300317081415225500002001",
    "description": "",
    "metadata": {},
    "charge_essentials": {},
    "receipt_app": "app_1Gqj58ynP0mHeX1q",
    "service_app": "app_1Gqj58ynP0mHeX1q",
    "available_methods": [],
    "charges": {
        "object": "list",
        "url": "/v1/charges",
        "has_more": false,
        "data": [
            {
                "id": "ch_1Kyn50DyjXbHbvnv5SGK4qDK",
                "object": "charge",
                "created": 1502695440,
                "livemode": false,
                "paid": false,
                "refunded": false,
                "reversed": false,
                "app": "app_1Gqj58ynP0mHeX1q",
                "channel": "alipay_qr",
                "order_no": "2017081400000006",
                "client_ip": "127.0.0.1",
                "amount": 800,
                "amount_settle": 800,
                "currency": "cny",
                "subject": "Your Subject",
                "body": "Your Body",
                "extra": {},
                "time_paid": null,
                "time_expire": 1502781019,
                "time_settle": null,
                "transaction_no": null,
                "refunds": null,
                "amount_refunded": 0,
                "failure_code": null,
                "failure_msg": null,
                "metadata": {},
                "credential": {},
                "description": null
            }
        ]
    }
}