/eligible_for_campaign

/me/eligible_for_campaign

Target audience: Developers

1
Release version: 4.2.0

Introduction

This endpoint uses the Payway Campaign Rules to determine if the user is eligible to buy a specific campaign.

URI

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

Requirements

Identity Scope
Yes /external/me/r

Parameters

Field Required Type Description
campaign_code Required String The campaign code to check eligibility for.
Size range: ..50

Curl Example

1
2
3
4
5
6
7
8
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me/eligible_for_campaign \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <access_token_with_identity>' \
  --header 'content-type: application/json' \
  --data '{
              "campaign_code": "my_campaign_code"
          }'

Response

1
2
3
4
5
6
HTTP 200 OK
{
    "item": {
        "eligible": true,
    }         
}

Errors

Example error response

1
2
3
4
5
6
HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "campaign_code",
    "message": "Parameter must match format (/^[a-f\d]{24}$/)"
}

HTTP 400 Bad Request

Name Type Description
unknown_parameter Object One or more of the fields in the request was not recognized

HTTP 404 Not Found

Name Type Description
not_found Object Indicates that no account could be found associated with the acces-token in use

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side