> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mymorabaa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get app businesses

> Retrieve the businesses assigned to the authenticated app.

## Endpoint

`GET /apps/current/businesses`

Production URL:

`https://sam.aragon.morabaa.com/api/apps/current/businesses`

## Authentication

This endpoint requires app authentication headers:

* `X-App-Id: <APP_ID>`
* `X-App-Secret: <APP_SECRET>`

### Required headers

<ParamField header="X-App-Id" type="string" required>
  App ID credential.
</ParamField>

<ParamField header="X-App-Secret" type="string" required>
  App secret credential.
</ParamField>

<Note>
  Need credentials? Contact [info@morabaa.com](mailto:info@morabaa.com).
</Note>

If either header is invalid or missing, the response is `401 Unauthorized`.

Do not send `Content-Type: application/json` for this `GET` request. The request has no body or query parameters.

## Request example

```bash theme={null}
curl "https://sam.aragon.morabaa.com/api/apps/current/businesses" \
  -H "X-App-Id: <APP_ID>" \
  -H "X-App-Secret: <APP_SECRET>"
```

## Response

A successful response returns `200 OK` with the businesses assigned to the authenticated app. Results may be cached for up to five minutes.

<ResponseField name="id" type="guid">
  Business ID.
</ResponseField>

<ResponseField name="title" type="string">
  Business title.
</ResponseField>

```json theme={null}
[
    {
        "id": "9c7f3b9d-0809-4f5e-b8f2-b6e46a4eb3af",
        "title": "Morabaa Pharmacy"
    }
]
```

If the app has no assigned businesses, the endpoint returns an empty array:

```json theme={null}
[]
```

If Morabaa rejects the request, returns an invalid response, or is unavailable, the endpoint returns `502 Bad Gateway`:

```json theme={null}
{
    "message": "Failed to get businesses from Morabaa ."
}
```


## OpenAPI

````yaml openapi.json GET /apps/current/businesses
openapi: 3.1.0
info:
  title: MyMorabaa API
  version: 1.0.0
servers:
  - url: https://sam.aragon.morabaa.com/api
security: []
paths:
  /apps/current/businesses:
    get:
      summary: Get app businesses
      description: Retrieve the businesses assigned to the authenticated app.
      parameters:
        - $ref: '#/components/parameters/XAppId'
        - $ref: '#/components/parameters/XAppSecret'
      responses:
        '200':
          description: Businesses returned successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BusinessResponse'
              example:
                - id: 9c7f3b9d-0809-4f5e-b8f2-b6e46a4eb3af
                  title: Morabaa Pharmacy
        '401':
          description: Missing or invalid app authentication headers.
        '502':
          description: >-
            Morabaa Hub rejected the request, returned an invalid response, or
            was unavailable.
components:
  parameters:
    XAppId:
      name: X-App-Id
      in: header
      required: true
      schema:
        type: string
      description: App ID credential.
    XAppSecret:
      name: X-App-Secret
      in: header
      required: true
      schema:
        type: string
      description: App secret credential.
  schemas:
    BusinessResponse:
      type: object
      required:
        - id
        - title
      properties:
        id:
          type: string
          format: uuid
          description: Business ID.
        title:
          type: string
          description: Business title.

````