{
  "openapi": "3.0.0",
  "info": {
    "title": "x-gateway-external-api",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.xgateway.tech/api/v2"
    }
  ],
  "paths": {
    "/customer/{id}/bank-transfer/bank-account": {
      "post": {
        "operationId": "CreateBankTransferAccount",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSuccessResponse_CreateBankTransferAccountResponse_"
                },
                "examples": {
                  "EUR": {
                    "value": {
                      "data": {
                        "bic": "AAAAAA00",
                        "customerFirstName": "John",
                        "customerLastName": "Doe",
                        "country": "EE",
                        "currency": "EUR",
                        "iban": "EE000000000000000000",
                        "status": "ACTIVE"
                      },
                      "success": true
                    }
                  },
                  "Example 1": {
                    "value": {
                      "data": {
                        "accountNumber": "00000000",
                        "customerFirstName": "John",
                        "customerLastName": "Doe",
                        "country": "GB",
                        "currency": "GBP",
                        "sortCode": "000000",
                        "status": "ACTIVE"
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Database violation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "db_violation",
                          "message": "The request failed because it violated a database constraint."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAuthenticationErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "unauthorized",
                          "message": "You do not have permission to access this resource."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppValidationErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "conflict",
                          "message": "The request cannot be completed because there is a conflict with the requested resource."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "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": "Registers a new bank transfer account for a customer associated with the given external ID.\r\nAvailable only for FULL_USER KYC applicants.\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.",
        "summary": "Creates a bank transfer account for a customer.",
        "tags": [
          "Customer"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "description": "- The external identifier for the customer, used to uniquely identify them\r\nand associate them with a merchant.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "- Contains customer data for creating a bank\r\naccount.\r\n\r\n__Params__:\r\n- __currency__ - The currency code. \"EUR\" || \"GBP\".",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBankTransferBankAccountInput",
                "description": "- Contains customer data for creating a bank\r\naccount.\r\n\r\n__Params__:\r\n- __currency__ - The currency code. \"EUR\" || \"GBP\"."
              },
              "example": {
                "currency": "EUR"
              }
            }
          }
        }
      }
    }
  },
  "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
      },
      "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
      },
      "BankTransferFiatCurrency": {
        "type": "string",
        "enum": [
          "EUR",
          "GBP"
        ],
        "description": "Represents supported fiat currencies for `bank-transfer` payments in the payment processing\r\nsystem.\r\n\r\nCurrencies:\r\n- `EUR` - Euro\r\n- `GBP` - Pound Sterling."
      },
      "UnblockBankAccountStatus": {
        "type": "string"
      },
      "CreateBankTransferAccountResponse": {
        "properties": {
          "accountNumber": {
            "type": "string"
          },
          "bic": {
            "type": "string"
          },
          "customerFirstName": {
            "type": "string"
          },
          "customerLastName": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/BankTransferFiatCurrency"
          },
          "iban": {
            "type": "string"
          },
          "sortCode": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/UnblockBankAccountStatus"
          }
        },
        "required": [
          "country",
          "currency",
          "status"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppSuccessResponse_CreateBankTransferAccountResponse_": {
        "description": "The AppSuccessResponse object contains general information about the success execution.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": true
          },
          "data": {
            "$ref": "#/components/schemas/CreateBankTransferAccountResponse"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "CreateBankTransferBankAccountInput": {
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "GBP"
            ]
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "api_key": {
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      }
    }
  }
}