当付款被用户、合作伙伴或自动取消时,艾克索拉发送order_canceled
webhook到指定的URL。
order_canceled
webhook包含退货商品、付款信息和取消的交易的详细信息。
如果付款不成功,则不会发送order_canceled
webhook,例如:
建议order_canceled
webhook的处理时间小于3秒。
notification_type required | string 通知类型。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | Array of version = 1 (object) or version = 2 (object) 用户所购商品的列表。 The set of parameters included in the array depends on the webhook version.
Version 2 includes additional parameters: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array One of: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | object 订单信息。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | object 用户信息。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object 交易和付款详细信息。 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
custom_parameters | object 附加信息。 |
返回以指示处理成功。
提供的信息出错时返回(例如,缺少必需的参数、授权失败等)。
curl -v 'https://your.hostname/your/uri' \ -X POST \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Signature d09695066c52c1b8bdae92f2d6eb59f5b5f89843' \ -d '{ "notification_type": "order_canceled", "items": [ { "sku": "com.xsolla.v.item_1", "type": "virtual_good", "is_pre_order": false, "quantity": 3, "amount": "1000", "promotions": [ { "amount_without_discount": "6000", "amount_with_discount": "5000", "sequence": 1 }, { "amount_without_discount": "5000", "amount_with_discount": "4000", "sequence": 2 } ], "custom_attributes": { "purchased": 0, "attr": "value" } }, { "sku": "com.xsolla.v.item_new_1", "type": "bundle", "is_pre_order": false, "quantity": 1, "amount": "1000", "promotions": [] }, { "sku": "com.xsolla.gold_1", "type": "virtual_currency", "is_pre_order": false, "quantity": 1500, "amount": "[null]", "promotions": [] } ], "order": { "id": 1, "mode": "default", "currency_type": "virtual", "currency": "sku_currency", "amount": "2000", "status": "paid", "platform": "xsolla", "comment": null, "invoice_id": "1", "promotions": [ { "amount_without_discount": "4000", "amount_with_discount": "2000", "sequence": 1 } ], "promocodes": [ { "code": "promocode_some_code", "external_id": "promocode_sku" } ], "coupons": [ { "code": "WINTER2021", "external_id": "coupon_sku" } ] }, "user": { "external_id": "id_xsolla_login_1", "email": "email@example.com" }, "billing": { "notification_type": "refund", "settings": { "project_id": 18404, "merchant_id": 2340 }, "purchase": { "subscription": { "plan_id": "b5dac9c8", "subscription_id": "10", "date_create": "2014-09-22T19:25:25+04:00", "currency": "USD", "amount": 9.99 }, "total":{ "currency": "USD", "amount": 200 } }, "transaction": { "id": 1, "external_id": 1, "dry_run": 1, "agreement": 1 }, "refund_details": { "code": 4, "reason": "Potential fraud" }, "payment_details": { "sales_tax": { "currency": "USD", "amount": 0 }, "direct_wht": { "currency": "USD", "amount": 0.70 }, "xsolla_fee": { "currency": "USD", "amount": "10" }, "payout": { "currency": "USD", "amount": "200" }, "payment_method_fee": { "currency": "USD", "amount": "20" }, "payment": { "currency": "USD", "amount": "230" }, "repatriation_commission": { "currency": "USD", "amount": 10 } } } }'