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

# Update a Transaction

# 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": {
    "/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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transactions": {
      "post": {
        "summary": "Create Transactions",
        "description": "",
        "tags": [
          "Transactions"
        ],
        "operationId": "createTransaction",
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "TransactionRequest",
                "type": "object",
                "required": [
                  "provider",
                  "transaction"
                ],
                "properties": {
                  "provider": {
                    "type": "string",
                    "description": "The type of transaction to create. Valid values include ‘stripe’, ‘braintree’, ‘recurly’, ‘roku’, ‘apple_tv’ and ‘third_party’"
                  },
                  "transaction": {
                    "title": "TransactionProperties",
                    "type": "object",
                    "properties": {
                      "amount": {
                        "description": "Must be formatted as a string included cent value (Example: 1.99)",
                        "type": "string"
                      },
                      "apple_id": {
                        "description": "The ID of a native Apple TV payment, use only for storing Apple TV transactions",
                        "type": "string"
                      },
                      "braintree_id": {
                        "description": "Used to create transactions from payments already processed by Braintree, use only for creating Braintree transactions, and if not supplying a payment nonce",
                        "type": "string"
                      },
                      "consumer_id": {
                        "type": "string",
                        "description": "The ID of the consumer making the transaction"
                      },
                      "currency": {
                        "type": "string",
                        "description": "Set currency type. This is optional. Default value is `USD`"
                      },
                      "description": {
                        "type": "string"
                      },
                      "pass_plan_id": {
                        "description": "The ID of the pass plan the user is purchasing if purchasing a pass plan. Required if the transaction is for a pass plan",
                        "type": "string"
                      },
                      "payment_nonce": {
                        "description": "The payment nonce provided by Stripe, Braintree or Recurly if using one of those platforms",
                        "type": "string"
                      },
                      "playlist_id": {
                        "description": "The ID of the playlist the user is purchasing if purchasing a playlist. Required if the transaction is for a playlist",
                        "type": "string"
                      },
                      "recurly_invoice_number": {
                        "description": "Used to create transactions from invoices already processed by Recurly, use only for creating Recurly transactions, and if not supplying a payment nonce",
                        "type": "string"
                      },
                      "roku_id": {
                        "description": "The ID of a native Roku payment, use only for storing Roku transactions",
                        "type": "string"
                      },
                      "stripe_id": {
                        "description": "Used to create transactions from payments already processed by Stripe, use only for creating Stripe transactions, and if not supplying a payment nonce",
                        "type": "string"
                      },
                      "third_party_id": {
                        "description": "The ID of a payment processsed by a ‘third party’ payment processor, use only for creating ‘third party’ custom transactions",
                        "type": "string"
                      },
                      "transaction_type": {
                        "description": "Must be one of:\n  + purchase\n  + rental\n  + pass",
                        "type": "string"
                      },
                      "video_id": {
                        "description": "The ID of the video the user is purchasing if purchasing a video. Required if the transaction is for a video",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "title": "TransactionResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "Transaction",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "site_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "stripe_id": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "consumer_id": {
                          "type": "string"
                        },
                        "video_id": {
                          "type": "string"
                        },
                        "playlist_id": {
                          "type": "string"
                        },
                        "pass_plan_id": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "transaction_type": {
                          "type": "string"
                        },
                        "payment_nonce": {
                          "type": "string"
                        },
                        "roku_id": {
                          "type": "string"
                        },
                        "apple_id": {
                          "type": "string"
                        },
                        "braintree_id": {
                          "type": "string"
                        },
                        "recurly_invoice_number": {
                          "type": "string"
                        },
                        "third_party_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1plans/post/responses/422/content/application~1json/schema"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/{id}": {
      "put": {
        "summary": "Update a Transaction",
        "description": "",
        "tags": [
          "Transactions"
        ],
        "operationId": "updateTransaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the transaction"
          }
        ],
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/paths/~1transactions/post/requestBody/content/application~1json/schema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1transactions/post/responses/201/content/application~1json/schema"
                }
              }
            }
          },
          "404": {
            "description": "Transaction 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"
                }
              }
            }
          }
        }
      }
    }
  }
}
```