Submit Earning
The Earning Transaction API allows you to record or track customer earning transactions. This API handles the process of adding points or rewards to a customer's account based on specific actions or c
Earning Transaction
POST /earning
This endpoint processes and tracks earning transactions for customers
Headers
Accept
application/json
Authorization
Bearer <token>
Body
client_code
string
client identifier
customer_phone
string
Phone of Customer. Optional, if customer_id is filled
customer_id
number
Id of Customer. Optional, if customer_phone is filled
transactions[x][transaction_date]
DateTime
Transaction Date [Required, Date Format: yyyy-mm-dd hh:ii]
transactions[x][store_id]
number
Merchant ID [Required, Integer, Exists on Master Store]
transactions[x][payment_id]
number
Payment ID [Required, Integer, Exists on Master Payment]
transactions[x][amount]
number
Amount [Required, Numeric]
transactions[x][note]
string
Note [Optional]
Response
{
"status": "success",
"status_code": 200,
"message": "Earning success.",
"data": [
{
"id": 316523,
"card_type_multiplier": 1,
"receipt_number": "EA/24/00000025",
"transaction_date": "2024-10-01",
"amount": 150000,
"points": {
"redeem_point": {
"regular": 0,
"reward": 0,
"bonus": 0
},
"lucky_draw_point": {
"regular": 0,
"reward": 0,
"bonus": 0
},
"lucky_draw_numbers": {
"from": "",
"to": ""
}
},
"receipt_type": "combine",
"posted_by": "paintpro-h2h",
"status": "success",
"voided": {
"by": null,
"at": null
},
"adjusted": {
"by": null,
"at": null
},
"card_type": {
"id": 202,
"name": "REGULAR CARD",
"target_amount": 0,
"minimum_expense": 0,
"multiplier_point": 1,
"expired_period": 9999,
"level_up_evaluation_days": 365,
"level_down_evaluation_days": 365,
"default": true,
"active": true,
"image": null,
"benefits": []
},
"details": [
{
"id": 343698,
"transaction_date": "2024-10-01 10:00:00",
"amount": 150000,
"note": "Example Note",
"invoice_photo": null,
"store": {
"id": 3016,
"code": "001",
"name": "Default Tenant",
"name_with_client": "Paint Pro - Default Tenant",
"contact_name": null,
"contact_email": null,
"contact_phone": null,
"note": "",
"unit": null,
"floor": "",
"longitude": 0,
"latitude": 0,
"altitude": 0,
"image": null,
"active": 1
},
"payment": {
"id": 433,
"code": "001",
"name": "Cash"
}
}
]
}
]
}{
"status_code": 422,
"status": "error",
"message": "The selected transactions.0.payment_id is invalid.",
"errors": [
"The selected transactions.0.payment_id is invalid."
]
}Last updated