Skip to content

Eligible for campaign

/eligible_for_campaign

Target audience: Developers

Release version: 4.4.5

Eligible for campaign

Introduction

This endpoint gives information regarding if a specified user is eligible for a retention campaign or not.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/me_retention/eligible_for_campaign
Production https://backend.worldoftulo.com/external/api/v1/me_retention/eligible_for_campaign

Requirements

Identity Scope
Yes /external/me/w /external/me/r

Parameters

Field Required Type Description
user_product_id Required String The ID of the subscription (belonging to the user) to check, if an order id is not supplied.
Size range: ..1024
order_id Required String The order id that belongs to the subscription (of the user) to check, if an user product id is not supplied.
Size range: ..1024

Curl Example 1

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me_retention/eligible_for_campaign \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "user_product_id": "50f3ac249f6aef294d000007"
          }'

Curl Example 2

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me_retention/eligible_for_campaign \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "order_id": "ADEPRIMO-1"
          }'

Success response

Field Description
item Hash containing information about the retention campaign

Failure response

Field Description
code Short code, summarizing why the user was not eligible in a few words separated by underscores
message User-friendly message which further explains why the user was not eligible

Example success response

HTTP 200
{
    "item": {
      "id": "Retention campaign id", 
      "code": "Retention campaign product code", 
      "name": "Retention campaign name",
      "description": "Retention campaign description",
      "products": ["first_product", "second_product"]
    }
}

Example failure response

HTTP 200
{
      "code": "not_eligible", 
      "message": "User is not eligible for the retention campaign found on adeprimo_digital",
}

Errors

This API uses the common error conventions of the Payway API

See common error responses