> 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/member/mileage.md).

# Mileage

A benefit point system accumulated when purchasing or using services at the shopping mall. It accrues at a set rate each time a customer makes a purchase, and can later be redeemed for special benefits or used toward future purchases. Mileage is used to provide customers with additional benefits, increasing loyalty and enhancing the shopping experience.

***

## Key Features

* **Purchase Products with Mileage**
  * Products purchased at the X2BEE shopping mall can be paid for using held mileage.
* **Mileage Accrual and Validity Period**
  * Mileage can be accrued through various methods, and each accrual has a validity period.
    * Base accrual, product reviews, additional accrual by member grade: valid for 1 year
    * Promotion, customer compensation, refund, event accrual: valid for 30 days
* **Mileage Usage Priority**
  * When using mileage, entries closest to their expiration date are used first, followed by entries with the smallest remaining balance.

## Process Definition

<figure><img src="https://2999922013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTxKSWMmuxEkop1pvuwe%2Fuploads%2F6NRXQfxzvEUIycqv4PTg%2F%E1%84%86%E1%85%A1%E1%84%8B%E1%85%B5%E1%86%AF%E1%84%85%E1%85%B5%E1%84%8C%E1%85%B5.png?alt=media&#x26;token=38611a26-e2cd-4ab4-8d4e-144f94c17bd8" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Get Mileage Usage/Accrual List

Allows members to check their mileage usage and accrual history through the mileage usage/accrual list lookup. The lookup range can span up to 3 months at a time.
{% endstep %}

{% step %}

### Get Mileage Balance Summary

Retrieves a summary of the member's mileage balance status. This includes the total mileage held, along with the mileage set to expire today and this month.
{% endstep %}

{% step %}

### Get Available Mileage

The Get Available Mileage API is a module-only API that cannot be called directly from FO, used to retrieve the usable mileage amount for a specific member.
{% endstep %}

{% step %}

### Process Mileage Usage/Accrual

The Process Mileage Usage/Accrual API is a module-only API that cannot be called directly from FO. It processes mileage usage and accrual requests, and manages the mileage history and mileage status.
{% endstep %}

{% step %}

### Accrual

To calculate the mileage expiration date and time, the expiration period is retrieved from the mileage reference information.
{% endstep %}
{% endstepper %}

## API Function List

<table><thead><tr><th width="136.77783203125">API</th><th width="335.3333740234375">Description</th><th width="94.6666259765625">Server</th><th width="89.111083984375">Method</th><th>Remarks</th></tr></thead><tbody><tr><td>Get Available Mileage</td><td>Before requesting mileage usage processing, the requesting module can use the Get Available Mileage API to check the member's usable remaining mileage.</td><td>Member</td><td>GET</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%EB%A7%88%EC%9D%BC%EB%A6%AC%EC%A7%80&#x26;path=getMlgBalAmtInfo_1">🔗View API ></a></td></tr><tr><td>Get Mileage Balance Summary</td><td>Summarizes all held mileage, providing an at-a-glance view of the member's mileage<br>status.</td><td>Member</td><td>GET</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%EB%A7%88%EC%9D%BC%EB%A6%AC%EC%A7%80&#x26;path=getMlgBalAmtInfo">🔗View API ></a></td></tr><tr><td>Process Mileage Usage/Accrual</td><td>Allows members to purchase and receive discounts on products using mileage, and provides mileage accrual when<br>certain criteria are met.</td><td>Member</td><td>POST</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%EB%A7%88%EC%9D%BC%EB%A6%AC%EC%A7%80&#x26;path=saveMlgUseRfd">🔗View API ></a></td></tr><tr><td>Get Mileage Usage/Accrual List</td><td>Retrieves the usage or accrual history of held mileage. The lookup range<br>can span up to 3 months at a time.</td><td>Member</td><td>GET</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%EB%A7%88%EC%9D%BC%EB%A6%AC%EC%A7%80&#x26;path=getMlgDtlList">🔗View API ></a></td></tr></tbody></table>

## Definition of Terms

<table><thead><tr><th width="97.333251953125">Term</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Mileage</td><td>Points that can be used instead of cash when purchasing items at the X2BEE shopping mall. Mileage can be accrued through various means, including product purchases, product review submissions, and event participation, and the validity period of the mileage differs depending on the accrual method.</td><td></td></tr></tbody></table>

## Other Notes

* **Process Mileage Usage/Accrual**
  * Mileage usage and accrual processing is a module-only API that cannot be used directly from FO.
* **Mileage Accrual**
  * When mileage is accrued, the expiration period is looked up in the mileage reference information (ET\_MILG\_STD\_INFO) table based on the accrual classification code (CM016) and accrual target code (CM017), and the mileage validity period is set accordingly.
  * When mileage is accrued, a history record is added to the ET\_MBR\_AST\_MGR\_HIST table and accumulated in the TOT\_AMT column of the ME\_MBR\_AST\_SUM table.
  * When mileage is accrued, the asset management number and asset management detail number are managed using unique values identifiable by each module's process.
  * Mileage accrued from product reviews is capped at 3,000 mileage per month and 36,000 mileage per year.
* **Mileage Usage**
  * Mileage can be used as long as the total usable accrued mileage is greater than the amount to be used.
  * When mileage is used, a history record is added to the ET\_MBR\_AST\_MGR\_HIST table and accumulated in the USE\_AMT column of the ME\_MBR\_AST\_SUM table.
  * When mileage is used, the BAL\_AMT value of the accrued mileage in the ET\_MBR\_AST\_MGR\_HIST table is updated by deducting the used amount, and a usage history record is inserted.
* **Mileage Usage Priority**
  * When using mileage, there is a priority order among accrued mileage entries.
  * Mileage closest to its expiration date is used first > mileage with the smallest remaining amount is used next.
* **Unusable Mileage**
  * The following mileage cannot be used:
    * Mileage in the ET\_MBR\_AST\_MGR\_HIST table where the BAL\_AMT amount is 0
    * Mileage in the same table where APLY\_YN is N
    * Mileage whose validity period has expired

##
