def create(self,params=None, headers=None):
path = '<STR_LIT>'<EOL>if params is not None:<EOL><INDENT>params = {self._envelope_key(): params}<EOL><DEDENT>try:<EOL><INDENT>response = self._perform_request('<STR_LIT:POST>', path, params, headers,<EOL>retry_failures=True)<EOL><DEDENT>except errors.IdempotentCreationConflictError as err:<EOL><INDENT>return self.get(identity=err.conflicting_resource_id,<EOL>params=params,<EOL>headers=headers)<EOL><DEDENT>return self._resource_for(response)<EOL>
Create a refund.

        Creates a new refund object.

        This fails with:<a name="total_amount_confirmation_invalid"></a><a
        name="number_of_refunds_exceeded"></a>

        - `total_amount_confirmation_invalid` if the confirmation amount
        doesn't match the total amount refunded for the payment. This safeguard
        is there to prevent two processes from creating refunds without
        awareness of each other.

        - `number_of_refunds_exceeded` if five or more refunds have already
        been created against the payment.


        Args:
              params (dict, optional): Request body.

        Returns:
              ListResponse of Refund instances