# Actualizar desde hash de tx

### Requisitos de uso:

* Debe tener el `txHash` generado a partir de una transacción enviada directamente a la red Stellar.
* Los datos de escrow asociados con este `txHash` ya deben existir en la cola interna.

### Encabezados

<table><thead><tr><th width="366">Nombre</th><th>Valor</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>

### Flujo de trabajo:

1. El XDR se obtiene de cualquier transacción (no firmada) generada con cualquiera de los endpoints de nuestra API REST.
2. Se genera y devuelve un XDR no firmado.
3. El XDR se firma externamente y se envía directamente a Stellar.
4. Se recupera el resultado `txHash` is retrieved.
5. El `txHash` se envía a `/indexer/update-from-txHash`.
6. La información de escrow se recupera de la cola interna y se almacena en 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"]}}}}
```

### Ejemplo de uso:

```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/v1-es/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.
