# Deposit data confirmation

When a deposit is received, and the merchant is sent the corresponding callback, it is highly recommended to double check the deposit data using a direct call to the API.

{% hint style="danger" %}
Due to security risks, merchants *must* use our API to request transaction details. XGateway is not liable for issues caused by relying only on callback data.
{% endhint %}

The API can look up information for the following transactions in CONFIRMED, FAILED and PROCESSING (deposits only) status:

1. Deposit
2. Withdrawal
3. Chargeback
4. Settlement

## GET /transaction/{transactionId}

> Retrieves transaction details to the authenticated merchant by transaction ID.\
> \
> Access to this endpoint requires a valid API key. The API key is sent in the \`x-api-key\` header on requests.

```json
{"openapi":"3.0.0","info":{"title":"x-gateway-external-api","version":"0.0.1"},"servers":[{"url":"https://api.xgateway.tech/api/v2"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"AppSuccessResponse_ITransactionData_":{"description":"The AppSuccessResponse object contains general information about the success execution.","properties":{"success":{"type":"boolean","default":true},"data":{"$ref":"#/components/schemas/ITransactionData"}},"required":["success","data"],"type":"object","additionalProperties":false},"ITransactionData":{"properties":{"senderDetails":{"allOf":[{"$ref":"#/components/schemas/ISenderDetailsInCamelCase"}],"nullable":true},"hash":{"type":"string"},"amount":{"type":"string"},"applicationId":{"type":"string","nullable":true},"currency":{"type":"string"},"customerId":{"type":"string"},"id":{"type":"string"},"invoiceId":{"type":"string","nullable":true},"network":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"status":{"type":"string"},"transactionHash":{"type":"string","nullable":true},"type":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"info":{"properties":{"transactionAmountBaseCurrency":{"type":"string","nullable":true},"invoiceBaseCurrency":{"type":"string","nullable":true},"invoiceBaseAmount":{"type":"string","nullable":true},"transactionCurrency":{"type":"string"},"transactionAmount":{"type":"string"},"referenceExchangeRate":{"type":"string"},"referenceCurrency":{"type":"string"},"referenceAmount":{"type":"string"},"exchangeRate":{"type":"string","nullable":true}},"required":["transactionAmountBaseCurrency","invoiceBaseCurrency","invoiceBaseAmount","transactionCurrency","transactionAmount","referenceExchangeRate","referenceCurrency","referenceAmount","exchangeRate"],"type":"object"},"fees":{"properties":{"technical":{"type":"string","nullable":true},"processing":{"type":"string","nullable":true}},"required":["technical","processing"],"type":"object"},"eur":{"type":"string"},"usd":{"type":"string"},"additionalParams":{"$ref":"#/components/schemas/AdditionalParams"}},"required":["senderDetails","hash","amount","applicationId","currency","customerId","id","invoiceId","network","orderId","status","transactionHash","type","createdAt","updatedAt","info","fees","eur","usd","additionalParams"],"type":"object","additionalProperties":false},"ISenderDetailsInCamelCase":{"properties":{"senderIban":{"type":"string"},"senderAccountNumber":{"type":"string"},"senderSortCode":{"type":"string"}},"required":["senderIban","senderAccountNumber","senderSortCode"],"type":"object","additionalProperties":false},"AdditionalParams":{"anyOf":[{"$ref":"#/components/schemas/PayToMAdditionalParams"},{"$ref":"#/components/schemas/FlowpayAdditionalParams"},{"$ref":"#/components/schemas/MultiPayAdditionalParams"},{"$ref":"#/components/schemas/XGatewayAdditionalParams"},{"$ref":"#/components/schemas/UnblockAdditionalParams"},{"$ref":"#/components/schemas/Pay2PlayAdditionalParams"},{"$ref":"#/components/schemas/CardPaymentAdditionalParams"}]},"PayToMAdditionalParams":{"properties":{"utr":{"type":"string","nullable":true}},"required":["utr"],"type":"object","additionalProperties":false},"FlowpayAdditionalParams":{"properties":{},"type":"object","additionalProperties":false},"MultiPayAdditionalParams":{"properties":{},"type":"object","additionalProperties":false},"XGatewayAdditionalParams":{"properties":{"coveredDepositIds":{"items":{"type":"string"},"type":"array"}},"type":"object","additionalProperties":false},"UnblockAdditionalParams":{"properties":{"bankTransferRefund":{"type":"string","nullable":true}},"required":["bankTransferRefund"],"type":"object","additionalProperties":false},"Pay2PlayAdditionalParams":{"properties":{},"type":"object","additionalProperties":false},"CardPaymentAdditionalParams":{"properties":{"customer":{"$ref":"#/components/schemas/Partial__email-string--fullname-string--phone-string--country-string--city-string__"},"paymentMethodDetails":{"$ref":"#/components/schemas/Partial__customerAccountNumber-string--cardType-string--cardExpiryYear-string--cardholderName-string--cardExpiryMonth-string--cardIssuingCountryCode-string__"},"billingAddress":{"$ref":"#/components/schemas/Partial__city-string--state-string--postalCode-string--addressLine-string--countryCode-string__"},"rejectionReason":{"type":"string"}},"required":["customer","paymentMethodDetails"],"type":"object","additionalProperties":false},"Partial__email-string--fullname-string--phone-string--country-string--city-string__":{"properties":{"email":{"type":"string"},"fullname":{"type":"string"},"phone":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"}},"type":"object","description":"Make all properties in T optional"},"Partial__customerAccountNumber-string--cardType-string--cardExpiryYear-string--cardholderName-string--cardExpiryMonth-string--cardIssuingCountryCode-string__":{"properties":{"customerAccountNumber":{"type":"string"},"cardType":{"type":"string"},"cardExpiryYear":{"type":"string"},"cardholderName":{"type":"string"},"cardExpiryMonth":{"type":"string"},"cardIssuingCountryCode":{"type":"string"}},"type":"object","description":"Make all properties in T optional"},"Partial__city-string--state-string--postalCode-string--addressLine-string--countryCode-string__":{"properties":{"city":{"type":"string"},"state":{"type":"string"},"postalCode":{"type":"string"},"addressLine":{"type":"string"},"countryCode":{"type":"string"}},"type":"object","description":"Make all properties in T optional"},"AppErrorResponse":{"description":"The AppErrorResponse object contains general information about the error message.","properties":{"success":{"type":"boolean","default":false},"errors":{"items":{"$ref":"#/components/schemas/IAppError"},"type":"array"}},"required":["success","errors"],"type":"object","additionalProperties":false},"IAppError":{"description":"The IAppError interface represents an application error message.","properties":{"code":{"anyOf":[{"$ref":"#/components/schemas/AppClientErrorResponseCode"},{"$ref":"#/components/schemas/AppServerErrorResponseCode"}]},"message":{"type":"string"}},"required":["code","message"],"type":"object","additionalProperties":false},"AppClientErrorResponseCode":{"type":"string","enum":["bad_request","db_violation","unauthorized","payment_required","forbidden","not_found","method_not_allowed","not_acceptable","proxy_authentication_required","request_timeout","conflict","db_unique_violation","gone","length_required","precondition_failed","payload_too_large","uri_too_long","unsupported_media_type","range_not_satisfiable","expectation_failed","misdirected_request","unprocessable_content","db_non_null_violation","locked","failed_dependency","upgrade_required","precondition_required","too_many_requests","request_header_fields_too_large","unavailable_for_legal_reasons"],"nullable":false,"description":"The AppClientErrorResponseCode object contains all client error response codes."},"AppServerErrorResponseCode":{"type":"string","enum":["internal_server_error","not_implemented","bad_gateway","service_unavailable","gateway_timeout","http_version_not_supported","variant_also_negotiates","insufficient_storage","loop_detected","not_extended","network_authentication_required"],"nullable":false,"description":"The AppServerErrorResponseCode object contains all server error response codes."},"AppAuthenticationErrorResponse":{"description":"The AppAuthenticationErrorResponse object contains general information about the authentication\nerror.","properties":{"success":{"type":"boolean","default":false},"errors":{"items":{"$ref":"#/components/schemas/IAppError"},"type":"array","default":[{"code":"unauthorized","message":"You do not have permission to access this resource."}]}},"required":["success","errors"],"type":"object","additionalProperties":false}}},"paths":{"/transaction/{transactionId}":{"get":{"operationId":"GetTransactionDataAsync","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSuccessResponse_ITransactionData_"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppAuthenticationErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}}},"description":"Retrieves transaction details to the authenticated merchant by transaction ID.\n\nAccess to this endpoint requires a valid API key. The API key is sent in the `x-api-key` header on requests.","tags":["Transaction"],"parameters":[{"in":"path","name":"transactionId","required":true,"schema":{"type":"string"}}]}}}}
```
