InPlayer API (2.0.0)

Download OpenAPI specification:Download

INTRODUCTION

InPlayer equips you to run a detailed subscription business model, to build and grow your consumer base, and drive significant revenues. Our paywall supports recurring payments and billing cycles, consumer acquisition, subscriber lifecycle management, and provides you with consumer retention CRM tools.

Once you create an InPlayer Merchant Account, you are entitled to using our InPlayer dashboard for publishing, managing, and selling your premium content. Moreover, you can always integrate with our APIs for a full custom integration.

INPLAYER API

The InPlayer API follows the REST architectural style and uses standard HTTP response codes to indicate success requests (2xx) or API errors (4xx, 5xx). Each of the InPlayer Core Resources (Accounts & Authentication, Asset & Access, Payments & Subscriptions, Vouchers & Promotions, Branding, Restrictions & Rules, Reporting, Analytics, and Features) has their own URL and each of the operations involved (POST, PUT, PATCH, GET, and DELETE) carries a specific meaning like creating, updating, fetching, deleting data, and much more.

All API requests should contain Content-Type:application/x-www-form-urlencoded header. The responses are always returned in JSON object(s), both for the successful requests and the failed attempts (errors).

DOCS TERMINOLOGY

The following section defines the domain language used across our platform. Proceed reading to introduce yourself to the terms employed for each of our Core Resources before you start working on your custom integration.

Accounts and Account Types

Term Explanation
merchant The Merchants are those who have ownership of the premium content.
consumer The Consumers are those who can view or buy the premium content.
customer The Customers are those who have made at least one purchase.
uuid Stands for the Unique Identifier of the Merchant. You can find it on the InPlayer's dashboard at the Account Details section as Account ID.

Items/Assets and Item Types

Term Explanation
items The digital Assets that Merchants can protect and sell. Asset is an Item with applied pricing and access options.
item_type The type of the digital content that can be created in the InPlayer platform. According to the type of the premium content, we distinguish between a few item types. Currently, we support HTML/Text (where you can store HTML code or any IFRAME code), video, file, and RSS type of asset.
content The content of the Item is the premium content that you can store and protect. Once the Customer has access to the Item, they can view the content.
metadata An unlimited key-value store containing additional info of the Item concerned.

Access Types

Term Explanation
access_type The supported types of granting access in the system (pay-per-view and subscription).
period The period of the access entitlement that consumers get after purchasing the asset.

Access Fees

Term Explanation
access_fee The applied access_type and price to an Item.

Items Packages

Term Explanation
package The Packages are a collection of multiple Items (a group of Items). You can set up a Package Access Fee as an additional pricing option for Items that are part of a given Package. Once the Customer buys the Package Access Fee, they will have access to every Item that belongs to that Package.

API ENVIRONMENTS

To make the API as explorable as possible, we have two different environments for production related and testing purposes. There is no switch for changing between modes, so just refer to the URL you need.

ERRORS

InPlayer uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with InPlayer's servers.

Not all errors map cleanly onto HTTP response codes, however. For instance, when a request is valid but does not complete successfully (e.g. if asset access is not found), we return a 402 error code.

List of status codes

Status code Explanation
200 OK Everything worked as expected.
201 Created The resource has been created.
202 Accepted The request has been accepted for processing but the processing has not been completed.
204 No Content The server has fulfilled the request but does not need to return an entity-body.
400 Bad Request The request was unacceptable, often due to omission of a required parameter.
401 Unauthorized No valid access token provided.
402 Request Failed The parameters were valid but the request failed.
404 Not Found The requested resource does not exist.
409 Conflict The request conflicts with another request.
429 Too Many Requests Too many requests have been sent to the API in a short amount of time. We recommend using exponential backoff for your requests.
500, 502, 503, 504 Server Errors Something went wrong on InPlayer's end.

V1

All operations related to restrictions & rules

Create global age restriction

