# Merchant side purchase control

{% hint style="info" %}
Implementation is **OPTIONAL**
{% endhint %}

*Purchase check rules are divided into two groups.*&#x20;

* **Product specific** rules will be send along with product data request.&#x20;
* **Store based** rules can be configured in Smarts manager UI.&#x20;

### General Flow

* Smarts asks from merchant if the purchase check is needed by sending shopping cart information to merchant.
* Merchant will response with purchase check decision.&#x20;
  * Smarts will lock app and shows the purchase check notification to client.
* Merchant send the purchase check result to Smarts.
  * Smarts will unlock the  app
  * Purchase control supervisor is able to make changes from client shopping cart.
  * Purchase control supervisor is able to cancel the shopping process.
* After purchase check client will be directed to payment process.

{% hint style="danger" %}
App lock will **expire after 4 hours** and app will be unlocked.  This might be happen when client will not appear to purchase check or merchant will not send purchase check result back to Smarts.
{% endhint %}

### Configuration

Visit your store configuration page in Smarts manager UI. Switch merchant side purchase control to **ON** position and implement required endpoints.

### Implementation

Implement following endpoints

[**Receive purchase check endpoint**](https://developer.smarts.ee/integration/custom-integration/merchant-side-purchase-control/receive-purchase-check-request)

[**Send purchase check result to Smarts**](https://developer.smarts.ee/integration/custom-integration/merchant-side-purchase-control/send-purchase-check-result)

[**Ask for purchase check resend from Smarts**](https://developer.smarts.ee/integration/custom-integration/merchant-side-purchase-control/ask-for-purchase-check-data-resend)
