---
updatedAt: 2026-10-26T12:36:26.000Z
---

# Maya Mini App

# Overview

With the Maya Mini App, the customer's session is shared with your Mini App to enable seamless navigation from the Maya App to your Mini App.

[block:html]
{
  "html": "<style>\n  details.steps[open] summary.steps details.others[open] summary.others~ * {\n    animation: open 0.3s ease-in-out;\n  }\n  \n  @keyframes open {\n    0% {\n      opacity: 0;\n    }\n    100% {\n      opacity: 1;\n    }\n  }                                            \n  \n  details.steps summary.steps details.others summary.others::-webkit-details-marker {\n    display: none;\n  }                                                \n  \n  details.steps summary.steps {\n    cursor: pointer;\n    /**font-size: 1.25rem;**/\n    font-weight: 300;\n    list-style: none;\n    padding: 0.1rem 0;\n    position: relative;\n    width: 100%;\n  }\n  \n  details.steps summary.steps:after {\n    color: #270E7A;\n    content: \"Read more\";\n    /**font-size: 1.75rem;**/\n    font-weight: 200;\n    line-height: 0;\n    margin-top: 0.02rem;\n    position: absolute;\n    right: 0;\n    transform-origin: center;\n    transition: 200ms linear;\n  }\n  \n  details.steps[open] summary.steps:after {\n    content: \"X\";\n  }  \n\n  details.steps summary.steps details.others summary.others {\n    outline: 0;\n  }                                                                   \n  \n  details.others summary.others {\n    border: none !important;\n    cursor: pointer;\n    font-size: 1.25rem;\n    font-weight: 300;\n    list-style: none;\n    outline: 0;\n    padding: 0.1rem 0;\n    position: relative;\n    width: 100%;\n  }\n  \n  details.others summary.others:after {\n    color: black;\n    content: \"+\";\n    font-size: 1.75rem;\n    font-weight: 200;\n    line-height: 0;\n    --margin-top: 0rem;\n    margin-bottom: 0.5rem;\n    position: absolute;\n    top: 15px;\n    right: 0;\n    transform-origin: center;\n    transition: 200ms linear;\n  }\n  \n  details.others[open] summary.others:after {\n    /**font-size: 2rem;**/\n    transform: rotate(45deg);\n  }\n  \n  /*Custome style for detail expand*/\n  .genericExpand {\n    background-color: #FFFFFF;\n  }\n  \n  .genericExpand.steps {\n    background-color: #FFFFFF;\n    /**border: 1px solid #797C7A;**/\n    border: none !important;\n    padding: 0;\n    margin: 0;\n  }\n  \n  .genericExpand.others {\n    background-color: #FFFFFF;\n    border: none !important;\n    border-radius: 0 !important;;\n    border-bottom: 2px solid #e7e7e7 !important;\n  }\n  \n  .divExpand {\n    background-color: #FFFFFF;\n    border: 1px solid #797C7A;\n    border-radius: 5px;\n    padding: 0 10px 12px 10px;\n    margin: 0;\n  } \n  \n  .top-border {\n    border-top: 2px solid #e7e7e7 !important;\n  }\n  \n  img {\n    display: block !important;\n  }\n\n  .icon-redirect {\n    display: inline !important;\n  }\n  \n</style>"
}
[/block]

<div class="divExpand">

# API Sequence

<section>
<details class="genericExpand steps" id="read-more-mma-api-sequence">
<summary class="steps">

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/5c51e9e3aac71d601125f135d07c114fa806af037834ca76b95d6a352f042c27-mma-sessions-v4.png",
        "",
        ""
      ],
      "align": "center",
      "sizing": "70% "
    }
  ]
}
[/block]

</summary>

<br />

This flow covers both the normal token generation and session usage and the handling of an expired session.

1. The **customer** clicks the tile within the **Maya App** triggering the **Maya Mini App**.
2. The **Maya Mini App** performs an age and KYC (Know Your Customer) check.
3. If no consent is recorded:
   * **Maya App** will prompt the customer with the consent screen.
   * The customer will then agree to the terms presented and give consent.
   * **Maya Mini App** records the consent.
