Every API here is available over the APIs.io API and to AI agents over MCP.
{
"openapi": "3.0.1",
"info": {
"title": "Monetization",
"version": "1.0.0",
"description": ""
},
"servers": [
{
"url": "https://api.zype.com/"
}
],
"security": [
{
"api_key": []
}
],
"components": {
"securitySchemes": {
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "query"
},
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "OAuth access token",
"description": "OAuth access token of the consumer"
}
}
},
"paths": {
"/subscriptions": {
"get": {
"summary": "List Subscriptions",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "listSubscriptions",
"parameters": [
{
"name": "id",
"$ref": "#/paths/~1plans/get/parameters/0"
},
{
"name": "created_at",
"$ref": "#/paths/~1plans/get/parameters/1"
},
{
"name": "updated_at",
"in": "query",
"schema": {
"type": "string"
},
"description": "Filter records by updated at date using times in ISO8601 format (Example: `2017-01-01T00:00:00-00:00`) or Unix timestamps (Example: `1483228800`) **Note**: Range filters can be applied by adding a suffix: \u2018.gt\u2019, \u2018.gte\u2019, \u2018.lt\u2019, \u2018lte\u2019 (Example: `updated_at.gte`)"
},
{
"name": "q",
"$ref": "#/paths/~1plans/get/parameters/2"
},
{
"name": "order",
"$ref": "#/paths/~1plans/get/parameters/3"
},
{
"name": "sort",
"$ref": "#/paths/~1plans/get/parameters/4"
},
{
"name": "page",
"$ref": "#/paths/~1plans/get/parameters/5"
},
{
"name": "per_page",
"$ref": "#/paths/~1plans/get/parameters/6"
},
{
"name": "plan_id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "ID of Plan"
},
{
"name": "braintree_id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Filter by the consumer's Braintree ID"
},
{
"name": "recurly_code",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Filter by the consumer's Recurly Code"
},
{
"name": "stripe_id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Filter by the consumer's Stripe ID"
},
{
"name": "consumer_id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "ID of consumer"
},
{
"name": "receipt_id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Receipt ID of Amazon Fire TV"
},
{
"name": "payment_provider",
"in": "query",
"description": "Filter records by payment provider.",
"schema": {
"type": "string",
"enum": [
"stripe",
"braintree",
"recurly",
"redemption",
"third_party",
"amazon_fire",
"google_play",
"itunes",
"samsung",
"tizen",
"roku"
]
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"title": "SubscriptionsResponse",
"type": "object",
"properties": {
"response": {
"type": "array",
"items": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema/properties/response"
}
}
}
}
}
}
}
}
},
"post": {
"summary": "Create a Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "createSubscription",
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"title": "SubscriptionRequest",
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Use this parameter to indicate the subscription type ('stripe', 'braintree' or 'recurly'). This value is **required only** when the subscription type cannot be inferred automatically via its specific attributes (for example when creating a Stripe subscription with a 100% discount coupon where no stripe_id or stripe_card_token is passed)."
},
"subscription": {
"title": "SubscriptionProperties",
"required": [
"plan_id",
"consumer_id"
],
"type": "object",
"properties": {
"consumer_id": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"third_party_id": {
"description": "The id of a third party plan. required if not using recurly, braintree or stripe.\n*Note*: third_party_id can\u2019t have unicode characters in the name. Only alphanumeric characters are allowed (Example: apple123)",
"type": "string"
},
"coupon_code": {
"description": "The code of the coupon, if used.",
"type": "string"
},
"stripe_card_token": {
"description": "The Stripe credit card token as generated by a Stripe payment form",
"type": "string"
},
"stripe_id": {
"description": "The id of a Stripe subscription that has already been fully created (used for reconciling the Zype dashboard with subscriptions that have been previously created)",
"type": "string"
},
"stripe_metadata": {
"description": "Custom Stripe Metadata can be added, updated, and removed from Zype Subscription objects corresponding to a Stripe Subscription. Metdata will be persisted in Stripe and Zype Platforms.\nTo add or update Stripe metadata use URL or JSON syntax: `subscription[stripe_metadata]key1=value1&subscripition[stripe_metadata]key2=value2`\nTo remove a Stripe metadata key/value pair, include the key to be removed, but do not set a value: `subscription[stripe_metadata]key1&subscripition[stripe_metadata]key2`",
"type": "object"
},
"braintree_payment_nonce": {
"description": "The Braintree credit card payment nonce as generated by a Braintree payment form",
"type": "string"
},
"braintree_id": {
"description": "The id of a Braintree subscription that has already been fully created (used for reconciling the Zype dashboard with subscriptions that have been previously created)",
"type": "string"
},
"recurly_token_id": {
"description": "The Recurly credit card token ID by a Recurly.js payment form",
"type": "string"
},
"recurly_uuid": {
"description": "The uuid of a Recurly subscription that has already been fully created (used for reconciling the Zype dashboard with subscriptions that have been previously created)",
"type": "string"
},
"status": {
"description": "Valid values are \u2018canceled\u2019, \u2018active\u2019 or \u2018paused\u2019 (Stripe only). If left empty, \u2018active\u2019 will be the default value. When \u2018paused\u2019, use \u2018active\u2019 to resume the cycle.",
"type": "string"
},
"cancelled_at": {
"description": "If the subscription has already been cancelled at a certain date",
"type": "string"
},
"cancel_at_period_end": {
"description": "Set Stripe subscription to cancel at period end (Stripe only)",
"type": "boolean"
},
"trial_end": {
"description": "Unix timestamp to set Stripe subscription's trial_end value (Stripe only). Overrides Zype's trialing logic.",
"type": "string"
},
"trial_from_plan": {
"description": "Set Stripe subscription's trial_from_plan (Stripe only). Overrides Zype's trialing logic.",
"type": "boolean"
},
"current_period_start_at": {
"description": "Set the beginning of the subscription period. *Only applies to Recurly and third party subscriptions* Either `current_period_start_at` or `current_period_end_at` should be set, *but not both*.",
"type": "string"
},
"current_period_end_at": {
"description": "Set the end of the subscription period. *Only applies to third party subscriptions* (`third_party_id` field should be present). Either `current_period_start_at` or `current_period_end_at` should be set, *but not both*.",
"type": "string"
}
}
}
}
}
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"title": "SubscriptionResponse",
"type": "object",
"properties": {
"response": {
"title": "Subscription",
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"amount": {
"description": "Amount the subscription costs (3.99)",
"type": "integer"
},
"created_at": {
"type": "string"
},
"currency": {
"description": "will match the Plan's currency",
"type": "string"
},
"current_period_end_at": {
"type": "string"
},
"current_period_start_at": {
"type": "string"
},
"discount_amount": {
"type": "number"
},
"discount_duration": {
"type": "string",
"description": "How long the discount will be valid"
},
"discount_duration_months": {
"description": "How many months the discount will be valid",
"type": "number"
},
"discount_percent": {
"description": "Percentage off total price",
"type": "number"
},
"mrr": {
"description": "Monthly Recurring Revenue",
"type": "number"
},
"site_id": {
"type": "string"
},
"start_at": {
"type": "string"
},
"trial_period_days": {
"description": "Number of days a trial will last",
"type": "number"
},
"updated_at": {
"type": "string"
},
"plan_name": {
"type": "string"
},
"consumer_id": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"third_party_id": {
"type": "string"
},
"stripe_card_token": {
"description": "The Stripe credit card token as generated by a Stripe payment form",
"type": "string"
},
"stripe_id": {
"type": "string"
},
"braintree_payment_nonce": {
"type": "string"
},
"braintree_id": {
"type": "string"
},
"recurly_token_id": {
"type": "string"
},
"recurly_uuid": {
"type": "string"
},
"status": {
"description": "Valid values are \u2018canceled\u2019, \u2018active\u2019 or \u2018paused\u2019 (Stripe only). If left empty, \u2018active\u2019 will be the default value. When \u2018paused\u2019, use \u2018active\u2019 to resume the cycle.",
"type": "string"
},
"days_remaining": {
"description": "When the status is \u2018active\u2019, the days remaining in the current cycle. When \u2018canceled\u2019, the value returned is 0. When \u2018paused\u2019 (Stripe only), the days remaining before pausing.",
"type": "integer"
},
"cancelled_at": {
"type": "string"
},
"cancel_at_period_end": {
"description": "Set Stripe subscription to cancel at period end",
"type": "boolean"
},
"coupon_code": {
"description": "The code of the coupon, if used.",
"type": "string"
},
"payment_provider": {
"type": "string"
}
}
}
}
}
}
}
},
"422": {
"description": "Unprocessable entity",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
}
}
}
}
}
}
},
"/subscriptions/{id}": {
"get": {
"summary": "View Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "getSubscription",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of the subscription"
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema"
}
}
}
},
"404": {
"description": "Subscription not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans~1%7Bid%7D/get/responses/404/content/application~1json/schema"
}
}
}
}
}
},
"put": {
"summary": "Update Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "updateSubscription",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of the subscription"
}
],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/requestBody/content/application~1json/schema"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema"
}
}
}
},
"404": {
"description": "Subscription not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans~1%7Bid%7D/get/responses/404/content/application~1json/schema"
}
}
}
},
"422": {
"description": "Unprocessable entity",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
}
}
}
}
}
},
"delete": {
"summary": "Delete Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "deleteSubscription",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of the subscription"
}
],
"responses": {
"204": {
"description": "Subscription successfully deleted",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema"
}
}
}
},
"404": {
"description": "Subscription not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans~1%7Bid%7D/get/responses/404/content/application~1json/schema"
}
}
}
}
}
}
},
"/subscriptions/{id}/cancel": {
"put": {
"summary": "Cancel Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "cancelSubscription",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of the subscription"
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema"
}
}
}
},
"404": {
"description": "Subscription not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans~1%7Bid%7D/get/responses/404/content/application~1json/schema"
}
}
}
},
"422": {
"description": "Unprocessable entity",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
}
}
}
}
}
}
},
"/subscriptions/{id}/reactivate": {
"put": {
"summary": "Reactivate Cancelled Subscription",
"description": "",
"tags": [
"Subscriptions"
],
"operationId": "reactivateSubscription",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of the subscription"
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1subscriptions/post/responses/201/content/application~1json/schema"
}
}
}
},
"404": {
"description": "Subscription not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans~1%7Bid%7D/get/responses/404/content/application~1json/schema"
}
}
}
},
"422": {
"description": "Unprocessable entity",
"content": {
"application/json": {
"schema": {
"$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
}
}
}
}
}
}
},
"/plans": {
"get": {
"summary": "List Plans",
"description": "",
"tags": [
"Plans"
],
"operationId": "listPlans",
"parameters": [
{
"name": "id",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Filter by ID\nExample: `id=5992f328ce593000ef000008`"
},
{
"name": "created_at",
"in": "query",
"schema": {
"type": "string"
},
"description": "Filter records by created date using times in ISO8601 format (Example: `2017-01-01T00:00:00-00:00`) or Unix timestamps (Example: `1483228800`) **Note**: Range filters can be applied by adding a suffix: \u2018.gt\u2019, \u2018.gte\u2019, \u2018.lt\u2019, \u2018lte\u2019 (Example: `created_at.gte`)"
},
{
"name": "q",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Filter by keyword"
},
{
"name": "order",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"asc",
"desc"
]
},
"description": "Filter by ascending or descending order"
},
{
"name": "sort",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Sort on the specified field"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer"
},
"description": "Page number to return, with per_page dictating page size"
},
{
"name": "per_page",
"in": "query",
"required": false,
"schema": {
"type": "integer"
},
"description": "Number of records to return per page"
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"title": "PlansResponse",
"type": "object",
"properties": {
"response": {
"type": "array",
"items": {
"$ref": "#/paths/~1plans/post/responses/201/content/application~1json/schema/properties/response"
},
"description": ""
},
"pagination": {
"title": "Pagination",
"type": "object",
"properties": {
"current": {
"type": "number",
"format": "int32",
"description": "The current page of results"
},
"previous": {
"type": "number",
"format": "int32",
"description": "the previous page of results",
"nullable": true
},
"next": {
"type": "number",
"format": "int32",
"description": "the next page of results",
"nullable": true
},
"per_page": {
"type": "number",
"format": "int32",
"description": "the number of results returned per page"
},
"pages": {
"type": "number",
"format": "int32",
"description": "the total number of pages available, using per_page"
}
},
"example": {
"current": 1,
"previous": null,
"next": 2,
"per_page": 10,
"pages": 20
}
}
}
}
}
}
}
}
},
"post": {
"summary": "Create Plan",
"description": "",
"operationId": "createPlan",
"tags": [
"Plans"
],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"title": "PlanRequest",
"type": "object",
"required": [
"plan"
],
"properties": {
"plan": {
"required": [
"name",
"amount",
"interval_count",
"currency",
"interval",
"entitlement_type"
],
"type": "object",
"title": "PlanProperties",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"amount": {
"type": "integer",
"format": "double",
"description": "The amount to charge to subscribe to this Plan"
},
"currency": {
"type": "string"
},
"interval": {
"type": "string",
"description": "The unit of time a subscriptions should last before the next charge cycle (`month`, `year`, `lifetime`)"
},
"interval_count": {
"type": "integer",
"description": "How many intervals a subscription should last before the next charge cycle"
},
"trial_period_days": {
"type": "integer",
"description": "How many trial days to provide for the subscription (only for Stripe, Braintree or Recurly Plans)"
},
"active": {
"type": "boolean",
"description": "Indicates if the plan is active"
},
"stripe_id": {
"type": "string",
"description": "The Stripe Plan ID to use for this Plan - **Required for Stripe Plans**"
},
"braintree_id": {
"type": "string",
"description": "The Braintree Plan ID to use for this Plan - **Required for Braintree Plans**"
},
"recurly_code": {
"type": "string",
"description": "The Braintree Plan Code to use for this Plan - **Required for Recurly Plans**"
},
"amazon_id": {
"type": "string",
"description": "The Amazon Plan ID to use for this Plan - **Required for Amazon Plans**"
},
"third_party_id": {
"type": "string",
"description": "An ID from a third-party payment gateway to use for this Plan"
},
"entitlement_type": {
"type": "string",
"description": "The entitlement type for this Plan, used to change configure a plan as global or tiered (`global`, `tiered`) - Default: `global`"
},
"playlist_ids": {
"type": "string",
"description": "A list of Playlist IDs to associate with a Tiered Plan - **Required for `entitlement_type: tiered`**"
}
}
}
}
}
}
}
},
"responses": {
"201": {
"description
# --- truncated at 32 KB (105 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zype/refs/heads/main/openapi/zype-monetization.json