openapi: 3.0.3
info:
  title: Keeta Open Delivery API
  version: v.1.0.6
  contact:
    name: Keeta Developer Website
    email: https://developers.mykeeta.com/
  description: |-

    # ■ --- GENERAL INFO --- ■

    **Special Note:** 
      - Keeta Open Delivery API is based on **Open Delivery v1.5.0**. For basic understanding, please refer to <a href="https://abrasel-nacional.github.io/docs/" target="_blank">Open Delivery API</a>.
      - For some of the APIs, **Keeta has made some adjustments based on business scenarios**. Therefore, when Software Service integrates with Keeta, please refer to the APIs definitions in this document. 
      </br>**The major changes include:**
        > - Authentication: **The credentials have been changed from the merchant level to the software level, and the token as well.** However, software services cannot access the merchant data without the merchant's authorization first.
        > - Signature: **Keeta requires the Software Service to include a signature in the header of every API request.** This is to enhance security and prevent the risk of data leakage due to token exposure (such as man-in-the-middle attacks).Please refer to the <a href="./Signature-Calculation"> detailed documentation for the specific signing requirements.</a>
        > - Merchant Menu: Keeta supports menu push (software services push via POST /merchantUpdate interface) and pull (Keeta pulls via GET /merchant interface); however, **Keeta currently only supports full menu updates (modular entry updates are not supported at this time)**. For details, please refer to the description of the corresponding Merchant endpoints in this document.
        > - Order: **Keeta supports querying order events of batch merchants in the polling endpoint**, since the credential is in the software level.
        > - Fields: **Keeta has made some adjustments to the fields in each endpoint, including the number of fields, whether the fields are required, etc.** Please refer to the definitions in this document.
        > - Refund Process: When requesting a total/partial refund after order completion, a negotiation will be initiated between the **Customer** and the **Merchant**. This allows the **Merchant** the opportunity to `ACCEPT` or `DENY` the Customer's request. For details, refer to **ORDERS** section. 
        > - User Privacy Data: To protect users' personal privacy, Keeta will return encrypted data in [order details](#operation/orderDetails). In scenarios involving **merchant self-delivery or third-party logistics (3PL)**, this data can be decrypted. If Software Services need to decrypt the data, they must make additional calls to the [data decryption endpoint](#operation/batchDecrypt). For details, please refer to the description in the **Order section** of this document.
      </br>

      - <b>We strongly recommend software services to integrate the menu API for data synchronization</b>, to avoid merchants maintaining menus in multiple places.
      - Keeta provides a self-service authorization feature in its <a href="https://merchant.mykeeta.com/" target="_blank" rel="noopener noreferrer"> merchant management system </a>. Merchants can log in to the system to independently authorize or revoke access for Software Services. Detailed instructions are available in <a href="../merchant-authorization"> the relevant documentation section </a>.

      - In addition, Keeta offers API endpoints that enable Software Services to automate merchant authorization and embed the workflow into their own SaaS software. For implementation details, please refer to <a href="../merchant-self-serve-authorization"> the relevant documentation section </a>.
      - You can 
        <a href="https://s3-fra01-eu.mykeeta.net/open-third-shop-mapping-template/ODA%20Test%20Collection.postman_collection.json.zip" target="_blank" rel="noopener noreferrer"> Download the Postman Collection </a>
        and add signature calculation script to the pre-request section in Postman to simplify integration and testing.

        **Important** :You need to replace the secret value in the Postman script with the one assigned to you by Keeta.
        <p><img src="./images/postman_replace_client_secret.jpg" /></p>

      - For some general instructions, can directly refer to Open Delivery Documents, and relevant links will be attached.

    # ─► How to Start
      <p><img src="./images/odaguide.png" /></p>
      <h3>Preparation Phase</h3>
      <ol>
        <li><h4>NDA</h4></li>
      <p>
          Please contact the Keeta team to sign the NDA (Non-disclosure Agreement).
      </p>
        <li><h4>Complete profile information</h4></li>
      <p>    
          After you have signed the NDA, Keeta API experts will share developer account and test application ID and secret with you. Log in to the Keeta Developer Portal using the developer account we provided.   
          Please complete the profile on the Information Management page of the Dev Portal, including <strong>company logo, contact phone number, contact email, and merchant operations email.</strong>
          These details are essential—make sure all information is fully filled out and accurate.
      </p>
      <p>
          <strong>Please note that your company logo will be visible to customers, so ensure it is uploaded correctly.</strong> Additionally, Keeta will send the test store credentials and merchant onboarding details to the email addresses listed above — please double-check that they are accurate.
      </p>
        <li><h4>Set up test store and Keeta test APP</h4></li>
      <p>
      <ol type="a" style="padding-left: 20px; list-style-type: none;">
            <li style="position: relative; padding-left: 20px;">
            <strong style="position: absolute; left: 0;">a.</strong>
            Please log in to the <a href="https://developers.mykeeta.com/" target="_blank" rel="noopener noreferrer">Dev Portal </a> and use the Test Store Tool to create a test store. </li>
            <li style="position: relative; padding-left: 20px;">
            <strong style="position: absolute; left: 0;">b.</strong>
            During the store creation process, please scan the Keeta App QR code to download the Keeta Test App. Then, register as a Keeta user using your mobile phone number. </li>
            <li style="position: relative; padding-left: 20px;">
            <strong style="position: absolute; left: 0;">c.</strong>
            Once registration is complete, enter your phone number to link your user account with the test store. After this step, you’ll be able to view your test store within the app.</li>
            <li style="position: relative; padding-left: 20px;">
            <strong style="position: absolute; left: 0;">d.</strong>
            For instructions on using test store in Keeta test APP, <a href="https://api-docs.mykeeta.com/apis/opendelivery/section/introduction-to-keeta-test-app" target="_blank" rel="noopener noreferrer">click here </a>.</li>
            <li style="position: relative; padding-left: 20px;">
            <strong style="position: absolute; left: 0;">e.</strong>
            Once you've created a test store, the credentials will be sent to the primary contact email. You can then use the account to log into the <a href="https://merchant.mykeeta.com/" target="_blank" rel="noopener noreferrer">Keeta Merchant Management System </a>, where you'll be able to manage store business hours, basic information, and menus.</li>
      </ol>
      </p>
      </ol>

      <h3>Development Phase</h3>
      <ol>
        <li><h4>SOW (Statement of Work)</h4></li>
        <p>Before initiating technical development, please download the SOW file from the Integration Document Management section. Complete the document before the online integration testing (SIT homologation) with Keeta, and upload it to the Dev Portal.
        
          (This file defines the scope of this integration (SOW – Statement of Work) and will help you understand keeta API system).</p>
        <li><h4>Developer Self-Test</h4></li>
        <p>
            Please download and review the SIT file, which is a set of self-testing use cases for your reference during internal QA. Keeta team will use the same test cases in the Joint SIT (system integration test) test in the future. We recommend that you follow these test cases to ensure the system functions properly. Please fill in and submit the self-test records before conducting SIT tests with Keeta.
        </p>
        <li><h4>Joint SIT (System Integration Test) with Keeta</h4></li>
        <p>After completing the developer self-test, please schedule an online joint SIT test (homologation) with Keeta. Keeta team will attend to conduct test with you and help resolve issues. If the SIT test meets the requirements, Keeta will sign off the test, and assign an application for the production environment (including the ID and secret) to you. It is strongly recommended to conduct thorough self-testing before the joint SIT test with Keeta.</p>
      </ol>

      <h3>UAT (User Acceptance Test) Phase</h3>
      <ol>
        <li><h4>Schedule UAT Test</h4></li>
        <p>
          After passing the SIT test, we will coordinate with a common customer (restaurant) and schedule the UAT test (you can also recommend one to us).
        </p>
        <li><h4>Conduct UAT Test (Pilot store test)</h4></li>
        <p>
          Before the test, notify the responsible person of the customer's restaurant to ensure support for the test. The Keeta team will place and pay for orders in the actual store to verify that the software system functions properly (such as menu management, order management, KDS, receipt printing).
        </p>
        <p>
          <strong>Please note that during the UAT testing phase, you must use the production environment application (which Keeta will assign to you after passing SIT testing) to access Keeta.</strong>
        </p>
        <p>
          Test applications used during the development phase will not have access to merchant data.
        </p>
      </ol>
      
      <h3>Recommendation</h3>
      <ol>
      <li><h4>Operational Meeting</h4></li>
      <p>
          We recommend that both parties' operational teams hold an operation meeting after the system integration is completed to discuss the subsequent merchant activation/authorization process and align on daily operation and technical issue handling mechanisms.
      </p>
      <p>
          In addition, based on your developer account, Keeta can provide operation accounts upon request. This accounts allow you to view and manage merchants that have authorized your applications on the Dev Portal.
      </p> 
      </ol>


    # ─► Integrating with Keeta API

    - ### Authenticate  
      All API endpoints (except **Get Access Token** itself) require authentication. Therefore, you must first obtain an access token by calling the [Get Access Token](#operation/getToken) endpoint before making any further requests.

    - ### Configure Store Mapping and Webhooks  
      After obtaining the access token, you can register the mapping between your internal `merchantId` and the `Keeta merchantId`, and configure webhook endpoints by calling the [Merchant Onboarding](#operation/putMerchantOnboarding) endpoint.

    - ### Place a Test Order  
      Once the store mapping has been successfully configured, refer to the [**Keeta Test App**](./Keeta-test-APP) to place a test order for the configured store and proceed to the **Order Module** testing phase.

    - ### Order Workflow Testing  
      At this stage, whenever a new order is placed from the registered store, you will receive a `PLACED` event via webhook or polling.

      Upon receiving a `PLACED` event, you should first [retrieve order details](#operation/orderDetails), and then either [confirm](#operation/confirmOrder) or [cancel](#operation/cancelOrder) the order.

      Once the order is prepared, you must either [mark it as ready](#operation/orderReady) or [dispatch it](#operation/dispatchOrder) — depending on whether the delivery will be fulfilled by the merchant or a third-party logistics provider.

      ✅ Good job! Your app is now ready to receive and process orders. For more advanced features, please refer to the relevant sections of this documentation.


    # ─► Basic Concepts  

      - **PARAMETERS IN THE SOFTWARE SERVICE**   (SOFTWARE SERVICE --> Keeta)

        - **{baseURL}** 
          - The {baseURL} is the parameter that indicates the base address, i.e. the constant part of the address, where the routes will be called. 

        - **clientId** and **clientSecret**
          - **Keeta** is responsible for providing the credentials for authentication to be performed through the authentication endpoint. 
            > **IMPORTANT**: As described in the authentication section of the documentation, credentials are generated by Keeta, that is, **if several MERCHANTS use the same Software Service, the software will have a same clientId and clientSecret**.

        - **AppId**
          - It is the unique ID of Keeta which is generated by Keeta itself, it will be informed to all the Software Services that it will integrate.

        - **X-App-Signature**   
          - Keeta requires Software Service to generate a signature and include it in the header of each API request. Refer to the [Signature Calculation](https://api-docs.mykeeta.com/apis/opendelivery/section/signature-calculation) section for the complete algorithm specification.

      - **PARAMETERS IN Keeta**    (Keeta --> SOFTWARE SERVICE)

        - **[GET /merchant](#tag/merchantEndpoints) endpoint URL:** 
          - Keeta must be provided with the URL to access the `GET /merchant` route to obtain the merchant's information. 

          > **IMPORTANT**: Each merchant that the Software Service works with must have a unique URL.
        - **apiKey**
          - If the GET /merchant endpoint is implemented using authentication, it is necessary that the Software Service provides the apiKey referring to the entered merchant.

        - **Order Event Webhook**
          - If both parties are going to work with sending order events via webhook, it is necessary to provide the URL of the webhook. Default webhook route:  `POST {baseURL}/newEvent`


    - ### General Guidelines

      For general guidelines on the Keeta Open Delivery API, please refer directly to <a href="https://abrasel-nacional.github.io/docs/#section/General-Guidelines" target="_blank">Open Delivery General Guidelines</a>.


    - ### Error Handling

      For error handling guidelines on the Keeta Open Delivery API, please refer directly to <a href="https://abrasel-nacional.github.io/docs/#section/Error-Handling" target="_blank">Open Delivery Error Handling</a>.



    # ─► Keeta Developer Portal
      <p>
          <a href="https://developers.mykeeta.com/" target="_blank" rel="noopener noreferrer"> Dev Portal </a> is the developer backend for the Keeta API open platform, comprising two main modules:
      </p>
      <h4>1. Application Management</h4>
      <p>
          In this module, you can create and manage applications, view application tokens, and check the list of associated merchants. 
          For setting regular webhooks, please use the Open Delivery approach to register and update webhooks(e.g., via the " <a href="https://api-docs.mykeeta.com/apis/opendelivery/merchantendpoints/putmerchantonboarding"> Register / Update Merchant endpoint info </a>" method).
          For Merchant authorization updates webhooks, you can directly configure them in the webhook setting page. 
          Please focus only on the webhook configuration for Formal Store. 1301 represents the webhook for new authorization notifications, and 1302 represents the webhook for authorization cancellation notifications.
      </p>
      <h4>2. Development Testing Tools</h4>
      <ol>
          <li>
              <strong>Store Mapping Check</strong><br/>
              This tool allows you to view and search all authorized merchant lists and their menu push statuses. To validate the accuracy of store mapping between systems, you can upload the store IDs and coordinates recorded in your system to Keeta. The system will automatically calculate the geographical deviation distance to achieve validation.
          </li>
          <li>
              <strong>Test Store Tool</strong><br/>
              This tool allows you to create test stores. Please note that you must create an application before proceeding. You can also use this tool to manage the store’s operating status—for example, to reopen a store that was closed due to order failures. After creating a test store, go to <em>Store Details → Edit → Link with your Keeta user account</em>. Be sure to enter the same phone number you used to register as a Keeta user. This will make the test store visible in your app.
          </li>
          <li>
              <strong>Keeta Rider Simulator</strong><br/>
              To test the full lifecycle of orders, you can use this tool to simulate the entire fulfillment process of a Keeta rider, including rider dispatching, arrival at the restaurant, food pickup, and delivery completion.
          </li>
          <li>
              <strong>Test Order Tool</strong><br/>
              The Test Order Tool is a convenient web-based utility that allows developers to place test orders at designated test stores, enabling quick validation of the order flow. Alternatively, you may choose to download and use the Keeta <a href="./Keeta-test-APP"> Test App </a> to browse store menus and place test orders directly.
          </li>
      </ol>


    # ─► Test Store Management
      <p>
          You can create a test store yourself in the Dev Portal (see <a href="./keeta-developer-portal"> Keeta Developer Portal </a> for details), or use the test store assigned to you by Keeta. Using the account and password of the test store to log into the <a href="https://merchant.mykeeta.com/" target="_blank" rel="noopener noreferrer"> Keeta Merchant Management System </a>, you will have access to all store management functions, including: viewing orders, viewing historical data, setting store operating hours and status, viewing and editing menus, and setting up promotion activities etc.
      </p>
      <h4>Menu Management</h4>
      <p>
          If you do not integrate with Keeta's Menu API (i.e., do not manage and publish menus via the API), you can edit and upload menus in the Merchant Management System for testing purposes. If needed, Please use the menu upload template (including PDV Code) to help quickly batch upload full menu and the corresponding external codes. Please contact Keeta team for details and support if needed.
      </p>
      <h4>Please note:</h4>
      <p>
          If the menu is not integrated, manual entry is required — and it's important to ensure the PDV Code is entered correctly.
      </p>
      <p>    
          However, if menu synchronization is performed via API, Keeta will automatically disable manual entry and modification through the Merchant Management System to prevent data inconsistencies and potential order failures.
      </p>
      <p>   
          If a merchant needs to make manual adjustments to the menu despite API integration, please contact the Keeta API team for support.
      </p>
      
      <h4>Promotion Settings</h4>
      <p>
          We recommend setting up various types of marketing activities and placing test orders in the test store to ensure that promotional information in the orders is processed correctly.
      </p>
      <p>   
          Additionally, if you wish to test scenarios involving Keeta platform subsidies, please contact the Keeta API team. We will add Keeta platform promotional items to your test store for this purpose.
      </p>
      <p>  
          Please note that in the SIT testing environment (homologation), we will test scenarios involving both merchant subsidies and platform subsidies to ensure the orders are processed correctly and the promotional information is accurately parsed.
      </p>


    # ─► Keeta test APP
          <strong>To place orders for test stores, there are two available methods:</strong>
      <h3>
          Developer Portal with Test Order Tool:
      </h3>
      <p>
          Log into the <a href="https://developers.mykeeta.com" target="_blank" rel="noopener noreferrer"> Dev Portal </a> and use the Test Order Tool to directly place orders at the test store. This method is convenient and allows for rapid validation of order flow, but its functionality is limited.
      </p>
      <h3>
          Keeta Test App:
      </h3>
      <p>
          Download and use the Keeta Test App to browse the store menu and place orders directly within the app. This approach enables a full end-to-end simulation from the user perspective, provides a visualized menu interface, and allows you to trigger refund operations—making it essential for testing reverse order flows and other features.
      </p>
      <p>
          Keeta team will share the download link for the Test APP (available for both Android and iOS versions). Please download and install the app, then select the Bongolava region (as shown in the image below), and complete the user registration (Brazilian phone numbers are supported).
      </p>
      <p><img src="./images/appliebiaoEn.png" width="300px"/></p>

      <h3>Test Store Registration and Location Settings</h3>
      <p>
          After registration, please inform Keeta of your registered phone number and the test store ID you previously created via the <a href="https://wenjuan.meituan.com/m/survey/5496779" target="_blank" rel="noopener noreferrer"> link</a>. The Keeta team will bind the two for you to place test orders. After this you will be able to see the test store in the Home page and place test orders with mocked payment.
      </p>
      <p>
          <strong>Note:</strong> Keeta's test stores are located in the <strong>Bongolava region of Madagascar</strong>. Please ensure that the delivery address for the test order is near the test store.
      </p>
      <p>
          If your test store cannot accept orders and displays “Out of Delivery Area,” please switch your current location to a nearby point within the designated testing region.
      </p>
      <p><strong>To update your location:</strong></p>
      <ol>
          <li>Tap the address in the top-right corner of the screen.</li>
          <li>Select <strong>“Tap to Change.”</strong></li>
          <li>Tap the top-right region selector (e.g., “<strong>Brasil</strong>”).</li>
          <li>Choose the first option: <strong>“Bongolava”</strong>, then tap <strong>“Confirm.”</strong></li>
          <li>Select any available location point within the region and tap <strong>“Confirm Location.”</strong></li>
      </ol>
      <p>
          Once your location is updated, you will be within the testing area and can place orders at the designated test store.
      </p>
      <p><img src="./images/appcaiping.png" /></p>
      <p><img src="./images/appxiadan.png" /></p>
      <p><img src="./images/appshouhuodizhi.png" /></p>
      <p><img src="./images/xuanzedizhi.png" /></p>
      <p><img src="./images/dizhixiangqing.png" /></p>


    # ─► Signature Calculation
        This document describes the HMAC-SHA256 signature calculation process used for API authentication. The signature is generated by combining the request URL, query parameters, and request body into a signature string, then computing an HMAC-SHA256 hash using a secret key.

        **Algorithm**:   HMAC-SHA256 <br>
        **Encoding**:    Base64 <br>
        **Signature Header**:    X-App-Signature  <br>

        ## Signature Generation Process

        #### Step 1: Extract Request Components

          1. **URL**: Extract the base URL (without query parameters)
          2. **Query Parameters**: Extract all enabled query parameters
          3. **Request Body**: Process the request body content

        #### Step 2: Build Signature String

          The signature string is constructed by concatenating the following components with `&` as separator:

        ```curl
        signature_string = URL + "&" + sorted_query_params + "&" + request_body
        ```

          ##### 2.1 URL Processing

        - Use the base URL without query parameters
        - Example: `https://api.example.com/v1/orders` <br>


        ##### 2.2 Query Parameters Processing
        - Extract all enabled query parameters
        - Sort parameters by key name (alphabetical order)
        - Format each parameter as `key=value`
        - Join multiple parameters with `&`
        - Handle null/undefined values as empty strings

        **Example:**

        ```curl
        Original parameters: {c: "3", a: "1", b: "2"}
        Sorted result: a=1&b=2&c=3
        ```

          ##### 2.3 Request Body Processing

        - JSON Format: Use JSON string directly
        - Null Value Handling: Empty objects `{}` or empty strings will be skipped
        - Type Conversion: Non-string types will be converted to JSON strings

        #### Step 3: Calculate HMAC-SHA256 Signature
        1. Use the constructed signature string as the message
        2. Use the provided secret key
        3. Calculate HMAC-SHA256 hash
        4. Encode the result in Base64 format

        ## Examples

        #### Example 1: GET Request with Query Parameters

        **Request:**

        ``` curl
        URL: https://api.example.com/v1/users
        Query Parameters: {page: "2", limit: "10", sort: "name"}
        Body: (empty)
        ```

        **Signature String:**

        ``` curl
        https://api.example.com/v1/users&limit=10&page=2&sort=name
        ```

        #### Example 2: POST Request with JSON Body

        **Request:**

        ``` curl
        URL: https://api.example.com/v1/orders
        Query Parameters: (empty)
        Body: {"userId": 123, "productId": 456, "quantity": 2}
        ```

        **Signature String:**

        ``` curl
        https://api.example.com/v1/orders&{"userId":123,"productId":456,"quantity":2}
        ```

        #### Example 3: PUT Request with Both Query Parameters and Body

        **Request:**

        ```curl
        URL: https://api.example.com/v1/products
        Query Parameters: {version: "v2", format: "json"}
        Body: {"name": "Product A", "price": 99.99}
        ```

        **Signature String:**

        ```curl
        https://api.example.com/v1/products&format=json&version=v2&{"name":"Product A","price":99.99}
        ```
        
        ## Signature calculation script example
        - Below is a complete calculation script example of the signature (**JAVA**). You can refer to it to implement the signature calculation script of your development language.

        ```java
        import org.apache.commons.lang.StringUtils;
        import javax.crypto.Mac;
        import javax.crypto.spec.SecretKeySpec;
        import java.nio.charset.StandardCharsets;
        import java.security.InvalidKeyException;
        import java.security.NoSuchAlgorithmException;
        import java.util.Base64;
        import java.util.Map;
        import java.util.TreeMap;

        public class SignatureUtils {

            /**
            * generate signature
            * @param url: request url
            * @param queryParamMap: request query parameters Map Structure
            * @param bodyJSONString: request body JSON String
            * @param clientSecret: client secret
            * @return
            */
            public String generateSignature(String url, Map<String, Object> queryParamMap, String bodyJSONString, String clientSecret) {
                StringBuilder sb = new StringBuilder();
                // step 1: concat url
                sb.append(url);
                // step 2: concat query parameters
                if (!queryParamMap.isEmpty()) {
                    // 2.1: sort by alphabetical order
                    TreeMap<String, Object> sortedParams = new TreeMap<>(queryParamMap);
                    // 2.2: concat key and value
                    for (Map.Entry<String, Object> entry : sortedParams.entrySet()) {
                        String key = entry.getKey();
                        String value = entry.getValue() != null ? entry.getValue().toString() : null;
                        sb.append("&");
                        sb.append(key + "=" + value);
                    }
                }
                // step 3: concat body
                if (StringUtils.isNotBlank(bodyJSONString)) {
                    sb.append("&");
                    sb.append(bodyJSONString);
                }
                // step 4: got a complete string waiting to generate a signature
                String signatureString = sb.toString();
                try {
                    // step 5: initialize the HmacSHA256 algorithm with the clientSecret
                    Mac mac = Mac.getInstance("HmacSHA256");
                    mac.init(new SecretKeySpec(clientSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
                    // step 6: calculate signature
                    byte[] bytes = mac.doFinal(signatureString.getBytes(StandardCharsets.UTF_8));
                    // step 7: encode the signature in Base64 format
                    String signature = new String(Base64.getEncoder().encode(bytes), StandardCharsets.UTF_8);
                    return signature;
                }catch (NoSuchAlgorithmException e){
                    throw new IllegalStateException("Algorithm HmacSHA256 does not exist.", e);
                }catch (InvalidKeyException e){
                    throw new RuntimeException("Key is invalid.", e);
                }
            }
        }

        ```

    # ─► Merchant Authorization
        <h2>Merchant Adding Authorization (with APP ID)</h2>
        <p>
          If a merchant wants to authorize an application, the merchant should go to the <b> App Activation </b> tab in the Merchant Management 
          system, and click the <b> "Activar aplicativo" </b> button at the top right corner of the page and follow the steps below:
        </p>
        <ol>
          <li>
              <b> Enter the APP ID </b> of the service provider's application (available from the provider).
          </li>
          <li>
              <b> Confirm provider information </b> to ensure accuracy.
          </li>
          <li>
              <b> Select the store(s) </b> to be authorized:
            <ul>
              <li>For store-level accounts, this step is skipped.</li>
              <li>For brand-level accounts, the merchant must select which stores to authorize.</li>
            </ul>
          </li>
          <li>
              Click <b> Confirm </b> to proceed.
          </li>
          <li>
              Click <b> "Registro da autorização" </b> to automatically download an Excel file containing the authorization record
          </li>
          <li>
              Once authorization is complete:
              <ul>
                  <li>The service provider's merchant operations email will receive a notification.</li>
                  <li>The provider's system will receive a <a href="./authentication/receiveauthorizationwebhook"> webhook </a> notification.</li>
                  <li>The provider can retrieve authorized merchant data via API.</li>
              </ul>
          </li>
        </ol>
        
        <h2>Merchant Adding Authorization (via URL)</h2>
        <p>
          The service provider logs into the Keeta Dev Portal using a developer or sub-account (operations account), clicks <b> “Add Authorization” </b> , and shares the generated authorization URL with the merchant.
        </p>
        <ol>
          <li>The merchant opens the URL and logs in using either a <b> brand-level </b> or <b> store-level </b> account.</li>
          <li>The merchant does <b> not </b> need to input an APP ID—simply select the stores to authorize, and click <b> Confirm. </b> </li>
          <li>Click <b> “Registro da autorização” </b> to automatically download an Excel record of the authorization.</li>
          <li>
            Once authorization is completed:
            <ul>
              <li>The provider’s merchant operations email will receive a notification.</li>
              <li>The provider’s system will receive a <a href="./authentication/receiveauthorizationwebhook"> Webhook </a> notification.</li>
              <li>Authorized merchant data can be retrieved via API.</li>
            </ul>
          </li>
        </ol>
        <p>
          After authorization, the merchant should contact the provider to complete store configuration (such as store mapping).
        </p>
        
        
        <h3>
          Merchant Revokeing Authorization
        </h3>
        <p>
          Merchants can revoke authorization using either of the following methods:
        </p>
        <ol>
          <li>
            <b> Bulk revocation: </b>
            <p>Select the current list of stores and revoke authorization in a batch. A double-confirmation popup is required before the operation proceeds.</p>
          </li>
          <li>
            <b> Single revocation: </b>
            <p>Click the designated button and confirm to revoke authorization for an individual store.</p>
          </li>
        </ol>
        <p>Upon completion:</p>
        <ol>
          <li>An Excel file containing the operation record will be automatically downloaded for reference.</li>
          <li>The service provider's merchant operations email will receive a notification.</li>
          <li>The provider's system will receive a <a href="./authentication/receiveauthorizationwebhook"> Webhook </a> event.</li>
          <li>The provider will lose access to merchant store data via API.</li>
        </ol>
        <h3>Stay updated of merchants authorization activity</h3>
        <p>
          The service provider can receive notifications for merchant authorization cancellations or new authorizations via <a href="./authentication/receiveauthorizationwebhook"> Webhook </a>. Keeta will also send an email to the merchant operation mailbox, please check the inbox.
        </p>
        <p>
          Or, the service provider can also view all the authorized stores in the Mapping Check in Dev Portal with detailed infomation, as mentioned above.
        </p>



    # ─► Merchant Self-serve Authorization
        <p>
          Before accessing merchant data, service providers must obtain authorization from merchants. Within the Keeta platform, it is recommended to use <b> Merchant Self-Authorization </b> to automate and streamline this process.
        </p>
        <img src="./images/Untitled_diagram_MermaidChart.png" />
        <h3>Step 1: Retrieve Authorization Link</h3>
        <ul>
          <li>
            <b> Initiate Request: </b> The service provider system calls the <a href="./getauthorizationurl"> Keeta API </a> to retrieve the authorization URL.
            <p>Note: If API integration is not available, the URL can be manually acquired via the <b> Add Authorization </b> button on the Dev Portal.</p>
          </li>
          <li><b>Generate Link:</b> Keeta returns an authorization link containing the required parameters.</li>
          <li><b>Distribute Link:</b> The service provider shares the link with the target merchant to begin the authorization flow.</li>
        </ul>
        <h3>Step 2: Merchant Authorization Operation</h3>
        <ul>
          <li><b>Access Authorization Page:</b> The merchant clicks the link, redirecting their browser to the Keeta authorization page.</li>
          <li><b>Authentication:</b> The merchant logs in via Keeta, using either a <b> Brand Account </b> or a <b> Store Account. </b></li>
          <li><b>Store Selection:</b> The system displays the merchant’s store list.</li>
          <ul>
            <li>Brand account users must select the store scope to authorize.</li>
            <li>Store account users will proceed without additional selection.</li>
          </ul>
        </ul>
        
        
        <h3>Step 3: Post-Authorization Handling (Two Modes)</h3>
        <h4>Mode A: Redirect Integration (Automated Workflow)</h4>
        <ul>
          <li><b>Automatic Redirect:</b> After authorization, Keeta redirects to the service provider system with the authId.</li>
          <li><b>Fetch Store Info:</b> The service provider calls the <a href ="./authentication/getmerchantinfo"> API </a> to retrieve detailed store information.</li>
          <li><b>Store Mapping UI:</b> The service provider displays a mapping interface for the merchant to match their stores with the service provider’s system.</li>
          <li><b>Integration Complete:</b> Upon confirmation, the service provider registers store data via the onboarding API.</li>
        </ul>
        
        <h4>Mode B: Manual Mapping via Authorization Records</h4>
        <ul>
          <li><b>Merchant-side Download:</b> After authorization, the Keeta merchant management system automatically downloads a spreadsheet of the authorized stores. Alternatively, merchants may manually download the store list to assist with mapping. To explore detailed functionality and operations, please log in to the <a href="https://merchant.mykeeta.com/" target="_blank" rel="noopener noreferrer"> merchant portal </a> using a test store account.</li>
          <li><b>Email Notification to Service Provider:</b> Keeta sends the authorized store list to the merchant operations email provided by the service provider for reference and mapping.</li>
          <li><b>View in Dev Portal:</b> Service providers can log into the <a href="https://developers.mykeeta.com/" target="_blank" rel="noopener noreferrer"> Dev Portal </a> and use the <b> Mapping Check </b> feature to search for authorized store records and maintain mappings manually.</li>
        </ul>


    #   
    # ■ --- CHANGELOG --- ■
      **Version[1.0.6] - Sep 2, 2025**
      1. Added `Delivered` and `Send Delivery Updates` APIs related to "Merchant Responsible Delivery".

      **Version[1.0.5] - Jul 25, 2025**
      1. Added Integrating with the Keeta API.
      2. Added Postman Collection.

      **Version[1.0.4] - Jul 18, 2025**

      **ORDERS changes**
      1. Added the post `/v1/batchDecrypt` endpoint.
      </br></br>

      **Version[1.0.3] - Jul 8, 2025**

      **ORDERS changes**
      1. Added the post `/v1/orders/{orderId}/dispatch` endpoint. <em>request validation only.</em>
      </br></br>
      
      **Version[1.0.2] - Jul 7, 2025**

      **MERCHANT changes**
      1. Removed the post `/v1/merchantStatus/{merchantId}/available` and `post /v1/merchantStatus/{merchantId}/unavailable` endpoints, and unified the merchant status update through the `POST /merchantUpdate` endpoint (consistent with the native Open Delivery protocol).
      </br></br>

      **Version[1.0.1] - Jun 30, 2025**

      **Response Body Structure Definition Change**
      1. Version 1.0.0 introduced response body structural changes, while v1.0.1 was adjusted to **maintain alignment with the Open Delivery**.

      **ORDERS changes**
      1. Updated order events diagram and order flow diagram in **Order Overview** section.
      2. Added **Order Refund** instruction under **Order Overview** which follows Keeta's refund rules.
      3. Added sample metadata for payload within `USER_REFUND_REQUEST` event that could be notified by polling or webhook mechanism.

      **MERCHANT changes**
      1. The data structure and fields of `GET /merchant` and `POST /merchantUpdate` endpoints are adjusted to be consistent with the native Open Delivery protocol.


    # ■ --- API REFERENCE --- ■
tags:
  - name: securitySection
    description: ' '
    x-displayName: └─● SECURITY
    x-traitTag: true
  - name: authentication
    x-displayName: └────► Authentication
    description: >-

      Keeta suports two types of authentication methods: **OAuth 2** and
      **apiKey**.
  - name: merchantSection
    description: >-
      Keeta follows the merchant model definition in Open Delivery, which refers
      to the following link: 
        - <a href="https://abrasel-nacional.github.io/docs/#tag/merchantOverview" target="_blank">Merchant overview</a>
        - <a href="https://abrasel-nacional.github.io/docs/#tag/merchantStructure" target="_blank">Merchant structure</a>

      > **IMPORTANT:**  Please note that Keeta only allows partial update of
      merchant basic information. The fields in BASIC_INFO and SERVICE entities
      will be reduced. Please refer to this document.
    x-displayName: └─● MERCHANT
    x-traitTag: true
  - name: merchantEndpoints
    x-displayName: └────► Merchant Endpoint
    description: >-
      This section details the `GET /v1/merchant` endpoint.


      This endpoint should be implemented by the Software Service and its URL
      should be informed to Keeta.


      The endpoint is designed so that **each merchant has its own URL**.  


      The specification recommends that the endpoint ends with the `/merchant`
      route, but this is **not mandatory**. The Software Service can implement
      the URL in any way it sees fit, as long as it contains information from
      **only one** merchant.
  - name: ordersSection
    description: >-
      This overview summarizes the Ordering flow and how it interacts with
      merchant Software Service and Keeta.


      <h2>Order Events State Machine</h2>
       
       <div align="center">
         <img src="./images/modified_order_lifecycle.svg" />
       </div>

       <h2>Understanding the Order Flow</h2>
       
       <div align="center">
         <img src="./images/oda_order_flow.svg" />
       </div>
       
       ***
       The order flow has the following Macro steps:
       
       <h3>1. Order Event Reception</h3>
       
       Through Order Events,  **Keeta** communicates to the **Software Service** the existence of a new order, as well as the other events of the order lifecycle.
       
       **Open Delivery** provides two ways for merchant **Software Service** to be aware of new events:
       
       - **[Polling](#tag/ordersPolling)**: 
       Receiving events through polling provided by  **Keeta** is the common way **Open Delivery Order Events** works.
       
       - **[Webhook](#tag/ordersWebhook)**:
         Optionally it is recommended the implementation of a **webhook** by the merchant **Software Service** for the **Keetas** to send new events directly, ensuring a much faster communication.
       
       
       <h3>2. Order Details</h3>
       
       Before confirming or canceling an order, it is necessary to get the order details so that the merchant Software Service user can check if he will be able to prepare and deliver this order, such as checking if he has all the necessary items and if he is available to make the delivery to the informed address.
       
       Through the [GET /orders/{id}](#operation/orderDetails) endpoint the merchant Software Service can get all the details of an order.
       
       This endpoint returns the code 200 and the content of the request. If an invalid request id is entered the endpoint returns 404.

       <br />
       Regarding order detail information, the following additional clarification is provided to prevent user information leakage:

       > Keeta will return encrypted data with the `ENC_` prefix when returning users' personal privacy data(as customer, delivery). Software Services can call the [POST /v1/batchDecrypt](#operation/batchDecrypt) endpoint to decrypt the data. 
       > Please note that data can only be decrypted in **merchant self-delivery or third-party logistics (3PL)** delivery scenarios. For Keeta platform-delivery orders (full service), the data cannot be decrypted.
       
       <h3>3. Order Events Updates</h3>
       Following the order lifecycle, the merchant Software Service needs to notify Keeta of the upcoming order status.
       
       After acknowledging receipt of a new order event (either via polling or webhook) is expected that the Software Service explicitly 
       [POST /orders/{orderId}/confirm](#operation/confirmOrder) or [POST /orders/{orderId}/requestCancellation](#operation/requestCancellation) within a time window set by Keeta.
       Otherwise the order can time out and auto-cancel and the merchant can suffer a penalty based on Keeta policy.   
       Order acceptances should be posted as quickly as possible to minimize consumer cancellations.
       
       When the order is ready, it is expected that a request will be sent to [POST /orders/{orderId}/readyForPickup](#operation/orderReady)
       
       > When sending requests to these endpoints, is expected that Keeta notifies the consumer of the progress of the order.
       
       <h3>4. Order Cancellation</h3>
       An order can be canceled for several reasons and the initiative to cancel an order can come from the merchant, the customer, or Keeta.   
       It may also happen that the delivery person requests the cancellation in some scenarios, such as when the customer is not found at the delivery address.
       
       > **Cancellation Rules**
       >  
       > It is expected that both Keeta and merchant Software Service have their own order cancellation policies and inform their users.
       
       
       A cancellation request must always contain:
       
       - **reason**: Open text field indicating the reason for the cancellation.
       - **code**: An enumerator containing a cancellation reason.  
       - **mode**: Field indicating whether the cancellation occurred Automatically or Manually.
       
       The cancellation can be requested by:
       
       **Software Service** (Merchant):
       
       <div align="center">
         <img src="./images/oda_cancel_flow.svg" />
       </div>
       
       If the merchant wants to cancel an order, it must make a [POST /orders/{orderId}/requestCancellation](#operation/requestCancellation) request.
       
       > **Penalties**
       >
       > Avoid order cancellations! Excessive cancellations can result in some penalties (depending on Keeta's policy) such as having the merchant temporarily closed on the platform.
       
       **Cancellation Validation**
       
       The Cancellation request does not guarantee that the order is cancelled. When sending a request [/orders/{orderId}/requestCancellation](#operation/requestCancellation),  Keeta will send the code 202 (accepted) in response.
       This does not yet mean that the request has been cancelled. It means that the request has been accepted and will be processed by Keeta cancellation service. As a result of this request, the merchant Software Service may receive at the next polling (or via webhook) one of the following events:
       
       - CANCELLED
       
       The order should only be Canceled when the CANCELLED event is generated.
       
       > Cancellation rules may vary depending on the timing of the order (before or after confirmation). In some situations it is possible that  Keeta cancellation service will consult with the consumer on whether or not the consumer accepts the cancellation of the order.
       
       ``` 
       Cancellation codes:
       
       - INSUFFICIENT_DISHES
       - SUSPENSION_OF_BUSINESS
       - INSUFFICIENT_MANPOWER
       - OTHERS
       ``` 
       
       Cancellation by **Keeta** can happen by:
       ```
       code: CONSUMER_CANCELLATION_REQUESTED
       ```  
       
       The consumer can request the cancellation of an order. 
       Depending on the cancellation rules applied, this option may not be enabled for all merchants. 
       It may also only be allowed at certain times, such as before the order is confirmed.
       ```
       code: OTHER_CANCELLATION_REASON
       ```
       
       Keetas may cancel the order for reasons other than via customer. 
       Possible reasons for order cancellation by the system include: timing out without acceptance, 
       no rider accepting the order, or the rider reporting the store as closed.
       
       When the Order Application initiates a cancellation, an order cancellation event is transmitted to 
       the Software Service via webhook or polling. The Software Service must then update the order status based on 
       the event details.

       <h3>5. Order Refund</h3>
       Users can initiate a fully order refund or a partial item refund request from the Order Application, 
       which will trigger the `USER_REFUND_REQUEST` event to be sent to the Software Service. 
       This event will include details such as the refunded items and pricing information. 
       The refund process follows a handshake protocol: if the merchant agrees to the refund request, 
       they need to call the <a href="#operation/acceptRefund" title="agree refund">Agree Refund API</a>; 
       if they disagree, they should call the <a href="#operation/rejectRefund" title="Reject Refund API">Reject Refund API</a>.
       
       <div align="center">
         <img src="./images/oda_refund_flow.svg" />
       </div>
       
       <br>

       **Sample metadata** within `USER_REFUND_REQUEST` event, refer to [polling API](#operation/pollingEvents) and [webhook](#operation/newEvent).
       ```json
       {
         "money": 8500,
         "opTime": 1751005551823,
         "shopId": "461827",
         "status": 5002,
         "currency": "HKD",
         "isAppeal": 0,
         "partRefund": 0,
         "applyOpType": 10,
         "applyReason": "Wrong Order",
         "orderViewId": 783441058793308,
         "handleOpType": 20,
         "handleReason": "Merchant Agreed to Refund",
         "refundProducts": [
             {
                 "id": 12053105,
                 "name": "1️⃣  Noodles with 1 Topping",
                 "spec": "",
                 "tags": [],
                 "count": 1,
                 "price": 7500,
                 "skuId": 8949938,
                 "spuId": 9897081,
                 "groups": [
                     {
                         "groupId": 4305174,
                         "groupName": "Choose Your Choices of Noodles",
                         "groupNameI18n": {
                             "en": "Choose Your Choices of Noodles",
                             "zh-HK": "選擇麵底",
                             "default": "選擇麵底"
                         },
                         "groupOpenItemCode": "cgp-7741|1-1",
                         "shopProductGroupSkuList": [
                             {
                                 "count": 1,
                                 "price": 0,
                                 "spuId": 2069967,
                                 "spuName": "Rice Stick Noodle Supremes",
                                 "currency": "HKD",
                                 "spuPvList": [],
                                 "groupSkuId": 23903426,
                                 "refundCount": 0,
                                 "refundPrice": 0,
                                 "spuNameI18n": {
                                     "en": "Rice Stick Noodle Supremes",
                                     "zh-HK": "米線",
                                     "default": "米線"
                                 },
                                 "groupSkuOpenItemCode": "128019"
                             }
                         ]
                     }
                 ],
                 "remark": "",
                 "picList": [
                     "http://img-ap-hongkong.mykeeta.net/sailorproduct/aa2d5209534619f31c2e966080ecac5885942.jpg"
                 ],
                 "currency": "HKD",
                 "nameI18n": {
                     "en": "1️⃣  Noodles with 1 Topping",
                     "zh-HK": "1️⃣  單拼小窩米線",
                     "default": "1️⃣  單拼小窩米線"
                 },
                 "priceStr": "$75.00",
                 "spuPvList": [],
                 "promotions": [],
                 "refundType": 1,
                 "originPrice": 7500,
                 "refundCount": 1,
                 "refundPrice": 0,
                 "orderProductId": 359379560,
                 "originPriceStr": "$75.00",
                 "priceWithGroup": {
                     "amount": 7500,
                     "amountStr": "$75.00",
                     "originAmount": 7500,
                     "originAmountStr": "$75.00"
                 },
                 "skuOpenItemCode": "AY290105",
                 "spuOpenItemCode": "8898",
                 "priceWithoutGroup": {
                     "amount": 5900,
                     "amountStr": "$59.00",
                     "originAmount": 5900,
                     "originAmountStr": "$59.00"
                 }
             }
         ],
         "partRefundCount": 0,
         "afterSaleOrderId": 783440453161676
       }
       ```

       <h3>Reverse Transaction Policy</h3>
       The reverse transaction flow includes two scenarios: Cancellation Requests and Refund Requests, initiated by four possible parties:
         <ol>
         <li>User</li>
         <li>Merchant</li>
         <li>Keeta Customer Support</li>
         <li>Keeta System</li>
         </ol>
       Below are the detailed rules:
       <style type="text/css">
         .tg  {border-collapse:collapse;border-spacing:0;}
         .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
           overflow:hidden;padding:10px 5px;word-break:normal;}
         .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
           font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
         .tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
         </style>
         <table class="tg"><thead>
           <tr>
             <th class="tg-0pky"></th>
             <th class="tg-0pky">User</th>
             <th class="tg-0pky">Merchant</th>
             <th class="tg-0pky">Customer Service</th>
             <th class="tg-0pky">System</th>
           </tr></thead>
         <tbody>
           <tr>
             <td class="tg-0pky">Cancellation</td>
             <td class="tg-0pky">Full Service: Users can only cancel order before merchants accpet (confirm) the order, without merchants' approval.</td>
             <td class="tg-0pky">
              <p>After a user successfully places an order, the merchant has the option to proactively cancel the order at any time within 48 hours after the order is completed.</p>
              <p>Merchants can choose to initiate order cancellations through the Software Services system, or alternatively, log into the Keeta Order Management System to cancel orders.</p>
              <p>For the latter option, Keeta will send an order cancellation notification to Software Services via API.</p>
             </td>
             <td class="tg-0pky">If an order cancellation request is escalated to Keeta Customer Support, the support team may cancel the order at any time—up to <br>30 days after the order is completed. Therefore, if an order is cancelled by Customer Support (even after order completion), the <br>cancellation event will be notified to Software Services</td>
             <td class="tg-0pky">If an order is not accepted within five minutes, the system will automatically cancel the order. Merchant approval is not required for this cancellation.<br>⚠️ Important:<br>Failure to accept an order within five minutes will result in the temporary closure of the store.</td>
           </tr>
           <tr>
             <td class="tg-0pky">Refund</td>
             <td class="tg-0pky">After a user submits a refund request, an event notification will be triggered, and merchant approval is required.<br>Regardless of whether the software integrates the deny refund or approve refund API, merchants can always log in to the Keeta Merchant Portal to communicate with users and manage disputes via Instant Messenger.<br>No matter which method the merchant uses to process the refund request—either through the Keeta Merchant Portal or via software capabilities—the outcome is idempotent. Both workflows can operate in parallel, and the final result will be determined by whichever response is received first</td>
             <td class="tg-0pky">Merchants are not able to initiate refund requests via API.</td>
             <td class="tg-0pky">Same as above</td>
             <td class="tg-0pky">N/A</td>
           </tr>
         </tbody></table>    
         <p>In summary, Keeta may initiate order refund or cancellation notifications at any point in time. Software Services should handle these order status updates based on its own operational needs — <strong>either by aligning with Keeta’s order status, or, by ignoring the notifications to preserve the integrity of its internal system state.</strong></p> 
         <p>If you prefer not to have your internal order status changed by Keeta under certain conditions (e.g., after an order is accepted or after completion), please discard Keeta’s order status notifications to ensure your system’s order status remains unaffected.</p>
         <p>If this results in reconciliation issues for the merchant, they should contact Keeta’s Business Development (BD) team to resolve the matter.</p>
    x-displayName: └─● ORDERS
    x-traitTag: true
  - name: ordersPolling
    x-displayName: └────► Polling
    description: >-

      Receiving events via Polling works as follows:


      <div align="center">
        <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/polling.png" />
      </div>


      ### Query new order events


      In order to receive new order events, the merchant Software Service must
      make requests on the polling endpoint regularly at a certain time
      interval, determined by  Keeta. 

      Whenever there is a new event the response will send the response code 200
      with the list of events. If there are no new events, the response will
      send the response code 204.


      > **IMPORTANT**:  It is important that the Software Service performs the
      requests within the timeframe determined by Keeta, as blocking and
      penalties may occur depending on the application's rules.


      **Keeta Polling Rate Limiting and Event TTL**


      - The Keeta polling API enforces a rate limit of **no more than two
      requests per minute per token**. Once a request is blocked due to rate
      limiting, it will be allowed again in the next time window, which resets
      every minute. 

      - It is recommended to poll for the latest order events associated with
      the token **every 30 seconds**. **The TTL for order events is 4 hours and
      10 minutes**. In the Keeta system, orders automatically transition to a
      final state after 4 hours; an additional 10 minutes is provided as a
      buffer for time discrepancies.


      **Availability of new events in polling:** 


      - Keeta may have specific rules about the maximum time new events are
      available in polling before they are removed.

      - Always check with Keeta what the rules are for using the polling
      service. 


      **Duplicate Events**


      - Eventually Keeta may return the same event more than once, for example
      the `CREATED` event, including old orders. For this reason **it is
      important that the Software Application handles the uniqueness of requests
      and events through id and the date**.

      - When receiving an event, the Software Service must check the event id
      and validate that this event (id) has not been processed before. **If this
      event has already been received previously, it must be discarded**.


      > **IMPORTANT**: The Software Services should only accept a new order or
      update the status of an order after validating that the event has not been
      processed before.


      It is also possible for the Software Service to make a request for the
      same event more than once (for example, requesting the `POST
      /v1/orders/{orderId}/confirm` endpoint repeatedly).


      In these cases  Keeta can handle this situation in two different ways:

        - As Keeta processes the requests synchronously, then Keeta should return `HTTP 422`, indicating that that event has been received before.

      ### Acknowledgment Events


      When receiving new events via **Polling**, the Software Service should
      always send acknowledgement so that Keeta does not send that same event
      again;


      >**Important recommendations**:

      >

      > - Merchants Software Service should make an acknowledgment request for
      each polling request with results.  

      > - If it receives events that are not used by the itself, it needs to
      send the acknowledgment of these events anyway so that it is not receiving
      them every polling again.   

      > - It is recommended that this be the default treatment for all events
      not yet mapped in the Software Service application.  

      > - The Software Services only needs to send acknowledgment of the event
      once.


      > **IMPORTANT**: Acknowledgment NOT apply for WEBHOOKS.
  - name: ordersWebhook
    x-displayName: └────► Webhook
    description: >-

      Receiving events via Webhook works as follows:


      <div align="center">
        <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/webhook.png" />
      </div>


      ### Order Event Notification

      Webhook is sent to notify the merchant **Software Service** that an new
      order event has happened on  **Keeta**.


      The merchant **Software Service** that implements this webhook, should
      return an HTTP `200` response code with an empty response body to
      acknowledge receipt of the webhook event. 

      If  **Keeta** does not receive a `200` acknowledgement response, than the
      webhook event will be resent based on  **Keeta** policies.


      **Keeta Webhook Retry Policy**

      The Keeta webhook retry policy is designed to ensure reliable delivery of
      webhook events. If the merchant **Software Service** does not acknowledge
      receipt of a webhook event with a `200` response, Keeta will retry sending
      the event up to 3 times. The retries will occur at intervals of 1 minute,
      2 minutes and finally 3 minutes. If the merchant **Software Service**
      still does not acknowledge the event after these retries, the event will
      be considered undelivered.


      ### Webhook Headers

      **Open Delivery** will include security headers for all requests made to
      the merchant **Software Service** webhook URL.


      **Header Description**


      | Header            | Description |

      | ----------------- | ----------- |

      | X-App-Id          | An Unique Identificator of  **Keeta** |

      | X-App-MerchantId   | An Unique Identificator of the **Merchant**
      receiving the order |      

      | X-App-Signature   | SHA256 hash of the request body, using the client
      secret as the key |



      **Webhook Security** 


      Webhook messages are signed so that the merchant Software Service can
      verify that the sender is a valid Keeta. Webhooks requests contain an
      X-App-Signature header.
  - name: orderAPI
    x-displayName: └────► Order API
    description: ' '
  - name: merchantFulfillAPI
    x-displayName: └────► Merchant Fulfill API
    description: >-
      The endpoint below should be used **when the order logistics service is
      provided by the Merchant** and is only available for updates **after the
      merchant accepts the order**. Orders that are completed or cancelled
      cannot be updated.
servers:
  - url: https://open.mykeeta.com/api/open/opendelivery
paths:
  /oauth/token:
    post:
      operationId: getToken
      security: []
      tags:
        - authentication
      summary: Get Access Token
      description: >-
        Requests new access token for accessing Keeta API resources. <br>

        > **IMPORTANT:**  The client_id and client_secret are issued by Keeta.
        **The token  can be used to access all stores authorized**.

        The Software Service must obtain the merchant’s authorization before
        accessing their data.


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      requestBody:
        $ref: '#/components/requestBodies/Token'
      responses:
        '200':
          description: Successful returns token request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /oauth/authorization/url:
    get:
      operationId: getAuthorizationUrl
      security: []
      tags:
        - authentication
      summary: Get Authorization URL
      description: >-
        Get Keeta merchant authorization link for merchant authorization
        process.<br>


        > **NOTE:** Merchants can click this link to complete the authorization
        process.


        The returned URL can be used to redirect merchants to Keeta's
        authorization page.


        URL Example:
        "https://merchant.mykeeta.com/m/web/openapi/authorize?locale=en&region=BR&cityId=110200008&risk_cost_id=&responseType=client_credentials&appId=2123830428&redirectUri=&state=&scope=all/#/app-activation"<br>


        **Authorization Flow:**

        If Software Services wants merchants to be redirected to your own page
        after authorization, you can set the `redirectUri` parameter
        accordingly. 


        When the merchant completes authorization, they will be redirected to
        your specified `redirectUri` with the following parameters appended:


        ```

        redirectUri?authId=authId&state=%s&appId=%s&timestamp=%s

        ```


        **Parameter definitions:**

        - **`authId`**: Unique authorization identifier for this specific
        authorization session. Use this ID for subsequent API calls.

        - **`state`**: State parameter for request/response correlation (matches
        your original request)

        - **`appId`**: Your application identifier

        - **`timestamp`**: Authorization completion timestamp <br>

        For detailed workflow, please refer to: [Merchant Self-serve
        Authorization](#tag/Merchant-Self-serve-Authorization)"


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionGETSS_OA.png" />
        </div>
      parameters:
        - name: clientId
          in: query
          required: true
          description: Client ID
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved authorization URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  merchantAuthorizationUrl:
                    type: string
                    description: Authorization URL for merchant
                    example: >-
                      https://merchant.mykeeta.com/m/web/openapi/authorize?locale=en&region=BR&cityId=110200008&risk_cost_id=&responseType=client_credentials&appId=2123830428&redirectUri=&state=&scope=all/#/app-activation
                required:
                  - merchantAuthorizationUrl
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /oauth/authorized/{authId}/merchantInfo:
    get:
      operationId: getMerchantInfo
      security:
        - OAuth2:
            - od.all
          Sig: []
      tags:
        - authentication
      summary: Get Authorized Merchant Store List
      description: >-
        Retrieves authorized merchant store list with basic store information
        and pagination data.<br>


        > **IMPORTANT:** Valid access token required to access this endpoint.


        Returns all authorized store information for the specified authorization
        ID with pagination support.


        > **USE CASE:** This endpoint is commonly used for **store binding**
        functionality, allowing service providers to retrieve authorized store
        details and bind them to their own systems for shop onboarding.


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>


        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionGETSS_OA.png" />
        </div>
      parameters:
        - name: authId
          in: path
          required: true
          description: ' Authorization ID that uniquely identifies a specific authorization session. <br> Each authorization generates a unique authId. There are two ways to obtain the authId: <br> 1. Merchant authorization redirect - the authId is included in the redirect URL        <br> 2. Keeta Authorization Webhook - the authId is provided in the webhook payload <br> Please refer to the following for the specific workflow:[Merchant Self-serve Authorization](#tag/Merchant-Self-serve-Authorization)'
          schema:
            type: string
        - name: pageNum
          in: query
          required: false
          description: Page number starting from 1
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: pageSize
          in: query
          required: false
          description: Number of items per page
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successfully retrieved merchant store information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantData'
              examples:
                success:
                  summary: Successful response example
                  value:
                    userId: 12345678
                    brandId: 1001
                    brandName: Sample Brand
                    authorizedShops:
                      - id: 159416882
                        name: stbaxi3 - API Test store
                        address: Rua Augusta, 500, São Paulo, SP, Brasil
                        longitude: 46.049568
                        latitude: -18.770281
                        timeZone: America/Sao_Paulo
                    page:
                      pageNum: 1
                      pageSize: 10
                      totalPage: 1
                      totalCount: 3
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /webhook/authorization:
    post:
      operationId: receiveAuthorizationWebhook
      security: []
      tags:
        - authentication
      summary: Receive Authorization Status Change Notification
      parameters:
        - in: header
          name: X-App-Signature
          required: true
          schema:
            type: string
            format: SHA256
            description: >-
              SHA256 hash of the request body, using the client secret as the
              key
      description: >-
        **Webhook Endpoint for Software Services**<br>


        This endpoint should be implemented by Software Services to receive
        authorization status change notifications from Keeta system.<br>


        > **IMPORTANT:** This is an endpoint you need to implement on your
        server.


        **How to configure webhooks**  You can log in to the Developer Portal,
        where there is a webhook configuration section. You can configure
        webhooks there.

        Please focus only on the webhook configuration for Formal Store. 1301
        represents the webhook for new authorization notifications, and 1302
        represents the webhook for authorization cancellation notifications.


        <p><img src="./images/webhook_for_authorization.jpg" /></p>


        **Notification Triggers:**

        - Merchant adds new store authorization

        - Merchant cancels store authorization


        **Technical Requirements:**

        - **Method:** HTTP POST

        - **Content-Type:** application/json

        - **Response Time:** Recommended within 5 seconds

        - **HTTP Status:** Must return 200 for success

        - **Response Format:** JSON with code and message fields


        **Best Practices:**

        - **Idempotency:** Use authId and opType to ensure operation idempotency

        - **Async Processing:** Respond quickly, process business logic
        asynchronously

        - **Logging:** Log all received notifications for troubleshooting

        - **Monitoring:** Set up monitoring and alerting for webhook reception


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Service Provider**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTOA_SS.png" />
        </div> 
      requestBody:
        required: true
        description: Authorization status change notification data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookNotification'
            example:
              clientId: 2666245991
              authId: '41008'
              opType: 1
              shopId: 478268
              shopName: 10 Shanghai
              createTime: 1753151456973
      responses:
        '200':
          description: Successfully processed webhook notification
        '400':
          description: Invalid webhook data format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                status: 400
                title: Invalid data format
        '500':
          description: Internal server error processing webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                status: 500
                title: Internal server error
  /v1/merchantOnboarding:
    put:
      tags:
        - merchantEndpoints
      operationId: putMerchantOnboarding
      summary: Register / Update Merchant endpoint info.
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Register and update the Merchant endpoint [GET
        /v1/merchant](#operation/getMerchant) information in  Keeta. <br /><br
        />

        For the Software Service, **all authorized merchant will use the same
        token**. 

        To enable Keeta to identify which merchant needs to be registered,

        the Software Service  must include the **Keeta merchant ID** in its
        requests.

        **The Software Service should also save the mapping relationship between
        the Keeta merchant ID and its own merchant ID in the system.**

        Merchants can obtain this merchantId from the Keeta merchant portal.

        > **IMPORTANT**: 

        > 1. It is necessary to provide the Keeta merchant ID to ensure that the
        mapping between the merchant ID of Software Service and the merchantId
        of Keeta is accurate.

        > 2. If an existing `Keeta MerchantId` or `External MerchantId` under
        the App has been previously registered, any subsequent onboarding
        request containing these identifiers will result in the deletion of
        historical data and the creation of a new mapping configuration.

        > 3. **Store registration via onboarding endpoint must be completed
        prior to order flow integration.** This enables Keeta to properly
        identify the merchantId in your system. Otherwise, no order events will
        be received via polling or webhook.


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPUTSS_OA.png" />
        </div>
      parameters:
        - in: query
          name: merchantId
          required: true
          schema:
            type: string
            description: >-
              The ID of the Merchant for whom you want to complete or change
              registration info.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantAPIInfo'
      responses:
        '201':
          description: Resource has been created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantAPIInfo'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/merchant:
    get:
      servers:
        - url: https://{domain_of_the_software_service}
      tags:
        - merchantEndpoints
      operationId: getMerchant
      summary: Get information of a Merchant
      security:
        - {}
        - apiKey: []
      description: >-
        Endpoint to get data of a specific merchant, such as basic info, menus,
        and services.

        - this endpoint can **optionally** require an **apiKey** for
        authentication, and the Software Service that hosts the endpoint can
        decide whether it is needed.

        - The Software Service can pass the data through the [PUT
        /v1/merchantOnboarding](#operation/putMerchantOnboarding) endpoint.

        > **An item must have either a delivery price or a pickup price.
        Currently, item with only `indoor` price is not permitted.**


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **SOFTWARE SERVICE**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionGETOA_SS.png" />
        </div>
      responses:
        '200':
          description: Successful returns Merchant information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Merchant'
              examples:
                menuExample:
                  $ref: '#/components/examples/merchantExample'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/merchantUpdate/{merchantId}:
    post:
      summary: New Merchant Update Notification
      description: >-

        > **POST /v1/merchantUpdate/{merchantId}** 



        Information about a update in the systems.


        This endpoint can be used in the following ways:


        **1 - Sent with an empty body:**  

        This will force Keeta to make a new request to the [GET
        /v1/merchant](#operation/getMerchant) endpoint to update all the
        merchant information.


        **2 - Sent with only the `merchantStatus` field:**  

        This will force the opening or closing of the merchant within Keeta,
        without forcing a new [GET /v1/merchant](#operation/getMerchant) call.


        **3 - Sent with only the `entityType` and `updatedObjects` fields:**  

        This will force  Keeta to update only the sent objects, without forcing
        a new [GET /v1/merchant](#operation/getMerchant) call.

        > **IMPORTANT:**

        > </br>1- Please do not pass `merchantStatus` and
        `entityType`&`updatedObjects` at the same time. When `merchantStatus`
        has a value, the request will be regarded as updating only merchant
        status, and `entityType`&`updatedObjects` will be ignored.Please update
        merchant status and other entity separately. 

        > </br>2- When the `entityType` field is populated, the `updatedObjects`
        field cannot be empty.

        > </br>3- It is recommended not to pass an empty body, but to pass a
        specific entity to be updated to avoid invalid update operations.

        > </br>4- An item must have either a delivery price or a pickup price.
        Currently, item with only `indoor` price is not permitted.

        > </br>5- The business status of a store is determined by many factors
        (business hours, number of items available for sale, merchant status,
        etc.).


        <br /><br />  

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**  


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      operationId: merchantUpdate
      parameters:
        - name: merchantId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the merchant. The merchantId is generated
              by the Software Service.
      tags:
        - merchantEndpoints
      security:
        - OAuth2:
            - od.all
          Sig: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantUpdate'
      responses:
        '204':
          description: >-
            The change was successfully notified to Keeta, but since **Keeta may
            be updated asynchronously**, this status code does not mean that the
            change has been applied to Keeta.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/events:polling:
    get:
      operationId: pollingEvents
      parameters:
        - name: x-polling-merchants
          in: header
          required: false
          schema:
            type: array
            description: >-
              Subset of merchants to fetch events from. Must either be omitted
              or non-empty.
            items:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's Software Service.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            maxItems: 100
        - name: eventType
          in: query
          schema:
            type: array
            description: >-
              Desired event types. All other events not selected by group will
              be automatically acknowledged and omitted from the response. 

              Must either be omitted or non-empty.


              **Event Types definitions:**

              > `CREATED` : Order created.\

              > `CONFIRMED` : Order confirmed.       

              > `READY_FOR_PICKUP`: Order ready for pickup by the customer or
              delivery person.\

              > `DISPATCHED` : Order went out for delivery.\

              > `PICKED_UP` : Order has been picked up by customer.\

              > `DELIVERED` : Order has been delivered to customer.\

              > `CONCLUDED` : Order completed.\

              > `CANCELLATION_REQUESTED` : Sent by the Software Service to
              Keeta.\

              > `CANCELLED` : When the order is actually cancelled.\

              > `USER_REFUND_REQUEST` : Sent by Keeta to the Software Service.\

              > `REFUNDED` : Sent by Keeta to the Software Service.\

              > `REFUND_FAILED` : Sent by Keeta to the Software Service.
            items:
              type: string
              description: >-
                The event type. **[Click here](#operation/pollingEvents)** for
                definitions of each type.
              enum:
                - CREATED
                - CONFIRMED
                - DISPATCHED
                - READY_FOR_PICKUP
                - PICKED_UP
                - DELIVERED
                - CONCLUDED
                - CANCELLATION_REQUESTED
                - CANCELLED
                - USER_REFUND_REQUEST
                - REFUNDED
                - REFUND_FAILED
            maxItems: 12
      tags:
        - ordersPolling
      summary: Get New Events
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Polls events for any orders from merchants associated with the
        authenticated user.  

        Each event received from this endpoint must be properly acknowledged,
        otherwise it will continue to be returned on further requests.


        > Important: The software service **must first call the [Merchant
        Onboarding](#operation/putMerchantOnboarding) endpoint** to register the
        store before calling this endpoint, otherwise the polling endpoint will
        not be able to obtain the events.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionGETSS_OA.png" />
        </div>
      responses:
        '200':
          description: Successful returns list of polled events .
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderEventPollingResponse'
        '204':
          description: No content.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/events/acknowledgment:
    post:
      requestBody:
        $ref: '#/components/requestBodies/AckEvents'
      tags:
        - ordersPolling
      operationId: pollingAcknowledgment
      summary: Acknowledge Events
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Acknowledge a set of events, dismissing them from future polling calls.

        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}:
    get:
      parameters:
        - name: orderId
          required: true
          in: path
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by 
              Keeta.
      tags:
        - orderAPI
      operationId: orderDetails
      summary: Get Order Details
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Endpoint to consult the details of an order.

        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionGETSS_OA.png" />
        </div>
      responses:
        '200':
          description: Order returning success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/confirm:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by 
              Keeta.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderConfirmed'
      tags:
        - orderAPI
      operationId: confirmOrder
      summary: Confirm
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs  **Keeta** that the order has been accepted and preparation will
        start soon.


        > It is expected to receive a `CONFIRMED` event after this action.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/readyForPickup:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by
              Keeta.
      tags:
        - orderAPI
      summary: Ready For Pickup
      operationId: orderReady
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs  **Keeta** that the order is ready for pickup.


        > It is expected to receive a `READY_FOR_PICKUP` event after this
        action.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/dispatch:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by 
              Keeta.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderDispatched'
      tags:
        - merchantFulfillAPI
      operationId: dispatchOrder
      summary: Dispatch
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs  **Keeta** that the order has been dispatched.


        > It is expected to receive a `DISPATCHED` event after this action.


        **Important:** This endpoint should be sent **only in cases where the
        order logistics service is provided by the Merchant and not the
        Marketplace**.


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/delivered:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by 
              Keeta.
      tags:
        - merchantFulfillAPI
      operationId: orderDelivered
      summary: Delivered (Optional)
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs  **Keeta** that the order has been delivered.


        > It is expected to receive a `DELIVERED` event after this action.


        **Important:** This endpoint is not mandatory and should be sent **only
        if the Ordering Application is able to receive this request and only in
        cases where the order logistics service is provided by the Merchant and
        not the Marketplace**.


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/tracking:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by 
              Keeta.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderTracking'
      tags:
        - merchantFulfillAPI
      operationId: sendDeliveryUpdates
      summary: Send Delivery Updates (Optional)
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Sends information about the delivery in progress.


        **This endpoint should be used when the delivery is the responsibility
        of the Merchant, so the Software Service should send the delivery
        updates to the Ordering Application.**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/requestCancellation:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by
              Keeta.
      requestBody:
        $ref: '#/components/requestBodies/CancelRequest'
      tags:
        - orderAPI
      operationId: requestCancellation
      summary: Request order cancellation
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Request order cancellation to Keeta.


        > It is expected to receive a `CANCELLATION_REQUESTED` event after this
        action.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '202':
          $ref: '#/components/responses/Accepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntityOrderCancellation'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/acceptRefund:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by
              Keeta.
      tags:
        - orderAPI
      operationId: acceptRefund
      summary: Accept order refund
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs Keeta that the refund request has been accepted and the order
        can be refunded.


        > It is expected to receive a `REFUNDED` event after this action.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '204':
          description: Order refund has been confirmed. No response content.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/orders/{orderId}/rejectRefund:
    post:
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              The unique identifier of the order. The order ID is generated by
              Keeta.
      requestBody:
        $ref: '#/components/requestBodies/RefundDenied'
      tags:
        - orderAPI
      operationId: rejectRefund
      summary: Deny order refund
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Informs Keeta that the refund request has been denied and the order
        cannot be refunded.


        > It is expected to receive a `REFUND_FAILED` event after this action.


        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **Keeta**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTSS_OA.png" />
        </div>
      responses:
        '204':
          description: Order refund has been denied. No response content.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/newEvent:
    post:
      operationId: newEvent
      security:
        - {}
      parameters:
        - in: header
          name: X-App-Id
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              An unique Identificator of the `**Keetas**`. The same ID must be
              sent to all `**Software Service**s` that implements this webhook.
        - in: header
          name: X-App-MerchantId
          required: true
          schema:
            $ref: '#/components/schemas/Merchant/properties/id'
            description: 'An unique Identificator of the Merchant '
        - in: header
          name: X-App-Signature
          required: true
          schema:
            type: string
            format: SHA256
            description: >-
              SHA256 hash of the request body, using the client secret as the
              key, and finally encoded into Base64 format.
      summary: New Order Event Notification
      description: >-
        > **POST /v1/newEvent** 


        Information about a new event in the systems

        <br /><br />

        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">HOST:</span> **SOFTWARE SERVICE**


        <span style="text-decoration:underline; color:#26323880;
        font-size:13.006px">DIRECTION:</span>

        <div align="center">
          <img src="https://abrasel-nacional.github.io/docs/versions/rc/images/directionPOSTOA_SS.png" />
        </div>
      tags:
        - ordersWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Event'
      responses:
        '200':
          description: >-
            Status 200 available for compatibility reasons. Please use status
            204 instead.
        '204':
          description: Data was received successfully. No response content.
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /v1/batchDecrypt:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchDecryptRequest'
      tags:
        - orderAPI
      operationId: batchDecrypt
      summary: BatchDecrypt
      security:
        - OAuth2:
            - od.all
          Sig: []
      description: >-
        Call this endpoint to decrypt the encrypted data returned by the API.

        > 1. For **merchant self-delivery or third-party logistics (3PL)**
        orders, this endpoint can be called to decrypt the user's phone number
        and address.

        > 2. A maximum of **50** data items can be decrypted at once.

        > 3. The encrypted data generally uses `ENC_` as a prefix.


        The following data returned by the order details endpoints will be
        encrypted data (ciphertext data prefixed with `ENC_`):

        > 1. customer.​phone.​number

        > 2. delivery.​deliveryAddress.​district

        > 3. delivery.​deliveryAddress.​number

        > 4. delivery.​deliveryAddress.complement

        > 5. delivery.​deliveryAddress.​formattedAddress
      responses:
        '200':
          description: Message batch decrypt success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDecryptResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      description: >-
        OAuth2 should be the standard authentication method between parties.  

        - For the **ORDERS** and **MERCHANT** endpoints,  **Keeta** is
        responsible for credentials and token generation.  

        - For the **LOGISTICS** endpoints, the **Logistics Service** will be
        responsible for managing these infos.  

        > Webhooks are an exception and have their own authentication method,
        not using OAuth.


        As of the time of this release only one scope will be used for all
        endpoints: `od.all`.

        ### Generating a Client Credentials Token

        To generate a client credentials token, the merchant **Software
        Service** must retrieve the **clientId** and **clientSecret** from a
        **Keeta** or **Logistics Service** company and access the
        [/oauth/token](#operation/getToken) endpoint.

        > **Keeta** provide one `clientId` and `clientSecret` credentials for 
        **Software Service**. Each **Software Service** is assigned only one
        client_id and client_secret.

        ### Usage

        The **accessToken** field will contain the token used to authenticate
        against the **Open Delivery** APIs. Once you’ve obtained this token, you
        can provide it in the “Authorization” header of requests you make to
        endpoints that require client credentials scopes.

        The **expiresIn** field indicates the lifetime of the access token,
        provided in seconds. This should be cached and re-used across requests
        until (or shortly before) expiration, not re-generated per request.

        ```

        curl 
         -H 'authorization: Bearer <TOKEN>' 
         https://{baseURL}/v1/events:polling
        ```

        > Refresh Token is not available at this version.
      flows:
        clientCredentials:
          tokenUrl: oauth/token
          scopes:
            od.all: Access to all **Open Delivery** APIs
    apiKey:
      type: apiKey
      description: >-
        The apiKey is a key that should be generated by the endpoint's host and
        passed to its clients. Each client of the endpoint can have its own key.
        The creation and content of the key is of responsibility of the
        endpoint's host.

        > As of the time of this release, only the **[GET
        /v1/merchant](#operation/getMerchant)** endpoint can require
        authentication via apiKey.
      in: header
      name: X-API-KEY
    Sig:
      type: apiKey
      description: >-
        To enhance overall security, Keeta requires **Software services** to
        include a signature in the header when making requests to Keeta. <br>The
        signature should be generated as follows: SHA256 hash of the request
        body, using the client secret as the key.
      in: header
      name: X-App-Signature
  requestBodies:
    Token:
      required: true
      content:
        application/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/TokenRequest'
          examples:
            newToken:
              $ref: '#/components/examples/tokenExample'
    AckEvents:
      required: true
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AckEvents'
            maxItems: 100
    CancelRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RequestCancelled'
    RefundDenied:
      description: Request for order cancellation has been denied.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RequestDenied'
    DeliveryOrder:
      description: Request for a new delivery order
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeliveryOrder'
    DeliveryEvent:
      description: New event
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeliveryOrderEvent'
    DeliveryHandleProblem:
      description: New event
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeliveryHandleProblem'
    DeliveryCancel:
      description: New event
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeliveryCancel'
  responses:
    Accepted:
      description: Request has been accepted for processing.
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Request lacks valid authentication credentials for the target resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    AccessDenied:
      description: Authenticated participant request that violates some authorization rule.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: >-
        Server understands the content type of the request entity, and the
        syntax of the request entity is correct, but it was unable to process
        the contained instructions. (Check if the instruction has not been sent
        before.)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntityOrderCancellation:
      description: >-
        Server understands the content type of the request entity, and the
        syntax of the request entity is correct, but it was unable to process
        the contained instructions. (Check if the instruction has not been sent
        before.)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CancellationError'
    ServiceUnavailable:
      description: >-
        Service is not currently available. Requested service may be under
        maintenance or outside the operating window.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    VersionOrderingApp:
      type: object
      properties:
        merchant:
          type: object
          description: Information regarding the **Merchant's** standard endpoints.
          properties:
            version:
              type: string
              description: |-
                Current version for MERCHANT endpoints.

                Existing MERCHANT routes:

                > - "POST /v1/merchantUpdate"
                > - "GET /v1/merchantStatus"
              enum:
                - 1.0.0
                - 1.0.1
                - 1.1.0
                - 1.1.1
                - 1.2.0
                - 1.2.1
                - 1.3.0
                - 1.3.1
                - 1.4.0
                - 1.5.0
        order:
          type: object
          description: Information regarding the **Order's** standard endpoints.
          properties:
            version:
              type: string
              description: |-
                Current version for ORDER endpoints.

                Existing ORDER routes:

                >  - "GET /v1/events:polling"
                >  - "POST /v1/events/acknowledgment"
                >  - "GET /v1/orders/{orderId}"
                >  - "POST /v1/orders/{orderId}/confirm"
                >  - "POST /v1/orders/{orderId}/preparing"
                >  - "POST /v1/orders/{orderId}/readyForPickup"
                >  - "POST /v1/orders/{orderId}/pickedUp"                
                >  - "POST /v1/orders/{orderId}/dispatch"
                >  - "POST /v1/orders/{orderId}/delivered"                
                >  - "POST /v1/orders/{orderId}/requestCancellation"
                >  - "POST /v1/orders/{orderId}/acceptCancellation"
                >  - "POST /v1/orders/{orderId}/denyCancellation"
              enum:
                - 1.0.0
                - 1.0.1
                - 1.1.0
                - 1.1.1
                - 1.2.0
                - 1.2.1
                - 1.3.0
                - 1.3.1
                - 1.4.0
                - 1.5.0
            availableEventsMethods:
              type: array
              description: >-
                Lists which methods for obtaining new order events the
                **Software Service** can use with this **Keeta**.
              items:
                type: string
                enum:
                  - POLLING
                  - WEBHOOK
    VersionMerchant:
      type: object
      properties:
        merchantEndpoint:
          type: string
          description: Current version for the `GET /v1/merchant` endpoint.
          enum:
            - 1.0.0
            - 1.0.1
            - 1.1.0
            - 1.1.1
            - 1.2.0
            - 1.2.1
        ordersWebhook:
          type: string
          description: Current version for the `/v1/orderUpdate` webhook.
          enum:
            - 1.0.0
            - 1.0.1
            - 1.1.0
            - 1.1.1
            - 1.2.0
            - 1.2.1
    CommonResponse:
      type: object
      required:
        - status
      properties:
        status:
          type: integer
          description: Response Code
        title:
          type: string
          description: Response Message
    OrderEventPollingResponse:
      type: array
      items:
        $ref: '#/components/schemas/Event'
      maxItems: 1000
      description: Response Message
    TokenRequest:
      type: object
      title: TokenRequest
      required:
        - client_id
        - client_secret
        - grant_type
      properties:
        client_id:
          type: string
          description: Client identifier provided by Keeta.
        client_secret:
          type: string
          description: Client Secret provided by Keeta.
        grant_type:
          type: string
          description: >-
            The OAuth grant type. Currently, the only supported grant type is
            `client_credentials`.
          enum:
            - client_credentials
    TokenResponse:
      type: object
      title: TokenResponse
      required:
        - access_token
        - token_type
      properties:
        access_token:
          type: string
          description: A code representing the access token.
        token_type:
          type: string
          description: The token type. Currently, the only supported type is `bearer`
          enum:
            - bearer
        expires_in:
          type: number
          format: double
          description: The token expiration time in seconds
    Merchant:
      type: object
      title: MenuEntity
      required:
        - id
        - status
        - basicInfo
        - services
        - items
        - menus
        - categories
        - itemOffers
      properties:
        lastUpdate:
          type: string
          format: date-time
          description: >-
            The last modified date and time in ISO timestamp format but with
            type String. 

            This should be used in conjuction of the TTL field to update the
            information on the ordering aplication. 

            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info)."


            > **Keeta does not support this field and will be ignored.**
          example: '2021-05-27T20:45:10.332Z'
        TTL:
          type: integer
          description: |-
            Time to Live (in seconds).
            - Min: 500
            - Max: 86400

            A new request must be done when the TTL expires.
            > **Keeta does not support this field and will be ignored.**
          example: 500
        id:
          type: string
          description: >-
            Unique Identifier. Identifies the merchant in the different systems
            that the merchant will communicate.  

            This id must be generated by the merchant's **`Software Service`**.


            > The software service should ensure that merchantId is unique.


            > If this is not possible, it is recommended to at least use a UUID.
          minLength: 36
          maxLength: 100
          example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
        status:
          type: string
          description: >-
            Indicates if the Merchant is Available or Unavailable. Only use this
            type when you must close (disable) the merchant due to an unexpected
            event and you don't know when the service will be re-established
            (e.g. do not use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        basicInfo:
          type: object
          description: A required entity to implement. Describes basic info of a merchant.
          allOf:
            - $ref: '#/components/schemas/BasicInfo'
        services:
          type: array
          description: >-
            A required entity to implement. Describes food ordering services
            details for a merchant.
          items:
            $ref: '#/components/schemas/Service'
        menus:
          type: array
          description: A required entity to implement. Describes an array of menus.
          items:
            $ref: '#/components/schemas/Menu'
        categories:
          type: array
          description: >-
            A required entity to implement. Describes an array of sections in
            the menu where `ItemOffers` will be showed.
          items:
            type: object
            $ref: '#/components/schemas/Category'
        itemOffers:
          type: array
          description: >-
            A required entity to implement. Describes an array of offers for the
            `Items`.
          items:
            type: object
            $ref: '#/components/schemas/ItemOffer'
        items:
          type: array
          description: >-
            A required entity to implement. Describes an array of items. To be
            used with an `ItemOffer` or an `Option`.
          items:
            $ref: '#/components/schemas/Item'
        optionGroups:
          type: array
          description: >-
            An optional entity to implement. Describes additional options of an
            `ItemOffer`.
          items:
            $ref: '#/components/schemas/OptionGroup'
        availabilities:
          type: array
          description: >-
            An optional entity to implement. Describes the time period during
            which a `Category` or an `ItemOffer` entity is served.


            > **Note:**

            > <br/>Our current menu model supports the following options for
            configuring product availability:
              <br/>&nbsp;&nbsp;&nbsp;&nbsp; 1. Specific date ranges defined by the startDate and endDate fields
              <br/>&nbsp;&nbsp;&nbsp;&nbsp; 2. A weekly schedule defined by the hours array
              <br/>**Combination of 1 and 2 are not supported.**
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/Availability'
    UpdateMerchant:
      type: object
      required:
        - id
        - status
        - basicInfo
        - services
        - items
        - menus
        - categories
        - itemOffers
      properties:
        id:
          type: string
          description: >-
            Unique Identifier. Identifies the merchant in the different systems
            that the merchant will communicate.  

            This id must be generated by the merchant's **`Software Service`**.


            > The software service should ensure that merchantId is unique.


            > If this is not possible, it is recommended to at least use a UUID.
          minLength: 36
          maxLength: 100
        status:
          type: string
          description: >-
            Indicates if the Merchant is Available or Unavailable. Only use this
            type when you must close (disable) the merchant due to an unexpected
            event and you don't know when the service will be re-established
            (e.g. do not use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        basicInfo:
          type: object
          description: A required entity to implement. Describes basic info of a merchant.
          allOf:
            - $ref: '#/components/schemas/BasicInfo'
        services:
          type: array
          description: >-
            A required entity to implement. Describes food ordering services
            details for a merchant.
          items:
            $ref: '#/components/schemas/Service'
        menus:
          type: array
          description: A required entity to implement. Describes an array of menus.
          items:
            $ref: '#/components/schemas/Menu'
        categories:
          type: array
          description: >-
            A required entity to implement. Describes an array of sections in
            the menu where `ItemOffers` will be showed.
          items:
            type: object
            $ref: '#/components/schemas/Category'
        itemOffers:
          type: array
          description: >-
            A required entity to implement. Describes an array of offers for the
            `Items`.
          items:
            type: object
            $ref: '#/components/schemas/ItemOffer'
        items:
          type: array
          description: >-
            A required entity to implement. Describes an array of items. To be
            used with an `ItemOffer` or an `Option`.
          items:
            $ref: '#/components/schemas/Item'
        optionGroups:
          type: array
          description: >-
            An optional entity to implement. Describes additional options of an
            `ItemOffer`.
          items:
            $ref: '#/components/schemas/OptionGroup'
        availabilities:
          type: array
          description: >-
            An optional entity to implement. Describes the time period during
            which a `Category` or an `ItemOffer` entity is served.


            > **Note:**

            > <br/>Our current menu model supports the following options for
            configuring product availability:
              <br/>&nbsp;&nbsp;&nbsp;&nbsp; 1. Specific date ranges defined by the startDate and endDate fields
              <br/>&nbsp;&nbsp;&nbsp;&nbsp; 2. A weekly schedule defined by the hours array
              <br/>**Combination of 1 and 2 are not supported.**
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/Availability'
    MerchantDescription:
      type: object
      title: MenuEntity
      required:
        - id
        - status
        - basicInfo
        - services
        - items
        - menus
        - categories
        - itemOffers
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Unique Identifier. Must be formatted with `Merchant Document +
            UUID` 

             This id must be generated by the company responsible for the merchant's menu and have to be informed in the Order object by the ***Keeta***.
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
        basicInfo:
          type: object
          description: |-
            See: **[BasicInfo](#section/BasicInfo)** 

             A required entity to implement. Describes basic info of a merchant.
        services:
          type: array
          description: |-
            See: **[Service](#section/Service)** 

             A required entity to implement. Describes food ordering services details for a merchant.
          items:
            type: object
        menus:
          type: array
          description: |-
            See: **[Menu](#section/Menu)** 

             A required entity to implement. Describes an array of menus.
          items:
            type: object
        items:
          type: array
          description: |-
            See: **[Item](#section/Menu/Item)** 

             A required entity to implement. Describes an array of items. To be used with an `ItemOffer` or an `OptionGroups`.
          items:
            type: object
        categories:
          type: array
          description: |-
            See: **[Category](#section/Menu/Category)** 

             A required entity to implement. Describes an array of sections in the menu where `ItemOffers` will be showed.
          items:
            type: object
        itemOffers:
          type: array
          description: |-
            See: **[ItemOffers](#section/Menu/ItemOffer)** 

             A required entity to implement. Describes an array of offers for the `Items`.
          items:
            type: object
        optionGroups:
          type: array
          description: |-
            See: **[Options](#section/Menu/OptionGroup-and-Option)** 

             An optional entity to implement. Describes additional options of an `ItemOffer`.
          items:
            type: object
        availabilities:
          type: array
          description: |-
            See: **[Availability](#section/Menu/Availability)** 

             An optional entity to implement. Describes the time period during which a `Category` or an `ItemOffer` entity is served.
          items:
            type: object
    BasicInfo:
      type: object
      title: BasicInfo
      required:
        - contactEmails
        - contactPhones
      properties:
        name:
          type: string
          description: |-
            Merchant Public Name
            > **Keeta does not support this field and will be ignored.**
          maxLength: 500
          example: Pizza Plaza
        document:
          type: string
          description: |-
            Merchant Document
            > **Keeta does not support this field and will be ignored.**
          pattern: ^\d{14}$
          example: '22815773000169'
        corporateName:
          type: string
          description: |-
            Merchant Corporate Name
            > **Keeta does not support this field and will be ignored.**
          maxLength: 500
          example: Food Company
        description:
          type: string
          description: |-
            Merchant Description
            > **Keeta does not support this field and will be ignored.**
          example: Food company specializing in pizzas.
        averageTicket:
          type: number
          format: decimal
          description: >-
            Average Ticket. Can be used to show the price range of items
            available at the merchant. It is not mandatory, but recommended to
            be used.

            > **Keeta does not support this field and will be ignored.**
          example: 90
        averagePreparationTime:
          type: number
          format: double
          description: |-
            Average amount of time preparing an order takes, in minutes.
            > **Keeta does not support this field and will be ignored.**
          example: 20
        minOrderValue:
          type: object
          description: |-
            Minimum order value that the merchant accepts.
            > **Keeta does not support this field and will be ignored.**
          allOf:
            - $ref: '#/components/schemas/Price'
        merchantType:
          type: string
          description: |-
            Merchant Type.Currently, only `RESTAURANT` is accepted.
            > **Keeta does not support this field and will be ignored.**
          enum:
            - RESTAURANT
          example: RESTAURANT
        merchantCategories:
          type: array
          description: |-
            Merchant Categories
            > **Keeta does not support this field and will be ignored.**
          items:
            type: string
            enum:
              - BURGERS
              - PIZZA
              - FAST_FOOD
              - HOT_DOG
              - JAPANESE
              - DESSERTS
              - AMERICAN
              - ICE_CREAM
              - BBQ
              - SANDWICH
              - MEXICAN
              - BRAZILIAN
              - PASTRY
              - ARABIAN
              - COMFORT_FOOD
              - VEGETARIAN
              - VEGAN
              - BAKERY
              - HEALTHY
              - ITALIAN
              - CHINESE
              - JUICE_SMOOTHIES
              - SEAFOOD
              - CAFE
              - SALADS
              - COFFEE_TEA
              - PASTA
              - BREAKFAST_BRUNCH
              - LATIN_AMERICAN
              - CONVENIENCE
              - PUB
              - HAWAIIAN
              - EUROPEAN
              - FAMILY_MEALS
              - FRENCH
              - INDIAN
              - PORTUGUESE
              - SPANISH
              - GOURMET
              - KIDS_FRIENDLY
              - SOUTH_AMERICAN
              - SPECIALTY_FOODS
              - ARGENTINIAN
              - PREMIUM
              - AFFORDABLE_MEALS
          example:
            - PIZZA
            - FAMILY_MEALS
            - PREMIUM
        address:
          type: object
          description: |-
            Merchant Address
            > **Keeta does not support this field and will be ignored.**
          allOf:
            - $ref: '#/components/schemas/Address'
        contactEmails:
          type: array
          description: Merchant Contact Emails. **Only supports up to 3**.
          items:
            type: string
          example:
            - food@company.com
        contactPhones:
          type: object
          description: Merchant Contact Phones.
          allOf:
            - $ref: '#/components/schemas/ContactPhones'
        logoImage:
          type: object
          description: |-
            Image to be used as the merchant logo.
            > **Keeta does not support this field and will be ignored.**
          allOf:
            - $ref: '#/components/schemas/Image'
        bannerImage:
          type: object
          description: >-
            Image to be used as the merchant banner (the banner display depends
            on the client application interface).

            > **Keeta does not support this field and will be ignored.**
          allOf:
            - $ref: '#/components/schemas/Image'
        createdAt:
          type: string
          format: date-time
          description: >-
            Merchant creation date and time. \n\n(UTC date-time in ISO timestamp
            format. See [Guidelines](#section/General-Guidelines) for more
            info).

            > **Keeta does not support this field and will be ignored.**
        acceptedCards:
          type: array
          description: |-
            Indicates which card brands are accepted by the merchant.
            > **Keeta does not support this field and will be ignored.**
          items:
            type: string
            enum:
              - VISA
              - MASTERCARD
              - DINERS
              - AMEX
              - HIPERCARD
              - ELO
              - AURA
              - DISCOVER
              - VR_BENEFICIOS
              - SODEXO
              - TICKET
              - GOOD_CARD
              - BANESCARD
              - SOROCARD
              - POLICARD
              - VALECARD
              - AGICARD
              - JCB
              - CREDSYSTEM
              - CABAL
              - GREEN_CARD
              - VEROCHEQUE
              - AVISTA
              - OTHER
    Service:
      type: object
      title: Service
      required:
        - id
        - serviceType
        - menuId
        - serviceHours
      properties:
        id:
          type: string
          format: uuid
          description: Unique Identifier
          example: f078e8e2-3044-4eec-b4a8-8359810de123
        status:
          type: string
          description: >-
            Indicates if the entity is Avaliable or Unavaliable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays).

            > **Keeta does not support this field and will be ignored.**
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        serviceType:
          type: string
          description: >-
            The type of service being offered:  

            `DELIVERY` - for orders that will be delivered to the customer's
            address.  

            `TAKEOUT` - orders that will be picked up at the establishment by
            the customer  

            `INDOOR` - orders that will be consumed inside the establishment. 
          enum:
            - DELIVERY
            - TAKEOUT
            - INDOOR
          example: DELIVERY
        serviceTiming:
          type: object
          title: Service Timing
          description: |-
            Information regarding the accepted service times.
            > **Keeta does not support this field and will be ignored.**
          properties:
            timing:
              type: array
              description: >-
                Indicates the timings that the service accepts: 


                `INSTANT`: for orders that must be prepared immediately.  

                `SCHEDULED`: for orders scheduled for a specific date and
                time.  

                `ONDEMAND`: for orders that will only be delivered when the
                consumer indicates that they are going to pick it up.  


                Please inform all accepted types in the field.  

                If not informed, defaults to the `INSTANT` option.
              items:
                type: string
                enum:
                  - INSTANT
                  - SCHEDULED
                  - ONDEMAND
              default:
                - INSTANT
              example:
                - INSTANT
                - SCHEDULED
            schedule:
              type: object
              description: |-
                Information regarding the time windows for scheduling. 

                 This only applies to the `SCHEDULED` service timing.
              required:
                - scheduleTimeWindow
                - scheduleStartWindow
                - scheduleEndWindow
              properties:
                scheduleTimeWindow:
                  type: string
                  description: >-
                    Time window where scheduling will be possible. 


                    > Example: If `15_MINUTES` is chosen, then the available
                    scheduling times will be displayed every 15 minutes (e.g.
                    9:15, 9:30, 9:45, 10:00).
                  enum:
                    - 15_MINUTES
                    - 30_MINUTES
                    - 45_MINUTES
                    - 60_MINUTES
                    - 90_MINUTES
                    - 120_MINUTES
                scheduleStartWindow:
                  type: string
                  description: >-
                    Informs how long after the merchant has opened (considering
                    the `serviceHours` entity) the first schedule time will be
                    displayed.


                    > Example: Service starts at 9:00 and the option
                    `45_MINUTES` was entered, then the first available time for
                    scheduling will be 9:45.
                  enum:
                    - 15_MINUTES
                    - 30_MINUTES
                    - 45_MINUTES
                    - 60_MINUTES
                    - 90_MINUTES
                    - 120_MINUTES
                scheduleEndWindow:
                  type: string
                  description: >-
                    Informs how long before the merchant closes (considering the
                    `serviceHours` entity) the last schedule time will be
                    displayed.


                    > Example: Service ends at 23:00 and the option `60_MINUTES`
                    was entered, then the last available time for scheduling
                    will be 22:00.
                  enum:
                    - 15_MINUTES
                    - 30_MINUTES
                    - 45_MINUTES
                    - 60_MINUTES
                    - 90_MINUTES
                    - 120_MINUTES
        servicePriority:
          type: array
          description: >-
            Indicates to the Ordering Application whether the merchant works
            with different order preparation and delivery priorities.  

            Must enter up to how many priority levels the merchant serves.  

            If not entered, it means that the merchant does not have any
            specific configuration for working with priority, and may or may not
            be able to do so.


            > **Keeta does not support this field and will be ignored.**
          items:
            type: string
            enum:
              - PRIORITY1
              - PRIORITY2
              - PRIORITY3
              - PRIORITY4
              - PRIORITY5
          example:
            - PRIORITY1
            - PRIORITY2
        menuId:
          description: >-
            The id value of the `Menu` entity correlated to this `Service`
            entity.
          type: string
          format: uuid
          example: f627ccdc-6789-456f-a782-148538d5035b
        targetAppId:
          type: string
          format: uuid
          description: >-
            This field is for situations in which the merchant needs to send
            different menus for the same `serviceType` to different Ordering
            Applications (this can occur when there is an integration software
            between the merchant software and the Ordering Application). In this
            case this field must be filled in with the `AppId` of the
            OrderingApplication which will receive this `service` info.

            > **Keeta does not support this field and will be ignored.**
        serviceArea:
          type: object
          description: >-
            A conditional entity to implement (required if the Service entity
            associated has serviceType set to `DELIVERY`). Describes the
            geographical region in which food can be delivered.

            > **Keeta does not support this field and will be ignored.**
          allOf:
            - $ref: '#/components/schemas/ServiceArea'
        serviceHours:
          type: object
          description: >-
            A required entity to implement. Describes the time window which
            users can place orders.
          allOf:
            - $ref: '#/components/schemas/ServiceHours'
    ServiceArea:
      type: object
      title: Service Area
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the service area.
          example: 01339e6d-520b-429e-bc7c-dcfd2df42278
        polygon:
          type: array
          description: >-
            If the `polygon` is chosen to be used, `geoRadius` is not required.




            A polygon or multipolygon expressed as a series of three or more
            space delimited points.
          items:
            allOf:
              - $ref: '#/components/schemas/Polygon'
        geoRadius:
          type: object
          description: >-
            If the `geoRadius` is chosen to be used, `polygon` is not required.
            Indicates the approximate radius (in meters) of the CIRCLE area.
          allOf:
            - $ref: '#/components/schemas/GeoRadius'
        exclusionAreaPolygon:
          type: array
          description: >-
            This object will act as a complement, indicating specific polygons
            within the previously mapped delivery area, where NO deliveries will
            be made. 
             This field can be filled in regardless of whether `polygon` or `geoRadius` is used.
          items:
            allOf:
              - $ref: '#/components/schemas/ExclusionPolygon'
    Polygon:
      type: object
      title: Polygon
      required:
        - geoCoordinates
      properties:
        geoCoordinates:
          type: array
          description: >-
            Coordinates of each point of the polygon. It is recommended that the
            first and last points be the same, but it is not required.




            Each point in a polygon or multipolygon is defined by a latitude
            point followed by a longitude point. You also must specify the
            points in a counter-clockwise direction.
          items:
            type: object
            title: geoCoordinate
            required:
              - latitude
              - longitude
            properties:
              latitude:
                type: number
                format: float
                description: >-
                  Indicates the latitude coordinate of the polygon point.




                  Latitude in degrees. Values are restricted to the range [[-90,
                  90]].
                example: -23.54809
              longitude:
                type: number
                format: float
                description: >-
                  Indicates the longitude coordinate of the polygon point.




                  Longitude in degrees. Values are restricted to the range
                  [[-180, 180]].
                example: -46.63638
        price:
          type: object
          description: Price of the fee for this polygon
          allOf:
            - $ref: '#/components/schemas/Price'
          example:
            value: 5
            currency: BRL
        estimateDeliveryTime:
          type: integer
          description: Estimate delivery time for this polygon in minutes
    GeoRadius:
      type: object
      title: GeoRadius
      required:
        - geoMidpointLatitude
        - geoMidpointLongitude
        - radius
      properties:
        geoMidpointLatitude:
          type: number
          format: float
          description: |-
            Indicates the latitude coordinate at the center of the CIRCLE area.



            Latitude in degrees. Values are restricted to the range [[-90, 90]].
          example: -23.54809
        geoMidpointLongitude:
          type: number
          format: float
          description: >-
            Indicates the longitude coordinate at the center of the CIRCLE area.




            Longitude in degrees. Values are restricted to the range [[-180,
            180]].
          example: -46.63638
        radius:
          type: array
          description: >-
            Informations about each radius of the CIRCLE that the merchant
            serves.
          items:
            type: object
            title: radius
            required:
              - size
            properties:
              size:
                type: integer
                description: The size of the CIRCLE radius in meters.
              price:
                type: object
                description: Price of the fee for this CIRCLE size.
                allOf:
                  - $ref: '#/components/schemas/Price'
                example:
                  value: 5
                  currency: BRL
              estimateDeliveryTime:
                type: integer
                description: Estimate delivery time for this CIRCLE size in minutes.
    ExclusionPolygon:
      type: object
      title: Polygon
      required:
        - geoCoordinates
      properties:
        geoCoordinates:
          type: array
          description: >-
            Coordinates of each point of the polygon. It is recommended that the
            first and last points be the same, but it is not required.




            Each point in a polygon or multipolygon is defined by a latitude
            point followed by a longitude point. You also must specify the
            points in a counter-clockwise direction.
          items:
            type: object
            title: geoCoordinate
            required:
              - latitude
              - longitude
            properties:
              latitude:
                type: number
                format: float
                description: >-
                  Indicates the latitude coordinate of the polygon point.




                  Latitude in degrees. Values are restricted to the range [[-90,
                  90]].
                example: -23.54809
              longitude:
                type: number
                format: float
                description: >-
                  Indicates the longitude coordinate of the polygon point.




                  Longitude in degrees. Values are restricted to the range
                  [[-180, 180]].
                example: -46.63638
    Catalog:
      type: object
      title: Catalog
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: Unique Identifier of `Menu`
          example: f078e8e2-3044-4eec-b4a8-8359810de123
    ItemPrice:
      type: object
      title: Item Price
      required:
        - originalValue
      properties:
        value:
          type: number
          format: decimal
          description: |-
            The actual price value. 4 decimals places are accepted. 
            > **Keeta does not support this field and will be ignored.**
          example: 50
        originalValue:
          type: number
          format: decimal
          description: The orginal price value. 4 decimals places are accepted
          example: 50
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: >-
            The 3-letter ISO 4217 currency code. 

            > **Keeta does not use this field as the currency unit and will be
            ignored.**
          example: BRL
    ServiceHours:
      type: object
      title: Service Hours
      required:
        - id
        - weekHours
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the service hours.
          example: fb093d8c-2ca5-40fb-afcf-472fbdae81cc
        weekHours:
          type: array
          description: >-
            A list of the day(s) of the week and time periods for which the
            service is valid.
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/Hours'
        holidayHours:
          type: array
          description: >-
            Map of holiday dates, each with optional `timePeriods`. If a date
            does not have a time period specified, the restaurant will be closed
            for that date.
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/HolidayHours'
    Hours:
      type: object
      title: Hours
      required:
        - dayOfWeek
        - timePeriods
      properties:
        dayOfWeek:
          type: array
          description: Day of the week for which these service hours are valid
          items:
            type: string
            enum:
              - MONDAY
              - TUESDAY
              - WEDNESDAY
              - THURSDAY
              - FRIDAY
              - SATURDAY
              - SUNDAY
          example:
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            - SUNDAY
        timePeriods:
          type: object
          description: Time window from which users' orders can be placed.
          allOf:
            - $ref: '#/components/schemas/TimePeriods'
    TimePeriods:
      type: object
      title: Time Periods
      required:
        - startTime
        - endTime
      properties:
        startTime:
          type: string
          format: time
          description: >-
            Indicates the specific time of day in ISO format starting from which
            users' orders can be placed.
          example: 10:00:00.000Z
        endTime:
          type: string
          format: time
          description: >-
            Indicates the specific time of day in ISO format beyond which users'
            orders cannot be placed.
          example: 18:00:00.000Z
    HolidayHours:
      type: object
      title: Holiday Hours
      required:
        - date
        - timePeriods
      properties:
        date:
          type: string
          format: date
          description: date
          example: '2021-04-07'
        timePeriods:
          type: object
          description: hours
          allOf:
            - $ref: '#/components/schemas/TimePeriods'
    Item:
      type: object
      title: Item
      required:
        - id
        - name
        - externalCode
        - status
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the item.
          example: 732bd31e-77fc-47ee-88ee-a0437f97b198
        name:
          type: string
          description: Item name
          maxLength: 150
          example: 1/2 Pepperoni
        description:
          type: string
          description: Item Description
          example: Pepperoni flavored pizza with LOTS of pepperoni.
        externalCode:
          type: string
          description: >-
            Item External Code. (Tipically the merchant Software Service item
            code)
          example: '233467'
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays). Default is `AVAILABLE`.
          enum:
            - AVAILABLE
            - UNAVAILABLE
          default: AVAILABLE
          example: AVAILABLE
        image:
          type: object
          description: >-
            Image of the item. This field should be used when there is only one
            image for the item without size variations.  

            It must **be considered** only if the `images` array **is empty**.  

            If `images` **contains any value**, this field must **be ignored**
            even if it is filled.
          allOf:
            - $ref: '#/components/schemas/Image'
        images:
          type: array
          maxItems: 2
          items:
            allOf:
              - $ref: '#/components/schemas/ImageWithType'
          description: >-
            Array of images of the item. This field should be used when you need
            size variations for the images.
        nutritionalInfo:
          type: object
          description: Nutrition information for the dish.
          allOf:
            - $ref: '#/components/schemas/NutritionalInfo'
        serving:
          type: integer
          description: Field to show the number of people the portion serves.
          example: 2
        unit:
          type: string
          description: |
            Item's Unit of Measurement.

            Possible values:  
            - `UN` - Unit  
            - `KG` - Kilogram  
            - `L` - Liter
            - `OZ` - Ounce  
            - `LB` - Pound  
            - `GAL` - Gallon
          enum:
            - UN
            - KG
            - L
            - OZ
            - LB
            - GAL
          example: KG
        ean:
          type: string
          description: >-
            EAN (European Article Number). **Keeta does not support this field
            and will be ignored.**
          example: '7896005202074'
    NutritionalInfo:
      type: object
      title: Nutritional Info
      required:
        - description
        - calories
      properties:
        description:
          type: string
          description: >-
            Nutrition information in free text. For example "Contains
            preservatives".
          example: Contains preservatives
        calories:
          type: string
          description: >-
            The number of calories in Cal, kcal, or kJ, using the following
            format: value Cal or min-max Cal
          pattern: ^[0-9]+(\.[0-9]+)? ?(- ?[0-9]+(\.[0-9]+)?)? [a-zA-Z]+$
          example: 2000 Cal
        allergen:
          type: array
          description: Allergens of this Item
          items:
            type: string
            enum:
              - ALMONDS
              - ALPHA_ISOMETHYL_IONONE
              - ALCOHOL
              - AMYL_CINNAMAL
              - ANISE_ALCOHOL
              - BARLEY
              - BENZYL_ALCOHOL
              - BENZYL_BENZOATE
              - BENZYL_CINNAMATE
              - BENZYL_SALICYLATE
              - BRAZIL_NUTS
              - BUTYLPHENYL_METHYLPROPIONATE
              - CARROTS
              - CASHEW_NUTS
              - CELERY
              - CEREALS_CONTAINING_GLUTEN
              - CINNAMAL
              - CINNAMYL_ALCOHOL
              - CITRAL
              - CITRONELLOL
              - COCOA
              - CORIANDER
              - CORN
              - COUMARIN
              - CRUSTACEANS
              - EGGS
              - EUGENOL
              - EVERNIA_FURFURACEA
              - EVERNIA_PRUNASTRI
              - FARNESOL
              - FISH
              - GERANIOL
              - GLUTEN
              - HAZELNUTS
              - HEXYL_CINNAMAL
              - HYDROXYCITRONELLAL
              - KAMUT
              - LACTOSE
              - LUPINE
              - MACADAMIA_NUTS
              - METHYL_2_OCTYNOATE
              - MILK
              - MOLLUSCS
              - MUSTARD
              - NO_DECLARED_ALLERGENS
              - OAT
              - PEANUTS
              - PEAS
              - PECAN_NUTS
              - PISTACHIOS
              - POD_FRUITS
              - QUEENSLAND_NUTS
              - RYE
              - SESAME_SEEDS
              - SOYBEANS
              - SPELT
              - SULPHUR_DIOXIDE
              - TREE_NUTS
              - TREE_NUT_TRACES
              - WALNUTS
              - WHEAT
            example: GLUTEN
        additives:
          type: array
          description: Additives of this Item
          items:
            type: string
        suitableDiet:
          type: array
          description: The dish complies with the described dietary restriction
          items:
            type: string
            enum:
              - DIABETIC
              - GLUTEN_FREE
              - HALAL
              - HINDU
              - KOSHER
              - LOW_CALORIE
              - LOW_FAT
              - LOW_LACTOSE
              - LOW_SALT
              - VEGAN
              - VEGETARIAN
        isAlcoholic:
          type: boolean
          description: Indicates if an item is alcoholic.
          example: false
    Menu:
      type: object
      title: Menu
      required:
        - id
        - name
        - externalCode
        - categoryId
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the menu.
          example: f627ccdc-6789-456f-a782-148538d5035b
        name:
          type: string
          description: Menu name
          maxLength: 500
          example: Pizzas
        description:
          type: string
          description: Menu Description
          example: Pizza menu
        externalCode:
          type: string
          description: >-
            Menu External Code. (Tipically the merchant Software Service menu
            code)
          example: '123'
        disclaimer:
          type: string
          description: |-
            Disclaimer. 
            > **Keeta does not support this field and will be ignored.**
          example: >-
            Lorem Ipsum is simply dummy text of the printing and typesetting
            industry.
        disclaimerURL:
          type: string
          format: uri
          description: |-
            Disclaimer URL. 
            > **Keeta does not support this field and will be ignored.**
          example: http://example.com
        categoryId:
          type: array
          description: >-
            A list of the id values of the child `Category` entities that
            correspond to this `Menu` entity. Default assumes all `Category`
            entities are available in this menu.
          items:
            type: string
            format: uuid
          example:
            - 92fad022-2c28-4239-a026-989f5b555cb7
            - 6bb71850-1d40-49f9-8046-b13e068c0cca
    Category:
      type: object
      title: Category
      required:
        - id
        - index
        - name
        - externalCode
        - status
        - itemOfferId
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the category.
          example: 92fad022-2c28-4239-a026-989f5b555cb7
        index:
          type: integer
          description: Category display index.
          example: 0
        name:
          type: string
          description: Category name.
          maxLength: 150
          example: Salted Pizza
        description:
          type: string
          description: Category description.
          example: Salted pizza flavors.
        image:
          type: object
          description: Image of the category.
          allOf:
            - $ref: '#/components/schemas/Image'
        externalCode:
          type: string
          description: >-
            Category External Code. (Tipically the merchant Software Service
            category code)
          example: '13'
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        availabilityId:
          type: array
          description: >-
            The id values of `Availability` entities which provide details on
            when the category is available. 

            > **If not informed, assumes a `Category` is AVAILABLE at all
            times.**
          items:
            type: string
            format: uuid
            description: A unique identifier of the availability.
            example: 11d063c4-73a7-4f87-a0eb-71636cc02029
          example:
            - 11d063c4-73a7-4f87-a0eb-71636cc02029
        itemOfferId:
          type: array
          description: >-
            A list of the id values of the child `ItemOffer` entities that
            correspond to this `Category` entity.
          items:
            type: string
            format: uuid
            description: A unique identifier of the item offer.
            example: f080cfb3-5c4a-4eb7-907d-2de3bbb5dfb9
          example:
            - f080cfb3-5c4a-4eb7-907d-2de3bbb5dfb9
    ItemOffer:
      type: object
      title: ItemOffer
      required:
        - id
        - itemId
        - index
        - status
        - price
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the item offer.
          example: f080cfb3-5c4a-4eb7-907d-2de3bbb5dfb9
        itemId:
          type: string
          description: >-
            The id value of the `Item` entity correlated to this `ItemOffer`
            entity.
          example: 732bd31e-77fc-47ee-88ee-a0437f97b198
        index:
          type: integer
          description: ItemOffer display index.
          example: 0
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays). Default is `AVAILABLE`.
          enum:
            - AVAILABLE
            - UNAVAILABLE
          default: AVAILABLE
          example: AVAILABLE
        price:
          type: object
          description: >-
            Price of the menu item offer. Original and actual values can be
            informed, for showing discounts.
          allOf:
            - $ref: '#/components/schemas/ItemPrice'
          example:
            value: 43
            originalValue: 43
            currency: BRL
        availabilityId:
          type: array
          description: >-
            The id values of `Availability` entities which provide details on
            when the menu item offer is available. 

            > **If not informed, assumes an `ItemOffer` is AVAILABLE at all
            times.**
          items:
            type: string
            format: uuid
            description: A unique identifier of the availability.
            example: 11d063c4-73a7-4f87-a0eb-71636cc02029
          example:
            - 11d063c4-73a7-4f87-a0eb-71636cc02029
        optionGroupsId:
          type: array
          description: >-
            A list of the id values of the child `OptionGroup` entities that
            correspond to this `ItemOffer` entity.
          items:
            type: string
            format: uuid
            description: A unique identifier of the option group.
            example: fe67e551-f42f-499a-8afb-0ed893c71fa3
          example:
            - fe67e551-f42f-499a-8afb-0ed893c71fa3
    OptionGroup:
      type: object
      title: Option Group
      required:
        - id
        - index
        - name
        - externalCode
        - status
        - minPermitted
        - maxPermitted
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the option group.
          example: fe67e551-f42f-499a-8afb-0ed893c71fa3
        index:
          type: integer
          description: Option Group display index.
          example: 0
        name:
          type: string
          description: Option Group Name.
          maxLength: 150
          example: Choose your salted pizza flavor
        description:
          type: string
          description: Option Group Description.
          example: Choose your salted pizza flavor.
        externalCode:
          type: string
          description: >-
            Option External Code. (Tipically the merchant Software Service
            option group code)
          example: '12'
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        minPermitted:
          type: integer
          description: >-
            The minimum number of options which should be selected in the option
            group.
          example: 2
        maxPermitted:
          type: integer
          description: >-
            The maximum number of options which should be selected in the option
            group.
          example: 2
        priceMethod:
          type: string
          description: >-
            **Keeta does not support this field and will be ignored.**

            Instructions on how this `optionGroup` should be calculated before
            being applied to the item.


            **- SUM**: It will be added to the other optionGroups without any
            additional rules. **Default** option.  

            **- MAX**: The highest `optionGroup` value between all
            `optionGroups` with `priceMethod` = `MAX` will be applied to the
            calculation.  

            **- AVG**: The average between `optionGroup` with `priceMethod` =
            `AVG` will be applied to the calculation.  


            Example:   
              item base price: $25,00

              optionGroup1 - priceMethod = **AVG**
              - __option 1 = $5,00 (selected)__
              - option 2 = $10,00 (not selected)

              optionGroup2 - priceMethod = **AVG**
              - option 1 = $7,00 (not selected)
              - __option 2 = $10,00 (selected)__

              optionGroup3 - priceMethod = **MAX**
              - __option 1 = $15,00 (selected)__
              - option 2 = $20,00 (not selected)

              optionGroup4 - priceMethod = **MAX**
              - option 1 = $30,00 (not selected)
              - __option 2 = $35,00 (selected)__

              optionGroup5 - priceMethod = **SUM**
              - option 1 = $2,00 (not selected)
              - __option 2 = $3,00 (selected)__
              - option 3 = $5,00 (not selected)

              **optionsPrice** = avg(optionGroup1, optionGroup2) + max(optionGroup3, optionGroup4) + optionGroup5  
              **optionsPrice** = 7,50 + 35,00 + 3,00  
              **optionPrice** = 45,50  
              **itemPrice** = 25,00 + 45,50 = 70,50
          enum:
            - SUM
            - MAX
            - AVG
          default: SUM
        options:
          type: array
          description: A list of `Option` entities that correspond to this option group
          items:
            type: object
            description: options
            allOf:
              - $ref: '#/components/schemas/Option'
    Option:
      type: object
      title: Option
      required:
        - id
        - itemId
        - index
        - status
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the option.
          example: e5232f14-430c-4a94-8ff6-289d5a16a87a
        itemId:
          type: string
          description: >-
            The id value of the `Item` entity correlated to this `Option`
            entity.
          example: 502ecf11-0509-48ed-b63c-6211c48fd9b9
        index:
          type: integer
          description: Option display index.
          example: 0
        status:
          type: string
          description: >-
            Indicates if the entity is Available or Unavailable. Only use this
            type when you must disable the entity due to an unexpected event and
            you don't know when the service will be re-established (e.g. do not
            use for holidays). Default is `AVAILABLE`.
          enum:
            - AVAILABLE
            - UNAVAILABLE
          default: AVAILABLE
          example: AVAILABLE
        price:
          type: object
          description: >-
            Price of the option. Original and actual values can be informed, for
            showing discounts.
          allOf:
            - $ref: '#/components/schemas/ItemPrice'
        maxPermitted:
          type: integer
          description: >-
            The maximum quantity of this option which can be selected in the
            option group. **Keeta does not support this field and will be
            ignored.**
          example: 2
    Availability:
      type: object
      title: Availability
      required:
        - id
        - hours
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the availability.
          example: 11d063c4-73a7-4f87-a0eb-71636cc02029
        startDate:
          type: string
          description: >-
            Availability start date. If not informed, the availabilty is already
            available.
          example: '2021-05-01'
        endDate:
          type: string
          description: >-
            Availability end date. If not informed, the availabilty is always
            available.
          example: '2021-05-30'
        hours:
          type: array
          description: Hours
          items:
            allOf:
              - $ref: '#/components/schemas/Hours'
    MerchantStatus:
      type: object
      title: Merchant Status
      required:
        - lastRead
        - status
      properties:
        lastRead:
          type: string
          format: date-time
          description: >-
            Date of last attempt to read merchant information. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        status:
          type: string
          description: Reading attempt status
          enum:
            - SUCCESS
            - PROCESSING
            - FAIL
        moreInfo:
          type: string
          description: >-
            Open field to provide any relevant information to the caller. Eg:
            Error messages or causes.
    MerchantUpdate:
      type: object
      discriminator:
        propertyName: entityType
        mapping:
          MERCHANT: '#/components/schemas/FullMerchantUpdate'
          BASIC_INFO: '#/components/schemas/BasicInfoUpdate'
          SERVICE: '#/components/schemas/ServiceUpdate'
          MENU: '#/components/schemas/MenuUpdate'
          CATEGORY: '#/components/schemas/CategoryUpdate'
          ITEM: '#/components/schemas/ItemUpdate'
          ITEM_OFFER: '#/components/schemas/ItemOfferUpdate'
          OPTION_GROUP: '#/components/schemas/OptionGroupUpdate'
          OPTION: '#/components/schemas/OptionUpdate'
          AVAILABILITY: '#/components/schemas/AvailabilityUpdate'
      properties:
        merchantStatus:
          type: string
          description: >-
            Indicates if the Merchant is Avaliable or Unavaliable. Only use this
            type when you must close (disable) the merchant due to an unexpected
            event and you don't know when the service will be re-established
            (e.g. do not use for holidays).
          enum:
            - AVAILABLE
            - UNAVAILABLE
          example: AVAILABLE
        entityType:
          type: string
          description: The entity type of the updated object.
    FullMerchantUpdate:
      description: Updated Merchant Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: Updated `Merchant` entity objects
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/UpdateMerchant'
    BasicInfoUpdate:
      description: Updated Service Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: |-
                Updated `Service` entity objects.
                > **Only the first one in the array will be used.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/BasicInfo'
    ServiceUpdate:
      description: Updated Service Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Service` entity objects.

                > **When updating merchant `serviceHours` info, only entities
                with serviceType=`DELIVERY` will be used.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Service'
    MenuUpdate:
      description: Updated Menu Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Menu` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`Menu`.**
              type: array
              items:
                - $ref: '#/components/schemas/Menu'
    CategoryUpdate:
      description: Updated `Category` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Category` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`Category`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Category'
    ItemUpdate:
      description: Updated `Item` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Item` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`Item`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Item'
    ItemOfferUpdate:
      description: Updated `ItemOffer` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `ItemOffer` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`ItemOffer`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/ItemOffer'
    OptionGroupUpdate:
      description: Updated `OptionGroup` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `OptionGroup` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`OptionGroup`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/OptionGroup'
    OptionUpdate:
      description: Updated `Option` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Option` entity objects.

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`Option`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Option'
    AvailabilityUpdate:
      description: Updated `Availability` Object
      allOf:
        - $ref: '#/components/schemas/MerchantUpdate'
        - type: object
          properties:
            updatedObjects:
              description: >-
                Updated `Availability` entity objects.


                > **Note:**

                > <br/>Our current menu model supports the following options for
                configuring product availability:
                  <br/>&nbsp;&nbsp;&nbsp;&nbsp; 1. Specific date ranges defined by the startDate and endDate fields
                  <br/>&nbsp;&nbsp;&nbsp;&nbsp; 2. A weekly schedule defined by the hours array
                  <br/>**Combination of 1 and 2 are not supported.**

                > **Currently, Keeta does not support module-level information
                updates for merchant menus. Therefore,  Keeta will actively
                request the GET /merchant endpoint to obtain the full merchant
                information for update when receiving an update request with
                entityType=`Availability`.**
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Availability'
    AckEvents:
      type: object
      title: Ack Events
      required:
        - id
        - orderId
        - eventType
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the event.
        orderId:
          type: string
          format: uuid
          description: >-
            The unique identifier of the order. The order ID is generated by
            Keeta.
        eventType:
          type: string
          description: >-
            The event type. **[Click here](#operation/pollingEvents)** for
            definitions of each type.
          enum:
            - CREATED
            - CONFIRMED
            - DISPATCHED
            - READY_FOR_PICKUP
            - PICKED_UP
            - DELIVERED
            - CONCLUDED
            - CANCELLATION_REQUESTED
            - CANCELLED
            - USER_REFUND_REQUEST
            - REFUNDED
            - REFUND_FAILED
    Order:
      type: object
      title: Order
      required:
        - id
        - type
        - displayId
        - createdAt
        - orderTiming
        - preparationStartDateTime
        - merchant
        - items
        - total
        - payments
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The unique identifier of the order. The order ID is generated by
            Keeta.
        type:
          type: string
          description: >-
            `DELIVERY` - for orders that will be delivered to the customer's
            address.  

            `TAKEOUT` - orders that will be picked up at the establishment by
            the customer  

            `INDOOR` - orders that will be consumed inside the establishment.
          enum:
            - DELIVERY
            - TAKEOUT
            - INDOOR
        displayId:
          type: string
          description: Order Id shown in  Keeta interface for the customer.
        sourceAppId:
          type: string
          format: uuid
          description: >-
            This field must be filled in with the AppId of Keeta that originated
            the order. This field is to help the applications that will work as
            a Hub, intermediating the requests from Keeta with the Software
            Service.
        salesChannel:
          type: string
          description: You can indicate through which sales channel this order originated.
        virtualBrand:
          type: string
          description: >-
            This field can be used as an alternative id for the merchant, in
            cases where the same merchant has different identifications or
            brands (such as dark kitchens). It is important to note that Keeta
            or Software Hub must know this Id beforehand.
        category:
          type: string
          description: >-
            Indicates the order category. 


            > If you find that your order category does not fit any of the
            listed categories, please open an issue so it can be added.
          enum:
            - FOOD
            - GROCERY
            - DRUGSTORE
            - PETSTORE
          default: FOOD
        createdAt:
          type: string
          format: date-time
          description: >-
            Order creation date and time. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info.).
        lastEvent:
          type: string
          description: >-
            The last valid event polled (whether acknowledged or not) or sent
            via webhook. **[Click here](#operation/pollingEvents)** for
            definitions of each type.
          enum:
            - CREATED
            - CONFIRMED
            - DISPATCHED
            - READY_FOR_PICKUP
            - PICKED_UP
            - DELIVERED
            - CONCLUDED
            - CANCELLATION_REQUESTED
            - CANCELLED
            - USER_REFUND_REQUEST
            - REFUNDED
            - REFUND_FAILED
        orderTiming:
          type: string
          description: >-
            Indicates the timing for initiating the order:


            `INSTANT`: for orders that must be prepared immediately.

            `SCHEDULED`: for orders scheduled for a specific date and time. It
            will always be accompanied by the `schedule` object.

            `ONDEMAND`: for orders that will only be delivered when the consumer
            indicates that they are going to pick it up. In this case, the
            Software Service will receive a `PREPARATION_REQUESTED` event
            indicating that the order should be started.
          enum:
            - INSTANT
            - SCHEDULED
            - ONDEMAND
        preparationStartDateTime:
          type: string
          format: date-time
          description: >-
            Suggestion for the preparation start time after Order creation. This
            can be used by Keeta to inform the merchant to delay the start of
            the preparation for any reason. Default is the same time as the
            order creation time. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        merchant:
          type: object
          required:
            - id
            - name
          description: Merchant information.
          properties:
            id:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's **`Software
                Service`**.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            name:
              type: string
              description: Merchant Public Name
              maxLength: 500
              example: Pizza Plaza
        items:
          type: array
          description: Order items.
          items:
            type: object
            required:
              - id
              - name
              - unit
              - quantity
              - unitPrice
              - totalPrice
              - externalCode
            properties:
              id:
                type: string
                format: uuid
                description: A unique identifier of the item.
              index:
                type: integer
                description: Item's position.
              name:
                type: string
                description: Product name
              externalCode:
                type: string
                description: External product code.
              unit:
                type: string
                description: >
                  Item's Unit of Measurement.


                  Possible values:  

                  - `UN` - Unit  

                  - `KG` - Kilogram  

                  - `L` - Liter  

                  - `OZ` - Ounce  

                  - `LB` - Pound  

                  - `GAL` - Gallon  


                  > Use fractional values for quantities smaller than the unit
                  of measure:

                  > Example: 500 grams = 0.5 KG
                enum:
                  - UN
                  - KG
                  - L
                  - OZ
                  - LB
                  - GAL
                example: KG
              ean:
                type: string
                description: EAN is the barcode standard used on items.
              quantity:
                type: number
                format: decimal
                description: |-
                  Amount of items.

                   > Use fractional values for quantities smaller than the unit of measure:
                   > Example: 500 grams = 0.5 KG
              specialInstructions:
                type: string
                description: Special instructions about the items.
              unitPrice:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Price'
                description: >-
                  Price per unit. This is the price the customer is paying and
                  will be considered for order totals calculations.
              originalPrice:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Price'
                description: >-
                  Original price of the product. 

                  This price **is for information purposes only** and should be
                  used to inform the price of an item before applying markdowns
                  on the list price. 


                  Discounts applied during the order such as coupons and
                  vouchers should not be considered here. These must be reported
                  in the `discounts` object.


                  **THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS
                  CALCULATIONS.**
              scalePriceApplied:
                type: boolean
                description: >-
                  Indicates whether or not the unit price of the item has
                  changed due to a scaled purchase (where the quantity of items
                  purchased changes the value of the item). Default is `false`
                default: false
              optionsPrice:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Price'
                description: The sum of the total prices of all options of the item.
              subtotalPrice:
                type: object
                description: >-
                  This price **is for information purposes only** and should be
                  used to inform the total price for the quantity of items
                  ordered, excluding additional options. **(quantity *
                  unitPrice)**

                    **THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS CALCULATIONS.**
                allOf:
                  - $ref: '#/components/schemas/Price'
              totalPrice:
                type: object
                description: >-
                  Total Price of the item. **(quantity * (unitPrice +
                  optionsPrice))**
                allOf:
                  - $ref: '#/components/schemas/Price'
              indoor:
                type: object
                description: Item-related properties for when the order is of type `INDOOR`
                properties:
                  productionPoint:
                    type: string
                    description: >-
                      Production point for this specific item.  

                      It should be used when the merchant has more than one
                      production point and it is necessary to carry out
                      production at a specific location.


                      Note: The locations must be previously registered in both 
                      **Keeta** and the **Software Service**.
              options:
                type: array
                description: >-
                  The optional extras chosen by the consumer, related to this
                  item.
                items:
                  type: object
                  required:
                    - id
                    - name
                    - externalCode
                    - unit
                    - quantity
                    - unitPrice
                    - totalPrice
                  properties:
                    index:
                      type: integer
                      description: Option's position.
                    id:
                      type: string
                      format: uuid
                      description: A unique identifier of the item.
                    name:
                      type: string
                      description: Options name
                    externalCode:
                      type: string
                      description: External product code.
                    unit:
                      type: string
                      description: >
                        Item's Unit of Measurement.


                        Possible values:  

                        - `UN` - Unit  

                        - `KG` - Kilogram  

                        - `L` - Liter  

                        - `OZ` - Ounce  

                        - `LB` - Pound  

                        - `GAL` - Gallon  


                        > Use fractional values for quantities smaller than the
                        unit of measure:

                        > Example: 500 grams = 0.5 KG
                      enum:
                        - UN
                        - KG
                        - L
                        - OZ
                        - LB
                        - GAL
                      example: KG
                    ean:
                      type: string
                      description: EAN is the barcode standard used on items.
                    quantity:
                      type: number
                      format: decimal
                    unitPrice:
                      type: object
                      allOf:
                        - $ref: '#/components/schemas/Price'
                      description: >-
                        Price per unit. This is the price the customer is paying
                        and will be considered for order totals calculations.
                    originalPrice:
                      type: object
                      allOf:
                        - $ref: '#/components/schemas/Price'
                      description: >-
                        Original price of the option. 

                        This price **is for information purposes only** and
                        should be used to inform the price of an option before
                        applying markdowns on the list price. 


                        Discounts applied during the order such as coupons and
                        vouchers should not be considered here. These must be
                        reported in the `discounts` object.


                        **THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS
                        CALCULATIONS.**
                    subtotalPrice:
                      type: object
                      description: >-
                        This price **is for information purposes only** and
                        should be used to inform the total price for the
                        quantity of items ordered, excluding additional options.
                        **(quantity * unitPrice)**

                          **THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS CALCULATIONS.**
                      allOf:
                        - $ref: '#/components/schemas/Price'
                    totalPrice:
                      type: object
                      description: Total Price of the option. **(quantity * unitPrice)**
                      allOf:
                        - $ref: '#/components/schemas/Price'
                    specialInstructions:
                      type: string
                      description: More instructions, if needed.
        otherFees:
          type: array
          description: Other fees that may apply.
          items:
            type: object
            required:
              - name
              - type
              - receivedBy
              - price
            properties:
              name:
                type: string
                description: Name related to the other fees.
              type:
                type: string
                enum:
                  - DELIVERY_FEE
                  - SERVICE_FEE
                  - TIP
              receivedBy:
                type: string
                enum:
                  - MARKETPLACE
                  - MERCHANT
                  - LOGISTIC_SERVICES
              receiverDocument:
                type: string
                description: Mandatory for marketplace.
              price:
                type: object
                description: The fee price
                allOf:
                  - $ref: '#/components/schemas/Price'
              observation:
                type: string
                description: Any extra comments.
        discounts:
          type: array
          description: Any discounts that may apply.
          items:
            type: object
            required:
              - amount
              - target
              - sponsorshipValues
            properties:
              amount:
                type: object
                description: Amount value of the discount.
                allOf:
                  - $ref: '#/components/schemas/Price'
              target:
                type: string
                enum:
                  - CART
                  - DELIVERY_FEE
                  - ITEM
              targetId:
                type: string
                description: Only mandatory for `target` = `ITEM`.
              sponsorshipValues:
                description: >-
                  Values sponsored by either party. The sum of the amounts
                  listed in this atribute must match the value informed in the
                  `amount` atribute above.
                type: array
                items:
                  type: object
                  required:
                    - name
                    - amount
                  properties:
                    name:
                      type: string
                      enum:
                        - MARKETPLACE
                        - MERCHANT
                        - CHAIN
                    amount:
                      type: object
                      description: Discount amount given by the sponsor.
                      allOf:
                        - $ref: '#/components/schemas/Price'
                    discountCode:
                      type: string
                      description: >-
                        Code related to the discount applied. Here you can enter
                        a coupon used by the user, or an identification code
                        from a marketing campaign, for example.
        total:
          type: object
          required:
            - itemsPrice
            - otherFees
            - orderAmount
            - discount
          description: >-
            Set of fields with the sum of the values previously described in the
            order.
          properties:
            itemsPrice:
              type: object
              description: >-
                Sum of the total price of the items listed in the `items`
                attribute.
              allOf:
                - $ref: '#/components/schemas/Price'
            otherFees:
              type: object
              description: >-
                Sum of the total value of other fees listed in the `otherFees`
                attribute. If there isn't one, use 0.
              allOf:
                - $ref: '#/components/schemas/Price'
            discount:
              type: object
              description: >-
                Sum of any discounts that may be listed in the `discounts`
                attribute. If there isn't one, use 0.
              allOf:
                - $ref: '#/components/schemas/Price'
            orderAmount:
              type: object
              description: >-
                The final value of the order (itemsPrice + otherFees -
                discounts). 
              allOf:
                - $ref: '#/components/schemas/Price'
        payments:
          type: object
          required:
            - prepaid
            - pending
            - methods
          description: >-
            All the description of the payment, such as methods, pre-payments,
            change, etc.
          properties:
            prepaid:
              type: number
              format: decimal
              description: Amount paid in advance.
            pending:
              type: number
              format: decimal
              description: Amount that is still to be paid.
            methods:
              type: array
              description: >-
                The payment method used. Whether it was online, on delivery,
                credit card, voucher, cash, etc.
              items:
                type: object
                required:
                  - value
                  - currency
                  - type
                  - method
                properties:
                  value:
                    type: number
                    format: decimal
                    description: Price value. 4 decimals places are accepted
                  currency:
                    type: string
                    pattern: ^[A-Z]{3}$
                    description: The 3-letter ISO 4217 currency code.
                    example: BRL
                  type:
                    type: string
                    description: >-
                      `PREPAID` if the payment was made through some platform,
                      or `PENDING` if it going to be paid on delivery or in
                      cash, for example.
                    enum:
                      - PREPAID
                      - PENDING
                  method:
                    type: string
                    enum:
                      - CREDIT
                      - DEBIT
                      - MEAL_VOUCHER
                      - FOOD_VOUCHER
                      - DIGITAL_WALLET
                      - PIX
                      - CASH
                      - CREDIT_DEBIT
                      - COUPON
                      - REDEEM
                      - PREPAID_REDEEM
                      - OTHER
                  brand:
                    type: string
                    description: >-
                      Indicates the brand of the card selected in the `method`
                      field.


                      This field must only be filled in if `method` is `CREDIT`,
                      `DEBIT`, `CREDIT_DEBIT`, `MEAL_VOUCHER` or `FOOD_VOUCHER`.


                      If `OTHER` is chosen, it is recommended that you describe
                      the brand name in the `methodInfo` field.
                    enum:
                      - VISA
                      - MASTERCARD
                      - DINERS
                      - AMEX
                      - HIPERCARD
                      - ELO
                      - AURA
                      - DISCOVER
                      - VR_BENEFICIOS
                      - SODEXO
                      - TICKET
                      - GOOD_CARD
                      - BANESCARD
                      - SOROCARD
                      - POLICARD
                      - VALECARD
                      - AGICARD
                      - JCB
                      - CREDSYSTEM
                      - CABAL
                      - GREEN_CARD
                      - VEROCHEQUE
                      - AVISTA
                      - OTHER
                  methodInfo:
                    type: string
                    description: >-
                      Additional information regarding the payment method.  

                      It can be used to indicate some useful information of the
                      chosen payment method, such as the name of the wallet, or
                      an authorization number.  


                      This field can be used for any `method` entered, but it is
                      highly recommended to fill it in when the chosen `method`
                      is `OTHER`.
                  transaction:
                    type: object
                    description: >-
                      Authorization details and intermediary identification for
                      credit card and/or subsidy transactions
                    properties:
                      authorizationCode:
                        type: string
                        description: >-
                          Credit card and/or subsidy transaction authorization
                          number.
                      acquirerDocument:
                        type: string
                        description: >-
                          Document of the Transaction Intermediary (agency,
                          delivery platform, marketplace, and similar) of
                          services and businesses.
                  changeFor:
                    type: number
                    format: decimal
                    description: >-
                      Indicates the total that will be paid in cash by the
                      customer and that should be considered for the calculation
                      of the change   

                      (ex. customer will pay a $43 order with a $50 bill. Then
                      50.00 must be entered.). 


                      Only mandatory when `method` is `CASH`.
        taxInvoice:
          type: object
          description: Tax Invoice information.
          properties:
            issued:
              type: boolean
              description: Inform if a tax invoice has already been issued for this order.
              default: false
            taxInvoiceURL:
              type: string
              description: The address to download the tax invoice issued.
        customer:
          type: object
          required:
            - id
            - phone
            - name
            - ordersCountOnMerchant
          description: |-
            Customer related information. 

            **REQUIRED** if the chosen `type` is `DELIVERY`
          properties:
            id:
              type: string
              format: uuid
              description: >-
                A unique identifier related to the consumer. If Keeta does not
                have an Id for the customer, this Id can be generated when
                creating the order. 
            name:
              type: string
              description: Customer's name.
            documentNumber:
              description: >-
                Customer document. This document may be sent for dealing with
                tax issues.
              type: string
            phone:
              type: object
              description: >-
                Customer's phone. Here you can enter the customer's phone number
                directly (provided that the customer has given permission for
                this data to be shared, according to local policies) or another
                phone number (such as the Keeta's call center phone number)
                where the merchant can communicate about order issues that
                affect the customer (such as health issues).


                **Please note**: The telephone number is considered an
                identification field and therefore the customer's advance
                consent is required.
              required:
                - number
              properties:
                number:
                  type: string
                extension:
                  type: string
            email:
              description: >-
                Customer email. This document may be sent for dealing with tax
                issues.
              type: string
            ordersCountOnMerchant:
              description: >-
                Total number of orders that the customer already placed within
                the merchant.
              type: number
              format: decimal
        schedule:
          type: object
          description: |-
            Information for scheduled orders. 

            **REQUIRED** if `orderTiming` is `SCHEDULED`.
          required:
            - scheduledDateTimeStart
            - scheduledDateTimeEnd
          properties:
            scheduledDateTimeStart:
              type: string
              format: date-time
              description: >-
                Date and time for when the order is ready. It can be calculated
                by  **Keeta** using the average preparation time of the dishes.
                Default is the same time as order creation time. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            scheduledDateTimeEnd:
              type: string
              format: date-time
              description: >-
                Date and time for when the order is ready. It can be calculated
                by  **Keeta** using the average preparation time of the dishes.
                Default is the same time as order creation time. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        orderPriority:
          type: string
          description: >-
            Defines the priority of preparation and delivery of this order in
            relation to other orders from the same **Keeta**.  

            The lower the priority, the faster this order should be fulfilled.


            **Note:** This field depends on both Keeta and the Merchant being
            able to support this functionality.
          enum:
            - PRIORITY1
            - PRIORITY2
            - PRIORITY3
            - PRIORITY4
            - PRIORITY5
        delivery:
          type: object
          description: |-
            Information for DELIVERY orders. 

            **REQUIRED** if the chosen `type` is `DELIVERY`
          required:
            - deliveredBy
            - deliveryAddress
            - estimatedDeliveryDateTime
          properties:
            deliveredBy:
              type: string
              enum:
                - MERCHANT
                - MARKETPLACE
            deliveryAddress:
              type: object
              description: The address to which the order will be delivered.
              required:
                - country
                - street
                - formattedAddress
                - number
                - city
                - postalCode
                - coordinates
                - district
                - state
              properties:
                country:
                  type: string
                  pattern: ^[A-Z]{2}$
                  description: >-
                    Two-letter [ISO 3166-1
                    alpha-2](https://www.iso.org/standard/72482.html) country
                    code.
                  example: BR
                state:
                  type: string
                  description: >-
                    State or country subdivision. It is recommended (but not
                    required) that you use the [ISO
                    3166-2](https://www.iso.org/standard/72483.html)
                    representation. 
                  example: BR-SP
                city:
                  type: string
                  description: City name.
                  example: São Paulo
                district:
                  type: string
                  description: Neighborhood or District.
                  example: Moema
                street:
                  type: string
                  description: Street name.
                  example: Plaza Avenue
                number:
                  type: string
                  description: Street number.
                  example: '100'
                complement:
                  type: string
                  description: Address complement.
                  example: BL 02 AP 31
                reference:
                  type: string
                  description: Address reference.
                  example: Yellow House
                formattedAddress:
                  type: string
                  description: Full Formated Address Text
                  example: >-
                    Plaza Avenue, 100, BL 02 AP 31, Moema - São Paulo, SP -
                    Brazil
                postalCode:
                  type: string
                  description: Postal Code
                  example: 20111-000
                coordinates:
                  type: object
                  required:
                    - latitude
                    - longitude
                  properties:
                    latitude:
                      type: number
                      format: float
                      description: >-
                        Latitude in degrees. Values are restricted to the range
                        [[-90, 90]].
                      example: -23.54823
                    longitude:
                      type: number
                      format: float
                      description: >-
                        Longitude in degrees. Values are restricted to the range
                        [[-180, 180]].
                      example: -46.63632
            estimatedDeliveryDateTime:
              type: string
              format: date-time
              description: >-
                Estimated delivery date and time. The same date showed to the
                customer, in  **Keeta** interface. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            deliveryDateTime:
              type: string
              format: date-time
              description: >-
                Delivery date. The date time that the delivery actually took
                place. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            pickupCode:
              type: string
              description: >-
                It gives the Merchant a code so that the **delivery man** can
                collect the order.


                Note: Not to be confused with the customer's delivery code.
        takeout:
          type: object
          description: |-
            Information for TAKEOUT orders. 

            **REQUIRED** if the chosen `type` is `TAKEOUT`
          required:
            - mode
            - takeoutDateTime
          properties:
            mode:
              type: string
              enum:
                - DEFAULT
                - PICKUP_AREA
            takeoutDateTime:
              type: string
              format: date-time
              description: >-
                Takeout date and time. It can be calculated by  **Keeta** using
                the average preparation time of the dishes. Default is the same
                time as order creation time. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        indoor:
          type: object
          description: |-
            Information for INDOOR orders. 

            **REQUIRED** if the chosen `type` is `INDOOR`
          required:
            - mode
            - indoorDateTime
          properties:
            mode:
              type: string
              description: >-
                Indoor mode identifier:


                - `DEFAULT`: Used for orders placed in  **Keeta** to be consumed
                inside the merchant without a specific location.


                - `PLACE`: Used for orders placed in  **Keeta** to be consumed
                inside the merchant at a specific location already specified,
                such as a **table** or a **counter**.


                - `TAB`: Used for establishments that control orders via
                **tabs** or **control cards** (can be used in conjunction with
                the place field).


                - `TERMINAL`: Used for orders placed through self-services, such
                as kiosks, totems or tablets.
              enum:
                - DEFAULT
                - PLACE
                - TAB
                - TERMINAL
            indoorDateTime:
              type: string
              format: date-time
              description: >-
                Date and time for when the order is ready. It can be calculated
                by  **Keeta** using the average preparation time of the dishes.
                Default is the same time as order creation time. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            place:
              type: string
              description: The place identifier (Required if mode is `PLACE`)
            tab:
              type: string
              description: The tab or control card identifier (Required if mode is `TAB`)
            seat:
              type: string
              description: Optional Identifier of the seat where the customer is located.
            waiterCode:
              type: string
              description: Optional code to identify the waiter responsible for the order.
        sendPreparing:
          type: boolean
          description: >-
            This field indicates whether it is necessary for the `Software
            Service` to make a request to the [POST
            /v1/orders/{orderId}/preparing](#operation/orderPreparing) endpoint
            to indicate to the `Keeta` that the order is in production.


            `true`: Indicates that the `Keeta` is waiting for a request.


            `false` or `not informed`: It is not required to make a
            request.                             
        sendDelivered:
          type: boolean
          description: >-
            This field indicates whether it is necessary for the `Software
            Service` to make a request to the [POST
            /v1/orders/{orderId}/delivered](#operation/orderDelivered) endpoint
            to indicate to the `Keeta` that the order has been delivered to the
            client.


            `true`: Indicates that the `Keeta` is waiting for a request.


            `false` or `not informed`: It is not required to make a request.
        sendPickedUp:
          type: boolean
          description: >-
            This field indicates whether it is necessary for the `Software
            Service` to make a request to the [POST
            /v1/orders/{orderId}/pickedUp](#operation/orderPickedUp) endpoint to
            indicate to the `Keeta` that the order has been picked up by the
            client.


            `true`: Indicates that the `Keeta` is waiting for a request.


            `false` or `not informed`: It is not required to make a request.
        sendTracking:
          type: boolean
          description: >-
            This field indicates whether it is necessary for the `Software
            Service` to make a request to the [POST
            /v1/orders/{orderId}/tracking](#operation/orderTracking) endpoint to
            inform the `Keeta` about delivery updates.


            `true`: Indicates that the `Keeta` is waiting for a request.


            `false` or `not informed`: It is not required to make a request.
        extraInfo:
          type: string
          description: Extra information, if necessary.
    OrderConfirmed:
      type: object
      title: Order Confirmed
      required:
        - createdAt
        - orderExternalCode
      properties:
        reason:
          type: string
          description: >-
            Free field for more information about the order confirmation, such
            as which employee accepted the order, for example.
        createdAt:
          type: string
          format: date-time
          description: >-
            Order creation date and time. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        orderExternalCode:
          type: string
          description: External order code, which can be used by merchant or marketplace.
        preparationTime:
          type: integer
          description: >-
            Indicates an estimate of the preparation time (in minutes) for the
            order being confirmed.
    RequestCancelled:
      type: object
      title: Request Cancelattion
      required:
        - reason
        - code
        - mode
      properties:
        reason:
          type: string
          description: Open text field indicating the reason for the cancellation.
        code:
          type: string
          enum:
            - INSUFFICIENT_DISHES
            - SUSPENSION_OF_BUSINESS
            - INSUFFICIENT_MANPOWER
            - OTHERS
        mode:
          type: string
          description: >-
            Indicates whether the cancellation request was made by an automatic
            or manual process in the Software Service
          enum:
            - AUTO
            - MANUAL
        outOfStockItems:
          type: array
          description: Items that are not in the merchant's inventory.
          items:
            format: uuid
            type: string
          maxItems: 100
        invalidItems:
          type: array
          description: Items that do not exist in the merchant's inventory.
          items:
            format: uuid
            type: string
          maxItems: 100
    RequestDenied:
      type: object
      title: Request Refund
      required:
        - reason
        - code
      properties:
        reason:
          type: string
          description: Reason for rejecting refund.
        code:
          type: string
          enum:
            - DISH_ALREADY_DONE
            - OUT_FOR_DELIVERY
            - OTHER
    Event:
      type: object
      title: Event
      required:
        - eventId
        - eventType
        - orderId
        - orderURL
        - createdAt
      discriminator:
        propertyName: eventType
        mapping:
          CREATED: '#/components/schemas/EventMetadata'
          CONFIRMED: '#/components/schemas/EventMetadataConfirm'
          READY_FOR_PICKUP: '#/components/schemas/EventMetadata'
          DISPATCHED: '#/components/schemas/EventMetadata'
          PICKED_UP: '#/components/schemas/EventMetadata'
          DELIVERED: '#/components/schemas/EventMetadata'
          CONCLUDED: '#/components/schemas/EventMetadata'
          CANCELLATION_REQUESTED: '#/components/schemas/EventMetadataCancel'
          CANCELLED: '#/components/schemas/EventMetadataCancel'
      properties:
        eventId:
          type: string
          format: uuid
          description: A unique identifier of the event.
        eventType:
          type: string
          description: >-
            The event type. **[Click here](#operation/pollingEvents)** for
            definitions of each type.
          enum:
            - CREATED
            - CONFIRMED
            - DISPATCHED
            - READY_FOR_PICKUP
            - PICKED_UP
            - DELIVERED
            - CONCLUDED
            - CANCELLATION_REQUESTED
            - CANCELLED
            - USER_REFUND_REQUEST
            - REFUNDED
            - REFUND_FAILED
        orderId:
          type: string
          format: uuid
          description: >-
            The unique identifier of the order. The order ID is generated by
            Keeta.
        orderURL:
          type: string
          format: uri
          description: The URL to get the order details
        createdAt:
          type: string
          format: date-time
          description: >-
            Order creation date and time. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        sourceAppId:
          type: string
          format: uuid
          description: >-
            This field must be filled in with the AppId of Keeta that originated
            the order. This field is to help the applications that will work as
            a Hub, intermediating the requests from  Keeta with the Software
            Service.
        virtualBrand:
          type: string
          description: >-
            This field can be used as an alternative id for the merchant, in
            cases where the same merchant has different identifications or
            brands (such as dark kitchens). It is important to note that Keeta
            or Software Hub must know this Id beforehand.
        metadata:
          type: string
          description: >-
            This field will be filled if event type is one of which
            [`USER_REFUND_REQUEST`, `CANCELLED`] and will contain the related
            details
    EventMetadataCancel:
      description: Metadata
      required:
        - metadata
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
        - properties:
            metadata:
              required:
                - reason
                - code
              type: object
              description: Information related to the Event Type
              properties:
                reason:
                  type: string
                  description: Reason for the cancellation
                code:
                  type: string
                  description: Cancelation reason code
                  enum:
                    - INSUFFICIENT_DISHES
                    - SUSPENSION_OF_BUSINESS
                    - INSUFFICIENT_MANPOWER
                    - OTHERS
                clientId:
                  type: string
                  description: >-
                    The ID of the client system that generated the action that
                    resulted in this event (to be used with application with
                    multiple stations).
    EventMetadata:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/Event'
    EventMetadataPickup:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
        - properties:
            metadata:
              type: object
              description: Information related to the Event Type
              required:
                - pickupArea
              properties:
                pickupArea:
                  type: string
                  description: >-
                    Information about the pickup area that the merchant needs to
                    deliver the order. Eg: Parking Lot Number
    EventMetadataConfirm:
      description: Metadata
      required:
        - metadata
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
        - properties:
            metadata:
              type: object
              description: Information related to the Event Type
              properties:
                clientId:
                  type: string
                  description: >-
                    The ID of the client system that generated the action that
                    resulted in this event (to be used with application with
                    multiple stations)
    OrderDispatched:
      type: object
      title: Order Dispatched
      properties:
        deliveryTrackingInfo:
          type: object
          description: Information about the person that was assigned to deliver the order.
          allOf:
            - $ref: '#/components/schemas/DeliveryTrackingInfoDisptach'
    BatchDecryptRequest:
      type: object
      required:
        - cipherInfos
      properties:
        cipherInfos:
          type: array
          description: List of encrypted data to be decrypted
          items:
            type: object
            required:
              - cipherText
            properties:
              cipherText:
                type: string
                description: >-
                  Encrypt text in the format of an encrypted string starting
                  with `ENC_`
                example: ENC_#MQesaE=#1#
    BatchDecryptResponse:
      type: object
      required:
        - plainInfos
      properties:
        plainInfos:
          type: array
          description: List of decrypted data with processing results
          items:
            type: object
            required:
              - errorMsg
              - plainText
              - errorCode
              - cipherText
            properties:
              errorMsg:
                type: string
                description: Error message for this decryption item
                example: success
              plainText:
                type: string
                description: Decrypted plain text result
                example: Bob
              errorCode:
                type: integer
                description: Error code for this decryption item
                example: 0
              cipherText:
                type: string
                description: Original encrypted text that was processed
                example: ENC_#MQesaE=#1#
    OrderTracking:
      type: object
      title: Order Tracking
      required:
        - deliveryTrackingInfo
      properties:
        deliveryTrackingInfo:
          type: object
          description: Information about the person that was assigned to deliver the order.
          allOf:
            - $ref: '#/components/schemas/DeliveryTrackingInfo'
    DeliveryTrackingInfoDisptach:
      description: Delivery Tracking Info
      type: object
      properties:
        event:
          description: The delivery last known event.
          type: object
          required:
            - type
            - datetime
          properties:
            type:
              type: string
              description: The current delivery event.
              enum:
                - DELIVERY_ONGOING
                - ARRIVED_AT_CUSTOMER
                - ORDER_DELIVERED
                - CANCELLED
            message:
              type: string
              description: >-
                Free message. It should be used to provide more detailed
                information.
            datetime:
              type: string
              format: date-time
              description: >-
                Date and time when the event ocurred. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        problem:
          description: In the event of a delivery problem, it states the last known reason.
          type: object
          required:
            - reason
            - datetime
          properties:
            reason:
              type: string
              description: Problem reason.
              enum:
                - DELIVERYPERSON_OCCURRENCE
                - PAYMENT_PROBLEMS
                - WRONG_PRODUCT_OR_ITEM
                - ORDER_DELAYED
                - ORDER_DAMAGED_OR_VIOLATED
                - CUSTOMER_DID_NOT_PLACE_ORDER
                - CUSTOMER_ADDRESS_UNKNOWN
                - ORDER_MISSING_ITEMS
                - NOBODY_TO_RECEIVE
                - DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER
                - ORDER_DELIVERED_WITHOUT_PAYMENT
                - FRAUD_OR_THEFT
            message:
              type: string
              description: >-
                Free message. It should be used to provide more detailed
                information.
            datetime:
              type: string
              format: date-time
              description: >-
                Date and time when the problem ocurred. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        vehicle:
          description: The vehicle that will be used for this delivery.
          type: object
          required:
            - type
          properties:
            type:
              type: array
              description: Vehicle Type
              items:
                type: string
                enum:
                  - MOTORBIKE_BAG
                  - MOTORBIKE_BOX
                  - CAR
                  - BICYCLE
                  - SCOOTER
                  - VUC
              maxItems: 10
            licencePlate:
              type: string
              description: Licence plate of the vehicle user for the delivery.
        eta:
          type: object
          description: Estimate Times of Pickup and Delivery.
          properties:
            deliveryEtaInMinutes:
              type: integer
              description: >-
                Delivery Eta in **minutes**. Informs how many minutes it will
                take the delivery person to arrive at the consumer's address for
                order delivery.
            deliveryEtaDatetime:
              type: string
              format: date-time
              description: >-
                Delivery Eta Datetime. Informs the date and time the delivery
                person is expected to arrive at the consumer's address for order
                delivery. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            maxDeliveryTime:
              type: string
              format: date-time
              description: >-
                Maximum Date and Time for delivery. This time should not exceed
                the delivery time limit given in the order request. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        deliveryPerson:
          type: object
          description: Information about the person taht was assigned to deliver the order.
          properties:
            id:
              type: string
              description: Delivery Person Id given by the `Keeta`.
            name:
              type: string
              description: Delivery Person Name.
            pictureURL:
              type: string
              format: URI
              description: >-
                URL to access the photo of the delivery person. Before entering
                this field, check that the parties allow data to be shared
                according to data disclosure laws and rules.
            areaCode:
              type: string
              description: Delivery Person telephone area code.
              example: '+55'
            phone:
              type: string
              description: Delivery Person phone number.
              example: '1234567'
        geoLocalization:
          description: Geo Localization Info.
          type: object
          properties:
            latitude:
              type: number
              format: float
              description: >-
                Indicates the latitude coordinate of the actual position of the
                delivery person.




                Latitude in degrees. Values are restricted to the range [[-90,
                90]].
              example: -23.54809
            longitude:
              type: number
              format: float
              description: >-
                Indicates the longitude coordinate of the actual position of the
                delivery person.




                Longitude in degrees. Values are restricted to the range [[-180,
                180]].
              example: -46.63638
            lastAddress:
              description: >-
                The last known address that the delivery person was when the
                event was sent.
              type: object
              required:
                - distanceToPickup
                - distanceToDelivery
                - timestamp
              properties:
                country:
                  type: string
                  pattern: ^[A-Z]{2}$
                  description: >-
                    Two-letter [ISO 3166-1
                    alpha-2](https://www.iso.org/standard/72482.html) country
                    code.
                  example: BR
                state:
                  type: string
                  description: >-
                    State or country subdivision. It is recommended (but not
                    required) that you use the [ISO
                    3166-2](https://www.iso.org/standard/72483.html)
                    representation. 
                  example: BR-SP
                city:
                  type: string
                  description: City name.
                  example: São Paulo
                district:
                  type: string
                  description: District or Neighborhood name.
                  example: Moema
                street:
                  type: string
                  description: Street Name.
                  example: Plaza Avenue
                postalCode:
                  type: string
                  description: Postal Code.
                  example: 20111-000
                distanceToPickup:
                  type: string
                  description: Distance To Pickup in **meters**.
                distanceToDelivery:
                  type: string
                  description: Distance To Delivery in **meters**.
                timestamp:
                  type: string
                  format: date-time
                  description: >-
                    Date and time when this information is valid. 


                    (UTC date-time in ISO timestamp format. See
                    [Guidelines](#section/General-Guidelines) for more info).
        externalTrackingURL:
          type: string
          format: URI
          description: >-
            External URL, provided by the logistics service to track the
            delivery on a specific page. Example: Real-time map view, or
            delivery timeline.
    DeliveryTrackingInfo:
      description: Delivery Tracking Info Updates
      type: object
      properties:
        event:
          description: The delivery last known event.
          type: object
          required:
            - type
            - datetime
          properties:
            type:
              type: string
              description: The current delivery event.
              enum:
                - PICKUP_ONGOING
                - ARRIVED_AT_MERCHANT
                - ORDER_PICKED
                - DELIVERY_ONGOING
                - ARRIVED_AT_CUSTOMER
                - ORDER_DELIVERED
                - CANCELLED
            message:
              type: string
              description: >-
                Free message. It should be used to provide more detailed
                information.
            datetime:
              type: string
              format: date-time
              description: >-
                Date and time when the event ocurred. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        problem:
          description: In the event of a delivery problem, it states the last known reason.
          type: object
          required:
            - reason
            - datetime
          properties:
            reason:
              type: string
              description: Problem reason.
              enum:
                - DELIVERYPERSON_OCCURRENCE
                - PAYMENT_PROBLEMS
                - WRONG_PRODUCT_OR_ITEM
                - ORDER_DELAYED
                - ORDER_DAMAGED_OR_VIOLATED
                - CUSTOMER_DID_NOT_PLACE_ORDER
                - CUSTOMER_ADDRESS_UNKNOWN
                - ORDER_MISSING_ITEMS
                - NOBODY_TO_RECEIVE
                - DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER
                - ORDER_DELIVERED_WITHOUT_PAYMENT
                - FRAUD_OR_THEFT
            message:
              type: string
              description: >-
                Free message. It should be used to provide more detailed
                information.
            datetime:
              type: string
              format: date-time
              description: >-
                Date and time when the problem ocurred. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        vehicle:
          description: The vehicle that will be used for this delivery.
          type: object
          required:
            - type
          properties:
            type:
              type: array
              description: Vehicle Type
              items:
                type: string
                enum:
                  - MOTORBIKE_BAG
                  - MOTORBIKE_BOX
                  - CAR
                  - BICYCLE
                  - SCOOTER
                  - VUC
              maxItems: 10
            licencePlate:
              type: string
              description: Licence plate of the vehicle user for the delivery.
        eta:
          type: object
          description: Estimate Times of Pickup and Delivery.
          properties:
            pickupEtaInMinutes:
              type: integer
              description: >-
                Pickup Eta in **minutes**. Informs how many minutes it will take
                the delivery person to arrive at the merchant for order pickup.
            pickupEtaDatetime:
              type: string
              format: date-time
              description: >-
                Pickup Eta Datetime. Informs the date and time the delivery
                person is expected to arrive at the merchant for order pickup. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            deliveryEtaInMinutes:
              type: integer
              description: >-
                Delivery Eta in **minutes**. Informs how many minutes it will
                take the delivery person to arrive at the consumer's address for
                order delivery.
            deliveryEtaDatetime:
              type: string
              format: date-time
              description: >-
                Delivery Eta Datetime. Informs the date and time the delivery
                person is expected to arrive at the consumer's address for order
                delivery. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            maxDeliveryTime:
              type: string
              format: date-time
              description: >-
                Maximum Date and Time for delivery. This time should not exceed
                the delivery time limit given in the order request. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        deliveryPerson:
          type: object
          description: Information about the person taht was assigned to deliver the order.
          properties:
            id:
              type: string
              description: Delivery Person Id given by the `Keeta`.
            name:
              type: string
              description: Delivery Person Name.
            pictureURL:
              type: string
              format: URI
              description: >-
                URL to access the photo of the delivery person. Before entering
                this field, check that the parties allow data to be shared
                according to data disclosure laws and rules.
        geoLocalization:
          description: Geo Localization Info.
          type: object
          properties:
            latitude:
              type: number
              format: float
              description: >-
                Indicates the latitude coordinate of the actual position of the
                delivery person.




                Latitude in degrees. Values are restricted to the range [[-90,
                90]].
              example: -23.54809
            longitude:
              type: number
              format: float
              description: >-
                Indicates the longitude coordinate of the actual position of the
                delivery person.




                Longitude in degrees. Values are restricted to the range [[-180,
                180]].
              example: -46.63638
            lastAddress:
              description: >-
                The last known address that the delivery person was when the
                event was sent.
              type: object
              required:
                - distanceToPickup
                - distanceToDelivery
                - timestamp
              properties:
                country:
                  type: string
                  pattern: ^[A-Z]{2}$
                  description: >-
                    Two-letter [ISO 3166-1
                    alpha-2](https://www.iso.org/standard/72482.html) country
                    code.
                  example: BR
                state:
                  type: string
                  description: >-
                    State or country subdivision. It is recommended (but not
                    required) that you use the [ISO
                    3166-2](https://www.iso.org/standard/72483.html)
                    representation. 
                  example: BR-SP
                city:
                  type: string
                  description: City name.
                  example: São Paulo
                district:
                  type: string
                  description: District or Neighborhood name.
                  example: Moema
                street:
                  type: string
                  description: Street Name.
                  example: Plaza Avenue
                postalCode:
                  type: string
                  description: Postal Code.
                  example: 20111-000
                distanceToPickup:
                  type: string
                  description: Distance To Pickup in **meters**.
                distanceToDelivery:
                  type: string
                  description: Distance To Delivery in **meters**.
                timestamp:
                  type: string
                  format: date-time
                  description: >-
                    Date and time when this information is valid. 


                    (UTC date-time in ISO timestamp format. See
                    [Guidelines](#section/General-Guidelines) for more info).
        externalTrackingURL:
          type: string
          format: URI
          description: >-
            External URL, provided by the logistics service to track the
            delivery on a specific page. Example: Real-time map view, or
            delivery timeline.
    Address:
      type: object
      title: Address
      required:
        - country
        - state
        - city
        - district
        - street
        - number
        - postalCode
        - complement
        - latitude
        - longitude
      properties:
        country:
          type: string
          pattern: ^[A-Z]{2}$
          description: >-
            Two-letter [ISO 3166-1
            alpha-2](https://www.iso.org/standard/72482.html) country code.
          example: BR
        state:
          type: string
          description: >-
            State or country subdivision. It is recommended (but not required)
            that you use the [ISO
            3166-2](https://www.iso.org/standard/72483.html) representation. 
          example: BR-SP
        city:
          type: string
          description: City name.
          example: São Paulo
        district:
          type: string
          description: District or Neighborhood name.
          example: Moema
        street:
          type: string
          description: Street Name.
          example: Plaza Avenue
        number:
          type: string
          description: Street Number.
          example: '100'
        postalCode:
          type: string
          description: Postal Code
          example: 20111-000
        complement:
          type: string
          description: Address complement.
          example: BL 02 AP 31
        reference:
          type: string
          description: Address reference.
          example: Yellow House
        latitude:
          type: number
          format: float
          description: Latitude in degrees. Values are restricted to the range [[-90, 90]].
          example: -23.54809
        longitude:
          type: number
          format: float
          description: >-
            Longitude in degrees. Values are restricted to the range [[-180,
            180]].
          example: -46.63638
    AddressLogistics:
      type: object
      title: Address
      required:
        - country
        - state
        - city
        - district
        - street
        - number
        - postalCode
        - complement
      properties:
        country:
          type: string
          pattern: ^[A-Z]{2}$
          description: >-
            Two-letter [ISO 3166-1
            alpha-2](https://www.iso.org/standard/72482.html) country code.
          example: BR
        state:
          type: string
          description: >-
            State or country subdivision. It is recommended (but not required)
            that you use the [ISO
            3166-2](https://www.iso.org/standard/72483.html) representation. 
          example: BR-SP
        city:
          type: string
          description: City name.
          example: São Paulo
        district:
          type: string
          description: District or Neighborhood name.
          example: Moema
        street:
          type: string
          description: Street Name.
          example: Plaza Avenue
        number:
          type: string
          description: Street Number.
          example: '100'
        postalCode:
          type: string
          description: Postal Code
          example: 20111-000
        complement:
          type: string
          description: Address complement.
          example: BL 02 AP 31
        reference:
          type: string
          description: Address reference.
          example: Yellow House
        latitude:
          type: number
          format: float
          description: Latitude in degrees. Values are restricted to the range [[-90, 90]].
          example: -23.54809
        longitude:
          type: number
          format: float
          description: >-
            Longitude in degrees. Values are restricted to the range [[-180,
            180]].
          example: -46.63638
    ContactPhones:
      type: object
      title: Contact Phones
      required:
        - commercialNumber
      properties:
        commercialNumber:
          type: string
          description: Telephone number of the merchant
          example: '11999999999'
        whatsappNumber:
          type: string
          description: >-
            Whatsapp number of the merchant, Keeta will temporarily ignore this
            information.

            > **Keeta does not support this field and will be ignored.**
          example: '11998888888'
    Price:
      type: object
      title: Price
      required:
        - value
        - currency
      properties:
        value:
          type: number
          format: decimal
          description: Price value. 4 decimals places are accepted
          example: 40
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: The 3-letter ISO 4217 currency code.
          example: BRL
    Error:
      type: object
      required:
        - title
        - status
      properties:
        title:
          type: string
          description: Short description of the problem.
          example: Unexpected error
        status:
          type: integer
          description: HTTP code of the returned status.
          example: 500
    CancellationError:
      type: object
      required:
        - title
        - status
      properties:
        title:
          type: string
          description: Short description of the problem.
          example: Unexpected error
        status:
          type: integer
          description: HTTP code of the returned status.
          example: 500
        cancellationStatus:
          type: string
          description: Indicates the result of the cancellation request.
          enum:
            - CANCELLED
    Image:
      type: object
      required:
        - URL
      properties:
        URL:
          type: string
          format: uri
          description: |-
            URL pointing to an image of the merchant logo.

             Image requirements: 
             - Supports standard HTTP/HTTPS external image URLs. 
             - File size must be less than 5MB, it is recommended to be less than 2MB. 
             - Support JPG, PNG, JPEG format. 
             - The width of the image cannot be less than 600px, and the height cannot be less than 450px. The recommended aspect ratio is 4:3, but this is not a constraint. 

             > It is expected that the images referenced in the URL are downloaded from the server that is making the request, because the URL may no longer be valid after a period of time.
          example: https://food-company.com/image.jpg
        CRC-32:
          type: string
          format: CRC32
          description: >-
            CRC-32 of the image file. This field can be used to check for
            changes in the image file.
          example: 96b41025
    ImageWithType:
      description: Image Object
      type: object
      required:
        - URL
        - type
      properties:
        URL:
          type: string
          format: uri
          description: |-
            URL pointing to an image of the merchant logo.

             Image requirements: 
             - Supports standard HTTP/HTTPS external image URLs. 
             - File size must be less than 5MB, it is recommended to be less than 2MB. 
             - Support JPG, PNG, JPEG format. 
             - The width of the image cannot be less than 600px, and the height cannot be less than 450px. The recommended aspect ratio is 4:3, but this is not a constraint. 

             > It is expected that the images referenced in the URL are downloaded from the server that is making the request, because the URL may no longer be valid after a period of time.
          example: https://food-company.com/image.jpg
        CRC-32:
          type: string
          format: CRC32
          description: >-
            CRC-32 of the image file. This field can be used to check for
            changes in the image file.
          example: 96b41025
        type:
          type: string
          enum:
            - main
            - thumb
          description: >-
            The type of the image. The `main` type is generally used for larger
            images, such as in the item detail, while the `thumb` type is for
            smaller images, typically used in the menu listing.
    MerchantAPIInfo:
      type: object
      required:
        - keetaMerchantId
      description: >-
        Information about the endpoints that are hosted at the **Software
        Service**.
      properties:
        getMerchantURL:
          type: object
          description: >-
            Information about the merchant's Software Service's [GET
            /v1/merchant](#operation/getMerchant) access. This endpoint has the
            necessary information for Keeta to be able to make the merchant's
            available on their plataform.
          required:
            - baseURL
          properties:
            baseURL:
              type: string
              format: uri
              description: The URL for accessing the endpoint.
            apiKey:
              type: string
              description: >-
                The API_KEY for accessing the endpoint (see
                [AUTHENTICATION](#tag/authentication) section form more
                information).
        ordersWebhookURL:
          type: string
          format: uri
          description: >-
            Information about the merchant's Software Service's [POST
            /v1/newEvent](#operation/newEvent) webhook access. This is where
            Keeta will sent the order's events to the Software Service as they
            happen.
        keetaMerchantId:
          type: number
          description: >-
            The Keeta merchant ID is generated by Keeta. Merchants can obtain
            this merchantId from the **Keeta merchant portal**.
    DeliveryOrder:
      description: Delivery Order Object.
      type: object
      required:
        - orderId
        - orderDisplayId
        - merchant
        - pickupAddress
        - returnToMerchant
        - canCombine
        - deliveryAddress
        - customerName
        - vehicle
        - limitTimes
        - totalOrderPrice
        - totalWeight
        - payments
      properties:
        orderId:
          type: string
          format: UUID
          description: The orderId generated by the **`Keeta`**.
          example: 52122852-6626-11ed-9022-0242ac120002
        orderDisplayId:
          type: string
          description: Order Id shown in the **`Keeta`** interface for the customer.
          example: 96b41025
        merchant:
          type: object
          required:
            - id
            - name
          description: Merchant information.
          properties:
            id:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's **`Software
                Service`**.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            name:
              type: string
              description: Merchant Public Name
              maxLength: 500
              example: Pizza Plaza
        pickupAddress:
          description: Pickup Address.
          allOf:
            - $ref: '#/components/schemas/AddressLogistics'
            - type: object
              properties:
                pickupLocation:
                  type: string
                  description: Pickup Location
                parkingSpace:
                  type: boolean
                  description: Parking Space
                instructions:
                  type: string
                  description: Any instructions that may help the delivery.
        pickupCode:
          type: string
          description: >-
            Pickup code to be provided to the delivery person for order
            collection at the merchant. This code may have been generated by
            Keeta or by the Software Service.
        notifyReadyForPickup:
          type: boolean
          description: >-
            Inform whether the **`Logistic Service`** to wait for a notification
            that the order was ready for been picked up. This notification
            happens via the endpoint: [POST
            /logistics/orderPicked/{orderId}](#operation/logisticsReadyForPicked)
        notifyPickup:
          type: boolean
          description: >-
            Inform whether the **`Logistic Service`** to wait for a notification
            that the order has actually been picked. This notification happens
            via the endpoint: [POST
            /logistics/orderPicked/{orderId}](#operation/logisticsPicked)
        notifyConclusion:
          type: boolean
          description: >-
            Inform whether the **`Logistic Service`** to wait for a delivery
            finish notification from the requester, before actually finalizing
            the delivery in its system. This notification is made via the
            endpoint: [POST
            /logistics/finishDelivery/{orderId}](#operation/logisticsFinish)
        returnToMerchant:
          type: boolean
          description: >-
            Inform whether the delivery person should return to the pickup
            address after the delivery has been made.
        canCombine:
          type: boolean
          description: >-
            Inform whether the **`Logistic Service`** can combine this order
            with other orders in the same delivery.
        confirmationCodeRequired:
          type: boolean
          description: ' Inform whether the **Logistics Service** needs to validate a Delivery Confirmation Code passed by the customer to complete the delivery.'
        deliveryAddress:
          description: Delivery Address
          allOf:
            - $ref: '#/components/schemas/AddressLogistics'
            - type: object
              properties:
                instructions:
                  type: string
                  description: Instructions
        customerName:
          type: string
          description: Customer Name.
        customerPhone:
          type: string
          description: >-
            Customer's phone. Here you can enter the customer's phone number
            directly (provided that the customer has given permission for this
            data to be shared, according to local policies) or another phone
            number (such as the Keeta's call center phone number).


            **Please note**: The telephone number is considered an
            identification field and therefore the customer's advance consent is
            required.
        customerPhoneLocalizer:
          type: string
          description: >-
            This propertie should be used as a complementary field to the
            `customerPhone` field in cases where a generic phone number is
            provided, such as a call center, and it is necessary to provide some
            order or customer identification.
        vehicle:
          description: >-
            Vehicle Info. informs which vehicle options are to be used for
            delivery. More than one can be informed, but the logistics service
            must choose only one of the types of vehicles informed.
          allOf:
            - $ref: '#/components/schemas/Vehicle'
        limitTimes:
          type: object
          description: >-
            Limit Times. Informs the maximum pickup and delivery times that must
            be met by the `Logistics Service`.
          properties:
            pickupLimit:
              type: integer
              description: >-
                Pickup Limit in **minutes**. It should be used to inform the
                maximum amount of minutes from the time the request was made to
                which the order should be collected at the merchant.
              example: 23
            deliveryLimit:
              type: integer
              description: >-
                Delivery Limit in **minutes**. It should be used to inform the
                maximum amount of minutes from the time the request was made to
                which the order should be delivered at the consumer's address.
              example: 48
            orderCreatedAt:
              type: string
              format: date-time
              description: >-
                The date and time that the Order was created at **Keeta**. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        preparationStartDateTime:
          type: string
          format: date-time
          description: >-
            Estimated time when the order will start being prepared. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        totalOrderPrice:
          description: >-
            Total order price that was calculated and displayed for the final
            consumer in the **`Keeta`**. This value may already contain taxes
            and shipping in addition to the value of the items purchased.
          allOf:
            - $ref: '#/components/schemas/Price'
        orderDeliveryFee:
          description: >-
            This field informs the delivery fee paid by the consumer in the
            **`Keeta`**.
          allOf:
            - $ref: '#/components/schemas/Price'
        totalWeight:
          type: integer
          description: Total packaging weight in **grams**
        packageVolume:
          type: number
          description: The cubage of the packaging in **cubic meters (m³)**.
        packageQuantity:
          type: integer
          description: >-
            Number of packages that will be transported in this order. For
            example, 2 packages, or 3 boxes.  

            > The unit of measure will not be considered, only the quantity.
        items:
          type: array
          description: List of items that are part of the delivery.
          items:
            type: object
            properties:
              name:
                type: string
                description: Product name
              quantity:
                type: number
                format: decimal
                description: |-
                  Amount of items.

                    > Use fractional values for quantities smaller than the unit of measure:
                    > Example: 500 grams = 0.5 KG
        specialInstructions:
          type: string
          description: >-
            Free text to describe special instructions that may apply. These
            instructions can be used to give some special guidance to the
            delivery person at the time of the pickup or delivery.
        additionalPricePercentual:
          type: number
          format: double
          description: >-
            Indicates to the **`Logistic Service`** an additional percentage to
            the list price that the requester agrees to pay for the delivery.

            > The delivery request will be refused if the delivery price exceeds
            this value.


            Example: List Price = $10  
                     Actual calculated price = $15  
                     Additonal price percentage = **50**


            In this case, any value informed below 50, would result in the order
            being rejected.
        payments:
          type: object
          description: >-
            Payments Info. It informs the payment methods chosen by the consumer
            in the **`Keeta`**. This section should be used by the `Logistics
            Service` to check how much the delivery person should receive from
            the consumer when delivering the order.
          properties:
            method:
              type: string
              description: >-
                OFFLINE - The order will be paid by the consumer at the time the
                order is received.  

                ONLINE - The order has already been paid through the order
                application.
              enum:
                - OFFLINE
                - ONLINE
            wirelessPos:
              type: boolean
              description: >-
                Indicates whether the delivery person should take the wireless
                payment device with him.
            offlineMethod:
              type: array
              description: >-
                If the method is `OFFLINE`, the payment information should be
                provided.
              items:
                type: object
                description: ''
                properties:
                  type:
                    type: string
                    enum:
                      - CREDIT
                      - DEBIT
                      - MEAL_VOUCHER
                      - FOOD_VOUCHER
                      - PIX
                      - CASH
                      - CREDIT_DEBIT
                      - OTHER
                  amount:
                    allOf:
                      - $ref: '#/components/schemas/Price'
              maxItems: 100
            change:
              description: If type is `CASH`, tells how much change will be needed.
              allOf:
                - $ref: '#/components/schemas/Price'
        combinedOrdersIds:
          type: array
          description: >-
            Combined Orders Ids. Informs the logistics service of the Id of
            other orders already in progress so that the operator can combine
            these orders. This combination may or may not be accepted by the
            logistic service, respecting the contracted policies.
          items:
            type: string
            format: uuid
          maxItems: 10
        sourceAppId:
          type: string
          format: uuid
          description: >-
            This field must be filled in with the AppId of **Keeta** that
            originated the order. This field is to help the applications that
            will work as a Hub, intermediating the requests from **Keeta** with
            the **Software Service** and the **Logistics Services**.
        sourceOrderId:
          type: string
          format: uuid
          description: >-
            This field must be filled in with the original OrderId generated by
            **Keeta**. In most cases this property will have the same value as
            the `orderId` property, since it is already recommended that the
            order id created by **Keeta** be sent in the `orderId` property. But
            if the order id created by  **Keeta** is not sent in the `orderId`
            property then it must be entered in this field.
    Vehicle:
      description: Vehicle Object.
      type: object
      required:
        - type
        - container
      properties:
        type:
          type: array
          description: Vehicle Type
          items:
            type: string
            enum:
              - MOTORBIKE_BAG
              - MOTORBIKE_BOX
              - CAR
              - BICYCLE
              - SCOOTER
              - VUC
          maxItems: 10
        container:
          type: string
          description: Vehicle container (bag) type.
          enum:
            - NORMAL
            - THERMIC
        containerSize:
          type: string
          description: Vehicle container (bag) size.
          enum:
            - SMALL
            - MEDIUM
            - LARGE
            - EXTRA_LARGE
        instruction:
          type: string
          description: >-
            Free text to describe special instructions that may apply. These
            instructions can be used to give some special guidance to the
            delivery person at the time of the pickup or delivery.
    DeliveryOrderResponse:
      description: Delivery Order Response Object.
      type: object
      required:
        - deliveryId
        - event
        - completion
      properties:
        deliveryId:
          type: string
          format: UUID
          description: The delivery Id generated by the **`Logistic Service`**.
          example: 48ae4d68-6626-11ed-9022-0242ac120002
        event:
          description: >-
            Current event of the order. It is expected to be sent with the value
            **`PENDING`** at this moment, since the acceptance or rejection of
            the request will be processed asynchronously.
          type: string
          enum:
            - PENDING
            - ACCEPTED
            - REJECTED
            - PICKUP_ONGOING
            - ARRIVED_AT_MERCHANT
            - ORDER_PICKED
            - DELIVERY_ONGOING
            - ARRIVED_AT_CUSTOMER
            - ORDER_DELIVERED
            - RETURNING_TO_MERCHANT
            - RETURNED_TO_MERCHANT
            - DELIVERY_FINISHED
            - CANCELLED
        completion:
          type: object
          description: >-
            Informs the expected date and time for sending the acceptance or
            refusal of the delivery order.
          properties:
            estimate:
              type: string
              format: date-time
              description: >-
                Expected date and time for completion. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
            rejectAfter:
              type: string
              format: date-time
              description: >-
                Maximum date and time to wait for the acceptance or refusal of
                the order. After this time the delivery request should be
                disregarded and a new request should be made. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        deliveryDetailsURL:
          type: string
          format: URI
          description: >-
            It is the URL where the delivery information can be found. 

            It should return the [GET
            /logistics/delivery/{orderId}](#operation/logisticDetails) route for
            this order."
          example: >-
            http://yourApiBaseUrl.com/v1/logistics/delivery/52122852-6626-11ed-9022-0242ac120002
    DeliveryOrderEvent:
      description: Delivery Order Event Object.
      type: object
      required:
        - deliveryId
        - orderId
        - orderDisplayId
        - merchant
        - event
        - customerName
      properties:
        deliveryId:
          type: string
          format: UUID
          description: The delivery ID generated by the `Logistics Service`.
          example: 48ae4d68-6626-11ed-9022-0242ac120002
        orderId:
          type: string
          format: uuid
          description: The orderId generated by the **`Keeta`**.
          example: 52122852-6626-11ed-9022-0242ac120002
        orderDisplayId:
          type: string
          description: Order Id shown in the **`Keeta`** interface for the customer.
          example: 96b41025
        merchant:
          type: object
          required:
            - id
            - name
          description: Merchant information.
          properties:
            id:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's **`Software
                Service`**.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            name:
              type: string
              description: Merchant Public Name
              maxLength: 500
              example: Pizza Plaza
        event:
          description: Current Event Info.
          allOf:
            - $ref: '#/components/schemas/DeliveryEvent'
        problem:
          type: array
          description: List of problems that may occur.
          items:
            allOf:
              - $ref: '#/components/schemas/DeliveryProblem'
        customerName:
          type: string
          description: Customer Name.
        vehicle:
          description: >-
            Chosen Vehicle Info. 

            > This propertie is **REQUIRED** when `event > type` is different
            from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/ChosenVehicle'
        deliveryPrice:
          description: >-
            Delivery Pricing Info.

            > This propertie is **REQUIRED** when `event > type` is different
            from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/DeliveryPrice'
        eta:
          description: >-
            Estimate Times of Pickup and Delivery. 

            > This propertie is **REQUIRED** when `event > type` is different
            from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/ETA'
        deliveryPerson:
          description: >-
            Delivery Person Info.

            > This propertie is **REQUIRED** when `event > type` is different
            from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/DeliveryMan'
        geoLocalization:
          description: Geo Localization Info.
          allOf:
            - $ref: '#/components/schemas/GeoLocalization'
        externalTrackingURL:
          type: string
          format: URI
          description: >-
            External URL, provided by the logistics service to track the
            delivery on a specific page. Example: Real-time map view, or
            delivery timeline.
        combinedOrdersIds:
          type: array
          description: >-
            Combined Orders Ids. Informs which other orders from the same
            merchant are being carried by the same delivery person, with the
            same `deliveryId`.
          items:
            type: string
            format: uuid
    DeliveryEvent:
      description: Delivery Event Object.
      type: object
      required:
        - type
        - datetime
      properties:
        type:
          type: string
          description: The current delivery event.
          enum:
            - PENDING
            - ACCEPTED
            - REJECTED
            - PICKUP_ONGOING
            - ARRIVED_AT_MERCHANT
            - ORDER_PICKED
            - DELIVERY_ONGOING
            - ARRIVED_AT_CUSTOMER
            - ORDER_DELIVERED
            - RETURNING_TO_MERCHANT
            - RETURNED_TO_MERCHANT
            - DELIVERY_FINISHED
            - CANCELLED
        message:
          type: string
          description: >-
            Free message. It should be used to provide more detailed
            information.
        datetime:
          type: string
          format: date-time
          description: >-
            Date and time when the event ocurred. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        rejectionInfo:
          description: >-
            Rejection Info. It should be informed to provide more information
            when the event type is `REJECTED`.
          allOf:
            - $ref: '#/components/schemas/DeliveryEventDenied'
    DeliveryEventDenied:
      description: Delivery Event Denied Object.
      type: object
      required:
        - reason
      discriminator:
        propertyName: reason
        mapping:
          PRICE_EXCEEDED: '#/components/schemas/DeliveryEventDeniedPrice'
          VEHICLE_NOT_AVAILABLE: '#/components/schemas/DeliveryEventDeniedVehicle'
          NO_DELIVERYPERSON_AVAILABLE: '#/components/schemas/DeliveryEventDeniedNoDeliveryMan'
          DOES_NOT_MEET_REQUESTED_TIMES: '#/components/schemas/DeliveryEventDeniedEta'
          REGION_NOT_SERVED: '#/components/schemas/DeliveryEventDenied'
          INVALID_ADDRESS: '#/components/schemas/DeliveryEventDenied'
          OTHER: '#/components/schemas/DeliveryEventDenied'
      properties:
        reason:
          type: string
          description: Rejection reason.
          enum:
            - PRICE_EXCEEDED
            - VEHICLE_NOT_AVAILABLE
            - NO_DELIVERYPERSON_AVAILABLE
            - DOES_NOT_MEET_REQUESTED_TIMES
            - REGION_NOT_SERVED
            - OTHER
    DeliveryEventDeniedVehicle:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/DeliveryEventDenied'
        - type: object
        - properties:
            metadata:
              type: object
              description: Information about vehicles availability at the moment.
              properties:
                availableVehicles:
                  type: integer
                  description: Informs how many vehicles are available at the moment.
                vehiclesAvailable:
                  description: List of currently available vehicles.
                  allOf:
                    - $ref: '#/components/schemas/Vehicle'
                nextAvailableVehicle:
                  type: integer
                  description: >-
                    Informs how soon the next vehicle will be available in
                    **minutes**.
    DeliveryEventDeniedPrice:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/DeliveryEventDenied'
        - type: object
        - properties:
            metadata:
              type: object
              description: >-
                The actual delivery price calculated according to the data given
                in the request.
              allOf:
                - $ref: '#/components/schemas/DeliveryPrice'
    DeliveryEventDeniedNoDeliveryMan:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/DeliveryEventDenied'
        - type: object
        - properties:
            metadata:
              type: object
              description: Information about delivery person availability.
              properties:
                nextAvailableVehicle:
                  type: integer
                  description: >-
                    Informs how soon the next delivery person will be available
                    in **minutes**.
    DeliveryEventDeniedEta:
      description: Metadata
      allOf:
        - $ref: '#/components/schemas/DeliveryEventDenied'
        - type: object
        - properties:
            metadata:
              type: object
              description: >-
                The actual ETAs calculated according to the data given in the
                request.
              allOf:
                - $ref: '#/components/schemas/ETA'
    DeliveryProblem:
      description: Delivery Problem Object.
      type: object
      required:
        - reason
        - datetime
        - canFinishDeliver
        - needMerchantAction
      properties:
        reason:
          type: string
          description: Problem reason.
          enum:
            - DELIVERYPERSON_OCCURRENCE
            - PAYMENT_PROBLEMS
            - WRONG_PRODUCT_OR_ITEM
            - ORDER_DELAYED
            - ORDER_DAMAGED_OR_VIOLATED
            - CUSTOMER_DID_NOT_PLACE_ORDER
            - CUSTOMER_ADDRESS_UNKNOWN
            - ORDER_MISSING_ITEMS
            - NOBODY_TO_RECEIVE
            - DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER
            - ORDER_DELIVERED_WITHOUT_PAYMENT
            - FRAUD_OR_THEFT
            - OTHER
        message:
          type: string
          description: >-
            Free message. It should be used to provide more detailed
            information.
        datetime:
          type: string
          format: date-time
          description: >-
            Date and time when the problem ocurred. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        canFinishDeliver:
          type: boolean
          description: Informs whether or not it is still possible to finish the delivery.
        needMerchantAction:
          type: boolean
          description: >-
            Informs whether or not the merchant needs to perform some action in
            order for delivery to continue.
    DeliveryProblemHistory:
      description: Delivery Event.
      type: object
      required:
        - reason
        - datetime
        - resolved
      properties:
        reason:
          type: string
          description: Problem reason.
          enum:
            - DELIVERYPERSON_OCCURRENCE
            - PAYMENT_PROBLEMS
            - WRONG_PRODUCT_OR_ITEM
            - ORDER_DELAYED
            - ORDER_DAMAGED_OR_VIOLATED
            - CUSTOMER_DID_NOT_PLACE_ORDER
            - CUSTOMER_ADDRESS_UNKNOWN
            - ORDER_MISSING_ITEMS
            - NOBODY_TO_RECEIVE
            - DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER
            - ORDER_DELIVERED_WITHOUT_PAYMENT
            - FRAUD_OR_THEFT
            - OTHER
        message:
          type: string
          description: >-
            Free message. It should be used to provide more detailed
            information.
        datetime:
          type: string
          format: date-time
          description: >-
            Date and time when the problem ocurred. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        resolved:
          type: boolean
          description: Informs if the problem was resolved or not.
        actionTaken:
          type: string
          description: Action taken by the requester.
          enum:
            - RETURN_TO_STORE
            - DELIVER_PRODUCT
            - CANCEL_DELIVERY
        resolutionDate:
          type: string
          format: date-time
          description: >-
            Date and time when the problem was resolved. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
    ChosenVehicle:
      description: Delivery Order Response Object
      type: object
      required:
        - type
        - container
      properties:
        type:
          type: string
          description: Vehicle Type.
          enum:
            - MOTORBIKE_BAG
            - MOTORBIKE_BOX
            - CAR
            - BICYCLE
            - SCOOTER
            - VUC
        container:
          type: string
          description: The veichle container (bag) type.
          enum:
            - NORMAL
            - THERMIC
        containerSize:
          type: string
          description: Vehicle container (bag) size.
          enum:
            - SMALL
            - MEDIUM
            - LARGE
            - EXTRA_LARGE
        instruction:
          type: string
          description: Special Instructions.
    DeliveryPrice:
      description: Delivery Pricing
      type: object
      required:
        - price
        - pricingList
        - additionalPricePercentual
      properties:
        price:
          description: >-
            The calculated price of the delivery. It may be 0. The price shall
            be calculated according to the Price List being used, as well as
            previously established commercial agreements.
          allOf:
            - $ref: '#/components/schemas/Price'
        pricingList:
          type: string
          description: Indicates what list was used to calculate the delivery price.
          enum:
            - NORMAL
            - DYNAMIC
        additionalPricePercentual:
          type: number
          description: >-
            Indicates the additional percentage to the list price that was
            calculated for this delivery.


            Example: List Price = $10  
                     Actual calculated price = $15  
                     Additonal price percentage = **50**
    DeliveryAvailabilityPrice:
      description: Delivery Order Object
      type: object
      required:
        - pickupAddress
        - returnToMerchant
        - canCombine
        - deliveryAddress
        - vehicle
        - limitTimes
        - totalOrderPrice
        - totalWeight
      properties:
        merchant:
          type: object
          required:
            - id
            - name
          description: Merchant information.
          properties:
            id:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's **`Software
                Service`**.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            name:
              type: string
              description: Merchant Public Name
              maxLength: 500
              example: Pizza Plaza
        pickupAddress:
          description: Pickup Address.
          allOf:
            - $ref: '#/components/schemas/AddressLogistics'
            - type: object
              properties:
                pickupLocation:
                  type: string
                  description: Pickup Location
                parkingSpace:
                  type: boolean
                  description: Parking Space
                instructions:
                  type: string
                  description: Instructions
        returnToMerchant:
          type: boolean
          description: >-
            Inform whether the delivery person should return to the pickup
            address after the delivery has been made.
        canCombine:
          type: boolean
          description: >-
            Inform whether the **`Logistic Service`** can combine this order
            with other orders in the same delivery.
        deliveryAddress:
          description: Delivery Address
          allOf:
            - $ref: '#/components/schemas/AddressLogistics'
            - type: object
              properties:
                instructions:
                  type: string
                  description: Instructions
        vehicle:
          description: >-
            Vehicle Info. informs which vehicle options are to be used for
            delivery. More than one can be informed, but the logistics service
            must choose only one of the types of vehicles informed.
          allOf:
            - $ref: '#/components/schemas/Vehicle'
        limitTimes:
          type: object
          description: >-
            Limit Times. Informs the maximum pickup and delivery times that must
            be met by the `Logistics Service`.
          properties:
            pickupLimit:
              type: integer
              description: >-
                Pickup Limit in **minutes**. It should be used to inform the
                maximum amount of minutes from the time the request was made to
                which the order should be collected at the merchant.
              example: 23
            deliveryLimit:
              type: integer
              description: >-
                Delivery Limit in **minutes**. It should be used to inform the
                maximum amount of minutes from the time the request was made to
                which the order should be delivered at the consumer's address.
              example: 48
            orderCreatedAt:
              type: string
              format: date-time
              description: >-
                The date and time that the Order was created at  **Keeta**. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
        totalOrderPrice:
          description: >-
            Total order price that was calculated and displayed for the final
            consumer in the **`Keeta`**. This value may already contain taxes
            and shipping in addition to the value of the items purchased.
          allOf:
            - $ref: '#/components/schemas/Price'
        orderDeliveryFee:
          description: >-
            This field informs the delivery fee paid by the consumer in the
            **`Keeta`**.
          allOf:
            - $ref: '#/components/schemas/Price'
        totalWeight:
          type: integer
          description: Total Weight in **grams**
        packageVolume:
          type: number
          description: The cubage of the packaging in **cubic meters (m³)**.
        packageQuantity:
          type: integer
          description: >-
            Number of packages that will be transported in this order. For
            example, 2 packages, or 3 boxes. 

            > The unit of measure will not be considered, only the quantity.
        specialInstructions:
          type: string
          description: Free text to describe special instructions that may apply.
        additionalPricePercentual:
          type: number
          description: >-
            Indicates to the **`Logistic Service`** an additional percentage to
            the list price that the requester agrees to pay for the delivery.

            > The delivery request will be refused if the delivery price exceeds
            this value.


            Example: List Price = $10  
                     Actual calculated price = $15  
                     Additonal price percentage = **50**


            In this case, any value informed below 50, would result in the order
            being rejected.
        onlinePayment:
          type: boolean
          description: >-
            Informs whether or not the payment has already been made in the
            **`Keeta`**
    DeliveryAvailabilityPriceResponse:
      description: Delivery Order Response Object
      type: object
      properties:
        deliveryPrice:
          description: Delivery Pricing Info.
          allOf:
            - $ref: '#/components/schemas/DeliveryPrice'
        vehicles:
          type: object
          description: Chosen Vehicle Info.
          properties:
            availableVehicles:
              type: integer
              description: Informs how many vehicles are available at the moment.
            vehiclesAvailable:
              description: List of currently available vehicles.
              allOf:
                - $ref: '#/components/schemas/Vehicle'
            nextAvailableVehicle:
              type: integer
              description: >-
                Informs how soon the next vehicle will be available in
                **minutes**.
        ETAs:
          description: ETAs
          allOf:
            - $ref: '#/components/schemas/ETA'
    ETA:
      description: ETA
      type: object
      required:
        - updateMethod
        - pickupEtaInMinutes
        - pickupEtaDatetime
        - deliveryEtaInMinutes
        - deliveryEtaDatetime
        - maxDeliveryTime
      properties:
        updateMethod:
          type: string
          description: >-
            Update Method: Indicates how the times will be updated in the
            events.


            `OFFLINE`: The time will be calculated in the event `ACCEPTED` and
            will no longer be updated in the following events.  


            `ONLINE`: The time will be updated in all events. In this case, when
            the collection has already occurred, the `pickupEtaInMinutes`
            property will be set to **0** and the `pickupEtaDatetime` property
            will be the time when the collection occurred.
          enum:
            - OFFLINE
            - ONLINE
        pickupEtaInMinutes:
          type: integer
          description: >-
            Pickup Eta in **minutes**. Informs how many minutes it will take the
            delivery person to arrive at the merchant for order pickup.
        pickupEtaDatetime:
          type: string
          format: date-time
          description: >-
            Pickup Eta Datetime. Informs the date and time the delivery person
            is expected to arrive at the merchant for order pickup. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        deliveryEtaInMinutes:
          type: integer
          description: >-
            Delivery Eta in **minutes**. Informs how many minutes it will take
            the delivery person to arrive at the consumer's address for order
            delivery.
        deliveryEtaDatetime:
          type: string
          format: date-time
          description: >-
            Delivery Eta Datetime. Informs the date and time the delivery person
            is expected to arrive at the consumer's address for order delivery. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        returnToMerchantEtaInMinutes:
          type: integer
          description: >-
            Delivery Person return to merchant Eta in **minutes**. Informs how
            many minutes it will take the delivery person to return to the
            merchant. Only valid when `returnToMerchant` is `true`.
        returnToMerchantEtaDatetime:
          type: string
          format: date-time
          description: >-
            Delivery Person return to merchant Eta Datetime. Informs the date
            and time the delivery person will arrive at the returning merchant.
            Only valid when `returnToMerchant` is `true`. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        maxDeliveryTime:
          type: string
          format: date-time
          description: >-
            Maximum Date and Time for delivery. This time should not exceed the
            delivery time limit given in the order request. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
    DeliveryMan:
      description: Delivery Person
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          description: Delivery Person Id generated at the `Logistics Service`.
        name:
          type: string
          description: Delivery Person Name.
        pictureURL:
          type: string
          format: URI
          description: >-
            URL to access the photo of the delivery person. Before entering this
            field, check that the parties allow data to be shared according to
            data disclosure laws and rules.
        phone:
          type: string
          description: >-
            Delivery Person Phone. Before entering this field, check that the
            parties allow data to be shared according to data disclosure laws
            and rules.
    GeoLocalization:
      description: Delivery Event
      type: object
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          format: float
          description: >-
            Indicates the latitude coordinate of the actual position of the
            delivery person.




            Latitude in degrees. Values are restricted to the range [[-90, 90]].
          example: -23.54809
        longitude:
          type: number
          format: float
          description: >-
            Indicates the longitude coordinate of the actual position of the
            delivery person.




            Longitude in degrees. Values are restricted to the range [[-180,
            180]].
          example: -46.63638
        lastAddress:
          description: >-
            The last known address that the delivery person was when the event
            was sent.
          type: object
          required:
            - distanceToPickup
            - distanceToDelivery
            - timestamp
          properties:
            country:
              type: string
              pattern: ^[A-Z]{2}$
              description: >-
                Two-letter [ISO 3166-1
                alpha-2](https://www.iso.org/standard/72482.html) country code.
              example: BR
            state:
              type: string
              description: >-
                State or country subdivision. It is recommended (but not
                required) that you use the [ISO
                3166-2](https://www.iso.org/standard/72483.html)
                representation. 
              example: BR-SP
            city:
              type: string
              description: City name.
              example: São Paulo
            district:
              type: string
              description: District or Neighborhood name.
              example: Moema
            street:
              type: string
              description: Street Name.
              example: Plaza Avenue
            postalCode:
              type: string
              description: Postal Code.
              example: 20111-000
            distanceToPickup:
              type: string
              description: Distance To Pickup in **meters**.
            distanceToDelivery:
              type: string
              description: Distance To Delivery in **meters**.
            timestamp:
              type: string
              format: date-time
              description: >-
                Date and time when this information is valid. 


                (UTC date-time in ISO timestamp format. See
                [Guidelines](#section/General-Guidelines) for more info).
    DeliveryCancel:
      description: Delivery Cancel
      type: object
      required:
        - reason
      properties:
        reason:
          type: string
          description: Cancel Reason.
          enum:
            - CONSUMER_CANCELLATION_REQUESTED
            - NO_SHOW
            - PROBLEM_AT_MERCHANT
            - HIGH_ACCEPTANCE_TIME
            - INCORRECT_ORDER_OR_PRODUCT_PICKUP
            - PROBLEM_RESOLUTION
            - DISCOMBINE_ORDER
            - OTHER
        action:
          type: string
          description: Action to be taken by the delivery person, after the cancellation.
          enum:
            - RETURN_TO_STORE
            - CANCEL_DELIVERY
        message:
          type: string
          description: >-
            Free message. It should be used to provide more detailed
            information.
    DeliveryCancelResponse:
      type: object
      required:
        - additionalCharges
      properties:
        additionalCharges:
          type: boolean
          description: >-
            Informs whether or not the cancellation will cause an additional
            charge to the delivery.
    DeliveryHandleProblem:
      description: Delivery Cancel
      type: object
      required:
        - reason
        - action
      properties:
        reason:
          type: string
          description: Problem Reason.
          enum:
            - DELIVERYPERSON_OCCURRENCE
            - PAYMENT_PROBLEMS
            - WRONG_PRODUCT_OR_ITEM
            - ORDER_DELAYED
            - ORDER_DAMAGED_OR_VIOLATED
            - CUSTOMER_DID_NOT_PLACE_ORDER
            - CUSTOMER_ADDRESS_UNKNOWN
            - ORDER_MISSING_ITEMS
            - NOBODY_TO_RECEIVE
            - DELIVERYPERSON_WAITING_PAYMENT_FOR_ALREADY_PAID_ORDER
            - ORDER_DELIVERED_WITHOUT_PAYMENT
            - FRAUD_OR_THEFT
            - OTHER
        action:
          type: string
          description: >-
            The action that the delivery person should take to solve this
            problem.
          enum:
            - RETURN_TO_STORE
            - DELIVER_PRODUCT
            - CANCEL_DELIVERY
        message:
          type: string
          description: >-
            Free message. It should be used to provide more detailed
            information.
    DeliveryOrderPicked:
      type: object
      title: Order Picked
      properties:
        pickupDate:
          type: string
          format: date-time
          description: >-
            Date and time when the order pickup occurred. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        volumePicked:
          type: integer
          description: Number of volumes picked up.
        observation:
          type: string
          description: Free text. It should be used to provide more detailed information.
    DeliveryOrderFinish:
      type: object
      title: Order Picked
      required:
        - finishDate
      properties:
        finishDate:
          type: string
          format: date-time
          description: >-
            Date and time when delivery completion occurred. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        observation:
          type: string
          description: Free text. It should be used to provide more detailed information.
    DeliveryOrderDetails:
      description: Delivery Order Details Object
      type: object
      required:
        - deliveryId
        - orderId
        - orderDisplayId
        - merchant
        - customerName
        - events
      properties:
        deliveryId:
          type: string
          format: UUID
          description: The delivery ID generated by the `Logistics Service`.
        orderId:
          type: string
          format: UUID
          description: The orderId generated by the **`Keeta`**.
        orderDisplayId:
          type: string
          description: Order Id shown in the **`Keeta`** interface for the customer.
          example: 96b41025
        merchant:
          type: object
          required:
            - id
            - name
          description: Merchant information.
          properties:
            id:
              type: string
              description: >-
                Unique Identifier. Identifies the merchant in the different
                systems that the merchant will communicate.  

                This id must be generated by the merchant's **`Software
                Service`**.


                > The software service should ensure that merchantId is unique.


                > If this is not possible, it is recommended to at least use a
                UUID.
              minLength: 36
              maxLength: 100
              example: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
            name:
              type: string
              description: Merchant Public Name
              maxLength: 500
              example: Pizza Plaza
        customerName:
          type: string
          description: Customer Name.
        customerPhone:
          type: string
          description: >-
            Customer's telephone number. 


            **Please note**: The telephone number is considered an
            identification field and therefore the customer's advance consent is
            required.
        events:
          type: array
          description: Events History.
          items:
            allOf:
              - $ref: '#/components/schemas/DeliveryEvent'
        problem:
          type: array
          description: History of problems that occuried during delivery.
          items:
            allOf:
              - $ref: '#/components/schemas/DeliveryProblemHistory'
        vehicle:
          description: >-
            Chosen Vehicle Info. 

            > This propertie is **REQUIRED** when current `event > type` is
            different from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/ChosenVehicle'
        deliveryPrice:
          description: >-
            Delivery Pricing Info.

            > This propertie is **REQUIRED** when current `event > type` is
            different from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/DeliveryPrice'
        times:
          description: >-
            Estimate Times of Pickup and Delivery. 

            > This propertie is **REQUIRED** when current `event > type` is
            different from `PENDING`, `REJECTED` and `CANCELLED`
          allOf:
            - $ref: '#/components/schemas/DeliveryTimes'
        deliveryPerson:
          description: Delivery person Info.
          allOf:
            - $ref: '#/components/schemas/DeliveryMan'
        combinedOrdersIds:
          type: array
          description: >-
            Combined Orders Ids. Informs which other orders from the same
            merchant are being carried by the same delivery person, with the
            same `deliveryId`.
          items:
            type: string
            format: uuid
        externalTrackingURL:
          type: string
          format: URI
          description: >-
            External URL, provided by the logistics service to track the
            delivery on a specific page. Example: Real-time map view, or
            delivery timeline.
    DeliveryTimes:
      description: ETA
      type: object
      required:
        - deliveryEtaDate
        - maxDeliveryTime
        - isDeliveryFinished
      properties:
        deliveryEtaDate:
          type: string
          format: date-time
          description: >-
            Delivery Eta Datetime. Informs the date and time the delivery person
            is expected to arrive at the consumer's address for order delivery. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        maxDeliveryTime:
          type: string
          format: date-time
          description: >-
            Maximum Date and Time for delivery. This time should not exceed the
            delivery time limit given in the order request. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
        isDeliveryFinished:
          type: boolean
          description: Informs whether or not the delivery is finished.
        deliveryFinishDate:
          type: string
          format: date-time
          description: >-
            Date and time when the delivery finished. 


            (UTC date-time in ISO timestamp format. See
            [Guidelines](#section/General-Guidelines) for more info).
    DeliveryConfirmationCode:
      description: Delivery Confirmation Object.
      type: object
      required:
        - orderId
        - deliveryCode
      properties:
        orderId:
          type: string
          format: uuid
          description: The orderId informed in the Delivery Request.
          example: 52122852-6626-11ed-9022-0242ac120002
        deliveryCode:
          type: string
          description: Delivery confirmation code provided by the customer.
    MerchantData:
      description: Delivery Confirmation Object.
      type: object
      required:
        - userId
        - brandId
        - brandName
        - authorizedShops
        - page
      properties:
        userId:
          type: integer
          format: int64
          description: Keeta brand account ID
          example: 12345678
        brandId:
          type: integer
          description: Keeta brand ID
          example: 1001
        brandName:
          type: string
          description: Keeta brand name
          example: Sample Brand
        authorizedShops:
          type: array
          description: List of authorized stores
          items:
            $ref: '#/components/schemas/AuthorizedShop'
        page:
          $ref: '#/components/schemas/PageInfo'
    AuthorizedShop:
      type: object
      required:
        - id
        - name
        - address
        - longitude
        - latitude
        - timeZone
      properties:
        id:
          type: integer
          format: int64
          description: Unique store identifier
          example: 159416882
        name:
          type: string
          description: Store name
          example: stbaxi3 - API Test store
        address:
          type: string
          description: Store address
          example: Rua Augusta, 500, São Paulo, SP, Brasil
        longitude:
          type: number
          format: double
          description: Longitude coordinate
          example: 46.049568
        latitude:
          type: number
          format: double
          description: Latitude coordinate
          example: -18.770281
        timeZone:
          type: string
          description: Time zone information
          example: America/Sao_Paulo
    PageInfo:
      type: object
      required:
        - pageNum
        - pageSize
        - totalPage
        - totalCount
      properties:
        pageNum:
          type: integer
          description: Current page number starting from 1
          example: 1
        pageSize:
          type: integer
          description: Number of items per page
          example: 10
        totalPage:
          type: integer
          description: Total number of pages
          example: 1
        totalCount:
          type: integer
          description: Total number of records
          example: 3
    WebhookNotification:
      type: object
      required:
        - clientId
        - authId
        - opType
        - shopId
        - shopName
        - createTime
      properties:
        clientId:
          type: integer
          format: int64
          description: Application ID identifying the Software Services application
          example: 2666245991
        authId:
          type: string
          description: ' Authorization ID that uniquely identifies a specific authorization session. <br> Each authorization generates a unique authId. There are two ways to obtain the authId: <br> 1. Merchant authorization redirect - the authId is included in the redirect URL        <br> 2. Keeta Authorization Webhook - the authId is provided in the webhook payload <br> Please refer to the following for the specific workflow:[Merchant Self-serve Authorization](#tag/Merchant-Self-serve-Authorization)'
          example: '41008'
        opType:
          type: integer
          description: 'Operation type: 1 = Add authorization, 2 = Cancel authorization'
          enum:
            - 1
            - 2
          example: 1
        shopId:
          type: integer
          format: int64
          description: Store ID
          example: 478268
        shopName:
          type: string
          description: Store name
          example: 10 Shanghai
        createTime:
          type: integer
          format: int64
          description: Event timestamp in milliseconds
          example: 1753151456973
    WebhookResponse:
      type: object
      required:
        - status
        - title
      properties:
        status:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        title:
          type: string
          description: Response message
          example: success
  examples:
    tokenExample:
      summary: New Token
      value:
        client_id: user1234
        client_secret: ty23yhmas4ldfias9834023jsdf032j023f02
        grant_type: client_credentials
    merchantExample:
      summary: Merchant Example
      value:
        lastUpdate: '2021-05-27T20:45:10.332Z'
        TTL: 500
        id: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824
        status: AVAILABLE
        basicInfo:
          name: Pizza Plaza
          document: '22815773000169'
          corporateName: Food Company
          description: Food company specializing in pizzas.
          averageTicket: 90
          averagePreparationTime: 20
          minOrderValue:
            value: 20
            currency: BRL
          merchantType: RESTAURANT
          merchantCategories:
            - PIZZA
            - FAMILY_MEALS
            - PREMIUM
          address:
            country: BR
            state: SP
            city: São Paulo
            district: Moema
            street: Plaza Avenue
            number: '100'
            postalCode: 20111-000
            complement: '2001'
            reference: Yellow house
            latitude: -23.54804
            longitude: -46.6363
          contactEmails:
            - food@company.com
          contactPhones:
            commercialNumber: '11999999999'
            whatsappNumber: '11998888888'
          logoImage:
            URL: https://food-company.com/logo.png
            CRC-32: 432098ASDSR
          bannerImage:
            URL: https://food-company.com/banner.png
            CRC-32: 09345UIHF98
          createdAt: '2021-05-10T20:45:10.332Z'
        services:
          - id: f078e8e2-3044-4eec-b4a8-8359810de123
            status: AVAILABLE
            serviceType: DELIVERY
            menuId: f627ccdc-6789-456f-a782-148538d5035b
            serviceArea:
              id: f078e8e2-3044-4eec-b4a8-8359810de124
              polygon:
                - geoCoordinates:
                    - latitude: -20.2333
                      longitude: -20.8383
                    - latitude: -20.85008
                      longitude: -21.00007
                    - latitude: -21.15002
                      longitude: -21.95483
                  price:
                    value: 5
                    currency: BRL
                  estimateDeliveryTime: 25
              geoRadius:
                geoMidpointLatitude: -20.2333
                geoMidpointLongitude: -20.8383
                radius:
                  - size: 10
                    price:
                      value: 5.5
                      currency: BRL
                    estimateDeliveryTime: 10
            serviceHours:
              id: fb093d8c-2ca5-40fb-afcf-472fbdae81cc
              weekHours:
                - dayOfWeek:
                    - MONDAY
                    - TUESDAY
                    - WEDNESDAY
                    - THURSDAY
                    - FRIDAY
                  timePeriods:
                    startTime: 10:00:00.000Z
                    endTime: 18:00:00.000Z
                - dayOfWeek:
                    - SATURDAY
                    - SUNDAY
                  timePeriods:
                    startTime: 14:00:00.000Z
                    endTime: 18:00:00.000Z
              holidayHours:
                - date: '2021-05-27'
                  timePeriods:
                    startTime: 12:00:00.000Z
                    endTime: 17:00:00.000Z
        items:
          - id: 732bd31e-77fc-47ee-88ee-a0437f97b198
            name: Medium - 2 flavors
            description: Medium two-flavored pizza.
            externalCode: '23'
            image:
              URL: https://www.food-place.com/images/medium-pizza.png
              CRC-32: 09345UIHF98
            serving: 8
            unit: UN
          - id: b728fd88-4af0-43f7-956f-95c251f01ddd
            name: Small - 1 flavor
            description: Small one-flavored pizza.
            externalCode: '23'
            image:
              URL: https://www.food-place.com/images/small-pizza.png
              CRC-32: 09345UIHF98
            serving: 4
            unit: UN
          - id: 502ecf11-0509-48ed-b63c-6211c48fd9b9
            name: 1/2 Pepperoni
            description: Pepperoni flavored pizza with LOTS of pepperoni.
            externalCode: '23'
            image:
              URL: https://www.food-place.com/images/pepperoni.png
              CRC-32: 09345UIHF98
            nutritionalInfo:
              description: Contains preservatives
              calories: 2000 Cal
              allergen:
                - GLUTEN
            unit: UN
          - id: 7e507cab-7235-4f75-a0c2-e955fb2f2048
            name: 1/2 Mozzarella
            description: Delicious mozzarella pizza.
            externalCode: '24'
            image:
              URL: https://www.food-place.com/images/mozzarella.png
              CRC-32: 09345UIHF98
            nutritionalInfo:
              description: Contains preservatives
              calories: 2500 Cal
              allergen:
                - GLUTEN
                - LACTOSE
            unit: UN
          - id: 2c0f3447-5309-49cc-a167-4eac5c664470
            name: Banana
            description: Banana Pizza with cream.
            externalCode: '25'
            image:
              URL: https://www.food-place.com/images/banana.png
              CRC-32: 09345UIHF98
            nutritionalInfo:
              description: Contains preservatives
              calories: 2500 Cal
              allergen:
                - GLUTEN
            unit: UN
        menus:
          - id: f627ccdc-6789-456f-a782-148538d5035b
            name: Pizzas
            description: Pizza menu
            externalCode: '123'
            disclaimer: >-
              Lorem Ipsum is simply dummy text of the printing and typesetting
              industry.
            categoryId:
              - 92fad022-2c28-4239-a026-989f5b555cb7
              - 6bb71850-1d40-49f9-8046-b13e068c0cca
        categories:
          - id: 92fad022-2c28-4239-a026-989f5b555cb7
            index: 0
            name: Salted Pizza
            description: Salted pizza flavors.
            image:
              URL: https://food-company.com/category1.png
              CRC-32: 09345UIHF98
            externalCode: '13'
            status: AVAILABLE
            availabilityId:
              - 11d063c4-73a7-4f87-a0eb-71636cc02029
            itemOfferId:
              - f080cfb3-5c4a-4eb7-907d-2de3bbb5dfb9
          - id: 6bb71850-1d40-49f9-8046-b13e068c0cca
            index: 1
            name: Sweeted Pizza
            description: Sweeted pizza flavors.
            image:
              URL: https://food-company.com/category2.png
              CRC-32: 09345UIHF98
            externalCode: '13'
            status: AVAILABLE
            availabilityId:
              - 11d063c4-73a7-4f87-a0eb-71636cc02029
            itemOfferId:
              - 377b99ba-5413-43d1-b875-7cdcaa72860e
        itemOffers:
          - id: f080cfb3-5c4a-4eb7-907d-2de3bbb5dfb9
            itemId: 732bd31e-77fc-47ee-88ee-a0437f97b198
            index: 0
            price:
              value: 43
              originalValue: 43
              currency: BRL
            availabilityId:
              - 11d063c4-73a7-4f87-a0eb-71636cc02029
            optionGroupsId:
              - fe67e551-f42f-499a-8afb-0ed893c71fa3
          - id: 377b99ba-5413-43d1-b875-7cdcaa72860e
            itemId: 7e507cab-7235-4f75-a0c2-e955fb2f2048
            index: 1
            price:
              value: 30
              originalValue: 30
              currency: BRL
            availabilityId:
              - 11d063c4-73a7-4f87-a0eb-71636cc02029
            optionGroupsId:
              - c524c066-96fa-458d-b78c-3712661529b3
        optionGroups:
          - id: fe67e551-f42f-499a-8afb-0ed893c71fa3
            index: 0
            name: Choose your salted pizza flavor
            description: Choose your salted pizza flavor.
            externalCode: '12'
            status: AVAILABLE
            minPermitted: 2
            maxPermitted: 2
            options:
              - id: e5232f14-430c-4a94-8ff6-289d5a16a87a
                itemId: 502ecf11-0509-48ed-b63c-6211c48fd9b9
                index: 0
                price:
                  value: 50
                  originalValue: 50
                  currency: BRL
                maxPermitted: 1
              - id: e5232f14-430c-4a94-8ff6-289d5a16a87b
                itemId: 7e507cab-7235-4f75-a0c2-e955fb2f2048
                index: 1
                price:
                  value: 43
                  originalValue: 43
                  currency: BRL
                maxPermitted: 1
          - id: c524c066-96fa-458d-b78c-3712661529b3
            index: 0
            name: Choose your sweeted pizza flavor
            description: Choose your sweeted pizza flavor.
            externalCode: '12'
            status: AVAILABLE
            minPermitted: 1
            maxPermitted: 1
            options:
              - id: 2419d582-357f-4149-9089-12321537f147
                itemId: 2c0f3447-5309-49cc-a167-4eac5c664470
                index: 0
                price:
                  value: 30
                  originalValue: 30
                  currency: BRL
                maxPermitted: 1
        availabilities:
          - id: 11d063c4-73a7-4f87-a0eb-71636cc02029
            startDate: '2021-05-01'
            endDate: '2021-05-30'
            hours:
              - dayOfWeek:
                  - MONDAY
                  - TUESDAY
                  - WEDNESDAY
                  - THURSDAY
                  - FRIDAY
                timePeriods:
                  startTime: 10:00:00.000Z
                  endTime: 18:00:00.000Z
              - dayOfWeek:
                  - SATURDAY
                  - SUNDAY
                timePeriods:
                  startTime: 14:00:00.000Z
                  endTime: 18:00:00.000Z
