import okhttp3.*;

import java.io.IOException;

public class ShabanicAPI {
    public static String getBankAccountInfo(String accountNumber, String bankCode, String apiKey) throws IOException {
        OkHttpClient client = new OkHttpClient();

        HttpUrl url = HttpUrl.parse("https://shabanic.ir/api/v1/bank_account_info").newBuilder()
                .addQueryParameter("account_number", accountNumber)
                .addQueryParameter("bank_code", bankCode)
                .build();

        Request request = new Request.Builder()
                .url(url)
                .post(RequestBody.create("", null))
                .addHeader("SHABANIC-API-KEY", apiKey)
                .build();

        try (Response response = client.newCall(request).execute()) {
            return response.body().string();
        }
    }
}
