Skip to content

Get purchasable product codes

/ranked_campaign_group/get_purchasable_product_code

Target audience: Developers

Get purchasable product codes for an account

Introduction

The endpoint returns the product code that the account can purchase from the ranked campaign group specified for the package identified either by a package code or campaign code.

URI

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

Requirements

Identity Scope
No /external/order/r

Parameters

Name Type Description Required
account_id String The id of the account.
Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i"
Yes
package_code String The product code for the package of the ranked campaign group. Cannot be used together with campaign_code.
Size range: 1..50 Allowed values: "/^[a-zA-Z-_0-9]+$/"
No, must give either package_code or campaign_code
campaign_code String A campaign code that is included in the ranked campaign group. Cannot be used together with package_code.
Size range: 1..50 Allowed values: "/^[a-zA-Z-_0-9]+$/"
No, must give either package_code or campaign_code

Curl Example

Get purchasable product code

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/ranked_campaign_group/get_purchasable_product_code?account_id=52a781d6400e06897c00000f&package_code=package_code \
  --header 'accept: application/json' \
  --header 'authorization: Bearer <token>' \

Response

Successful response

HTTP 200
{
  "item": "campaign_code"
}

Account cannot purchase any of the included campaigns nor the package the campaigns are based on

HTTP 200
{
  "item": null
}

Errors

Example error response

HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "account_id",
    "message": "Parameter must match format (/^[a-f\d]{24}$/)"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the query string

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side