您如何知道礼品卡与Shopify订单一起使用

时间:2017-11-06 16:55:24

标签: shopify orders

如果客户使用礼品卡支付全部或部分订单,我们如何从订单详情中了解该金额?有没有办法总结订单上使用的礼品卡的总金额?

1 个答案:

答案 0 :(得分:1)

您可以使用Transactions API接收此信息。 Shopify上的每个订单可能有多个交易。在交易对象中,您可以找到有关礼品卡ID和金额的信息

例如

使用礼品卡和COD订购支付GET /admin/orders/#{id}/transactions.json方法的回复:

{
    "transactions": [{
        "id": 89999999999,
        "order_id": 9999999999,
        "amount": "25.00",
        "kind": "sale",
        "gateway": "gift_card",
        "status": "success",
        "message": null,
        "created_at": "2017-09-28T16:34:41+04:00",
        "test": false,
        "authorization": null,
        "currency": "AED",
        "location_id": null,
        "user_id": null,
        "parent_id": null,
        "device_id": null,
        "receipt": {
            "gift_card_id": 999999,
            "gift_card_last_characters": "98h8"
        },
        "error_code": null,
        "source_name": "web"
    }, {
        "id": 89999999999,
        "order_id": 9999999999,
        "amount": "875.00",
        "kind": "sale",
        "gateway": "Cash on Delivery (COD)",
        "status": "pending",
        "message": "Pending the Cash on Delivery (COD) payment from the buyer",
        "created_at": "2017-09-28T16:34:41+04:00",
        "test": false,
        "authorization": null,
        "currency": "AED",
        "location_id": null,
        "user_id": null,
        "parent_id": null,
        "device_id": null,
        "receipt": {},
        "error_code": null,
        "source_name": "web"
    }, {
        "id": 89999999999,
        "order_id": 9999999999,
        "amount": "875.00",
        "kind": "sale",
        "gateway": "Cash on Delivery (COD)",
        "status": "success",
        "message": "Marked the Cash on Delivery (COD) payment as received",
        "created_at": "2017-10-02T19:13:35+04:00",
        "test": false,
        "authorization": null,
        "currency": "AED",
        "location_id": null,
        "user_id": null,
        "parent_id": 777777777,
        "device_id": null,
        "receipt": {},
        "error_code": null,
        "source_name": "web"
    }]
}