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.
Reporting
Term | Explanation |
---|---|
report type | The type of report a Merchant can generate. We support 4 types of reports that you can generate - reports regarding your Audience, Payments, Subscriptions, and Asset Access. |
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. |
Returns reports by period time.
startDate required | string Example: datetime The start date for the report |
endDate required | string Example: datetime The end date for the report |
groupBy | string Example: string Group by accsessFeeId or price |
curl https://staging-v2.inplayer.com/reporting \ -H "Authorization:Bearer <token>"
{- "numberOfRegisteredusers": 0,
- "numberOfPayments": 0,
- "numberOfCreatedSubscriptions": 0,
- "numberOfCancelledSubscriptions": 0,
- "topFiveCustomers": [
- {
- "id": 0,
- "email": "string",
- "full_name": "string",
- "number_of_payments": 0
}
], - "topFiveAssets": [
- {
- "id": 0,
- "title": "string",
- "type": "string",
- "number_of_purchases": 0,
- "revenues": [
- {
- "currency_iso": "EUR",
- "total_earned_amount": 4392
}
]
}
]
}
Returns reports by report type.
report_type required | string Example: subscription The type for the report |
merchantID required | number Example: merchantID=23434 The ID of the merchant |
curl https://staging-v2.inplayer.com/reporting/report/{report_type} \ -H "Authorization:Bearer <token>"
{- "message": "Generating report. Please wait."
}
Returns reports by report type.
report_type required | string Example: subscription The type for the report |
merchantID required | number Example: merchantID=23434 The ID of the merchant |
curl https://staging-v2.inplayer.com/reporting/reports/{report_type} \ -H "Authorization:Bearer <token>"
{- "reports": [
- {
- "created_at": 1554802943,
- "filename": "2019_03_09-2019_04_09-09-42-22-audience.csv"
}
]
}
Returns subscriptions by period time.
startDate required | string Example: datetime The start date for the subscriptions |
endDate required | string Example: datetime The end date for the subscriptions |
interval | string Example: string The interval for the subscriptions |
groupBy | string Example: string Group by accsessFeeId or price |
curl https://staging-v2.inplayer.com/reporting/subscriptions/count \ -H "Authorization:Bearer <token>"
{- "created": { },
- "canceled": { }
}
Endpoint for renaming reports.
file_name required | string The report file's name |
new_file_name required | string The report file's new name |
curl -X PUT https://staging-v2.inplayer.com/v2/reporting/rename/{report_type} \ -H "Authorization:Bearer <token>" \ -d file_name="file name" \ -d new_file_name="new file name"
{- "code": 200,
- "message": "File is renamed successfully."
}
Create report of a specific type.
start_date required | string <date-time> Start date for the report range in the format |
end_date | string <date-time> End date for the report range in the format |
currency | string <date-time> Currency for the merchant total revenue data, default is |
curl -X POST https://staging-v2.inplayer.com/v2/reporting/report/{report_type} \ -H "Authorization:Bearer <token>" \ -d start_date_=2021-02-22 22:22:22 \ -d end_date=2022-02-22 22:22:22 \ -d currency=EUR
{- "code": 200,
- "message": "Successfully started generating report"
}
Lists all scheduled/recurrent reports that are scheduled for execution.
report_type | string Enum: "transactions" "gift-payments" "subscriptions" "audience" "access" "account-logins" "paying-customers" "canceled-subscribers" "registered-only-customers" "merchant-analytics" "donation" "access-codes" Report type to filter reports by given type. |
curl https://staging-v2.inplayer.com/v2/reporting/schedule \ -H "Authorization:Bearer <token>"
[- {
- "id": 123,
- "merchant_id": 112233,
- "report_type": "audience",
- "scheduled_at": "2022-02-22T22:22:22.000Z",
- "recurrent": true,
- "start_date_resolution": "week",
- "start_date_resolution_before": 3,
- "data_start_range": "2022-01-01T10:00:00.000Z",
- "data_end_range": "2022-01-22T10:00:00.000Z",
- "scheduled_resolution": "month",
- "scheduled_resolution_before": 2,
- "created_at": "2022-01-02T22:00:00.000Z",
- "deleted_at": "2022-02-22T22:00:00.000Z"
}
]
Creates scheduled or recurrent report.
scheduled_at required | string <date-time> Date for when the report is scheduled in the format |
start_date_resolution required | string Enum: "week" "month" "year" Type of the frequency for included report data. |
start_date_resolution_before required | integer <number> Positive value for the frequency type for included report data. |
report_fields | Array of arrays Fields to be included in the report. |
access_status | string Additional data for access reports. |
access_type | string Additional data for access reports. |
exclude | string Additional data for transaction report. |
action_type | string Additional data for transaction and subscription reports. |
range_by | string Additional data for subscription report. |
export_type | string Additional data for audience, transaction and subscription reports. |
paying_customers | string Additional data for audience report. |
role | string Default: "consumer" The role of the user requesting report. |
unique | boolean Additional data for account-logins, transaction and subscription reports. |
curl -X POST https://staging-v2.inplayer.com/v2/reporting/schedule/{report_type} \ -H "Authorization:Bearer <token>" \ -d scheduled_at=2022-02-22 22:22:22 \ -d start_date_resolution=month \ -d start_date_resolution_before=1 \ -d scheduled_resolution=week \ -d scheduled_resolution_before=3 \ -d report_fields[]=Customer name \ -d report_fields[]=Created At
{- "code": 200,
- "message": "Report is scheduled for execution"
}
Stop scheduled/recurrent reports from execution.
report_id required | integer <number> Example: 23434 The ID of the report. |
curl https://staging-v2.inplayer.com/v2/reporting/schedule/delete/{report_id} \ -H "Authorization:Bearer <token>"
{- "code": 200,
- "message": "Scheduled report is deleted successfully"
}