> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/subscription-churn-prevention-campaigns/retrieve-eligible-enrollment-campaigns.md).

# Retrieve eligible enrollment campaigns

Use the **getEligibleEnrollmentCampaigns** method to retrieve all the automatic renewal enrollment campaigns a subscription is eligible for, so you can offer the shopper a discount to enable automatic renewal. Enrollment campaigns have no translations, so this method has no Language parameter.

A subscription is eligible when automatic renewal is disabled, the subscription is active, and there is an active enrollment campaign for its product. The criteria are the same as for the existing myAccount flow.

## Request parameters

<table><thead><tr><th width="204.4000244140625">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionID</code> expires in 10 minutes.</td></tr><tr><td><code>SubscriptionReference</code></td><td><strong>Required (string)</strong><br>Unique, system-generated subscription identifier.</td></tr></tbody></table>

### Request sample

```php
<?php

$vendorCode = 'YOUR_VENDOR_CODE';
$apiKey     = 'YOUR_API_KEY';
$date       = gmdate('Y-m-d H:i:s');
$hash       = hash_hmac(
    'md5',
    strlen($vendorCode) . $vendorCode . strlen($date) . $date,
    $apiKey
);

try {
    $client = new SoapClient(
        'https://api.2checkout.com/soap/6.0?wsdl',
        ['cache_wsdl' => WSDL_CACHE_NONE]
    );

    $sessionID = $client->login($vendorCode, $date, $hash);

    $subscriptionReference = '351D8F557E';

    $result = $client->getEligibleEnrollmentCampaigns($sessionID, $subscriptionReference);
    var_dump($result);
} catch (SoapFault $e) {
    echo 'SoapFault: ' . $e->getMessage() . PHP_EOL;
}
```

## Response parameters

| Parameter                             | Type                 |
| ------------------------------------- | -------------------- |
| `EligibleEnrollmentCampaignsResponse` | **Array of objects** |

## Response sample

```php
[
  {
    "Code": "UGPPKKJY5L1LHBFPHKQ3",
    "Name": "Enable auto-renewal and save",
    "RestrictedToCatalogPrices": false,
    "OfferDiscount": {
      "Discount": "20",
      "DiscountType": "PERCENT",
      "BillingCycles": "ALL"
    }
  }
]

```

## Error codes

| Error code                           | Description                                                               |
| ------------------------------------ | ------------------------------------------------------------------------- |
| **INVALID\_SUBSCRIPTION\_REFERENCE** | The subscription reference is invalid or belongs to a different merchant. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/subscription-churn-prevention-campaigns/retrieve-eligible-enrollment-campaigns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
