# Update From Tx Hash

### Requirements for Use:

* You must have the valid `txHash` generated from a transaction sent directly to the Stellar network.
* The escrow data associated with this `txHash` must already exist in the internal queue.

### Headers

<table><thead><tr><th width="366">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>x-api-key</td><td><code>&#x3C;token></code></td></tr></tbody></table>

### Workflow:

1. The XDR is obtained from any transaction (not signed) generated with any of the endpoints of our REST API.
2. An unsigned XDR is generated and returned.
3. The XDR is signed externally and sent directly to Stellar.
4. The resulting `txHash` is retrieved.
5. The `txHash` is sent to `/indexer/update-from-txHash`.
6. The escrow information is retrieved from the internal queue and stored in Firebase.

### Open API

## PUT /indexer/update-from-txhash

>

```json
{"openapi":"3.0.0","info":{"title":"Trustless Work API","version":"1.0"},"security":[{}],"paths":{"/indexer/update-from-txhash":{"put":{"operationId":"IndexerController_updateFromTxHash","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveIndexedEscrowClass"}}}},"responses":{"200":{"description":"Returns the escrow object that was just saved/updated in the indexer and the success or failure of the response.","content":{"application/json":{}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized access"},"429":{"description":"Too Many Requests"},"500":{"description":"\n      <p>Possible errors:</p>\n      <ul>\n        <li>Error processing transaction b0e61d4...f1cb2d29: <error_message></li>\n        <li>An unexpected error occurred</li>\n      </ul>","content":{"application/json":{}}}},"tags":["Indexer"]}}},"components":{"schemas":{"SaveIndexedEscrowClass":{"type":"object","properties":{"txHash":{"type":"string","description":"Transaction hash"}},"required":["txHash"]}}}}
```

### Use Example:

```typescript
import axios from "axios";

const http = axios.create({
  baseURL: "https://dev.api.trustlesswork.com",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
    "x-api-key": your_api_key,
  },
});

export const updateEscrowFromTxHash = async (txHash) => {
  const response = await http.post("/indexer/update-from-txHash", { txHash });
  return response.data;
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/indexer/update-escrow-properties.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
