{
  "openapi": "3.0.0",
  "info": {
    "title": "x-gateway-external-api",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.xgateway.tech/api/v2"
    }
  ],
  "paths": {
    "/transaction/{transactionId}": {
      "get": {
        "operationId": "GetTransactionDataAsync",
        "responses": {
          "200": {
            "description": "Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSuccessResponse_ITransactionData_"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "data": {
                        "senderDetails": {
                          "senderIban": "GB29NWBK60161331926819",
                          "senderAccountNumber": "31926819",
                          "senderSortCode": "601613"
                        },
                        "amount": "0.01",
                        "applicationId": null,
                        "currency": "eUSDC",
                        "customerId": "auto_test_x123456y-9876-12ab-c345-x3y76zuvw4kl",
                        "hash": "AbXyZ12MnOpQR34stUV56WxYZ78+/aBCDeFgHIJklMNOpQrST90vwXYzaBCDeFgHIJklMNOpQrST90vwXYzaBCDeFgHIJ",
                        "id": "a1b2c3d4-5678-4efa-bcde-123456789abc",
                        "invoiceId": "f1e2d3c4-1234-4abc-b567-89abcdef0123",
                        "network": "ethereum",
                        "orderId": "autotest_orderId_USD_a1b2c3d4-5678-4efa-bcde-123456789abc",
                        "status": "confirmed",
                        "transactionHash": "0xa1b2c3d4e5f60789abcdef1234567890a1b2c3d4e5f60789abcdef1234567890",
                        "type": "deposit",
                        "createdAt": "2024-01-15T10:30:00.000Z",
                        "updatedAt": "2024-01-15T10:35:00.000Z",
                        "info": {
                          "exchangeRate": "1",
                          "referenceAmount": "0.01",
                          "referenceCurrency": "USD",
                          "referenceExchangeRate": "1",
                          "transactionAmount": "0.01",
                          "transactionCurrency": "eUSDC",
                          "invoiceBaseAmount": "1",
                          "invoiceBaseCurrency": "USD",
                          "transactionAmountBaseCurrency": "0.01"
                        },
                        "fees": {
                          "processing": "0.00004",
                          "technical": "0.3437"
                        },
                        "eur": "0",
                        "usd": "0.01",
                        "additionalParams": {
                          "utr": "111111111111",
                          "bankTransferRefund": null
                        }
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "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.\r\n\r\nAccess to this endpoint requires a valid API key. The API key is sent in the `x-api-key` header on requests.",
        "tags": [
          "Transaction"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "transactionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "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."
      },
      "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
      },
      "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
      },
      "AppAuthenticationErrorResponse": {
        "description": "The AppAuthenticationErrorResponse object contains general information about the authentication\r\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
      },
      "ISenderDetailsInCamelCase": {
        "properties": {
          "senderIban": {
            "type": "string"
          },
          "senderAccountNumber": {
            "type": "string"
          },
          "senderSortCode": {
            "type": "string"
          }
        },
        "required": [
          "senderIban",
          "senderAccountNumber",
          "senderSortCode"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "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
      },
      "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"
      },
      "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
      },
      "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"
          }
        ]
      },
      "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
      },
      "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
      }
    },
    "securitySchemes": {
      "api_key": {
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      }
    }
  }
}