[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-19 UTC."],[[["\u003cp\u003eInitiates a new transaction within a specified Firestore database.\u003c/p\u003e\n"],["\u003cp\u003eUses a \u003ccode\u003ePOST\u003c/code\u003e request to the URL \u003ccode\u003ehttps://firestore.googleapis.com/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction\u003c/code\u003e, where the database path is required.\u003c/p\u003e\n"],["\u003cp\u003eThe request body can include transaction \u003ccode\u003eoptions\u003c/code\u003e, which defaults to a read-write transaction if unspecified.\u003c/p\u003e\n"],["\u003cp\u003eUpon success, the response contains a base64-encoded \u003ccode\u003etransaction\u003c/code\u003e string, representing the started transaction.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires either the \u003ccode\u003ehttps://www.googleapis.com/auth/datastore\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.databases.documents.beginTransaction\n\nStarts a new transaction.\n\n### HTTP request\n\n`POST https://firestore.googleapis.com/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nThe response for [Firestore.BeginTransaction](/firestore/docs/reference/rest/v1beta1/projects.databases.documents/beginTransaction#google.firestore.v1beta1.Firestore.BeginTransaction).\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/datastore`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]