---
updatedAt: 2026-05-29T20:03:25.000Z
agentTools:
  projectIndex: https://docs.zype.com/llms.txt
---

# Update Subscription

# OpenAPI definition

```json
{
  "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"
      }
    }
  },
  "paths": {
    "/subscriptions": {
      "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’t 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 ‘canceled’, ‘active’ or ‘paused’ (Stripe only). If left empty, ‘active’ will be the default value. When ‘paused’, use ‘active’ 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 ‘canceled’, ‘active’ or ‘paused’ (Stripe only). If left empty, ‘active’ will be the default value. When ‘paused’, use ‘active’ to resume the cycle.",
                          "type": "string"
                        },
                        "days_remaining": {
                          "description": "When the status is ‘active’, the days remaining in the current cycle. When ‘canceled’, the value returned is 0. When ‘paused’ (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}": {
      "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{id}/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": {
      "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": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "title": "PlanResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "Plan",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "active": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "interval": {
                          "type": "string"
                        },
                        "interval_count": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "stripe_id": {
                          "type": "string"
                        },
                        "braintree_id": {
                          "type": "string"
                        },
                        "recurly_code": {
                          "type": "string"
                        },
                        "amazon_id": {
                          "type": "string"
                        },
                        "third_party_id": {
                          "type": "string"
                        },
                        "stripe_public_key": {
                          "type": "string"
                        },
                        "trial_period_days": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        },
                        "playlist_ids": {
                          "type": "array"
                        },
                        "entitlement_type": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Unprocessable Entity",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plans/{id}": {
      "get": {
        "summary": "View Plan",
        "description": "",
        "tags": [
          "Plans"
        ],
        "operationId": "getPlan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the record"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1plans/post/responses/201/content/application~1json/schema"
                }
              }
            }
          },
          "404": {
            "description": "Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "title": "NotFound",
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```