# OTP (One Time Password) Process

The OTP (One Time Password) process secures Click & Collect orders by verifying that only the rightful customer can collect their package. This tutorial provides a detailed, step-by-step guide to managing the OTP process for Click & Collect orders within the Instore and OMS systems.

## <mark style="color:red;">Prerequisites</mark>​ <a href="#prerequisites" id="prerequisites"></a>

1. **Enable OTP Feature:**
   * Ensure that the OTP feature is enabled in your system. Check that the `IS_OTP_ENABLED` value in the `ApplicationSettings` is set to `true` for OTP functionality to be active. Please refer to the [Application Settings](https://apidocs.akinon.com/oms/application-settings-services) document.

## <mark style="color:red;">Click & Collect Process​</mark> <a href="#click--collect-process" id="click--collect-process"></a>

### <mark style="color:red;">Step 1: Verify Package Details​</mark> <a href="#step-1-verify-package-details" id="step-1-verify-package-details"></a>

1. **Confirm Order Type:**
   * Access the package table and verify the package’s details.
   * Check the **Delivery From Store** column. It should be marked as **Yes**.
   * Check the **Delivery Type** column. It should be set to **In\_store**.

     <figure><img src="/files/6ZPwXUX46oAXVdpTjPtw" alt=""><figcaption></figcaption></figure>
2. **Package Status:**
   * Ensure that the package status is **Ready For Customer**.

### <mark style="color:red;">Step 2: Initiate Package Collection​</mark> <a href="#step-2-initiate-package-collection" id="step-2-initiate-package-collection"></a>

1. **Locate the Package:**
   * The store employee should find the package with the status **Ready For Customer** in the system.
2. **Click & Collect Pack Item Button:**
   * To deliver the package to the customer; begin the verification process with the "Delivered" button for the package in the "Ready for Customer Pickup" status.

### <mark style="color:red;">Step 3: OTP Verification​</mark> <a href="#step-3-otp-verification" id="step-3-otp-verification"></a>

1. **Check OTP Feature Status:**
   * Determine if the `is_enabled_otp` setting is active.
   * If `is_enabled_otp` is active:
     1. The **SelfServisPackageDelivery** command will trigger a modal window.
     2. Enter the SMS verification code received from the customer into this modal for validation.
     3. **After successful verification:**
        * A success message will be displayed on the screen.
        * The package status will be automatically updated to **Delivered**.
   * If `is_enabled_otp` is not active:
     1. The **SelfServisPackageDelivery** command will execute without sms verification code.
     2. The package status will be updated to **Delivered** without requiring a verification code.

### <mark style="color:red;">Step 4: Manage Click & Collect Orders in Omnitron​</mark> <a href="#step-4-manage-click--collect-orders-in-omnitron" id="step-4-manage-click--collect-orders-in-omnitron"></a>

1. **Order Creation:**
   * Ensure that a Click & Collect order is created in the Omnitron application.
2. **Package Management:**
   * A package is generated in the stock location of the order.
   * Initially, the package status is set to **Waiting**.

{% hint style="info" %}
If you encounter an error with the OTP code, refer to the Error Handling section for information.
{% endhint %}

## <mark style="color:red;">Essential Package Statuses and Settings for Instore​</mark> <a href="#essential-package-statuses-and-settings-for-instore" id="essential-package-statuses-and-settings-for-instore"></a>

To move the package through various states, execute the following commands:

### <mark style="color:red;">1. Complete Packaging Without Shipment​</mark> <a href="#id-1-complete-packaging-without-shipment" id="id-1-complete-packaging-without-shipment"></a>

* **Command Name:** Complete Packaging Without Shipment
* **Source State:** Waiting
* **Destination State:** Packed All Items
* **Command Code:** `COMPLETE_PACKAGING_WITHOUT_SHIPMENT`
* **Visibility:** OMS WEB, INSTORE
* **Configuration:** {}

**Procedure:**

* Execute this command to change the package status from **Waiting** to **Packed All Items**.

### <mark style="color:red;">2. Ready For Customer Pickup​</mark> <a href="#id-2-ready-for-customer-pickup" id="id-2-ready-for-customer-pickup"></a>

* **Command Name:** Ready For Customer Pickup
* **Source State:** Packed All Items
* **Destination State:** Ready for Customer Pickup
* **Command Code:** `READY_FOR_PICKUP`
* **Visibility:** OMS WEB, INSTORE
* **Configuration:** {}

**Procedure:**

* Execute this command to generate an OTP for the package. The OTP is sent to the Extension application via the `PackageReadyForCustomerPickupWhispererEvent` event.
* The OTP is then included in the SMS sent to the customer.
* The package status will be updated to **Ready for Customer Pickup**.\\

  <figure><img src="/files/C4ShENSoJXZWnoeGLDI7" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">3. Self Service Package Delivery​</mark> <a href="#id-3-self-service-package-delivery" id="id-3-self-service-package-delivery"></a>

* **Command Name:** Self Service Package Delivery
* **Source State:** Ready for Customer Pickup
* **Destination State:** Delivered
* **Command Code:** `SELF_SERVICE_PACKAGE_DELIVERY_COMMAND`
* **Visibility:** OMS WEB, INSTORE
* **Configuration:** {}

**Procedure:**

* When the customer arrives to pick up the package, the store staff locates the package in the OMS/Instore application.
* Execute this command and request the OTP from the customer.
* Enter the provided OTP. If it matches the OTP generated for the package, the package status will be updated to **Delivered**, completing the process.
* If the OTP is incorrect, an error message will be displayed, and the package status will remain as **Ready for Customer Pickup**.

<figure><img src="/files/TJF67GOg1bzErctNwglL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Wah4DnpZQsbPRouWtUCV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mU5TR5TuOlkH5oNnwn49" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HIolrdTyOTk3czSMYBKT" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">Error Handling​</mark> <a href="#error-handling" id="error-handling"></a>

### <mark style="color:red;">Incorrect OTP​</mark> <a href="#incorrect-otp" id="incorrect-otp"></a>

* **Issue:** If the OTP provided by the customer does not match the generated OTP, an error message will be displayed.
* **Resolution:** The package status will remain as **Ready for Customer Pickup**, and the customer will need to retry with the correct OTP.

<figure><img src="/files/7yKikJZqmzlW4Mrrg8oA" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akinon.com/technical-guides/instore/otp-one-time-password-process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
