# Update Transaction Details

<mark style="color:green;">`POST`</mark> `https://{baseUrl}/api/v2/merchant/{merchantId}/updateTransactionDetails`

The **Authorization Header** is required if JWT (JSON Web Token) authentication is enabled in the application configuration (`config.server.jwt_enable` is `true`). This header must contain a valid JWT token prefixed with the word "Bearer". The token is used to authenticate the request and verify that the sender is authorized to perform the requested operation.

The **Request Body** must be an array containing exactly one object. This object includes the details for updating a transaction.

This endpoint is used to update the transaction details for a specific merchant identified by `merchantId`. The update is performed on the transaction record based on the provided `txShieldOICartReference`. The updated transaction details are stored in MongoDB and, if applicable, in AWS DynamoDB.

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### Path Parameters&#x20;

| Name         | Description                        |
| ------------ | ---------------------------------- |
| `merchantId` | Merchant Id for update transaction |

### **Body**

<table data-full-width="true"><thead><tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>txShieldOICartReference</code></td><td>String</td><td>True</td><td>A unique reference for the transaction that needs to be updated. This is a mandatory field.</td></tr></tbody></table>

## Update Transaction Details

> Update Merchant Transaction based on the txShieldOICartReference

```json
{"openapi":"3.0.1","info":{"title":"TxFind API's Version 2 Endpoints","version":"2.0.0"},"tags":[{"name":"Merchant","description":"Call related to merchant transaction."}],"servers":[{"url":"https://{baseUrl}","description":"Current server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/api/v2/merchant/{merchantId}/updateTransactionDetails":{"post":{"tags":["Merchant"],"summary":"Update Transaction Details","description":"Update Merchant Transaction based on the txShieldOICartReference","operationId":"merchantUpdateTransactionDetails","parameters":[{"name":"merchantId","in":"path","description":"Merchant Id for update transaction","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","required":["txShieldOICartReference"],"properties":{"txShieldOICartReference":{"type":"string","description":"The unique reference for the transaction to be updated."},"cardBin":{"type":"string","description":"First 6 or 8 digits of the card used in the transaction."},"cardLast4":{"type":"string","description":"Last 4 digits of the card used in the transaction."},"receipt":{"type":"object","properties":{"productsPurchasedList":{"type":"array","items":{"type":"object","properties":{"productDescription":{"type":"string","description":"Updated description of the product."},"deliveryDetails":{"type":"object","properties":{"deliveryStatus":{"type":"string","description":"Updated status of the delivery."},"dateOfShipment":{"type":"string","format":"date-time","description":"Updated date the item was shipped."}}}}}}}},"customerInformation":{"type":"object","properties":{"emailAddress":{"type":"string","format":"email","description":"Updated customer email address."}}}}}}}}},"responses":{"200":{"description":"Successful update","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"msg":{"type":"string"},"txShieldOICartReference":{"type":"string"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"500":{"description":"Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}
```
