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

# List Mobile Plans

> Get all available mobile top-up plans for Algerian operators

## Overview

Returns comprehensive list of all available mobile top-up plans for Mobilis, Djezzy, Ooredoo, operators.

<Note>
  Plans are stable and rarely change. **Safe to cache** in your database with
  your own pricing.
</Note>

## Plan Types

<Tabs>
  <Tab title="Dynamic Plans">
    **Variable amount plans** where you specify the amount within a range.
    **Examples:** Prepaid, Postpaid (Facture), International **Required
    fields:** - `plan_code` - `MSSIDN` (phone number) - `amount` (between
    `min_amount` and `max_amount`)
  </Tab>

  <Tab title="Fixed Plans">
    **Fixed amount plans** that are directly activated. **Examples:** "Pixx 500",
    "Special 2000", "Data Pack 1GB" **Required fields:** - `plan_code` - `MSSIDN`
    (phone number) - Amount is predetermined (`amount` field in response)
  </Tab>

  <Tab title="GetMenu Plans">
    **Special plans** that retrieve all available offers for a specific number.
    **Codes:** `GETMENU_Mobilis`, `GETMENU_Ooredoo`, `GETMENU_Djezzy` Returns
    the user's available offers based on their subscription.
  </Tab>
</Tabs>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="properties">
    <ResponseField name="dynamicPlans" type="array" required>
      Array of variable amount plans where you specify the amount within a range

      <Expandable title="Dynamic plan object">
        <ResponseField name="code" type="string">
          Unique plan code for API requests
        </ResponseField>

        <ResponseField name="name" type="string">
          User-friendly plan name for display
        </ResponseField>

        <ResponseField name="operator" type="string">
          Mobile operator: Mobilis, Djezzy, Ooredoo (or GMobilis, GDjezzy, GOoredoo for wholesale)
        </ResponseField>

        <ResponseField name="cost" type="number">
          Your cost multiplier (e.g., 0.96 = you pay 960 DZD for 1000 DZD top-up). Only present for retail plans.
        </ResponseField>

        <ResponseField name="isEnabled" type="boolean">
          Whether plan is currently available
        </ResponseField>

        <ResponseField name="min_amount" type="number">
          Minimum top-up amount in DZD
        </ResponseField>

        <ResponseField name="max_amount" type="number">
          Maximum top-up amount in DZD
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="fixedPlans" type="array" required>
      Array of fixed amount plans that are directly activated

      <Expandable title="Fixed plan object">
        <ResponseField name="code" type="string">
          Unique plan code for API requests
        </ResponseField>

        <ResponseField name="name" type="string">
          User-friendly plan name for display
        </ResponseField>

        <ResponseField name="operator" type="string">
          Mobile operator
        </ResponseField>

        <ResponseField name="cost" type="number">
          Your cost multiplier
        </ResponseField>

        <ResponseField name="isEnabled" type="boolean">
          Whether plan is currently available
        </ResponseField>

        <ResponseField name="amount" type="number">
          Fixed top-up amount in DZD
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object" required>
  <Expandable title="properties">
    <ResponseField name="timestamp" type="string">
      Response timestamp in ISO 8601 format
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.oneclickdz.com/v3/mobile/plans \
    -H "X-Access-Token: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.oneclickdz.com/v3/mobile/plans", {
    headers: { "X-Access-Token": "YOUR_API_KEY" },
  });
  const { data } = await response.json();
  console.log(data.dynamicPlans, data.fixedPlans);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.oneclickdz.com/v3/mobile/plans',
      headers={'X-Access-Token': 'YOUR_API_KEY'}
  )
  data = response.json()['data']
  dynamic_plans = data['dynamicPlans']
  fixed_plans = data['fixedPlans']
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.oneclickdz.com/v3/mobile/plans');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Access-Token: YOUR_API_KEY']);
  $response = json_decode(curl_exec($ch), true);
  $dynamicPlans = $response['data']['dynamicPlans'];
  $fixedPlans = $response['data']['fixedPlans'];
  ?>
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "success": true,
  "data": {
    "dynamicPlans": [
      {
        "code": "GROS_MOBILIS",
        "name": "📱 GROS MOBILIS | جملة",
        "operator": "GMobilis",
        "isEnabled": true,
        "min_amount": 5000,
        "max_amount": 300000
      },
      {
        "code": "PREPAID_DJEZZY",
        "name": "📱 PREPAID | عادي",
        "operator": "Djezzy",
        "cost": 0.9925,
        "isEnabled": true,
        "min_amount": 100,
        "max_amount": 10000
      },
      {
        "code": "PREPAID_MOBILIS",
        "name": "📱 PREPAID | عادي",
        "operator": "Mobilis",
        "cost": 0.96,
        "isEnabled": true,
        "min_amount": 40,
        "max_amount": 3999
      },
      {
        "code": "FACTURE_DJEZZY",
        "name": "📋 FACTURE | فاتورة",
        "operator": "Djezzy",
        "cost": 0.9925,
        "isEnabled": true,
        "min_amount": 100,
        "max_amount": 10000
      }
    ],
    "fixedPlans": [
      {
        "code": "MIX50_DJEZZY",
        "name": "📱🌐 Auto | MIX 50",
        "operator": "Djezzy",
        "isEnabled": true,
        "cost": 0.9925,
        "amount": 50
      },
      {
        "code": "MIX1000_OOREDOO",
        "name": "📱🌐 AUTO | MIX 1000",
        "operator": "Ooredoo",
        "isEnabled": true,
        "cost": 0.99,
        "amount": 1000
      },
      {
        "code": "MIX500_MOBILIS",
        "name": "📱🌐 AUTO | MIX 500",
        "operator": "Mobilis",
        "isEnabled": true,
        "cost": 0.96,
        "amount": 500
      },
      {
        "code": "GETMENU_Mobilis",
        "name": "إظهار كافة العروض ",
        "operator": "Mobilis",
        "isEnabled": true,
        "cost": 0.96,
        "amount": 0
      }
    ]
  },
  "meta": {
    "timestamp": "2025-10-29T00:35:59.220Z"
  }
}
```

## Plan Properties Explained

<AccordionGroup>
  <Accordion title="Understanding Cost">
    The `cost` field is your wholesale price multiplier:

    * `0.98` = You pay 98% of face value
    * For 1000 DZD top-up: your cost = 1000 × 0.98 = 980 DZD
    * Your profit margin: 1000 - 980 = 20 DZD (2%)

    **Important:** Remove `cost` from responses to end users. Apply your own markup.
  </Accordion>

  {" "}

  <Accordion title="Amount Ranges">
    **Dynamic plans** have `min_amount` and `max_amount`: - Users can choose any
    amount within this range - Common range: 50 - 5000 DZD - Some operators allow
    up to 10,000 DZD **Fixed plans** have a single `amount`: - No amount selection
    needed - Directly activate the service - Common for special offers and data
    packs
  </Accordion>

  {" "}

  <Accordion title="Plan Availability">
    The `isEnabled` field indicates:

    * `true`: Plan available for use
    * `false`: Temporarily disabled (maintenance, operator issues)

    Always check this field before allowing users to select a plan.
  </Accordion>
</AccordionGroup>

## Integration Strategy

<Steps>
  <Step title="Initial Load">
    Call this endpoint once when your application starts or during setup
  </Step>

  <Step title="Store Plans">
    Save plans to your database with your own pricing

    ```sql theme={null}
    CREATE TABLE mobile_plans (
      code VARCHAR PRIMARY KEY,
      name VARCHAR,
      operator VARCHAR,
      our_cost DECIMAL,
      sell_price DECIMAL,
      min_amount INT,
      max_amount INT,
      amount INT,
      is_enabled BOOLEAN,
      updated_at TIMESTAMP
    );
    ```
  </Step>

  <Step title="Apply Markup">
    Calculate your selling price:

    ```javascript theme={null}
    const ourCost = faceValue * plan.cost;
    const markup = 0.05; // 5% profit
    const sellPrice = ourCost * (1 + markup);
    ```
  </Step>

  <Step title="Serve to Users">
    Display plans with your pricing to end users

    ```javascript theme={null}
    {
      code: plan.code,
      name: plan.name,
      operator: plan.operator,
      price: sellPrice, // Your price, not wholesale cost
      minAmount: plan.min_amount,
      maxAmount: plan.max_amount
    }
    ```
  </Step>

  <Step title="Periodic Sync">
    Sync plans daily or when notified of changes

    ```javascript theme={null}
    // Daily sync at midnight
    cron.schedule('0 0 * * *', syncPlans);
    ```
  </Step>
</Steps>

## Filtering Plans

<CodeGroup>
  ```javascript By Operator theme={null}
  const mobilisPlans = [
    ...data.dynamicPlans.filter((p) => p.operator === "Mobilis"),
    ...data.fixedPlans.filter((p) => p.operator === "Mobilis")
  ];
  const djezzyPlans = [
    ...data.dynamicPlans.filter((p) => p.operator === "Djezzy"),
    ...data.fixedPlans.filter((p) => p.operator === "Djezzy")
  ];
  ```

  ```javascript By Type theme={null}
  const dynamicPlans = data.dynamicPlans;
  const fixedPlans = data.fixedPlans;
  const allPlans = [...data.dynamicPlans, ...data.fixedPlans];
  ```

  ```javascript Enabled Only theme={null}
  const availableDynamic = data.dynamicPlans.filter((p) => p.isEnabled);
  const availableFixed = data.fixedPlans.filter((p) => p.isEnabled);
  ```
</CodeGroup>

## Best Practices

<CardGroup cols={2}>
  <Card title="Cache Plans" icon="database">
    Store plans in your database to reduce API calls and improve performance
  </Card>

  <Card title="Remove Cost" icon="eye-slash">
    Never expose wholesale `cost` to end users. Show only your retail prices
  </Card>

  <Card title="Check Enabled" icon="circle-check">
    Always verify `isEnabled` before displaying plans to users
  </Card>

  <Card title="Sync Regularly" icon="arrows-rotate">
    Implement daily sync or webhook listener for plan updates
  </Card>
</CardGroup>

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Send Top-Up" icon="paper-plane" href="/en/api-reference/mobile/send-topup">
    Send a mobile top-up using a plan code
  </Card>

  <Card title="Check Status" icon="magnifying-glass" href="/en/api-reference/mobile/check-by-ref">
    Track top-up status
  </Card>
</CardGroup>