4. **Maya Mini App** generates a Customer Access Token (`accessToken`).
5. **Maya Mini App** sends the Customer Access Token (`accessToken`) to the **API Consumer** through their **session URL** endpoint.
6. The **API Consumer** saves the Customer Access Token (`accessToken`) and generates a unique `sessionId` to correspond with the Customer Access Token (`accessToken`).
7. **API Consumer** sends the `sessionId` as a response to the **Maya Mini App**.
8. The **Maya Mini App** appends the `sessionId` to the API Consumer's registered **landing page URL**.
9. **Maya Mini App** redirects the **Customer** to the **API Consumer**'s landing page URL.
10. The **API Consumer** uses the `sessionId` to verify the saved Customer Access Token (`accessToken`).
11. The **API Consumer** invalidates the `sessionId`.
12. The **API Consumer** prepares the required tokens and credentials acquired from the Maya Mini App:
    * **Customer Access Token**: the `accessToken` obtained from Maya through either your <a href="/reference/maya-mini-app#manage-mini-app-session-new-customer-session" style="text-decoration:none;">**session URL**</a> or acquired by <a href="/reference/maya-mini-app#manage-mini-app-session-expired-customer-session" style="text-decoration:none;">**refreshing the tokens**</a>, whichever is the most recent or valid value
    * **Bearer Token**: the `access_token` acquired during <a href="/reference/bearer-authentication" target="_blank" style="text-decoration:none;">**Bearer Authentication** <img class="icon-redirect"/></a> using the `client_credentials` grant type
13. The **API Consumer** calls the <a href="/reference/get-profile-via-maya-mini-app" target="_blank" style="text-decoration:none;">**Get Profile** <img class="icon-redirect"/></a> endpoint of the Maya Mini App, providing the `accessToken` and `access_token`.
14. **Maya Mini App** processes the request and retrieves the profile data based on the client scope. Refer to the <a href="/reference/profile-sharing#supported-scopes" target="_blank" style="text-decoration:none;">**Supported Scopes** <img class="icon-redirect"/></a> section for the list of scopes.
15. After retrieving the profile data, the **Maya Mini App** sends the encrypted profile data to the **API Consumer**.
16. The **API Consumer** monitors the Customer Access Token (`accessToken`) and Customer Refresh Token (`refreshToken`) expiry.
17. When the Customer Refresh Token (`refreshToken`) is about to expire:
    * The **API Consumer** uses the `refreshToken` and call the **Refresh Token** endpoint of the Maya Mini App.
    * **Maya Mini App** will generate a new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`).
    * **Maya Mini App** returns the new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`) to the **API Consumer**.
    * The **API Consumer** updates their system to save the new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`).
18. When you need the `accessToken` but it is already expired:
    * The **API Consumer** uses the valid or the most recent `refreshToken` and call the **Refresh Token** endpoint of the Maya Mini App.
    * **Maya Mini App** will generate a new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`).
    * **Maya Mini App** returns the new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`) to the **API Consumer**.
    * The **API Consumer** updates their system to save the new Customer Access Token (`accessToken`)  and  new Customer Refresh Token (`refreshToken`).

</details>
</section>

</div>

***

# Build your Integration

<div class="note-blue">

For the complete Sandbox Onboarding requirements, contact your designated **Maya Relationship Manager**.

</div>

<div class="divExpand">

## Whitelist Maya IP Addresses

<section>
<details class="genericExpand steps" id="read-more-mma-ip-whitelist">
<summary class="steps">

Implement IP whitelisting and whitelist Maya's IP Addresses in your Mini App.

</summary>

<br />

To enhance security, you should implement IP whitelisting in your Mini App allowing access to Maya systems only. Implement an IP whitelisting mechanism and specify Maya’s IP Addresses.

Note that the Maya Mini App requests should come from the IPs listed below.

[block:parameters]
{
  "data": {
    "h-0": "Environment",
    "h-1": "IP addresses",
    "0-0": "**Sandbox**",
    "0-1": "`52.76.175.228`  \n`13.251.40.239`  \n`13.251.3.237`  \n`18.138.3.140`",
    "1-0": "**Production**",
    "1-1": "`18.140.207.36`  \n`52.220.51.15`  \n`52.74.249.253`  \n`52.74.249.189`  \n`54.255.23.10`  \n`52.220.109.32`"
  },
  "cols": 2,
  "rows": 2,
  "align": [
    "left",
    "left"
  ]
}
[/block]

</details>
</section>

</div>

<div class="divExpand">

## Create your Session Initiation Endpoint

<section>
<details class="genericExpand steps" id="read-more-mma-session-init">
<summary class="steps">

Create your dedicated endpoint to accept session details from the Maya Mini App.

</summary>

<br />

You must create a dedicated endpoint, or the **Session URL**, where Maya can send the customer session securely and efficiently. Each time a customer accesses your application from the Maya app, Maya will send an API request to your **Session URL** endpoint.

With the customer's consent, Maya Mini App will send the following to your **Session URL** endpoint:

* **Customer Access Token**: the `accessToken` that your mini app will need to perform actions on behalf of the customer
* **Customer Refresh Token**: the `refreshToken` that your mini app can use to generate a new customer access token

#### Sample payload your Session URL will receive:

```
curl --location 'https://your.site.com/mayaminiapp/accept' \
--header 'Request-Reference-No: bbd94290-1078-47c4-bc1a-a5a326afaaf5' \
--header 'Content-Type: application/json' \
--data '{
    "accessToken": "eyJ1aWQiOiI0MGE2YmI1NS1iYzBjLTQzMjktYTE0Yi0wMzlmY2I3ZmRkZjciLCJjbGllbnRfaWQiOiIwZjFmMjJhYy1lMjQzLT",
    "refreshToken": "eyJ1aWQiOiI0MGE2YmI1NS1iYzBjLTQzMjktYTE0Yi0wMzlmY2I3ZmRkZjciLCJjbGllbnRfaWQiOiIwZjFmMjJhYy1lMjQzLT",
    "expiresAt": 1659375851
}'
```

<br />

The **Session URL** endpoint must be capable of receiving and processing this request according to the provided API contract and shall respond with a `sessionId` to Maya. Be sure to follow the <a href="/reference/session-url-api-contract" target="_blank" style="text-decoration:none;">**Session URL API Contract** <img class="icon-redirect"/></a>.

#### Sample Payload your Session URL is expected to respond:

```
{
    "sessionId": "Lr7I2MPDy_WUnnyCWyEE3737_PZF2VIKlQXbi-Q8kZw"
}
```

<br />

<div class="note-green">

Once you have successfully set up your **Session URL**, kindly provide the URL endpoint to Maya. Reach out to your **Maya Relationship Manager** for detailed requirements and guidance throughout the onboarding procedure.

</div>

</details>
</section>

</div>

<div class="divExpand">

## Create the Landing Page

<section>
<details class="genericExpand steps" id="read-more-mma-landing-page">
<summary class="steps">

Create your HTML 5 Mobile Web Application Landing Page.

</summary>

<br />

Create a web application your customer can access within the Maya app. It should be **mobile-responsive**.

Maya will redirect the customer to your landing page, with the `sessionId` generated by your **SessionURL** endpoint. Implement the necessary logic and make sure that your landing page accepts and handles `sessionId`.

***

#### Development Considerations for the Landing Page

Maya will redirect the customer to your landing page, with the appended `sessionId`.

**Landing Page URL (Sample)**: `https://your-landing-page-url.com`

