# Crypto transaction fees API

## Returns average withdrawal fee for a network.

> Returns the average technical withdrawal fee for the requested crypto network.\
> \
> This endpoint helps merchants estimate the expected transaction cost before initiating a\
> withdrawal. The value is calculated from recent blockchain transactions collected by the\
> gateway.

```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__network-Network--avgTransactionCostUsd-string__":{"description":"The AppSuccessResponse object contains general information about the success execution.","properties":{"success":{"type":"boolean","default":true},"data":{"properties":{"avgTransactionCostUsd":{"type":"string"},"network":{"$ref":"#/components/schemas/Network"}},"required":["avgTransactionCostUsd","network"],"type":"object"}},"required":["success","data"],"type":"object","additionalProperties":false},"Network":{"type":"string","enum":["bahamut","bitcoin","bnb_smart_chain","ethereum","polygon","solana","tron"],"description":"Represents supported cryptocurrency networks in the payment processing system.\n\nUsed to specify which blockchain network a cryptocurrency transaction relates to.\n\nEach network supports its own native cryptocurrency (e.g. BTC, ETH, TRX).\n\nTransactions must be processed differently based on network since each cryptocurrency functions\nindependently. Records of transactions and account balances are also maintained separately by\nnetwork."},"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},"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."},"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},"AppValidationErrorResponse":{"description":"The AppValidationErrorResponse object contains general information about the validation error.","properties":{"success":{"type":"boolean","default":false},"errors":{"items":{},"type":"array"}},"required":["success","errors"],"type":"object","additionalProperties":false}}},"paths":{"/withdrawal/avg-transaction-cost/{network}":{"get":{"operationId":"GetAverageWithdrawalFeeAsync","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSuccessResponse__network-Network--avgTransactionCostUsd-string__"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppAuthenticationErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppValidationErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}}},"description":"Returns the average technical withdrawal fee for the requested crypto network.\n\nThis endpoint helps merchants estimate the expected transaction cost before initiating a\nwithdrawal. The value is calculated from recent blockchain transactions collected by the\ngateway.","summary":"Returns average withdrawal fee for a network.","tags":["Withdrawal"],"parameters":[{"description":"- The blockchain network identifier, e.g. `bitcoin`, `ethereum`, `tron`.","in":"path","name":"network","required":true,"schema":{"$ref":"#/components/schemas/Network"}}]}}}}
```
