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

# Redeem an available Redemption Code

# 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"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "OAuth access token",
        "description": "OAuth access token of the consumer"
      }
    }
  },
  "paths": {
    "/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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/redemption_codes": {
      "post": {
        "summary": "Create Redemption Codes",
        "description": "",
        "tags": [
          "Redemption Codes"
        ],
        "operationId": "createRedemptionCode",
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "RedemptionCodeRequest",
                "type": "object",
                "required": [
                  "redemption_code"
                ],
                "properties": {
                  "redemption_code": {
                    "type": "object",
                    "title": "RedemptionCodeProperties",
                    "required": [
                      "code",
                      "expiration_date"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "description": "Use this param to specify your own code. If no code is sent, one will automatically be generated."
                      },
                      "expiration_date": {
                        "type": "string",
                        "description": "Expiration date for the redemption code. Example: 2017-01-15."
                      },
                      "video_id": {
                        "type": "string",
                        "description": "The ID of the video that the user will be entitled to upon redeeming the code. Required if the redemption code is for a video."
                      },
                      "playlist_id": {
                        "type": "string",
                        "description": "The ID of the playlist that the user will be entitled to upon redeeming the code. Required if the redemption code is for a playlist."
                      },
                      "plan_id": {
                        "type": "string",
                        "description": "The ID of the subscription plan that the user will be subscribed to upon redeeming the code. Required if the redemption code is for a subscription."
                      },
                      "pass_plan_id": {
                        "type": "string",
                        "description": "The ID of the pass plan that the user will have access to upon redeeming the code. Required if the redemption code is for a pass plan."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "title": "RedemptionCodeResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "RedemptionCode",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "content_title": {
                          "type": "string"
                        },
                        "content_type": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "redeemed_at": {
                          "type": "string"
                        },
                        "site_id": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        },
                        "nice_code": {
                          "type": "string"
                        },
                        "available": {
                          "type": "string"
                        },
                        "redeemed": {
                          "type": "string"
                        },
                        "expired": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string"
                        },
                        "expiration_date": {
                          "type": "string"
                        },
                        "video_id": {
                          "type": "string"
                        },
                        "pass_plan_id": {
                          "type": "string"
                        },
                        "plan_id": {
                          "type": "string"
                        },
                        "playlist_id": {
                          "type": "string"
                        },
                        "transaction_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
                }
              }
            }
          }
        }
      }
    },
    "/redemption_codes/redeem": {
      "post": {
        "summary": "Redeem an available Redemption Code",
        "description": "",
        "tags": [
          "Redemption Codes"
        ],
        "operationId": "redeem",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "RedemptionCodeRedeemRequest",
                "type": "object",
                "required": [
                  "redemption_code"
                ],
                "properties": {
                  "redemption_code": {
                    "type": "object",
                    "title": "RedemptionCodeRedeemProperties",
                    "required": [
                      "code"
                    ],
                    "properties": {
                      "code": {
                        "description": "Code of the Redemption Code",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1redemption_codes/post/responses/201/content/application~1json/schema"
                }
              }
            }
          },
          "404": {
            "description": "Redemption Code 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"
                }
              }
            }
          }
        }
      }
    }
  }
}
```