Creates a global age restriction for all items for the current merchant.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
min_age
required
integer

The customer’s minimum age allowed for asset entitlement

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/age
  -H 'Authorization: Bearer <token>'
  -d 'min_age=18'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully created global age restriction."
}

Delete global age restriction

Deletes a global age restriction for the merchant.

Authorizations:
bearerAuth

Responses

Request samples

curl -X DELETE \
  'https://services.inplayer.com/restrictions/age'
  -H 'Authorization: Bearer <token>'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted global age restriction"
}

Return global age restriction

Returns the global age restriction for the merchant account.

Authorizations:
bearerAuth

Responses

Request samples

curl https://services.inplayer.com/restrictions/age
  -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "min_age": 18,
  • "merchant_uuid": "4a39b5ab-b5fc-4ba3-b770-73155d20e61f",
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}

Return Age Restriction for Item

Returns age restriction for a specific item.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

Responses

Request samples

curl https://services.inplayer.com/restrictions/age/item/12
  -H 'Authorization: Bearer <token>'

Response samples

Content type
application/json
{
  • "min_age": 18,
  • "item_id": 12,
  • "merchant_id": 123,
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}

Create Age Restriction for Item

Creates age restriction for the item provided.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

Request Body schema: application/x-www-form-urlencoded
min_age
required
integer

The customer’s minimum age allowed for asset entitlement

Responses

Request samples

curl -X POST \
   https://services.inplayer.com/restrictions/age/item/12
  -H 'Authorization: Bearer <token>'
  -d min_age=18

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully created Age Restriction"
}

Delete Age Restriction for Item

Deletes age restriction for the item provided.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

Responses

Request samples

curl -X DELETE \
  'https://services.inplayer.com/restrictions/age/12'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted Age Restriction"
}

Return domain restrictions per Merchant

Returns a list of the restricted domains per merchant.

Authorizations:
bearerAuth
query Parameters
domain
string

The domain URL

Responses

Request samples

curl https://services.inplayer.com/restrictions/domain
  -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
[]

Delete global domain

Deletes all domain restrictions unless the query parameter has a domain specified, in which case, only a single domain would be deleted.

Authorizations:
bearerAuth
query Parameters
domain
string

The domain URL

Responses

Request samples

curl -X DELETE \
  'https://services.inplayer.com/restrictions/domain?domain=https://example.com' \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Creates or updates global domain restrictions

Creates new or updates existing global restricted domains.

Authorizations:
bearerAuth
path Parameters
type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’.

Request Body schema: application/x-www-form-urlencoded
required
Array of objects
example
any

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/domain/blacklist
  -H 'Authorization: Bearer <token>'
  -d 'domains%5B0%5D%5Bid%5D=0&domains%5B0%5D%5Bdomain%5D=http%3A%2F%2Fexample.com'


Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource created successfully"
}

Creates or updates domain restrictions for given asset

Creates new or updates existing restricted domains per asset.

Authorizations:
bearerAuth
path Parameters
type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

item_id
required
integer

Item ID

Request Body schema: application/x-www-form-urlencoded
required
Array of objects
example
any

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/domain/blacklist/item/909
  -H 'Authorization: Bearer <token>'
  -d 'domains%5B0%5D%5Bid%5D=0&domains%5B0%5D%5Bdomain%5D=http%3A%2F%2Fexample.com'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource created successfully"
}

Creates, updates or delete domain restrictions for given asset

Creates new, updates or delete existing restricted domains per asset.

Authorizations:
bearerAuth
path Parameters
type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

item_id
required
integer

Item ID

Request Body schema: application/x-www-form-urlencoded
required
Array of objects
example
any

Responses

Request samples

curl -X PUT https://services.inplayer.com/restrictions/domain/blacklist/item/909 \
-H 'Authorization: Bearer' \
-d 'domains[id]=0' \
-d 'domains[domain]="http://example.com"'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource updated successfully"
}

