Some content on this site may not be available right now. We are aware and actively monitoring the situation.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Automatic Renewal Enrollment Campaigns

Retrieve enrollment campaigns for a subscription

get

Retrieve the list of active automatic renewal enrollment campaigns a subscription is eligible for. A subscription is eligible when AR is disabled, the subscription is active, and there is at least one active enrollment campaign for its product. The eligibility criteria are the same as in the MyAccount enrollment flow. If several campaigns are active at the same time for the same product, all of them are returned and the vendor decides which one to display. Non-recurring subscriptions return an empty array.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
Responses
200

Successful response

application/json
CodestringOptional

Unique, system-generated campaign identifier.

NamestringOptional

Campaign name.

RestrictedToCatalogPricesbooleanOptional

True if the campaign is valid for catalog prices only.

get/subscriptions/{SubscriptionReference}/enrollment-campaigns/eligible/
GET /rest/6.0/subscriptions/{SubscriptionReference}/enrollment-campaigns/eligible/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
[
  {
    "Code": "IHMMYIAZULAZDHZGOLIY",
    "Name": "AR enrollment 20% off",
    "RestrictedToCatalogPrices": false,
    "OfferDiscount": {
      "Discount": 20,
      "DiscountType": "PERCENT",
      "BillingCycles": "1"
    }
  }
]

Enter enrollment campaign

post

Record the shopper's intent when they interact with an enrollment offer (a DISPLAY impression). The event stays recorded even if the shopper does not accept the discount. This call does not create a custom renewal price. The discount is applied only when the accept-discount endpoint is called. Recorded events are available in the retention tools enrollment and cancellation reports.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
CampaignCodestringRequired

Unique, system-generated enrollment campaign identifier.

Example: IHMMYIAZULAZDHZGOLIY
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
Responses
200

OK

application/json
post/subscriptions/{SubscriptionReference}/enrollment-campaigns/{CampaignCode}/enter/
POST /rest/6.0/subscriptions/{SubscriptionReference}/enrollment-campaigns/{CampaignCode}/enter/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
true

Accept enrollment campaign for a subscription

post

Enable automatic renewal and apply the discount from an enrollment campaign for a specific subscription. The campaign is re-validated server-side at request time, even if the eligible campaigns endpoint was not called first. The discount is saved as a custom renewal price. Any existing discount from a previous campaign is replaced, not stacked. On success, the LCN notification LICENCE_AR_ENROLLMENT_CAMPAIGN_ACCEPTED is dispatched (if enabled in cPanel LCN settings) and a confirmation email is sent to the shopper.

Path parameters
SubscriptionReferencestringRequired

Unique, system-generated subscription identifier.

Example: 48F5AC7011
CampaignCodestringRequired

Unique, system-generated enrollment campaign identifier.

Example: IHMMYIAZULAZDHZGOLIY
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
Responses
200

OK

application/json
post/subscriptions/{SubscriptionReference}/enrollment-campaigns/{CampaignCode}/accept-discount/
POST /rest/6.0/subscriptions/{SubscriptionReference}/enrollment-campaigns/{CampaignCode}/accept-discount/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code=\"{VENDOR_CODE}\" date=\"{REQUEST_DATE_TIME}\" hash=\"{HASH}\"
true

Last updated

Was this helpful?