Skip to content

Eligible for gift campaign

/me/eligible_for_gift_campaign

Target audience: Developers

Release version: 4.5.9

Eligible for gift campaign purchase

Introduction

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

URI

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

Requirements

Identity Scope
Yes /external/me/r

Parameters

Field Required Type Description
campaign_code Optional String The gift campaign code to check eligibility for.
Size range: ..50
campaign_id Optional String The id of the gift campaign to check eligibility for.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"

Either campaign_code or campaign_id must be supplied!

Curl Example

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me/eligible_for_gift_campaign \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <access_token_with_identity>' \
  --header 'content-type: application/json' \
  --data '{
              "campaign_code": "my_campaign_code"
          }'

Response

HTTP 200 OK
{
    "item": {
        "eligible": true,
    }         
}

Errors

Example error response

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
not_found Object Indicates that no campaign could be found using either supplied parameter

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side