**Landing Page URL with appended `sessionId`**: `https://your-landing-page-url.com?sessionId={sessionId-value}`

* Your landing page should be a **GET endpoint** capable of receiving the `sessionId` query parameter
* Invalidate the `sessionId` after its initial use to prevent reuse; your system should reject any subsequent attempts with the same `sessionId`
* Ensure the landing page URL is **SSL-secured** (https) and **publicly accessible**.
* Configure SSL on the **standard port 443** to avoid potential network issues with Maya integration

<br />

<div class="note-green">

Upon completing the setup of your **Landing Page**, kindly submit the URL of your Landing Page to Maya. For detailed requirements and guidance through the onboarding process, contact your **Maya Relationship Manager**.

</div>

<br />

</details>
</section>

</div>

<div class="divExpand">

## Manage Mini App Session: New Customer Session

<section>
<details class="genericExpand steps" id="read-more-mma-new-session">
<summary class="steps">

Complete the session initiation for the new customer session.

</summary>

<br />

<div class="note-blue">

Your Mini App should be able to identify the customer via the `sessionId`. One way to do this is to have a mapping of Customer Access Token (`accessToken`) and `sessionId`.

Every `sessionId` your Mini App sends to Maya must be **unique** and can only be **used once**. Maya recommends invalidating the session ID once it has been utilized and ensuring that it will not be reused in the future.

In case of **subsequent attempts**, where the landing page employs the same `sessionId`, **your system should decline or reject the access**.

</div>

<br />

During session initiation, Maya will use the following endpoints you have developed and submitted during onboarding:

