"""cellpointapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: D410, E501, E101, D206
from apimatic_core.authentication.multiple.single_auth import (
    Single,
)
from apimatic_core.request_builder import RequestBuilder
from apimatic_core.response_handler import ResponseHandler
from apimatic_core.types.parameter import Parameter

from cellpointapi.api_helper import APIHelper
from cellpointapi.apis.base_api import BaseApi
from cellpointapi.configuration import Server
from cellpointapi.exceptions.api_exception import (
    ApiException,
)
from cellpointapi.exceptions.problem_exception import (
    ProblemException,
)
from cellpointapi.http.http_method_enum import (
    HttpMethodEnum,
)
from cellpointapi.models.action_completion_response import (
    ActionCompletionResponse,
)
from cellpointapi.models.authorize_order_by_id_post_201_response import (
    AuthorizeOrderByIdPost201Response,
)
from cellpointapi.models.cancelled_payment_transactions import (
    CancelledPaymentTransactions,
)
from cellpointapi.models.capture_payment_response import (
    CapturePaymentResponse,
)
from cellpointapi.models.close_refund_response import (
    CloseRefundResponse,
)
from cellpointapi.models.closed_payment_transactions import (
    ClosedPaymentTransactions,
)
from cellpointapi.models.retry_refund_response import (
    RetryRefundResponse,
)


class TransactionsApi(BaseApi):
    """A Controller to access Endpoints in the cellpointapi API."""

    def __init__(self, config):
        """Initialize TransactionsApi object."""
        super(TransactionsApi, self).__init__(config)

    def authorize(self,
                  order_id,
                  idempotency_key=None,
                  body=None):
        """Perform a POST request to /payments/v1/orders/{orderId}/payments.

        Authorize a payment for an order.
        A `payment instrument` (specific instance of a payment method) must be
        specified.

        Args:
            order_id (str): Order to authorize a payment against.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (Authorization, optional): Request body containing the payment
                details.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Created

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(AuthorizeOrderByIdPost201Response.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException),
        ).execute()

    def order_refund(self,
                     order_id,
                     idempotency_key=None,
                     body=None):
        """Perform a POST request to /payments/v1/orders/{orderId}/refunds.

        Refund an order.
        This API call will refund money for the transaction(s) on an order.

        Args:
            order_id (str): ...
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (RefundRequest, optional): Request body containing the refund
                details.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Created

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/refunds")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException),
        ).execute()

    def transaction_retry_failed_refund(self,
                                        refund_id,
                                        idempotency_key=None,
                                        body=None):
        """Perform a POST request to
        /payments/v1/refunds/{refundId}/retry-failed-refunds.

        Retries a refund transaction with the given transaction id.

        Args:
            refund_id (str): Refund transaction the retry is being performed on.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (PaymentsV1RefundsRetryFailedRefundsRequest, optional): Refund retry
                request body.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Retry scheduled

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/refunds/{refundId}/retry-failed-refunds")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("refundId")
                .value(refund_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(RetryRefundResponse.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("401", "Authorization Required", ApiException)
            .local_error("403", "Forbidden", ProblemException)
            .local_error("406",
                "Cannot generate content acceptable according to the `Accept` headers"
                " in the request",
                ProblemException)
            .local_error("500", "Internal Server Error", ProblemException)
            .local_error("502", "Bad Gateway", ApiException)
            .local_error("503", "Service Unavailable", ApiException),
        ).execute()

    def transaction_retry_refund(self,
                                 order_id,
                                 refund_id,
                                 idempotency_key=None,
                                 body=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/payments/{refundId}/retry-failed-refunds.

        Retries a refund transaction with the given transaction id.

        Args:
            order_id (str): ...
            refund_id (str): Refund transaction the retry is being performed on.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (PaymentsV1OrdersPaymentsRetryFailedRefundsRequest, optional):
                Refund retry request body.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Retry scheduled

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments/{refundId}/retry-failed-refunds")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .template_param(Parameter()
                .key("refundId")
                .value(refund_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(RetryRefundResponse.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("401", "Authorization Required", ApiException)
            .local_error("403", "Forbidden", ProblemException)
            .local_error("406",
                "Cannot generate content acceptable according to the `Accept` headers"
                " in the request",
                ProblemException)
            .local_error("500", "Internal Server Error", ProblemException)
            .local_error("502", "Bad Gateway", ApiException)
            .local_error("503", "Service Unavailable", ApiException),
        ).execute()

    def transaction_close_refund(self,
                                 refund_id,
                                 idempotency_key=None,
                                 body=None):
        """Perform a POST request to /payments/v1/refunds/{refundId}/closures.

        Close the refund transaction that has previously failed to avoid its
        stagnation in review pools.

        Args:
            refund_id (str): Refund transaction the refund closure is being performed
                on.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (PaymentsV1RefundsClosuresRequest, optional): Refund closure request
                body.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Refund closed

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/refunds/{refundId}/closures")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("refundId")
                .value(refund_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(CloseRefundResponse.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("401", "Authorization Required", ApiException)
            .local_error("403", "Forbidden", ProblemException)
            .local_error("406",
                "Cannot generate content acceptable according to the `Accept` headers"
                " in the request",
                ProblemException)
            .local_error("500", "Internal Server Error", ProblemException)
            .local_error("502", "Bad Gateway", ApiException)
            .local_error("503", "Service Unavailable", ApiException),
        ).execute()

    def transaction_capture(self,
                            order_id,
                            transaction_id,
                            idempotency_key=None,
                            body=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/payments/{transactionId}/captures.

        Manually retry a failed capture of a transaction.

        Args:
            order_id (str): ...
            transaction_id (str): Transaction the capture is being performed on.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (Capture, optional): Capture request body.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Created

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments/{transactionId}/captures")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .template_param(Parameter()
                .key("transactionId")
                .value(transaction_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(CapturePaymentResponse.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("401", "Authorization Required", ApiException)
            .local_error("403", "Forbidden", ProblemException)
            .local_error("406",
                "Cannot generate content acceptable according to the `Accept` headers"
                " in the request",
                ProblemException)
            .local_error("500", "Internal Server Error", ProblemException)
            .local_error("502", "Bad Gateway", ApiException)
            .local_error("503", "Service Unavailable", ApiException),
        ).execute()

    def transaction_cancel(self,
                           order_id,
                           transaction_id,
                           idempotency_key=None,
                           body=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/payments/{transactionId}/cancellations.

        Manually retry a failed cancellation of a transaction.

        Args:
            order_id (str): Order associated with transaction.
            transaction_id (str): Transaction to cancel.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (Cancel, optional): Request body containing the cancellation details.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Created

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments/{transactionId}/cancellations")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .template_param(Parameter()
                .key("transactionId")
                .value(transaction_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(CancelledPaymentTransactions.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException),
        ).execute()

    def transaction_close(self,
                          order_id,
                          transaction_id,
                          idempotency_key=None,
                          body=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/payments/{transactionId}/closures.

        Close the transaction that has previously failed to avoid its stagnation in
        review pools.

        Args:
            order_id (str): Order associated with transaction.
            transaction_id (str): Transaction to close.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.
            body (Close, optional): Request body containing the cancellation details.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Created

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments/{transactionId}/closures")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .template_param(Parameter()
                .key("transactionId")
                .value(transaction_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .body_param(Parameter()
                .value(body))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(ClosedPaymentTransactions.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException),
        ).execute()

    def action_completed(self,
                         order_id,
                         transaction_id,
                         idempotency_key=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/payments/{transactionId}/action-completions.

        Notify the backend that an action has been completed.

        Args:
            order_id (str): Order the action completion is being performed on.
            transaction_id (str): Transaction the action completion is being
                performed on.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Action completed

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/payments/{transactionId}/action-completions")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .template_param(Parameter()
                .key("transactionId")
                .value(transaction_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(ActionCompletionResponse.from_dictionary)
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException),
        ).execute()

    def post_auth_fraud_check(self,
                              order_id,
                              idempotency_key=None):
        """Perform a POST request to
        /payments/v1/orders/{orderId}/fraud-checks/retries.

        This triggers post auth fraud check for a given order. Note that the
        transactions of the order
          should have last fraud event as FraudPreAuthCheckTechnicalErrorEvent

        Args:
            order_id (str): Order to trigger post auth fraud check for.
            idempotency_key (uuid|str, optional): A unique identifier.  If you don't
                receive a response (for example, in case of a timeout), you can
                safely retry the request with the same header.  If the system already
                processed the request, the response to the first attempt will be
                returned without duplication.  Idempotency-Keys will last for 24hrs.
                After this time, please do a GET call to the resource to check the
                status.  > This is used only in `POST` requests, so they have the
                same idempotency guarantees as `PUT`.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. No Content

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/orders/{orderId}/fraud-checks/retries")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("orderId")
                .value(order_id)
                .is_required(True)
                .should_encode(True))
            .header_param(Parameter()
                .key("Idempotency-Key")
                .value(idempotency_key))
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("401", "Authorization Required", ApiException)
            .local_error("403", "Forbidden", ProblemException)
            .local_error("406",
                "Cannot generate content acceptable according to the `Accept` headers"
                " in the request",
                ProblemException)
            .local_error("500", "Internal Server Error", ProblemException)
            .local_error("502", "Bad Gateway", ApiException)
            .local_error("503", "Service Unavailable", ApiException),
        ).execute()

    def payments(self,
                 transaction_id):
        """Perform a POST request to
        /payments/v1/{transactionId}/reconciliations.

        Triggers reconciliation for a specific payment method.

        Args:
            transaction_id (str): Transaction the that we want to trigger
                reconciliation for.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. OK

        Raises:
            ApiException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/payments/v1/{transactionId}/reconciliations")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("transactionId")
                .value(transaction_id)
                .is_required(True)
                .should_encode(True))
            .auth(Single("cpdIssuedJWT")),
        ).response(
            ResponseHandler()
            .is_api_response(True)
            .local_error("400", "Bad Request", ProblemException)
            .local_error("404", "Resource Not Found", ApiException),
        ).execute()
