Download OpenAPI specification:Download
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.
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).
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. |
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.
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. |
Creates a global age restriction for all items for the current merchant.
min_age required | integer The customer’s minimum age allowed for asset entitlement |
curl -X POST \ https://services.inplayer.com/restrictions/age -H 'Authorization: Bearer <token>' -d 'min_age=18'
{- "code": 200,
- "message": "Successfully created global age restriction."
}
Deletes a global age restriction for the merchant.
curl -X DELETE \ 'https://services.inplayer.com/restrictions/age' -H 'Authorization: Bearer <token>'
{- "code": 200,
- "message": "Successfully deleted global age restriction"
}
Returns the global age restriction for the merchant account.
curl https://services.inplayer.com/restrictions/age -H "Authorization: Bearer <token>"
{- "min_age": 18,
- "merchant_uuid": "4a39b5ab-b5fc-4ba3-b770-73155d20e61f",
- "created_at": 1532425425,
- "updated_at": 1532425425
}
Returns age restriction for a specific item.
item_id required | integer Item ID |
curl https://services.inplayer.com/restrictions/age/item/12 -H 'Authorization: Bearer <token>'
{- "min_age": 18,
- "item_id": 12,
- "merchant_id": 123,
- "created_at": 1532425425,
- "updated_at": 1532425425
}
Creates age restriction for the item provided.
item_id required | integer Item ID |
min_age required | integer The customer’s minimum age allowed for asset entitlement |
curl -X POST \ https://services.inplayer.com/restrictions/age/item/12 -H 'Authorization: Bearer <token>' -d min_age=18
{- "code": 200,
- "message": "Successfully created Age Restriction"
}
Deletes age restriction for the item provided.
item_id required | integer Item ID |
curl -X DELETE \ 'https://services.inplayer.com/restrictions/age/12'
{- "code": 200,
- "message": "Successfully deleted Age Restriction"
}
Returns a list of the restricted domains per merchant.
domain | string The domain URL |
curl https://services.inplayer.com/restrictions/domain -H "Authorization: Bearer <token>"
[
]
Deletes all domain restrictions unless the query parameter has a domain specified, in which case, only a single domain would be deleted.
domain | string The domain URL |
curl -X DELETE \ 'https://services.inplayer.com/restrictions/domain?domain=https://example.com' \
{- "code": 200,
- "message": "Resource deleted successfully"
}
Creates new or updates existing global restricted domains.
type required | string The restriction type which can be ‘whitelist’ or ‘blacklist’. |
required | Array of objects |
example | any |
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'
{- "code": 200,
- "message": "Resource created successfully"
}
Creates new or updates existing restricted domains per asset.
type required | string The restriction type which can be ‘whitelist’ or ‘blacklist’ |
item_id required | integer Item ID |
required | Array of objects |
example | any |
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'
{- "code": 200,
- "message": "Resource created successfully"
}
Creates new, updates or delete existing restricted domains per asset.
type required | string The restriction type which can be ‘whitelist’ or ‘blacklist’ |
item_id required | integer Item ID |
required | Array of objects |
example | any |
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"'
{- "code": 200,
- "message": "Resource updated successfully"
}
Returns all the restricted domains per item.
item_id required | integer Item ID |
domain | string The domain URL |
curl https://services.inplayer.com/restrictions/domain/item/{item_id} -H "Authorization: Bearer <token>"
{- "id": 14,
- "item_id": 40494,
- "merchant_id": 25478,
- "type": "blacklist"
}
Deletes all asset domain restrictions unless the query parameter has a domain specified, in which case, only a single domain would be deleted.
item_id required | integer Item ID |
domain | string The domain URL |
curl -X DELETE \ -H "Authorization: Bearer <token>" 'https://services.inplayer.com/restrictions/domain/item/909?domain=https://example.com'
{- "code": 200,
- "message": "Resource deleted successfully"
}
Returns all the restricted country sets and the countries within those country sets per merchant.
curl -X GET \ https://services.inplayer.com/restrictions/geo/country-set -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Creates new country set with whitelisted or blacklisted countries.
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) |
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'
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Returns a country set listing the countries within for a provided country set ID.
country_set_id required | integer Country Set ID |
curl -X GET \ https://services.inplayer.com/restrictions/geo/country-set/1 -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Edits the country set’s details.
country_set_id required | integer Country Set ID |
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) |
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'
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Deletes a given country set.
country_set_id required | integer Country Set ID |
curl -X DELETE \ https://services.inplayer.com/restrictions/geo/country-set/6 -H 'Authorization: Bearer <token>' \
{- "code": 200,
- "message": "Resource deleted successfully"
}
Deletes a country from a given country set.
country_set_id required | integer Country Set ID |
country_name required | string Two-letter ISO country code, in uppercase |
curl -X DELETE \ https://services.inplayer.com/restrictions/geo/country-set/3/country/Macedonia111only%20because%20is%20mandatory%202222 -H 'Authorization: Bearer <token>' \
{- "code": 200,
- "message": "Resource deleted successfully"
}
Applies a country set to a given asset.
country_set_id required | integer Country Set ID |
item_id required | integer Item ID |
curl -X POST \ https://services.inplayer.com/restrictions/geo/country-set/1/item/909 -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Updates a country set for a given asset.
country_set_id required | integer Country Set ID |
item_id required | integer Item ID |
curl -X PUT \ https://services.inplayer.com/restrictions/geo/country-set/1/item/909 \ -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Removes a given country set for a given asset.
item_id required | integer Item ID |
curl -X DELETE \ https://services.inplayer.com/restrictions/geo/country-set/item/41948 -H 'Authorization: Bearer <token>' \
{- "code": 200,
- "message": "Resource deleted successfully"
}
Returns a country set for a given asset.
item_id required | integer Item ID |
curl -X GET \ https://services.inplayer.com/restrictions/geo/items/42297/country-set -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Country Set 1",
- "type": "blacklist",
- "global": true,
- "countries": [
- {
- "country": "MK"
}
], - "created_at": 1532425425
}
Returns all the restricted sets and the countries/regions/cities within those geo sets.
curl -X GET \ https://services.inplayer.com/restrictions/geo/set -H 'Authorization: Bearer <token>' \
[- {
- "id": 1,
- "merchant_id": 25478,
- "name": "Geo Set 1",
- "type": "whitelist",
- "global": true,
- "countries": [
- {
- "id": 14,
- "country": "US"
}
], - "regions": [
- {
- "name": "FL"
}
], - "cities": [
- {
- "name": "Miami",
- "country": "US",
- "region": "FL"
}
], - "created_at": 1532425425
}
]
Creates new geo set with whitelisted or blacklisted countries/regions/cities
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 |
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
{- "id": 1,
- "merchant_id": 25478,
- "name": "Geo Set 1",
- "type": "whitelist",
- "global": true,
- "countries": [
- {
- "id": 14,
- "country": "US"
}
], - "regions": [
- {
- "name": "FL"
}
], - "cities": [
- {
- "name": "Miami",
- "country": "US",
- "region": "FL"
}
], - "created_at": 1532425425
}
Returns a geo set listing the countries/regions/cities within for a provided geo set ID.
set_id required | integer Geo Set ID |
curl -X GET \ https://services.inplayer.com/restrictions/geo/set/1 -H 'Authorization: Bearer <token>' \
{- "id": 1,
- "merchant_id": 25478,
- "name": "Geo Set 1",
- "type": "whitelist",
- "global": true,
- "countries": [
- {
- "id": 14,
- "country": "US"
}
], - "regions": [
- {
- "name": "FL"
}
], - "cities": [
- {
- "name": "Miami",
- "country": "US",
- "region": "FL"
}
], - "created_at": 1532425425
}
Edits the geo set’s details.
set_id required | integer Geo Set ID |
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 |
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
{- "id": 1,
- "merchant_id": 25478,
- "name": "Geo Set 1",
- "type": "whitelist",
- "global": true,
- "countries": [
- {
- "id": 14,
- "country": "US"
}
], - "regions": [
- {
- "name": "FL"
}
], - "cities": [
- {
- "name": "Miami",
- "country": "US",
- "region": "FL"
}
], - "created_at": 1532425425
}
Deletes a given geo set.
set_id required | integer Geo Set ID |
curl -X DELETE \ https://services.inplayer.com/restrictions/geo/set/6 -H 'Authorization: Bearer <token>' \
{- "code": 200,
- "message": "Resource deleted successfully"
}
Create or update restriction settings per merchant
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 |
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
{- "code": 200,
- "message": "Resource created/updated successfully"
}
Returns restriction settings per merchant
merchant_uuid required | string <uuid> Merchant's uuid |
curl https://services.inplayer.com/restrictions/settings/3b39b5ab-b5fc-4ba3-b770-73155d20e61f -H "Authorization: Bearer <token>"
{- "age_verification_type": "pin_code",
- "age_verification_enabled": true,
- "merchant_uuid": "3b39b5ab-b5fc-4ba3-b770-73155d20e61f",
- "created_at": 1532425425,
- "updated_at": 1532425425
}