[block:parameters]
{
  "data": {
    "h-0": "Your URL/Endpoints",
    "h-1": "Data you'll Receive",
    "h-2": "Data you'll Return",
    "0-0": "**Session URL**",
    "0-1": "`accessToken`  \n`refreshToken`  \n`expiresAt`",
    "0-2": "`sessionId`",
    "1-0": "**Landing Page**",
    "1-1": "`sessionId`",
    "1-2": ""
  },
  "cols": 3,
  "rows": 2,
  "align": [
    "left",
    "left",
    "left"
  ]
}
[/block]

<br />

Be guided by the flow described in the <a href="/reference/maya-mini-app#api-sequence" style="text-decoration:none;">**API Sequence**</a>.

<div class="note-yellow" style="background-color: #fdfaf0">

<br />

**Monitoring Tokens**: Your Mini App shall monitor the expiry of the customer tokens (`accessToken` and `refreshToken`), and keep these tokens valid or updated when the customer is active in your Mini App.

</div>

<br />

<div class="note-green">

Maya recommends knowing your customer by leveraging the <a href="/reference/profile-sharing" target="_blank" style="text-decoration:none;">**Profile Sharing**</a> feature of the Maya Mini App. To verify and enable this feature, contact your designated **Maya Relationship Manager**.

</div>

<br />

</details>
</section>

</div>

<div class="divExpand">

## Manage Mini App Session: Expired Customer Session

<section>
<details class="genericExpand steps" id="read-more-mma-expired-session">
<summary class="steps">

Use the `refreshToken` to refresh the customer session in the Maya Mini App.

</summary>

<br />

<div class="note-yellow" style="background-color: #fdfaf0">

At this point, your Mini App should have obtained and secured the following tokens:

* **Customer Refresh Token**: the `refreshToken` obtained from Maya through either your <a href="/reference/maya-mini-app#manage-mini-app-session-new-customer-session" style="text-decoration:none;">**Session URL**</a> or acquired by <a href="/reference/maya-mini-app#manage-mini-app-session-expired-customer-session"  style="text-decoration:none;">**refreshing the tokens**</a>, whichever is the most recent or valid value
* **Bearer Token**: the `access_token` acquired from Maya during <a href="/reference/bearer-authentication" target="_blank" style="text-decoration:none;">**Bearer Authentication** <img class="icon-redirect"/></a> using the `client_credentials` grant type

</div>

<br />

Your Mini App is expected to call <a href="/reference/refresh-maya-mini-app-token" target="_blank" style="text-decoration:none;">**Refresh Token** <img class="icon-redirect"/></a> endpoint providing the required tokens when:

* The customer initiates a transaction but the **Customer Access Token** (`accessToken`) is already expired
* The customer is still active in your Mini App and the **Customer Refresh Token** (`refreshToken`) is about to expire

Refer also to the <a href="/reference/business-rules-to-code-for-maya-mini-apps#handling-expired-maya-mini-app-tokens" target="_blank" style="text-decoration:none;">**Handling of Expired Maya Mini App Tokens** <img class="icon-redirect"/></a> for the scenarios and proper handling.

<br />

<div class="note-blue">

It's important to note that **every successful token refresh will invalidate the old tokens**, so you should also update your records with the new tokens.

</div>

<br />

<div class="note-yellow" style="background-color: #fdfaf0">

<br />

**Monitoring Tokens**: Your Mini App shall monitor the expiry of the customer tokens (`accessToken` and `refreshToken`), and keep these tokens valid or updated when the customer is active in your Mini App.

</div>

<br />

[block:tutorial-tile]
{
  "backgroundColor": "#018FF4",
  "emoji": "📖",
  "id": "6a6196383c739db831fe2c79",
  "link": "https://developers.maya.ph/v6.00/recipes/refresh-user-access-token-in-maya-mini-app",
  "slug": "refresh-user-access-token-in-maya-mini-app",
  "title": "Refresh User Access Token in Maya Mini App"
}
[/block]

</details>
</section>

</div>

<br />

<div class="note-green">

**What's Next?**

Once you have implemented the session initiation and the proper handling of tokens, you may now explore and implement the following Maya Mini App features:

* <a href="/reference/payments-via-maya-mini-app" target="_blank" style="text-decoration:none;">**Payments via Mini App**</a>
* <a href="/reference/cash-in-from-a-mini-app" target="_blank" style="text-decoration:none;">**Cash-in from a Mini App**</a>

