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
ignore_active_subscriptions Boolean Will ignore any active subscription on the given account if set to true.
Allowed values: true / false
Default value: false
No

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
}

Package or campaign is not included in a ranked campaign group, and as such will not be validated

HTTP 200
{
  "item": "package_code"
}

Errors

This API uses the common error conventions of the Payway API

See common error responses