> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/api-guide/api-guides-en/store-front/promotion/mileage-accrual.md).

# Mileage Accrual

The shopping mall operates a system that accrues mileage when a specific condition is met or a product is purchased. This encourages consumers to shop and stay active continuously, and by using the mileage system, users can receive more discount benefits and special perks. This serves as an important means of driving the shopping mall's activity and increasing sales.

***

## Key Features

* **Promotion information inquiry and mileage accrual amount calculation**
  * Retrieves the promotion information applied when a specific condition is met or a product is purchased.
  * Calculates the mileage accrual amount based on the promotion information.
* Code simplification and minimization of module management

## Process Definition

<figure><img src="https://2999922013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTxKSWMmuxEkop1pvuwe%2Fuploads%2FtecLpQgN7u3TkPYdmecH%2F187301939.jpg?alt=media&#x26;token=d3a8dbd1-ccbe-41e0-855a-41500ef966f9" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Accrual information inquiry

Calculates the mileage accrual amount using the order information and member information during order and claim processing.
{% endstep %}

{% step %}

### Accrual information verification

This logic is a service-level validation and calculation logic. Please refer to the 'business process definition' in the feature overview: Promotion Validation
{% endstep %}
{% endstepper %}

## API Function List

<table><thead><tr><th width="102.3333740234375">API</th><th width="365.4444580078125">Description</th><th width="93.5555419921875">Server</th><th width="89.111083984375">Method</th><th>Notes</th></tr></thead><tbody><tr><td>Promotion accrual information inquiry</td><td>Provides information calculating the promotion information and mileage accrual amount based on the requested order content during order and claim processing.</td><td>Order</td><td>POST</td><td><a href="https://api.x2bee.com/content?msa=order&#x26;depth=%ED%94%84%EB%A1%9C%EB%AA%A8%EC%85%98%20%EC%A0%81%EB%A6%BD&#x26;path=getAccumulationInfo_1">🔗View API></a></td></tr></tbody></table>

## Term Definitions

<table><thead><tr><th width="91.7777099609375">Term</th><th>Description</th><th data-hidden>Notes</th></tr></thead><tbody><tr><td>Mileage</td><td>Refers to a point system that is accrued or can be used based on activities such as purchases or usage. It represents a kind of reward or benefit customers can earn when purchasing specific products, leaving reviews, or otherwise using services within the shopping mall.</td><td></td></tr></tbody></table>

## Other Notes

* Mileage calculation by accrual type
  * The accrued amount is calculated based on three pieces of information: basic accrual, additional accrual by customer grade, and promotion accrual. Basic accrual is calculated based on the product table's mileage-accrual-eligible attribute (milg\_rsrv\_psb\_yn).

### How mileage accrued from orders is managed

| Accrual type                         | Accrual item                       | Accrual target       | Accrual rate           | Accrual date                | Expiration                  | Accrual limit             | Notes                                                         |
| ------------------------------------ | ---------------------------------- | -------------------- | ---------------------- | --------------------------- | --------------------------- | ------------------------- | ------------------------------------------------------------- |
| Applied rate                         | Base amount                        | Order cancellation   | Automatic cancellation |                             |                             |                           |                                                               |
| Order accrual                        | Basic accrual                      | N/A                  | Managed separately     | Based on order amount       | Delivery complete + 14 days | Return                    | <p>Based on accrual date, 1 year<br>Excludes shipping fee</p> |
| Additional accrual by customer grade | GREEN / FAMILY / GOLD / VIP / VVIP | Managed separately   |                        |                             |                             |                           |                                                               |
| Promotion accrual                    | Promotion                          | Based on input value | Based on input value   | Delivery complete + 14 days |                             | 30 days from accrual date |                                                               |

|                          | Basic accrual             | Customer grade additional accrual                 | Promotion accrual                                |
| ------------------------ | ------------------------- | ------------------------------------------------- | ------------------------------------------------ |
| Accrual base amount      | Amount after discount     | Amount after discount                             | Amount after discount                            |
| Accrual reference amount | N/A                       | Managed by grade in the ET\_MILG\_STD\_INFO table | N/A                                              |
| Accrual rate management  | ET\_MILG\_STD\_INFO table | ET\_MILG\_STD\_INFO table                         | Promotion information                            |
| Target products          | All                       | All                                               | Products meeting the applied/excluded conditions |

##
