The time at which the commit occurred. Any read with an equal or greater readTime is guaranteed to see the effects of the commit.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[],[],null,["# Method: projects.databases.documents.commit\n\nCommits a transaction, while optionally updating documents.\n\n### HTTP request\n\n`POST https://firestore.googleapis.com/v1/{database=projects/*/databases/*}/documents:commit`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------------|\n| `database` | `string` Required. The database name. In the format: `projects/{projectId}/databases/{databaseId}`. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"writes\": [ { object (/docs/firestore/reference/rest/v1/Write) } ], \"transaction\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `writes[]` | `object (`[Write](/docs/firestore/reference/rest/v1/Write)`)` The writes to apply. Always executed atomically and in order. |\n| `transaction` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` If set, applies all writes in this transaction, and commits it. A base64-encoded string. |\n\n### Response body\n\nThe response for [Firestore.Commit](/docs/firestore/reference/rest/v1/projects.databases.documents/commit#google.firestore.v1.Firestore.Commit).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------|\n| ``` { \"writeResults\": [ { object (/docs/firestore/reference/rest/v1/WriteResult) } ], \"commitTime\": string } ``` |\n\n| Fields ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `writeResults[]` | `object (`[WriteResult](/docs/firestore/reference/rest/v1/WriteResult)`)` The result of applying the writes. This i-th write result corresponds to the i-th write in the request. |\n| `commitTime` | `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` The time at which the commit occurred. Any read with an equal or greater `readTime` is guaranteed to see the effects of the commit. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. |\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 [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]