Returns domain restrictions per item

Returns all the restricted domains per item.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

query Parameters
domain
string

The domain URL

Responses

Request samples

curl https://services.inplayer.com/restrictions/domain/item/{item_id}
  -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "id": 14,
  • "item_id": 40494,
  • "merchant_id": 25478,
  • "domain": "https://example.com",
  • "type": "blacklist"
}

Delete asset domain

Deletes all asset domain restrictions unless the query parameter has a domain specified, in which case, only a single domain would be deleted.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

query Parameters
domain
string

The domain URL

Responses

Request samples

curl -X DELETE \
  -H "Authorization: Bearer <token>"
  'https://services.inplayer.com/restrictions/domain/item/909?domain=https://example.com'

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Return all country sets per merchant

Returns all the restricted country sets and the countries within those country sets per merchant.

Authorizations:
bearerAuth

Responses

Request samples

curl -X GET \
  https://services.inplayer.com/restrictions/geo/country-set
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Create new Country Set

Creates new country set with whitelisted or blacklisted countries.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
name
required
string

The name of the country set

global
required
boolean

Shows whether the country set is the default one

type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

required
Array of objects (CountrySetList)

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/geo/country-set
  -H 'Authorization: Bearer <token>' \
  -d 'global=0&name=ExampleName&countries%5B%5D=MK&countries%5B%5D=BR&type=whitelist'

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Return country set with countries

Returns a country set listing the countries within for a provided country set ID.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

Responses

Request samples

curl -X GET \
  https://services.inplayer.com/restrictions/geo/country-set/1
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Edit Country Set

Edits the country set’s details.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

Request Body schema: application/x-www-form-urlencoded
name
required
string

The name of the country set

global
required
boolean

Shows whether the country set is the default one

type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

required
Array of objects (CountrySetList)

Responses

Request samples

curl -X PUT \
  https://services.inplayer.com/restrictions/geo/country-set/21
  -H 'Authorization: Bearer <token>' \
  -d 'name=ExampleName&type=blacklist&global=1&countries%5B%5D=MK'

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Delete Country Set

Deletes a given country set.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

Responses

Request samples

curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/6
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Remove Country from Country Set

Deletes a country from a given country set.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

country_name
required
string

Two-letter ISO country code, in uppercase

Responses

Request samples

curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/3/country/Macedonia111only%20because%20is%20mandatory%202222
  -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Set Country set for Asset

Applies a country set to a given asset.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

item_id
required
integer

Item ID

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/geo/country-set/1/item/909
  -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Update Country set for Asset

Updates a country set for a given asset.

Authorizations:
bearerAuth
path Parameters
country_set_id
required
integer

Country Set ID

item_id
required
integer

Item ID

Responses

Request samples

curl -X PUT \
  https://services.inplayer.com/restrictions/geo/country-set/1/item/909 \
  -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

Remove Country Set for Asset

Removes a given country set for a given asset.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

Responses

Request samples

curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/item/41948
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Return Country Set for Asset

Returns a country set for a given asset.

Authorizations:
bearerAuth
path Parameters
item_id
required
integer

Item ID

Responses

Request samples

curl -X GET \
   https://services.inplayer.com/restrictions/geo/items/42297/country-set
  -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries": [
    ],
  • "created_at": 1532425425
}

List Geo Sets

Returns all the restricted sets and the countries/regions/cities within those geo sets.

Authorizations:
bearerAuth

Responses

Request samples

curl -X GET \
  https://services.inplayer.com/restrictions/geo/set
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
[
  • {
    }
]

Create Geo Set

Creates new geo set with whitelisted or blacklisted countries/regions/cities

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
name
required
string

The name of the geo set

global
required
boolean

Shows whether the geo set is the default one

type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

Array of objects (Countries)

ISO 3166-2 codes. Example: countries["MK","US"]

Array of objects (Region)

ISO 3166-2 codes. Example: regions["ME","FL"]