You can leverage these features depending on your scope and configuration in Maya. To verify and enable any of these features, contact your designated **Maya Relationship Manager**.

</div>

***

# Endpoints

## Partner-hosted Endpoints

These are the endpoints you need to prepare and submit to Maya during onboarding.

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "HTTP Method",
    "h-2": "Description",
    "0-0": "<a href=\"/reference/session-url-api-contract\" target=\"_blank\" style=\"text-decoration:none;\">**Session URL**</a>",
    "0-1": "<span class=\"methodPost\">POST</span>",
    "0-2": "Your **Session URL**; should be capable of receiving the `accessToken`, `refreshToken`, `expiryAt` from Maya and returning a `sessionId` during session initiation",
    "1-0": "**Landing Page**",
    "1-1": "<span class=\"methodGet\">GET</span>",
    "1-2": "Your **Landing Page**; should be capable of receiving a query parameter called `sessionId`"
  },
  "cols": 3,
  "rows": 2,
  "align": [
    "left",
    "left",
    "left"
  ]
}
[/block]

## Maya Mini App Endpoints

Endpoint/s you will need to manage the customer session in Maya Mini App.

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "HTTP Method",
    "h-2": "Key Type",
    "h-3": "Endpoint",
    "h-4": "Description",
    "0-0": "**Refresh Token**",
    "0-1": "<span class=\"methodPost\">POST</span>",
    "0-2": "<span class=\"statusOptional\">Bearer Auth</span>",
    "0-3": "<a href=\"/reference/refresh-maya-mini-app-token\" target=\"_blank\" style=\"text-decoration:none;\">/tokens</a>",
    "0-4": "Generate a new Customer Access Token (`accessToken`) and a new Customer Refresh Token (`refreshToken`)"
  },
  "cols": 5,
  "rows": 1,
  "align": [
    "left",
    "left",
    "left",
    "left",
    "left"
  ]
}
[/block]

***

# Business Rules to Code

To supplement your knowledge of the integration, it is essential to know the <a href="/reference/business-rules-to-code-for-maya-mini-apps" target="_blank" style="text-decoration:none;">**Business Rules to Code for Maya Mini Apps** <img class="icon-redirect"/></a>. This ensures that technology requirements and other development considerations are met.

***

<div class="note-green">

At this point, you have understood the following:

* The necessary APIs and their endpoints
* The sequence and purpose of each API
* The prerequisites for building your integration

</div>

<br />

***

<div class="faq-tag">

# Frequently Asked

</div>

<div class="faq-container">

<section>

<details class="genericExpand faqs" id="read-more-cash-in-mma-access-token-expires">
<summary class="faqs"><b>What to do when customer's <code>accessToken</code> expires?</b></summary>

<div class="faq-answer">

**Answer:** Your platform must request to generate a **new** Customer Access Token (`accessToken`) from the Maya endpoints. See the <a href="/reference/maya-mini-app#manage-mini-app-session-expired-customer-session" style="text-decoration:none;">**Manage Mini App Session: Expired Customer Session**</a> for more details.

</div></details>

<details class="genericExpand faqs" id="read-more-faq-errors">
<summary class="faqs"><b>My transaction in Sandbox keeps failing. How can I fix this?</b></summary>

<div class="faq-answer">

**Answer:** First, ensure your code is implemented correctly by reviewing the required steps. If your setup is correct but errors persist, check the <a href="/page/sandbox-health" target="_blank" style="text-decoration:none;">**Sandbox Health Page** <img class="icon-redirect"/></a> to verify if the service is operational. If the service is up, retrieve the error code and use the **search box in the Maya Developer Hub** to find relevant guides on resolving it.

</div></details>

<details class="genericExpand faqs" id="read-more-faq-timeouts">
<summary class="faqs"><b>Getting timeouts when connecting to the Sandbox of Maya. How can we resolve this?</b></summary>

<div class="faq-answer">

**Answer:** If you're encountering timeouts in the Sandbox, first check the <a href="/page/sandbox-health" target="_blank" style="text-decoration:none;">**Sandbox Health Page** <img class="icon-redirect"/></a> to see if the service is operational. If the service is up but the issue persists, visit our <a href="/docs/support" target="_blank" style="text-decoration:none;">**Support Page** <img class="icon-redirect"/></a> for the appropriate channel to escalate your concern.

</div></details>

</section>

</div>