HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Store Credit History

Data structure of Store Credit History

FieldColumn TypeDescriptionExample
_idStringRecord ID
紀錄 ID
5f55ad58d9ce6d003c1fd62f
customer_idStringCustomer ID
顧客 ID
5f47c96a86a983001614a834
credit_balanceIntegerCredit balance after this record
此紀錄後的購物金餘額
160
remarksStringCredit Change Reason
購物金更動原因
hello
valueIntegerThe value of this store credit record
此筆購物金金額
20
fulfillment_balanceIntegerFulfillment Balance (內部開發使用參數,可忽略)

(For internal usage, please ignore it)
10
end_atDateTimeExpiry Date
到期日
2021-11-30T00:00:00.000+00:00

if null, means no expiration date
performer_nameStringStaff who created this record
創建紀錄的管理員
staff1
typeStringStore credit type
購物金類型
----
manual_credit
welcome_credit
birthday_credit
auto_reward
applied_credit
user_credit_expired
welcome_member_referral_credit
member_referral_credit
manual_credit
created_atDateTimeRecord creation date
創建紀錄日期
2020-09-07T03:47:44.061Z
is_redeemBooleanThis store credit record is redeemed or not
此筆購物金是否被兌換
true means this store credit was already used (true for store credit deduction)
true 代表兌換購物金

false means still available (false for store credit increment)
false 代表新增購物金

Please refer to Example 2 (JSON Sample) for store credit records mapping.

690

JSON Sample

{
    "_id": "60cb0981adce280017608e1b",
    "customer_id": "5d8aeef5a7c9dd1c75263b98",
    "credit_balance": 100,
    "remarks": "10 credits",
    "value": 100,
    "fulfillment_balance": null,
    "end_at": "2021-11-30T00:00:00.000+00:00",
    "performer_id": "5d8aed1bb31a6800336a548f",
    "performer_name": "philip+postman",
    "type": "manual_credit",
    "created_at": "2021-06-17T08:36:17.152Z",
    "customer_ref_user_id": "test01",
    "status": "active",
    "is_redeem": false,
    "order_id": null,
    "value_dollar": null,
    "user_credit_rule_id": null,
    "order_wapos_id": null,
    "order_number": null,
    "merchant_order_number": null,
    "order_created_by": null
}
{
    "items": [
        {
            "_id": "6229c918144b53004ad62e8f",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 2340,
            "remarks": "2222",
            "value": 50,
            "fulfillment_balance": 0,
            "end_at": null,
            "performer_id": "61235f9b0add5d00441a5118",
            "performer_name": "Sadmin_SandyShop",
            "type": "manual_credit",
            "created_at": "2022-03-10T09:47:04.574Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": false,
            "order_id": null,
            "value_dollar": {
                "cents": 50,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$50",
                "dollars": 50.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        },
        {
            "_id": "6229c874144b530044d62e8e",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 2290,
            "remarks": "tedt",
            "value": 100,
            "fulfillment_balance": 100,
            "end_at": "2022-03-20T15:59:59.999+00:00",
            "performer_id": "61235f9b0add5d00441a5118",
            "performer_name": "Sadmin_SandyShop",
            "type": "manual_credit",
            "created_at": "2022-03-10T09:44:20.475Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": false,
            "order_id": null,
            "value_dollar": {
                "cents": 100,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$100",
                "dollars": 100.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        },
        {
            "_id": "6229c7f4144b53004ad62e8e",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 2190,
            "remarks": "asddas",
            "value": 2100,
            "fulfillment_balance": 0,
            "end_at": null,
            "performer_id": "61235f9b0add5d00441a5118",
            "performer_name": "Sadmin_SandyShop",
            "type": "manual_credit",
            "created_at": "2022-03-10T09:42:12.499Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": false,
            "order_id": null,
            "value_dollar": {
                "cents": 2100,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$2,100",
                "dollars": 2100.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        },
        {
            "_id": "622983c1144b530044eab481",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 90,
            "remarks": "1111",
            "value": 10,
            "fulfillment_balance": 0,
            "end_at": null,
            "performer_id": "61235f9b0add5d00441a5118",
            "performer_name": "Sadmin_SandyShop",
            "type": "manual_credit",
            "created_at": "2022-03-10T04:51:13.855Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": true,
            "order_id": null,
            "value_dollar": {
                "cents": 10,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$10",
                "dollars": 10.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        },
        {
            "_id": "6229839a144b530047eab481",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 100,
            "remarks": "szdad",
            "value": 100,
            "fulfillment_balance": 90,
            "end_at": "2022-03-20T15:59:59.999+00:00",
            "performer_id": "61235f9b0add5d00441a5118",
            "performer_name": "Sadmin_SandyShop",
            "type": "manual_credit",
            "created_at": "2022-03-10T04:50:34.756Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": false,
            "order_id": null,
            "value_dollar": {
                "cents": 100,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$100",
                "dollars": 100.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        },
        {
            "_id": "6225849da5c5c501c9bc34f9",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 0,
            "remarks": "",
            "value": 50,
            "fulfillment_balance": 0,
            "end_at": null,
            "performer_id": null,
            "performer_name": null,
            "type": "applied_credit",
            "created_at": "2022-03-07T04:05:49.903Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": true,
            "order_id": "6225849da5c5c501c9bc34f1",
            "value_dollar": {
                "cents": 50,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$50",
                "dollars": 50.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": "20220307040549844",
            "merchant_order_number": null,
            "order_created_by": "shop"
        },
        {
            "_id": "62258380a5c5c501c5bc34f0",
            "customer_id": "62258363b9675500171c4e2e",
            "credit_balance": 50,
            "remarks": null,
            "value": 50,
            "fulfillment_balance": 0,
            "end_at": null,
            "performer_id": "60eeb3fee7812d00400a4b0f",
            "performer_name": null,
            "type": "welcome_credit",
            "created_at": "2022-03-07T04:01:04.344Z",
            "customer_ref_user_id": null,
            "status": "active",
            "is_redeem": false,
            "order_id": null,
            "value_dollar": {
                "cents": 50,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$50",
                "dollars": 50.0
            },
            "user_credit_rule_id": null,
            "order_wapos_id": null,
            "order_number": null,
            "merchant_order_number": null,
            "order_created_by": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "per_page": 24,
        "total_pages": 1,
        "total_count": 7
    }
}