Array of objects (City)

Example: cities[0][name]=Portland&cities[0][country]=US

Responses

Request samples

curl -X POST \
  https://services.inplayer.com/restrictions/geo/set
  -H 'Authorization: Bearer <token>' \
  -d name="Geo Set 1" \
  -d type=whitelist \
  -d global=true \
  -d countries[]=US \
  -d regions[]=FL \
  -d cities[0][name]=Miami \
  -d cities[0][region]=FL \
  -d cities[0][country]=US

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Geo Set 1",
  • "type": "whitelist",
  • "global": true,
  • "countries": [
    ],
  • "regions": [
    ],
  • "cities": [
    ],
  • "created_at": 1532425425
}

Get Geo Set

Returns a geo set listing the countries/regions/cities within for a provided geo set ID.

Authorizations:
bearerAuth
path Parameters
set_id
required
integer

Geo Set ID

Responses

Request samples

curl -X GET \
  https://services.inplayer.com/restrictions/geo/set/1
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Geo Set 1",
  • "type": "whitelist",
  • "global": true,
  • "countries": [
    ],
  • "regions": [
    ],
  • "cities": [
    ],
  • "created_at": 1532425425
}

Update Geo Set

Edits the geo set’s details.

Authorizations:
bearerAuth
path Parameters
set_id
required
integer

Geo Set ID

Request Body schema: application/x-www-form-urlencoded
name
required
string

The name of the geo set

global
required
boolean

Shows whether the geo set is the default one

type
required
string

The restriction type which can be ‘whitelist’ or ‘blacklist’

Array of objects (Countries)

ISO 3166-2 codes. Example: countries["US","MK"]

Array of objects (Region)

ISO 3166-2 codes. Example: regions["ME","FL"]

Array of objects (City)

Example: cities[0][name]=Portland&cities[0][country]=US

Responses

Request samples

curl -X PUT \
  https://services.inplayer.com/restrictions/geo/set/21
  -H 'Authorization: Bearer <token>' \
  -d name="Geo Set 1" \
  -d type=whitelist \
  -d global=true \
  -d countries[]=US \
  -d regions[]=FL \
  -d cities[0][name]=Miami \
  -d cities[0][region]=FL \
  -d cities[0][country]=US

Response samples

Content type
application/json
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Geo Set 1",
  • "type": "whitelist",
  • "global": true,
  • "countries": [
    ],
  • "regions": [
    ],
  • "cities": [
    ],
  • "created_at": 1532425425
}

Delete Geo Set

Deletes a given geo set.

Authorizations:
bearerAuth
path Parameters
set_id
required
integer

Geo Set ID

Responses

Request samples

curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/set/6
    -H 'Authorization: Bearer <token>' \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Creates or updates restriction settings for given merchant

Create or update restriction settings per merchant

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
age_verification_enabled
required
bool
age_verification_type
required
string

Age Verification Type. Can be 'pin_code' or 'basic'

merchant_uuid
required
string

Merchant's uuid

Responses

Request samples

curl -X PATCH \
  https://services.inplayer.com/restrictions/settings
  -H 'Authorization: Bearer <token>'
  -d age_verification_enabled=true \
  -d age_verification_type=pin_code \
  -d merchant_uuid=6y79b5ab-b5fc-4ba3-b770-73155d20e61f


Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Resource created/updated successfully"
}

Return restriction settings per Merchant

Returns restriction settings per merchant

Authorizations:
bearerAuth
path Parameters
merchant_uuid
required
string <uuid>

Merchant's uuid

Responses

Request samples

curl https://services.inplayer.com/restrictions/settings/3b39b5ab-b5fc-4ba3-b770-73155d20e61f
  -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "age_verification_type": "pin_code",
  • "age_verification_enabled": true,
  • "merchant_uuid": "3b39b5ab-b5fc-4ba3-b770-73155d20e61f",
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}