# 5. Point accumulation API

1. Point accumulation history

URL: <https://apiring.antbuddy.com/history-point?type=point>

Method: GET

Content-Type: application/json

| **Parameters**     | **Type** | **Required** | **Explain**                              |
| ------------------ | -------- | ------------ | ---------------------------------------- |
| createdAtRangeFrom | number   |              | Start time                               |
| createdAtRangeTo   | number   |              | End time                                 |
| phone              | String   |              | Customer phone number                    |
| email              | String   |              | Customer email                           |
| page               | number   |              | Page number, maximum 20 records per page |

Results returned:

HTTP Response Code: 200

Response:

\[{

"type": 1, // cumulative type

"score": 100, // accumulated points

"status": 1, // accumulated status (success: 1, failure: 0)

"product": {

"code": "TIVI01", // cumulative product code

"name": "TV", // cumulative product name

"id": "64d9f28b2b3ba308b322c710"

},

"contact": {

"phones": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a8",

"value": "0867123456"

}

],

"name": "Garnacho",

"emails": \[

{

"type": "Work",

"\_id": "64db290a7796fe24bfe876a9",

"value": "<garnacho@gmail.com>"

}

],

"lastname": "",

"customerId": 475,

"id": "64db290a7796fe24bfe876a7"

},

"org": "62c10674cbe832bc9245a5b8",

"code": "TIVInpmx8b98pfg", // cumulative code

"serialNumber": "npmx8b98pfg", // serial number tích luỹ

"createdAt": 1692084490615, // accumulated time

"id": "64db290a7796fe24bfe876b4" }]

2. Accumulate points

URL: <https://apiring.antbuddy.com/accumulate>

Method: POST

Content-Type: application/json

| **Parameters** | **Type** | **Required** | **Explain**                                                                                                                                                                                                                                                                    |
| -------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| code           | string   | AND          | Cumulative code                                                                                                                                                                                                                                                                |
| data           | object   | AND          | <p>{</p><p>“emails”: \[{type: “Work”, value:</p><p>“<xyz@example.com>”}], // customer email to redeem gift</p><p>“name”: “thong”, // name of customer redeeming gift</p><p>“phones”: \[{type: “Work”, value: “023232”}] // phone number of customer redeeming gift</p><p>}</p> |

Results returned: HTTP Response Code: 200

Response:

{

"success": 1, }
