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 DELET
) 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. |
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 has been 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. |
Returns list of files for content requests
curl https://services.inplayer.com/v2/analytics/content-requests -H "Authorization:Bearer <token>"
{- "name": "content_requests_55761_2020-01-21.csv",
- "created_at": 1582205986
}
Returns redirect url for downloading csv record
file_name required | string File name |
curl https://services.inplayer.com/v2/analytics/content-requests/{file_name} -H "Authorization:Bearer <token>"
{- "redirect_url": "string"
}
Generating content request report
item_id required | int Item ID |
start_date required | string Start date of report |
end_date required | string End date of report |
curl https://services.inplayer.com/v2/analytics/content-requests/generate \ -d item_id=23423 \ -d start_date=2006-01-02 15:04:05 \ -d end_date=2006-01-02 15:04:05
{- "code": 0,
- "message": "string"
}
Returns Account Login Record
id required | integer Customer ID |
curl https://services.inplayer.com/v2/analytics/customers/{id}/activity \ -H "Authorization: Bearer <token>"
{- "last_login": {
- "timestamp": 1565769442,
- "merchant_id": 26987,
- "merchant_email": "example-merchant-email@inplayer.com",
- "account_id": 21,
- "name": "John Doe",
- "consumer_email": "example-consumer-email@inplayer.com",
- "account_role": [
- "merchant"
], - "geo_data": {
- "ipAddress": "192.168.0.1",
- "continent": "Euorope",
- "countryISO": "MKD",
- "country": "Macedonia"
}, - "date": "2019-08-08T12:38:34+0000",
- "device": {
- "type": "string",
- "os": "string",
- "model": "string"
}, - "client_id": "c6f4002f-7415-4eb6-ab03-72b0f7aff0e8"
}, - "content_requests_log": {
- "item_id": 0,
- "item_title": "string",
- "created_at": {
- "date": "2006-01-02T15:04:05.000Z",
- "timezone_type": null,
- "timezone": "string"
}, - "updated_at": {
- "date": "2006-01-02T15:04:05.000Z",
- "timezone_type": null,
- "timezone": "string"
}, - "item_type": {
- "id": 0,
- "name": "string",
- "desctiption": "string",
- "content_type": "string",
- "host": "string"
}, - "access_control_type": {
- "id": 0,
- "name": "string",
- "auth": null
}, - "customer_id": 0,
- "email": "string",
- "metadata": [
- null
], - "ip_address": "string",
- "country": "string",
- "country_iso": "string",
- "state": "string",
- "city": "string",
- "device": {
- "type": "string",
- "os": "string",
- "model": "string"
}, - "date": "string",
- "referrer": "string",
- "date_from": "2006-01-02T15:04:05.000Z",
- "date_to": "2006-01-02T15:04:05.000Z"
}
}
Returns Customer Lifetime Value
id required | integer Customer ID |
curl https://services.inplayer.com/v2/analytics/customers/{id}/lifetime \ -H "Authorization: Bearer <token>"
{- "total_assets_bought": 10,
- "money_spent": [
- {
- "total_amount": 101.4,
- "currency": "USD"
}
], - "first_purchase": {
- "id": 24352,
- "parrent_id": 443234,
- "merchant_id": 432432,
- "customer_id": 3423,
- "gateway_id": 34,
- "transaction_token": "transaction token",
- "payment_tool_token": "payment tool token",
- "payment_tool_info": "payment tool info",
- "payment_method_name": "Stripe",
- "action_type": "Pending",
- "item_access_id": 0,
- "item_id": 3423,
- "item_type": "asset",
- "item_title": "title",
- "charged_amount": 103.42,
- "currency_iso": "MKD",
- "issued_by": 12342,
- "exchange_rate": 5.4,
- "settlement_currency": "USD",
- "note": "note",
- "revenue_account": "revenue account",
- "branding_id": 0,
- "created_at": "2020-01-21T14:41:18.000Z",
- "trx_token": "token"
}, - "last_purchase": {
- "id": 24352,
- "parrent_id": 443234,
- "merchant_id": 432432,
- "customer_id": 3423,
- "gateway_id": 34,
- "transaction_token": "transaction token",
- "payment_tool_token": "payment tool token",
- "payment_tool_info": "payment tool info",
- "payment_method_name": "Stripe",
- "action_type": "Pending",
- "item_access_id": 0,
- "item_id": 3423,
- "item_type": "asset",
- "item_title": "title",
- "charged_amount": 103.42,
- "currency_iso": "MKD",
- "issued_by": 12342,
- "exchange_rate": 5.4,
- "settlement_currency": "USD",
- "note": "note",
- "revenue_account": "revenue account",
- "branding_id": 0,
- "created_at": "2020-01-21T14:41:18.000Z",
- "trx_token": "token"
}
}
curl https://services.inplayer.com/v2/analytics/customers/logins \ -H "Authorization: Bearer <token>"
{- "total": 10,
- "per_device": [
- {
- "name": "mobile",
- "total": 10
}
], - "per_country": [
- {
- "name": "Austria",
- "total": 10
}
]
}
Returns Account Registrations Analytics
curl https://services.inplayer.com/v2/analytics/customers/registrations \ -H "Authorization: Bearer <token>"
{- "total": 10,
- "per_device": [
- {
- "name": "mobile",
- "total": 10
}
], - "per_country": [
- {
- "name": "Austria",
- "total": 10
}
], - "per_register_source": [
- {
- "name": "inplayer",
- "total": 10
}
]
}
Returns the payment analytics per payment type and currency.
start_date | string Start date for analytics |
end_date | string End date for analytics |
curl https://services.inplayer.com/v2/analytics/payments -H "Authorization:Bearer <token>" -d start_date=2006-01-02 15:04:05 \ -d end_date=2006-01-02 15:04:05
{- "payment_analytics": {
- "total": 2,
- "per_method": {
- "property1": {
- "total": 1,
- "total_amount_per_currency": [
- {
- "total_amount": 4000,
- "currency": "EUR"
}
]
}, - "property2": {
- "total": 1,
- "total_amount_per_currency": [
- {
- "total_amount": 4000,
- "currency": "EUR"
}
]
}
}
}, - "refund_analytics": {
- "total": 2,
- "per_method": {
- "property1": {
- "total": 1,
- "total_amount_per_currency": [
- {
- "total_amount": 4000,
- "currency": "EUR"
}
]
}, - "property2": {
- "total": 1,
- "total_amount_per_currency": [
- {
- "total_amount": 4000,
- "currency": "EUR"
}
]
}
}
}
}
Returns list of subscriptions group by country, price, item or only by action types
country_code | any Example: country_code=MKD subscriptions grouped by |
grouped_by | any Example: grouped_by=price subscriptions grouped by |
action_type | any Example: action_type=recurrent subscriptions grouped by |
curl https://services.inplayer.com/v2/analytics/subscriptions?country_code=MK&grouped_by=price&action_type=recurrent \ -H "Authorization: Bearer <token>"
{- "country_code": "MK",
- "country_name": "Macedonia",
- "total_subcriptions": 10,
- "grouped_by": "price",
- "subscriptions_grouped_by": [
- {
- "id": 123,
- "description": "Subscribe for 1 Month",
- "total_voucher_discount": 4,
- "total_subcriptions": 15,
- "total_subscriptions_per_state": [
- {
- "action_type": "recurrent",
- "total_subscriptions": 5
}, - {
- "action_type": "canceled",
- "total_subscriptions": 10,
- "sub_action_type": {
- "action_type": "about_to_churn",
- "total_subscriptions": 3
}
}
]
}
]
}