> For the complete documentation index, see [llms.txt](https://developer.ellypayapp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.ellypayapp.com/service-payments/service-packages-list.md).

# Service Packages List

Obtaining a packages list relates to services returned [here](/service-payments/services-list.md) and the value for `has_packages` is **true**

### Get Service Packages List

<mark style="color:blue;">`GET`</mark> `https://gwapisdbx.ellypayapp.com/service-payments/service-packages?serviceCode=`

Returns the list of service packages based on the service code. The service code is passed as query parameter to retrieve the packages accordingly.

#### Query Parameters

<table><thead><tr><th width="180">Name</th><th width="82">Type</th><th>Description</th></tr></thead><tbody><tr><td>serviceCode<mark style="color:red;">*</mark></td><td>String</td><td>The service code for the service whose packages are to be obtained in the request.</td></tr></tbody></table>

#### Headers

<table><thead><tr><th width="147">Name</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td>public-key<mark style="color:red;">*</mark></td><td>String</td><td>The Public Key as shared in the approval email</td></tr></tbody></table>

### Sample Service Packages Request

```powershell
curl https://gwapisdbx.ellypayapp.com/service-payments/service-packages?serviceCode=MTNData \
   -H "Accept: application/json" \
   -H "x-api-version: 1" \
   -H "public-key: your-public-key"
```

{% tabs %}
{% tab title="200: OK Returns the list of service packages" %}

```json
{
    "code": 200,
    "status": "success",
    "message": "Request completed successfully.",
    "data": [
        {
            "code": "MTNData_33067121",
            "name": "MTN 70MB Daily Bundle",
            "currency": "UGX",
            "price": 500
        },
        {
            "code": "MTNData_9259874",
            "name": "MTN 25MB Monthly Bundle",
            "currency": "UGX",
            "price": 1500
        },
        {
            "code": "MTNData_40297551",
            "name": "MTN 512MB Monthly Bundle",
            "currency": "UGX",
            "price": 5500
        },
        {
            "code": "MTNData_49894758",
            "name": "MTN 165MB Daily Bundle",
            "currency": "UGX",
            "price": 1000
        }
    ]
}
```

{% tabs %}
{% tab title="Response Description" %}

<table><thead><tr><th width="123">Parameter</th><th width="96">Type</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>string</td><td>The unique code for the service package. During validation, this would be the service code.</td></tr><tr><td>name</td><td>string</td><td>The name of the service package</td></tr><tr><td>currency</td><td>string</td><td>The currency in which the service payment is done</td></tr><tr><td>price</td><td>Number</td><td>The cost of the service package. This is what the merchant pays for the package</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request When the request is not formed as expected" %}

```javascript
{
  "code": 400,
  "status": "error",
  "message": "unrecognized service code",
  "data": {}
}
```

{% endtab %}
{% endtabs %}
